Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c880a15

Browse files
committed
For the drivers calling MOM_wave_interface_init,
add the optional waves_csp arg to initialize_MOM calls so as to ensure that the waves_csp is allocated. This commit also has several misc doxygen fixes.
1 parent 6e929a7 commit c880a15

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

config_src/drivers/FMS_cap/ocean_model_MOM.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, wind_stagger, gas
276276
OS%Time = Time_in ; OS%Time_dyn = Time_in
277277
call initialize_MOM(OS%Time, Time_init, param_file, OS%dirs, OS%MOM_CSp, &
278278
OS%restart_CSp, Time_in, offline_tracer_mode=OS%offline_tracer_mode, &
279-
diag_ptr=OS%diag, count_calls=.true.)
279+
diag_ptr=OS%diag, count_calls=.true., waves_CSp=OS%Waves)
280280
call get_MOM_state_elements(OS%MOM_CSp, G=OS%grid, GV=OS%GV, US=OS%US, C_p=OS%C_p, &
281281
C_p_scaled=OS%fluxes%C_p, use_temp=use_temperature)
282282

config_src/drivers/mct_cap/mom_ocean_model_mct.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
274274
call initialize_MOM(OS%Time, Time_init, param_file, OS%dirs, OS%MOM_CSp, &
275275
OS%restart_CSp, Time_in, offline_tracer_mode=OS%offline_tracer_mode, &
276276
input_restart_file=input_restart_file, &
277-
diag_ptr=OS%diag, count_calls=.true.)
277+
diag_ptr=OS%diag, count_calls=.true., waves_CSp=OS%Waves)
278278
call get_MOM_state_elements(OS%MOM_CSp, G=OS%grid, GV=OS%GV, US=OS%US, C_p=OS%C_p, &
279279
C_p_scaled=OS%fluxes%C_p, use_temp=use_temperature)
280280

config_src/drivers/nuopc_cap/mom_cap_methods.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
303303
if (ChkErr(rc,__LINE__,u_FILE_u)) return
304304
call state_getimport(importState,'Sw_pstokes_y', isc, iec, jsc, jec, 1, nsc, stky, rc=rc)
305305
if (ChkErr(rc,__LINE__,u_FILE_u)) return
306-
306+
307307
! rotate from true zonal/meridional to local coordinates
308308
do j = jsc, jec
309309
jg = j + ocean_grid%jsc - jsc

config_src/drivers/solo_driver/MOM_driver.F90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,12 @@ program MOM_main
301301
if (sum(date) >= 0) then
302302
call initialize_MOM(Time, Start_time, param_file, dirs, MOM_CSp, restart_CSp, &
303303
segment_start_time, offline_tracer_mode=offline_tracer_mode, &
304-
diag_ptr=diag, tracer_flow_CSp=tracer_flow_CSp, ice_shelf_CSp=ice_shelf_CSp)
304+
diag_ptr=diag, tracer_flow_CSp=tracer_flow_CSp, ice_shelf_CSp=ice_shelf_CSp, &
305+
waves_CSp=Waves_CSp)
305306
else
306307
call initialize_MOM(Time, Start_time, param_file, dirs, MOM_CSp, restart_CSp, &
307308
offline_tracer_mode=offline_tracer_mode, diag_ptr=diag, &
308-
tracer_flow_CSp=tracer_flow_CSp, ice_shelf_CSp=ice_shelf_CSp)
309+
tracer_flow_CSp=tracer_flow_CSp, ice_shelf_CSp=ice_shelf_CSp, waves_CSp=Waves_CSp)
309310
endif
310311

311312
call get_MOM_state_elements(MOM_CSp, G=grid, GV=GV, US=US, C_p_scaled=fluxes%C_p)

src/user/MOM_wave_interface.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ module MOM_wave_interface
8383
real, allocatable, dimension(:,:,:), public :: &
8484
KvS !< Viscosity for Stokes Drift shear [Z2 T-1 ~> m2 s-1]
8585

86-
integer, public :: id_PFu_Stokes = -1 , id_PFv_Stokes = -1
8786
! The remainder of this control structure is private
8887
integer :: WaveMethod = -99 !< Options for including wave information
8988
!! Valid (tested) choices are:
@@ -187,6 +186,7 @@ module MOM_wave_interface
187186
!! timing of diagnostic output.
188187

189188
!>@{ Diagnostic handles
189+
integer, public :: id_PFu_Stokes = -1 , id_PFv_Stokes = -1
190190
integer :: id_surfacestokes_x = -1 , id_surfacestokes_y = -1
191191
integer :: id_3dstokes_x = -1 , id_3dstokes_y = -1
192192
integer :: id_ddt_3dstokes_x = -1 , id_ddt_3dstokes_y = -1
@@ -1775,7 +1775,7 @@ subroutine waves_register_restarts(CS, HI, GV, param_file, restart_CSp)
17751775

17761776
if (associated(CS)) then
17771777
call MOM_error(FATAL, "waves_register_restarts: Called with initialized waves control structure")
1778-
endif
1778+
endif
17791779
allocate(CS)
17801780

17811781
call get_param(param_file, mdl, "USE_WAVES", use_waves, &

0 commit comments

Comments
 (0)