@@ -36,7 +36,7 @@ module ocean_model_mod
3636
3737use MOM, only : initialize_MOM, step_MOM, MOM_control_struct, MOM_end
3838use MOM, only : calculate_surface_state, finish_MOM_initialization
39- use MOM, only : step_tracers
39+ use MOM, only : step_offline
4040use MOM_constants, only : CELSIUS_KELVIN_OFFSET, hlf
4141use MOM_diag_mediator, only : diag_ctrl, enable_averaging, disable_averaging
4242use MOM_diag_mediator, only : diag_mediator_close_registration, diag_mediator_end
@@ -222,7 +222,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in)
222222 real :: G_Earth ! The gravitational acceleration in m s-2.
223223! This include declares and sets the variable "version".
224224#include " version_variable.h"
225- character (len= 40 ) :: mod = " ocean_model_init" ! This module's name.
225+ character (len= 40 ) :: mdl = " ocean_model_init" ! This module's name.
226226 character (len= 48 ) :: stagger
227227 integer :: secs, days
228228 type (param_file_type) :: param_file ! < A structure to parse for run-time parameters
@@ -248,22 +248,22 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in)
248248 OS% fluxes% C_p = OS% MOM_CSp% tv% C_p
249249
250250 ! Read all relevant parameters and write them to the model log.
251- call log_version(param_file, mod , version, " " )
252- call get_param(param_file, mod , " RESTART_CONTROL" , OS% Restart_control, &
251+ call log_version(param_file, mdl , version, " " )
252+ call get_param(param_file, mdl , " RESTART_CONTROL" , OS% Restart_control, &
253253 " An integer whose bits encode which restart files are \n" // &
254254 " written. Add 2 (bit 1) for a time-stamped file, and odd \n" // &
255255 " (bit 0) for a non-time-stamped file. A restart file \n" // &
256256 " will be saved at the end of the run segment for any \n" // &
257257 " non-negative value." , default= 1 )
258- call get_param(param_file, mod , " TIMEUNIT" , Time_unit, &
258+ call get_param(param_file, mdl , " TIMEUNIT" , Time_unit, &
259259 " The time unit for ENERGYSAVEDAYS." , &
260260 units= " s" , default= 86400.0 )
261- call get_param(param_file, mod , " ENERGYSAVEDAYS" ,OS% energysavedays, &
261+ call get_param(param_file, mdl , " ENERGYSAVEDAYS" ,OS% energysavedays, &
262262 " The interval in units of TIMEUNIT between saves of the \n" // &
263263 " energies of the run and other globally summed diagnostics." , &
264264 default= set_time(0 ,days= 1 ), timeunit= Time_unit)
265265
266- call get_param(param_file, mod , " OCEAN_SURFACE_STAGGER" , stagger, &
266+ call get_param(param_file, mdl , " OCEAN_SURFACE_STAGGER" , stagger, &
267267 " A case-insensitive character string to indicate the \n" // &
268268 " staggering of the surface velocity field that is \n" // &
269269 " returned to the coupler. Valid values include \n" // &
@@ -274,38 +274,38 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in)
274274 else ; call MOM_error(FATAL," ocean_model_init: OCEAN_SURFACE_STAGGER = " // &
275275 trim (stagger)// " is invalid." ) ; endif
276276
277- call get_param(param_file, mod , " RESTORE_SALINITY" ,OS% restore_salinity, &
277+ call get_param(param_file, mdl , " RESTORE_SALINITY" ,OS% restore_salinity, &
278278 " If true, the coupled driver will add a globally-balanced \n" // &
279279 " fresh-water flux that drives sea-surface salinity \n" // &
280280 " toward specified values." , default= .false. )
281- call get_param(param_file, mod , " RESTORE_TEMPERATURE" ,OS% restore_temp, &
281+ call get_param(param_file, mdl , " RESTORE_TEMPERATURE" ,OS% restore_temp, &
282282 " If true, the coupled driver will add a \n" // &
283283 " heat flux that drives sea-surface temperauture \n" // &
284284 " toward specified values." , default= .false. )
285- call get_param(param_file, mod , " RHO_0" , Rho0, &
285+ call get_param(param_file, mdl , " RHO_0" , Rho0, &
286286 " The mean ocean density used with BOUSSINESQ true to \n" // &
287287 " calculate accelerations and the mass for conservation \n" // &
288288 " properties, or with BOUSSINSEQ false to convert some \n" // &
289289 " parameters from vertical units of m to kg m-2." , &
290290 units= " kg m-3" , default= 1035.0 )
291- call get_param(param_file, mod , " G_EARTH" , G_Earth, &
291+ call get_param(param_file, mdl , " G_EARTH" , G_Earth, &
292292 " The gravitational acceleration of the Earth." , &
293293 units= " m s-2" , default = 9.80 )
294294
295- call get_param(param_file, mod , " ICE_SHELF" , OS% use_ice_shelf, &
295+ call get_param(param_file, mdl , " ICE_SHELF" , OS% use_ice_shelf, &
296296 " If true, enables the ice shelf model." , default= .false. )
297297
298- call get_param(param_file, mod , " ICEBERGS_APPLY_RIGID_BOUNDARY" , OS% icebergs_apply_rigid_boundary, &
298+ call get_param(param_file, mdl , " ICEBERGS_APPLY_RIGID_BOUNDARY" , OS% icebergs_apply_rigid_boundary, &
299299 " If true, allows icebergs to change boundary condition felt by ocean" , default= .false. )
300300
301301 if (OS% icebergs_apply_rigid_boundary) then
302- call get_param(param_file, mod , " KV_ICEBERG" , OS% kv_iceberg, &
302+ call get_param(param_file, mdl , " KV_ICEBERG" , OS% kv_iceberg, &
303303 " The viscosity of the icebergs" , units= " m2 s-1" ,default= 1.0e10 )
304- call get_param(param_file, mod , " DENSITY_ICEBERGS" , OS% density_iceberg, &
304+ call get_param(param_file, mdl , " DENSITY_ICEBERGS" , OS% density_iceberg, &
305305 " A typical density of icebergs." , units= " kg m-3" , default= 917.0 )
306- call get_param(param_file, mod , " LATENT_HEAT_FUSION" , OS% latent_heat_fusion, &
306+ call get_param(param_file, mdl , " LATENT_HEAT_FUSION" , OS% latent_heat_fusion, &
307307 " The latent heat of fusion." , units= " J/kg" , default= hlf)
308- call get_param(param_file, mod , " BERG_AREA_THRESHOLD" , OS% berg_area_threshold, &
308+ call get_param(param_file, mdl , " BERG_AREA_THRESHOLD" , OS% berg_area_threshold, &
309309 " Fraction of grid cell which iceberg must occupy, so that fluxes \n" // &
310310 " below berg are set to zero. Not applied for negative \n" // &
311311 " values." , units= " non-dim" , default=- 1.0 )
@@ -472,7 +472,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
472472 Master_time = OS% Time ; Time1 = OS% Time
473473
474474 if (OS% MOM_Csp% offline_tracer_mode) then
475- call step_tracers (OS% fluxes, OS% state, Time1, time_step, OS% MOM_CSp)
475+ call step_offline (OS% fluxes, OS% state, Time1, time_step, OS% MOM_CSp)
476476 else
477477 call step_MOM(OS% fluxes, OS% state, Time1, time_step, OS% MOM_CSp)
478478 endif
@@ -879,25 +879,28 @@ end subroutine ocean_model_init_sfc
879879! WGA
880880
881881subroutine ocean_model_flux_init (OS )
882- type (ocean_state_type), pointer :: OS
882+ type (ocean_state_type), optional , pointer :: OS
883+
883884 integer :: dummy
884885 character (len= 128 ) :: default_ice_restart_file, default_ocean_restart_file
885- character (len= 40 ) :: mod = " ocean_model_flux_init" ! This module's name.
886-
886+ character (len= 40 ) :: mdl = " ocean_model_flux_init" ! This module's name.
887887 type (param_file_type) :: param_file ! < A structure to parse for run-time parameters
888888 type (directories) :: dirs_tmp ! A structure containing several relevant directory paths.
889889 logical :: use_OCMIP_CFCs, use_MOM_generic_tracer
890+ logical :: OS_is_set
891+
892+ OS_is_set = .false. ; if (present (OS)) OS_is_set = associated (OS)
890893
891894 call get_MOM_Input(param_file, dirs_tmp, check_params= .false. )
892895
893- call get_param(param_file, mod , " USE_OCMIP2_CFC" , use_OCMIP_CFCs, &
894- default= .false. )
895- call get_param(param_file, mod , " USE_generic_tracer" , use_MOM_generic_tracer,&
896- default= .false. )
896+ call get_param(param_file, mdl , " USE_OCMIP2_CFC" , use_OCMIP_CFCs, &
897+ default= .false. , do_not_log = .true. )
898+ call get_param(param_file, mdl , " USE_generic_tracer" , use_MOM_generic_tracer,&
899+ default= .false. , do_not_log = .true. )
897900
898901 call close_param_file(param_file, quiet_close= .true. )
899902
900- if (.not. associated (OS) ) then
903+ if (.not. OS_is_set ) then
901904 if (use_OCMIP_CFCs)then
902905 default_ice_restart_file = ' ice_ocmip2_cfc.res.nc'
903906 default_ocean_restart_file = ' ocmip2_cfc.res.nc'
@@ -919,7 +922,7 @@ subroutine ocean_model_flux_init(OS)
919922
920923 if (use_MOM_generic_tracer) then
921924#ifdef _USE_GENERIC_TRACER
922- call MOM_generic_flux_init
925+ call MOM_generic_flux_init()
923926#else
924927 call MOM_error(FATAL, &
925928 " call_tracer_register: use_MOM_generic_tracer=.true. BUT not compiled with _USE_GENERIC_TRACER" )
0 commit comments