Skip to content

Commit

Permalink
Moved call to open_boundary_init from MOM to MOM_state_initialize
Browse files Browse the repository at this point in the history
- The call to open_boundary_init() was immediately after the call to
  MOM_initialize_state(). It is now immediately above the calls to
  DOME_set_OBC_data, etc.
- No answer changes.
  • Loading branch information
adcroft committed Jun 15, 2016
1 parent 643063c commit 2558954
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module MOM
use MOM_mixed_layer_restrat, only : mixedlayer_restrat_register_restarts
use MOM_neutral_diffusion, only : neutral_diffusion_CS, neutral_diffusion_diag_init
use MOM_obsolete_diagnostics, only : register_obsolete_diagnostics
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_init
use MOM_set_visc, only : set_visc_register_restarts, set_visc_CS
Expand Down Expand Up @@ -1799,7 +1799,6 @@ 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
4 changes: 1 addition & 3 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,9 @@ subroutine open_boundary_config(G, param_file, OBC)
end subroutine open_boundary_config

!> Initialize open boundary control structure
subroutine open_boundary_init(Time, G, param_file, diag, OBC)
type(time_type), target, intent(in) :: Time !< Current model time
subroutine open_boundary_init(G, param_file, OBC)
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
type(param_file_type), intent(in) :: param_file !< Parameter file handle
type(diag_ctrl), target, intent(inout) :: diag !< Diagnostics control structure
type(ocean_OBC_type), pointer :: OBC !< Open boundary control structure
! Local variables

Expand Down
8 changes: 5 additions & 3 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module MOM_state_initialization
use MOM_io, only : open_file, read_data, read_axis_data, SINGLE_FILE, MULTIPLE
use MOM_io, only : slasher, vardesc, write_field
use MOM_io, only : EAST_FACE, NORTH_FACE
use MOM_open_boundary, only : ocean_OBC_type
use MOM_open_boundary, only : ocean_OBC_type, open_boundary_init
use MOM_open_boundary, only : OBC_NONE, OBC_SIMPLE
use MOM_open_boundary, only : open_boundary_query, set_Flather_data, set_Flather_positions
use MOM_grid_initialize, only : initialize_masks, set_grid_metrics
Expand Down Expand Up @@ -420,7 +420,10 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
end select
endif

! This subroutine call sets optional open boundary conditions.
! Reads OBC parameters not pertaining to the location of the boundaries
call open_boundary_init(G, PF, OBC)

! This is the legacy approach to turning on open boundaries
if (open_boundary_query(OBC, apply_orig_OBCs=.true.)) then
call get_param(PF, mod, "OBC_CONFIG", config, fail_if_missing=.true., do_not_log=.true.)
if (trim(config) == "DOME") then
Expand All @@ -433,7 +436,6 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
call set_Open_Bdry_Conds(OBC, tv, G, GV, PF, tracer_Reg)
endif
elseif (open_boundary_query(OBC, apply_orig_Flather=.true.)) then
! call set_Flather_positions(G, OBC)
call set_Flather_data(OBC, tv, h, G, PF, tracer_Reg)
endif
if (debug.and.associated(OBC)) then
Expand Down

0 comments on commit 2558954

Please sign in to comment.