Skip to content

Commit

Permalink
Merge from aja/obc_refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Jun 15, 2016
1 parent 2074943 commit 5e86623
Show file tree
Hide file tree
Showing 11 changed files with 603 additions and 649 deletions.
5 changes: 2 additions & 3 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 @@ -1785,7 +1785,7 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in)
call callTree_waypoint("restart registration complete (initialize_MOM)")

call cpu_clock_begin(id_clock_MOM_init)
call MOM_initialize_fixed(G, param_file, write_geom_files, dirs%output_directory)
call MOM_initialize_fixed(G, CS%OBC, param_file, write_geom_files, dirs%output_directory)
call callTree_waypoint("returned from MOM_initialize_fixed() (initialize_MOM)")
call MOM_initialize_coord(GV, param_file, write_geom_files, &
dirs%output_directory, CS%tv, G%max_depth)
Expand Down Expand Up @@ -1916,7 +1916,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
13 changes: 4 additions & 9 deletions src/core/MOM_dynamics_legacy_split.F90
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +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 : open_boundary_CS
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 @@ -241,7 +240,6 @@ module MOM_dynamics_legacy_split
type(legacy_barotropic_CS), pointer :: barotropic_CSp => NULL()
type(vertvisc_CS), pointer :: vertvisc_CSp => NULL()
type(set_visc_CS), pointer :: set_visc_CSp => NULL()
type(open_boundary_CS), pointer :: open_boundary_CSp => NULL()
type(ocean_OBC_type), pointer :: OBC => NULL() ! A pointer to an open boundary
! condition type that specifies whether, where, and what open boundary
! conditions are used. If no open BCs are used, this pointer stays
Expand Down Expand Up @@ -739,7 +737,7 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call Radiation_Open_Bdry_Conds(CS%OBC, u_av, u_old_rad_OBC, v_av, &
v_old_rad_OBC, hp, h_old_rad_OBC, G, CS%open_boundary_CSp)
v_old_rad_OBC, hp, h_old_rad_OBC, G)
endif

! h_av = (h + hp)/2
Expand Down Expand Up @@ -998,7 +996,7 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call Radiation_Open_Bdry_Conds(CS%OBC, u, u_old_rad_OBC, v, &
v_old_rad_OBC, h, h_old_rad_OBC, G, CS%open_boundary_CSp)
v_old_rad_OBC, h, h_old_rad_OBC, G)
endif

! h_av = (h_in + h_out)/2 . Going in to this line, h_av = h_in.
Expand Down Expand Up @@ -1380,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%open_boundary_CSp)
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
13 changes: 4 additions & 9 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +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 : open_boundary_CS
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 @@ -161,7 +160,6 @@ module MOM_dynamics_split_RK2
type(barotropic_CS), pointer :: barotropic_CSp => NULL()
type(vertvisc_CS), pointer :: vertvisc_CSp => NULL()
type(set_visc_CS), pointer :: set_visc_CSp => NULL()
type(open_boundary_CS), pointer :: open_boundary_CSp => NULL()
type(tidal_forcing_CS), pointer :: tides_CSp => NULL()

type(ocean_OBC_type), pointer :: OBC => NULL() !< A pointer to an open boundary
Expand Down Expand Up @@ -640,7 +638,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call Radiation_Open_Bdry_Conds(CS%OBC, u_av, u_old_rad_OBC, v_av, &
v_old_rad_OBC, hp, h_old_rad_OBC, G, CS%open_boundary_CSp)
v_old_rad_OBC, hp, h_old_rad_OBC, G)
endif

! h_av = (h + hp)/2
Expand Down Expand Up @@ -852,7 +850,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call Radiation_Open_Bdry_Conds(CS%OBC, u, u_old_rad_OBC, v, &
v_old_rad_OBC, h, h_old_rad_OBC, G, CS%open_boundary_CSp)
v_old_rad_OBC, h, h_old_rad_OBC, G)
endif

! h_av = (h_in + h_out)/2 . Going in to this line, h_av = h_in.
Expand Down Expand Up @@ -1141,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%open_boundary_CSp)
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
9 changes: 2 additions & 7 deletions src/core/MOM_dynamics_unsplit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +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 : open_boundary_CS
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 @@ -156,7 +155,6 @@ module MOM_dynamics_unsplit
type(PressureForce_CS), pointer :: PressureForce_CSp => NULL()
type(vertvisc_CS), pointer :: vertvisc_CSp => NULL()
type(set_visc_CS), pointer :: set_visc_CSp => NULL()
type(open_boundary_CS), pointer :: open_boundary_CSp => NULL()
type(ocean_OBC_type), pointer :: OBC => NULL() ! A pointer to an open boundary
! condition type that specifies whether, where, and what open boundary
! conditions are used. If no open BCs are used, this pointer stays
Expand Down Expand Up @@ -680,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%open_boundary_CSp)
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
9 changes: 2 additions & 7 deletions src/core/MOM_dynamics_unsplit_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +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 : open_boundary_CS
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 @@ -162,7 +161,6 @@ module MOM_dynamics_unsplit_RK2
type(PressureForce_CS), pointer :: PressureForce_CSp => NULL()
type(vertvisc_CS), pointer :: vertvisc_CSp => NULL()
type(set_visc_CS), pointer :: set_visc_CSp => NULL()
type(open_boundary_CS), pointer :: open_boundary_CSp => NULL()
type(ocean_OBC_type), pointer :: OBC => NULL() ! A pointer to an open boundary
! condition type that specifies whether, where, and what open boundary
! conditions are used. If no open BCs are used, this pointer stays
Expand Down Expand Up @@ -644,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%open_boundary_CSp)
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
Loading

0 comments on commit 5e86623

Please sign in to comment.