@@ -113,7 +113,8 @@ module MOM_state_initialization
113113! ! conditions or by reading them from a restart (or saves) file.
114114subroutine MOM_initialize_state (u , v , h , tv , Time , G , GV , US , PF , dirs , &
115115 restart_CS , ALE_CSp , tracer_Reg , sponge_CSp , &
116- ALE_sponge_CSp , oda_incupd_CSp , OBC , Time_in , frac_shelf_h , mass_shelf )
116+ ALE_sponge_CSp , oda_incupd_CSp , OBC_for_remap , &
117+ Time_in , frac_shelf_h , mass_shelf , OBC_for_bug )
117118 type (ocean_grid_type), intent (inout ) :: G ! < The ocean's grid structure.
118119 type (verticalGrid_type), intent (in ) :: GV ! < The ocean's vertical grid structure.
119120 type (unit_scale_type), intent (in ) :: US ! < A dimensional unit scaling type
@@ -137,8 +138,10 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, &
137138 type (tracer_registry_type), pointer :: tracer_Reg ! < A pointer to the tracer registry
138139 type (sponge_CS), pointer :: sponge_CSp ! < The layerwise sponge control structure.
139140 type (ALE_sponge_CS), pointer :: ALE_sponge_CSp ! < The ALE sponge control structure.
140- type (ocean_OBC_type), pointer :: OBC ! < The open boundary condition control structure.
141- ! OBC is only used in MOM_initialize_state if OBC_RESERVOIR_INIT_BUG is true.
141+ type (ocean_OBC_type), pointer :: OBC_for_remap ! < The open boundary condition control
142+ ! ! structure that may be used for remapping velocities.
143+ ! ! This must be on the unrotated grid, but only the
144+ ! ! position and directions of the OBC faces are used.
142145 type (oda_incupd_CS), pointer :: oda_incupd_CSp ! < The oda_incupd control structure.
143146 type (time_type), optional , intent (in ) :: Time_in ! < Time at the start of the run segment.
144147 real , dimension (SZI_(G),SZJ_(G)), &
@@ -147,6 +150,9 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, &
147150 real , dimension (SZI_(G),SZJ_(G)), &
148151 optional , intent (in ) :: mass_shelf ! < The mass per unit area of the overlying
149152 ! ! ice shelf [ R Z ~> kg m-2 ]
153+ type (ocean_OBC_type), optional , pointer :: OBC_for_bug ! < An open boundary condition control structure
154+ ! ! that might be used to store OBC temperatures and
155+ ! ! salinities if OBC_RESERVOIR_INIT_BUG is true.
150156 ! Local variables
151157 real :: depth_tot(SZI_(G),SZJ_(G)) ! The nominal total depth of the ocean [Z ~> m]
152158 real :: dz(SZI_(G),SZJ_(G),SZK_(GV)) ! The layer thicknesses in geopotential (z) units [Z ~> m]
@@ -432,7 +438,7 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, &
432438 endif
433439 endif ! not from_Z_file.
434440
435- if (use_temperature .and. associated (OBC )) then
441+ if (present (OBC_for_bug)) then ; if ( use_temperature .and. associated (OBC_for_bug )) then
436442 call get_param(PF, mdl, " ENABLE_BUGS_BY_DEFAULT" , enable_bugs, &
437443 default= .true. , do_not_log= .true. ) ! This is logged from MOM.F90.
438444 ! Log this parameter later with the other OBC parameters.
@@ -445,9 +451,9 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, &
445451 ! the temperatures and salinities can change due to the remapping and reading from the restarts.
446452 call pass_var(tv% T, G% Domain, complete= .false. )
447453 call pass_var(tv% S, G% Domain, complete= .true. )
448- call fill_temp_salt_segments(G, GV, US, OBC , tv)
454+ call fill_temp_salt_segments(G, GV, US, OBC_for_bug , tv)
449455 endif
450- endif
456+ endif ; endif
451457
452458 ! Convert thicknesses from geometric distances in depth units to thickness units or mass-per-unit-area.
453459 if (new_sim .and. convert) call dz_to_thickness(dz, tv, h, G, GV, US)
@@ -496,10 +502,10 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, &
496502
497503 if (new_sim .and. debug) &
498504 call hchksum(h, " Pre-ALE_regrid: h " , G% HI, haloshift= 1 , unscale= GV% H_to_MKS)
499- ! In this call, OBC is only used for the directions of OBCs when setting thicknesses at
505+ ! In this call, OBC_for_remap is only used for the directions of OBCs when setting thicknesses at
500506 ! velocity points.
501- call ALE_regrid_accelerated(ALE_CSp, G, GV, US, h, tv, regrid_iterations, u, v, OBC, tracer_Reg , &
502- dt= dt, initial= .true. )
507+ call ALE_regrid_accelerated(ALE_CSp, G, GV, US, h, tv, regrid_iterations, u, v, OBC_for_remap , &
508+ tracer_Reg, dt= dt, initial= .true. )
503509 endif
504510 endif
505511
0 commit comments