From 2558954ec1366b2cb320974734840959f4b51cb8 Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Tue, 14 Jun 2016 21:04:29 -0400 Subject: [PATCH] Moved call to open_boundary_init from MOM to MOM_state_initialize - 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. --- src/core/MOM.F90 | 3 +-- src/core/MOM_open_boundary.F90 | 4 +--- src/initialization/MOM_state_initialization.F90 | 8 +++++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index c2156d9cbf..4bdd7bf17d 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -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 @@ -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)") diff --git a/src/core/MOM_open_boundary.F90 b/src/core/MOM_open_boundary.F90 index be61791dc3..c530519cc8 100644 --- a/src/core/MOM_open_boundary.F90 +++ b/src/core/MOM_open_boundary.F90 @@ -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 diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90 index b1e7328f7c..17290657bd 100644 --- a/src/initialization/MOM_state_initialization.F90 +++ b/src/initialization/MOM_state_initialization.F90 @@ -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 @@ -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 @@ -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