Skip to content

Commit

Permalink
Moved calls to open_boundary_init() from MOM_dynamics_* to MOM.F90
Browse files Browse the repository at this point in the history
- Each algorithm had it's own call to open_boundary_init() which
  simply set three parameters. I've moved this up to early in the
  main initialization sequence ready to re-purpose the s/r.
- No answer changes.
  • Loading branch information
adcroft committed Jun 13, 2016
1 parent ec8ba6f commit 98c4918
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,7 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in)
call MOM_initialize_state(CS%u, CS%v, CS%h, CS%tv, Time, G, GV, param_file, &
dirs, CS%restart_CSp, CS%ALE_CSp, CS%tracer_Reg, &
CS%sponge_CSp, CS%ALE_sponge_CSp, CS%OBC, Time_in)
call open_boundary_init(Time, G, param_file, diag, CS%OBC)
call cpu_clock_end(id_clock_MOM_init)
call callTree_waypoint("returned from MOM_initialize_state() (initialize_MOM)")

Expand Down Expand Up @@ -1916,7 +1917,6 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in)
call wave_speed_init(Time, G, param_file, diag, CS%wave_speed_CSp)
call VarMix_init(Time, G, param_file, diag, CS%VarMix, CS%wave_speed_CSp)
call set_visc_init(Time, G, GV, param_file, diag, CS%visc, CS%set_visc_CSp)

if (CS%split) then
allocate(eta(SZI_(G),SZJ_(G))) ; eta(:,:) = 0.0
if (CS%legacy_split) then
Expand Down
7 changes: 2 additions & 5 deletions src/core/MOM_dynamics_legacy_split.F90
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ module MOM_dynamics_legacy_split
use MOM_interface_heights, only : find_eta
use MOM_lateral_mixing_coeffs, only : VarMix_CS
use MOM_MEKE_types, only : MEKE_type
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds, open_boundary_init
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds
use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS
use MOM_tidal_forcing, only : tidal_forcing_init, tidal_forcing_CS
use MOM_vert_friction, only : vertvisc, vertvisc_coef, vertvisc_remnant
Expand Down Expand Up @@ -1378,10 +1378,7 @@ subroutine initialize_dyn_legacy_split(u, v, h, uh, vh, eta, Time, G, GV, param_
CS%set_visc_CSp => setVisc_CSp

if (associated(ALE_CSp)) CS%ALE_CSp => ALE_CSp
if (associated(OBC)) then
CS%OBC => OBC
call open_boundary_init(Time, G, param_file, diag, CS%OBC)
endif
if (associated(OBC)) CS%OBC => OBC

if (.not. query_initialized(CS%eta,"sfc",restart_CS)) then
! Estimate eta based on the layer thicknesses - h. With the Boussinesq
Expand Down
7 changes: 2 additions & 5 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module MOM_dynamics_split_RK2
use MOM_lateral_mixing_coeffs, only : VarMix_CS
use MOM_MEKE_types, only : MEKE_type
use MOM_open_boundary, only : ocean_OBC_type
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds, open_boundary_init
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds
use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS
use MOM_set_visc, only : set_viscous_BBL, set_viscous_ML, set_visc_CS
use MOM_tidal_forcing, only : tidal_forcing_init, tidal_forcing_CS
Expand Down Expand Up @@ -1139,10 +1139,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, param_fil
(LEN_TRIM(dirs%input_filename) == 1)) )

if (associated(ALE_CSp)) CS%ALE_CSp => ALE_CSp
if (associated(OBC)) then
CS%OBC => OBC
call open_boundary_init(Time, G, param_file, diag, CS%OBC)
endif
if (associated(OBC)) CS%OBC => OBC

if (.not. query_initialized(CS%eta,"sfc",restart_CS)) then
! Estimate eta based on the layer thicknesses - h. With the Boussinesq
Expand Down
7 changes: 2 additions & 5 deletions src/core/MOM_dynamics_unsplit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module MOM_dynamics_unsplit
use MOM_lateral_mixing_coeffs, only : VarMix_CS
use MOM_MEKE_types, only : MEKE_type
use MOM_open_boundary, only : ocean_OBC_type
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds, open_boundary_init
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds
use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS
use MOM_set_visc, only : set_viscous_BBL, set_viscous_ML, set_visc_CS
use MOM_tidal_forcing, only : tidal_forcing_init, tidal_forcing_CS
Expand Down Expand Up @@ -678,10 +678,7 @@ subroutine initialize_dyn_unsplit(u, v, h, Time, G, GV, param_file, diag, CS, &
CS%set_visc_CSp => setVisc_CSp

if (associated(ALE_CSp)) CS%ALE_CSp => ALE_CSp
if (associated(OBC)) then
CS%OBC => OBC
call open_boundary_init(Time, G, param_file, diag, CS%OBC)
endif
if (associated(OBC)) CS%OBC => OBC

flux_units = get_flux_units(GV)
CS%id_uh = register_diag_field('ocean_model', 'uh', diag%axesCuL, Time, &
Expand Down
7 changes: 2 additions & 5 deletions src/core/MOM_dynamics_unsplit_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module MOM_dynamics_unsplit_RK2
use MOM_lateral_mixing_coeffs, only : VarMix_CS
use MOM_MEKE_types, only : MEKE_type
use MOM_open_boundary, only : ocean_OBC_type
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds, open_boundary_init
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds
use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS
use MOM_set_visc, only : set_viscous_BBL, set_viscous_ML, set_visc_CS
use MOM_tidal_forcing, only : tidal_forcing_init, tidal_forcing_CS
Expand Down Expand Up @@ -642,10 +642,7 @@ subroutine initialize_dyn_unsplit_RK2(u, v, h, Time, G, GV, param_file, diag, CS
CS%set_visc_CSp => setVisc_CSp

if (associated(ALE_CSp)) CS%ALE_CSp => ALE_CSp
if (associated(OBC)) then
CS%OBC => OBC
call open_boundary_init(Time, G, param_file, diag, CS%OBC)
endif
if (associated(OBC)) CS%OBC => OBC

flux_units = get_flux_units(GV)
CS%id_uh = register_diag_field('ocean_model', 'uh', diag%axesCuL, Time, &
Expand Down

0 comments on commit 98c4918

Please sign in to comment.