MOM6
|
The routines here implement the offline tracer algorithm used in MOM6. These are called from step_offline Some routines called here can be found in the MOM_offline_aux module.
'Offline tracer modeling' uses physical fields (e.g. mass transports and layer thicknesses) saved from a previous integration of the physical model to transport passive tracers. These fields are accumulated or averaged over a period of time (in this test case, 1 day) and used to integrate portions of the MOM6 code base that handle the 3d advection and diffusion of passive tracers.
The distribution of tracers in the ocean modeled offline should not be expected to match an online simulation. Accumulating transports over more than one online model timestep implicitly assumes homogeneity over that time period and essentially aliases over processes that occur with higher frequency. For example, consider the case of a surface boundary layer with a strong diurnal cycle. An offline simulation with a 1 day timestep, captures the net transport into or out of that layer, but not the exact cycling. This effective aliasing may also complicate online model configurations which strongly-eddying regions. In this case, the offline model timestep must be limited to some fraction of the eddy correlation timescale. Lastly, the nonlinear advection scheme which applies limited mass-transports over a sequence of iterations means that tracers are not transported along exactly the same path as they are in the online model.
This capability has currently targeted the Baltic_ALE_z test case, though some work has also been done with the OM4 1/2 degree configuration. Work is ongoing to develop recommendations and best practices for investigators seeking to use MOM6 for offline tracer modeling.
The subroutine step_tracers that coordinates this can be found in MOM.F90 and is only called using the solo ocean driver. This is to avoid issues with coupling to other climate components that may be relying on fluxes from the ocean to be coupled more often than the offline time step. Other routines related to offline tracer modeling can be found in tracers/MOM_offline_control.F90
As can also be seen in the comments for the step_tracers subroutine, an offline time step comprises the following steps:
How well an offline tracer model can be used as an alternative to integrating tracers online with the prognostic model must be evaluated for each application. This efficacy may be related to the native coordinate of the online model, to the length of the offline timestep, and to the behavior of the tracer itself.
A framework for formally regression testing the offline capability still needs to be developed. However, as a simple way of testing whether the offline model is nominally behaving as expected, the total inventory of the advection test tracers (tr1, tr2, etc.) should be conserved between time steps except for the last 4 decimal places. As a general guideline, an offline timestep of 5 days or less.
Data Types | |
type | offline_transport_cs |
The control structure for the offline transport module. More... | |
Functions/Subroutines | |
subroutine, public | offline_advection_ale (fluxes, Time_start, time_interval, CS, id_clock_ale, h_pre, uhtr, vhtr, converged) |
3D advection is done by doing flux-limited nonlinear horizontal advection interspersed with an ALE regridding/remapping step. The loop in this routine is exited if remaining residual transports are below a runtime-specified value or a maximum number of iterations is reached. More... | |
subroutine, public | offline_redistribute_residual (CS, h_pre, uhtr, vhtr, converged) |
In the case where the main advection routine did not converge, something needs to be done with the remaining transport. Two different ways are offered, 'barotropic' means that the residual is distributed equally throughout the water column. 'upwards' attempts to redistribute the transport in the layers above and will eventually work down the entire water column. More... | |
real function | remaining_transport_sum (CS, uhtr, vhtr) |
Sums any non-negligible remaining transport to check for advection convergence. More... | |
subroutine, public | offline_diabatic_ale (fluxes, Time_start, Time_end, CS, h_pre, eatr, ebtr) |
The vertical/diabatic driver for offline tracers. First the eatr/ebtr associated with the interpolated vertical diffusivities are calculated and then any tracer column functions are done which can include vertical diffuvities and source/sink terms. More... | |
subroutine, public | offline_fw_fluxes_into_ocean (G, GV, CS, fluxes, h, in_flux_optional) |
Apply positive freshwater fluxes (into the ocean) and update netMassOut with only the negative (out of the ocean) fluxes. More... | |
subroutine, public | offline_fw_fluxes_out_ocean (G, GV, CS, fluxes, h, out_flux_optional) |
Apply negative freshwater fluxes (out of the ocean) More... | |
subroutine, public | offline_advection_layer (fluxes, Time_start, time_interval, CS, h_pre, eatr, ebtr, uhtr, vhtr) |
When in layer mode, 3D horizontal advection using stored mass fluxes must be used. Horizontal advection is done via tracer_advect, whereas the vertical component is actually handled by vertdiff in tracer_column_fns. More... | |
subroutine, public | update_offline_fields (CS, h, fluxes, do_ale) |
Update fields used in this round of offline transport. First fields are updated from files or from arrays read during initialization. Then if in an ALE-dependent coordinate, regrid/remap fields. More... | |
subroutine, public | register_diags_offline_transport (Time, diag, CS) |
Initialize additional diagnostics required for offline tracer transport. More... | |
subroutine, public | post_offline_convergence_diags (CS, h_off, h_end, uhtr, vhtr) |
Posts diagnostics related to offline convergence diagnostics. More... | |
subroutine, public | extract_offline_main (CS, uhtr, vhtr, eatr, ebtr, h_end, accumulated_time, dt_offline, dt_offline_vertical, skip_diffusion) |
Extracts members of the offline main control structure. All arguments are optional except the control structure itself. More... | |
subroutine, public | insert_offline_main (CS, ALE_CSp, diabatic_CSp, diag, OBC, tracer_adv_CSp, tracer_flow_CSp, tracer_Reg, tv, G, GV, x_before_y, debug) |
Inserts (assigns values to) members of the offline main control structure. All arguments are optional except for the CS itself. More... | |
subroutine, public | offline_transport_init (param_file, CS, diabatic_CSp, G, GV, US) |
Initializes the control structure for offline transport and reads in some of the. More... | |
subroutine | read_all_input (CS) |
Coordinates the allocation and reading in all time levels of uh, vh, hend, temp, and salt from files. Used when read_all_ts_uvh. More... | |
subroutine, public | offline_transport_end (CS) |
Deallocates (if necessary) arrays within the offline control structure. More... | |
subroutine, public mom_offline_main::extract_offline_main | ( | type(offline_transport_cs), intent(in), target | CS, |
real, dimension(:,:,:), optional, pointer | uhtr, | ||
real, dimension(:,:,:), optional, pointer | vhtr, | ||
real, dimension(:,:,:), optional, pointer | eatr, | ||
real, dimension(:,:,:), optional, pointer | ebtr, | ||
real, dimension(:,:,:), optional, pointer | h_end, | ||
integer, optional, pointer | accumulated_time, | ||
real, intent(out), optional | dt_offline, | ||
real, intent(out), optional | dt_offline_vertical, | ||
logical, intent(out), optional | skip_diffusion | ||
) |
Extracts members of the offline main control structure. All arguments are optional except the control structure itself.
[in] | cs | Offline control structure |
uhtr | Remaining zonal mass transport [H m2 ~> m3 or kg] | |
vhtr | Remaining meridional mass transport [H m2 ~> m3 or kg] | |
eatr | Amount of fluid entrained from the layer above within one time step [H ~> m or kg m-2] | |
ebtr | Amount of fluid entrained from the layer below within one time step [H ~> m or kg m-2] | |
h_end | Thicknesses at the end of offline timestep [H ~> m or kg m-2] | |
accumulated_time | Length of time accumulated in the current offline interval [s] | |
[out] | dt_offline | Timestep used for offline tracers [T ~> s] |
[out] | dt_offline_vertical | Timestep used for calls to tracer vertical physics [T ~> s] |
[out] | skip_diffusion | Skips horizontal diffusion of tracers |
Definition at line 1203 of file MOM_offline_main.F90.
subroutine, public mom_offline_main::insert_offline_main | ( | type(offline_transport_cs), intent(inout) | CS, |
type(ale_cs), intent(in), optional, target | ALE_CSp, | ||
type(diabatic_cs), intent(in), optional, target | diabatic_CSp, | ||
type(diag_ctrl), intent(in), optional, target | diag, | ||
type(ocean_obc_type), intent(in), optional, target | OBC, | ||
type(tracer_advect_cs), intent(in), optional, target | tracer_adv_CSp, | ||
type(tracer_flow_control_cs), intent(in), optional, target | tracer_flow_CSp, | ||
type(tracer_registry_type), intent(in), optional, target | tracer_Reg, | ||
type(thermo_var_ptrs), intent(in), optional, target | tv, | ||
type(ocean_grid_type), intent(in), optional, target | G, | ||
type(verticalgrid_type), intent(in), optional, target | GV, | ||
logical, intent(in), optional | x_before_y, | ||
logical, intent(in), optional | debug | ||
) |
Inserts (assigns values to) members of the offline main control structure. All arguments are optional except for the CS itself.
[in,out] | cs | Offline control structure |
[in] | ale_csp | A pointer to the ALE control structure |
[in] | diabatic_csp | A pointer to the diabatic control structure |
[in] | diag | A pointer to the structure that regulates diagnostic output |
[in] | obc | A pointer to the open boundary condition control structure |
[in] | tracer_adv_csp | A pointer to the tracer advection control structure |
[in] | tracer_flow_csp | A pointer to the tracer flow control control structure |
[in] | tracer_reg | A pointer to the tracer registry |
[in] | tv | A structure pointing to various thermodynamic variables |
[in] | g | ocean grid structure |
[in] | gv | ocean vertical grid structure |
[in] | x_before_y | Indicates which horizontal direction is advected first |
[in] | debug | If true, write verbose debugging messages |
Definition at line 1242 of file MOM_offline_main.F90.
subroutine, public mom_offline_main::offline_advection_ale | ( | type(forcing), intent(inout) | fluxes, |
type(time_type), intent(in) | Time_start, | ||
real, intent(in) | time_interval, | ||
type(offline_transport_cs), pointer | CS, | ||
integer, intent(in) | id_clock_ale, | ||
real, dimension( cs%g %isd: cs%g %ied, cs%g %jsd: cs%g %jed, cs%g %ke), intent(inout) | h_pre, | ||
real, dimension( cs%g %isdb: cs%g %iedb, cs%g %jsd: cs%g %jed, cs%g %ke), intent(inout) | uhtr, | ||
real, dimension( cs%g %isd: cs%g %ied, cs%g %jsdb: cs%g %jedb, cs%g %ke), intent(inout) | vhtr, | ||
logical, intent(out) | converged | ||
) |
3D advection is done by doing flux-limited nonlinear horizontal advection interspersed with an ALE regridding/remapping step. The loop in this routine is exited if remaining residual transports are below a runtime-specified value or a maximum number of iterations is reached.
[in,out] | fluxes | pointers to forcing fields |
[in] | time_start | starting time of a segment, as a time type |
[in] | time_interval | time interval |
cs | control structure for offline module | |
[in] | id_clock_ale | Clock for ALE routines |
[in,out] | h_pre | layer thicknesses before advection |
[in,out] | uhtr | Zonal mass transport [H m2 ~> m3 or kg] |
[in,out] | vhtr | Meridional mass transport [H m2 ~> m3 or kg] |
[out] | converged | True if the iterations have converged |
Definition at line 210 of file MOM_offline_main.F90.
References mom_tracer_advect::advect_tracer(), mom_ale::ale_main_offline(), mom_tracer_registry::mom_tracer_chkinv(), and remaining_transport_sum().
subroutine, public mom_offline_main::offline_advection_layer | ( | type(forcing), intent(inout) | fluxes, |
type(time_type), intent(in) | Time_start, | ||
real, intent(in) | time_interval, | ||
type(offline_transport_cs), pointer | CS, | ||
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | h_pre, | ||
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | eatr, | ||
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | ebtr, | ||
real, dimension(szib_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | uhtr, | ||
real, dimension(szi_(cs%g),szjb_(cs%g),szk_(cs%g)), intent(inout) | vhtr | ||
) |
When in layer mode, 3D horizontal advection using stored mass fluxes must be used. Horizontal advection is done via tracer_advect, whereas the vertical component is actually handled by vertdiff in tracer_column_fns.
[in,out] | fluxes | pointers to forcing fields |
[in] | time_start | starting time of a segment, as a time type |
[in] | time_interval | Offline transport time interval |
cs | Control structure for offline module | |
[in,out] | h_pre | layer thicknesses before advection |
[in,out] | eatr | Entrainment from layer above |
[in,out] | ebtr | Entrainment from layer below |
[in,out] | uhtr | Zonal mass transport |
[in,out] | vhtr | Meridional mass transport |
Definition at line 844 of file MOM_offline_main.F90.
References mom_tracer_advect::advect_tracer(), and mom_tracer_flow_control::call_tracer_column_fns().
Referenced by mom::step_offline().
subroutine, public mom_offline_main::offline_diabatic_ale | ( | type(forcing), intent(inout) | fluxes, |
type(time_type), intent(in) | Time_start, | ||
type(time_type), intent(in) | Time_end, | ||
type(offline_transport_cs), pointer | CS, | ||
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | h_pre, | ||
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | eatr, | ||
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | ebtr | ||
) |
The vertical/diabatic driver for offline tracers. First the eatr/ebtr associated with the interpolated vertical diffusivities are calculated and then any tracer column functions are done which can include vertical diffuvities and source/sink terms.
[in,out] | fluxes | pointers to forcing fields |
[in] | time_start | starting time of a segment, as a time type |
[in] | time_end | time interval |
cs | control structure from initialize_MOM | |
[in,out] | h_pre | layer thicknesses before advection [H ~> m or kg m-2] |
[in,out] | eatr | Entrainment from layer above [H ~> m or kg m-2] |
[in,out] | ebtr | Entrainment from layer below [H ~> m or kg m-2] |
Definition at line 654 of file MOM_offline_main.F90.
References mom_tracer_flow_control::call_tracer_column_fns(), and mom_tracer_registry::mom_tracer_chkinv().
subroutine, public mom_offline_main::offline_fw_fluxes_into_ocean | ( | type(ocean_grid_type), intent(in) | G, |
type(verticalgrid_type), intent(in) | GV, | ||
type(offline_transport_cs), intent(inout) | CS, | ||
type(forcing), intent(inout) | fluxes, | ||
real, dimension(szi_(g),szj_(g),szk_(g)), intent(inout) | h, | ||
real, dimension(szi_(g),szj_(g)), intent(in), optional | in_flux_optional | ||
) |
Apply positive freshwater fluxes (into the ocean) and update netMassOut with only the negative (out of the ocean) fluxes.
[in,out] | cs | Offline control structure |
[in] | g | Grid structure |
[in] | gv | ocean vertical grid structure |
[in,out] | fluxes | Surface fluxes container |
[in,out] | h | Layer thickness [H ~> m or kg m-2] |
[in] | in_flux_optional | The total time-integrated amount |
Definition at line 758 of file MOM_offline_main.F90.
References mom_tracer_diabatic::applytracerboundaryfluxesinout(), and mom_tracer_registry::mom_tracer_chkinv().
subroutine, public mom_offline_main::offline_fw_fluxes_out_ocean | ( | type(ocean_grid_type), intent(in) | G, |
type(verticalgrid_type), intent(in) | GV, | ||
type(offline_transport_cs), intent(inout) | CS, | ||
type(forcing), intent(inout) | fluxes, | ||
real, dimension(szi_(g),szj_(g),szk_(g)), intent(inout) | h, | ||
real, dimension(szi_(g),szj_(g)), intent(in), optional | out_flux_optional | ||
) |
Apply negative freshwater fluxes (out of the ocean)
[in,out] | cs | Offline control structure |
[in] | g | Grid structure |
[in] | gv | ocean vertical grid structure |
[in,out] | fluxes | Surface fluxes container |
[in,out] | h | Layer thickness [H ~> m or kg m-2] |
[in] | out_flux_optional | The total time-integrated amount |
Definition at line 808 of file MOM_offline_main.F90.
References mom_tracer_diabatic::applytracerboundaryfluxesinout(), and mom_tracer_registry::mom_tracer_chkinv().
subroutine, public mom_offline_main::offline_redistribute_residual | ( | type(offline_transport_cs), pointer | CS, |
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | h_pre, | ||
real, dimension(szib_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | uhtr, | ||
real, dimension(szi_(cs%g),szjb_(cs%g),szk_(cs%g)), intent(inout) | vhtr, | ||
logical, intent(in) | converged | ||
) |
In the case where the main advection routine did not converge, something needs to be done with the remaining transport. Two different ways are offered, 'barotropic' means that the residual is distributed equally throughout the water column. 'upwards' attempts to redistribute the transport in the layers above and will eventually work down the entire water column.
cs | control structure from initialize_MOM | |
[in,out] | h_pre | layer thicknesses before advection |
[in,out] | uhtr | Zonal mass transport |
[in,out] | vhtr | Meridional mass transport |
[in] | converged | True if the iterations have converged |
Definition at line 423 of file MOM_offline_main.F90.
References mom_tracer_advect::advect_tracer(), mom_offline_aux::distribute_residual_uh_upwards(), mom_offline_aux::distribute_residual_vh_upwards(), mom_tracer_registry::mom_tracer_chkinv(), mom_tracer_registry::mom_tracer_chksum(), and remaining_transport_sum().
subroutine, public mom_offline_main::offline_transport_end | ( | type(offline_transport_cs), pointer | CS | ) |
Deallocates (if necessary) arrays within the offline control structure.
cs | Control structure for offline module |
Definition at line 1501 of file MOM_offline_main.F90.
Referenced by mom::mom_end().
subroutine, public mom_offline_main::offline_transport_init | ( | type(param_file_type), intent(in) | param_file, |
type(offline_transport_cs), pointer | CS, | ||
type(diabatic_cs), intent(in) | diabatic_CSp, | ||
type(ocean_grid_type), intent(in), target | G, | ||
type(verticalgrid_type), intent(in), target | GV, | ||
type(unit_scale_type), intent(in), target | US | ||
) |
Initializes the control structure for offline transport and reads in some of the.
[in] | param_file | A structure to parse for run-time parameters |
cs | Offline control structure | |
[in] | diabatic_csp | The diabatic control structure |
[in] | g | ocean grid structure |
[in] | gv | ocean vertical grid structure |
[in] | us | A dimensional unit scaling type |
Definition at line 1286 of file MOM_offline_main.F90.
References mom_error_handler::calltree_enter(), mom_error_handler::calltree_leave(), mom_diabatic_driver::extract_diabatic_member(), and read_all_input().
subroutine, public mom_offline_main::post_offline_convergence_diags | ( | type(offline_transport_cs), intent(in) | CS, |
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | h_off, | ||
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | h_end, | ||
real, dimension(szib_(cs%g),szj_(cs%g),szk_(cs%g)), intent(inout) | uhtr, | ||
real, dimension(szi_(cs%g),szjb_(cs%g),szk_(cs%g)), intent(inout) | vhtr | ||
) |
Posts diagnostics related to offline convergence diagnostics.
[in] | cs | Offline control structure |
[in,out] | h_off | Thicknesses at end of offline step |
[in,out] | h_end | Stored thicknesses |
[in,out] | uhtr | Remaining zonal mass transport |
[in,out] | vhtr | Remaining meridional mass transport |
Definition at line 1170 of file MOM_offline_main.F90.
|
private |
Coordinates the allocation and reading in all time levels of uh, vh, hend, temp, and salt from files. Used when read_all_ts_uvh.
[in,out] | cs | Control structure for offline module |
Definition at line 1461 of file MOM_offline_main.F90.
Referenced by offline_transport_init().
subroutine, public mom_offline_main::register_diags_offline_transport | ( | type(time_type), intent(in) | Time, |
type(diag_ctrl), intent(in) | diag, | ||
type(offline_transport_cs), pointer | CS | ||
) |
Initialize additional diagnostics required for offline tracer transport.
cs | Control structure for offline module | |
[in] | time | current model time |
[in] | diag | Structure that regulates diagnostic output |
Definition at line 1113 of file MOM_offline_main.F90.
References mom_diag_mediator::register_diag_field().
|
private |
Sums any non-negligible remaining transport to check for advection convergence.
cs | control structure for offline module | |
[in] | uhtr | Zonal mass transport |
[in] | vhtr | Meridional mass transport |
Definition at line 619 of file MOM_offline_main.F90.
Referenced by offline_advection_ale(), and offline_redistribute_residual().
subroutine, public mom_offline_main::update_offline_fields | ( | type(offline_transport_cs), pointer | CS, |
real, dimension(szi_(cs%g),szj_(cs%g),szk_(cs%g)) | h, | ||
type(forcing), intent(inout) | fluxes, | ||
logical, intent(in) | do_ale | ||
) |
Update fields used in this round of offline transport. First fields are updated from files or from arrays read during initialization. Then if in an ALE-dependent coordinate, regrid/remap fields.
cs | Control structure for offline module | |
h | The regridded layer thicknesses | |
[in,out] | fluxes | Pointers to forcing fields |
[in] | do_ale | True if using ALE |
Definition at line 1017 of file MOM_offline_main.F90.
References mom_ale::ale_offline_inputs(), mom_error_handler::calltree_enter(), and mom_error_handler::calltree_leave().