Skip to content

Preliminary offline tracer capability#367

Merged
adcroft merged 83 commits into
mom-ocean:dev/masterfrom
ashao:origin/offline_tracers
Oct 24, 2016
Merged

Preliminary offline tracer capability#367
adcroft merged 83 commits into
mom-ocean:dev/masterfrom
ashao:origin/offline_tracers

Conversation

@ashao
Copy link
Copy Markdown
Collaborator

@ashao ashao commented Oct 7, 2016

The changes introduced here allow for tracers to be done offline using the MOM6 framework mainly through the subroutine step_tracers. Associated with this pull request is also an addition to MOM6-examples that adds a Baltic_ALE_z_offline_tracers test case with instructions on how to run tracers offline. The information below can also be found in MOM_offline_control.F90 and in the README.offline in the Baltic_ALE_z_offline_tracers test case

OVERVIEW

'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.
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
1) Using the layer thicknesses and tracer concentrations from the previous timestep,
half of the accumulated vertical mixing (eatr and ebtr) is applied in the call to
tracer_column_fns.
For tracers whose source/sink terms need dt, this value is set to 1/2 dt_offline
2) Half of the accumulated surface freshwater fluxes are applied
START ITERATION
3) Accumulated mass fluxes are used to do horizontal transport. The number of iterations
used in advect_tracer is limited to 2 (e.g x->y->x->y). The remaining mass fluxes are
stored for later use and resulting layer thicknesses fed into the next step
4) Tracers and the h-grid are regridded and remapped in a call to ALE. This allows for
layers which might 'vanish' because of horizontal mass transport to be 'reinflated'
and essentially allows for the vertical transport of tracers
5) Check that transport is done if the remaining mass fluxes equals 0 or if the max
number of iterations has been reached
END ITERATION
6) Repeat steps 1 and 2
7) Force a remapping to the stored layer thicknesses that correspond to the snapshot of
the online model at the end of an accumulation interval
8) Reset T/S and h to their stored snapshotted values to prevent model drift


EVALUATING

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.

Andrew Shao and others added 30 commits May 6, 2016 17:09
…Baltic test case and for the first 1.5 days of the Baltic_ALE_z case
…litting up the vertical and horizontal transports. Also added more options for offline control.
…ithm accuracy using 1 and 5 day timesteps in the Baltic case
… check with previous commit to see where mistake was made
…rom a layer, passive tracers are also removed
Andrew Shao added 3 commits October 11, 2016 14:47
…l structures are not copied from during offline_transport_init. This should allow ocean_only cases to run again (double_gyre works). Need to figure out a solution so that offline_transport_init is not called unless MOM6 is being run in offline mode.
…the offline_transport_init is only called when tracer are done offline
@ashao
Copy link
Copy Markdown
Collaborator Author

ashao commented Oct 13, 2016

I'm going to close this pull request for now, until I can figure out why I get answers changing between dev/master and my own branch.

@ashao ashao closed this Oct 13, 2016
Andrew Shao added 4 commits October 13, 2016 15:30
…tation. adding -fp-model precise and -fp-model source now leaves answers unchanged in a small suit of test cases. Some typos were fixed, but otherwise this code should work fine.
@ashao
Copy link
Copy Markdown
Collaborator Author

ashao commented Oct 13, 2016

Turns out that it was just because of compiler options on my workstation. This should now be good to go.

@ashao ashao reopened this Oct 13, 2016
Andrew Shao and others added 13 commits October 14, 2016 14:03
…make one for v-direction then test in OM4_05
- New code looks like it was cut and pasted from an out of date code.
- This replaces "do_online" with "offline_tracer_mode" which means
  all other configurations and other drivers are unaffected.
- Corrected description of parameter which for DO_ONLINE was
  diametrically opposite of "do online".
- Parameter name "OFFLINE_TRACER_MODE" is more descriptive!
…ent ways of dealing with residual mass fluxes if advection fails to converge
Comment thread src/core/MOM.F90 Outdated
zero_3dh !
integer :: niter, iter
real :: Inum_iter, dt_iter
logical :: converged = .false.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up - this does not do what you think it does!

Andrew Shao and others added 2 commits October 24, 2016 15:00
Proposed update to ashao:origin/offline tracers. I agree that renaming the flag from DO_ONLINE to OFFLINE_TRACER_MODE is more descriptive. I checked that this still works as intended with the Baltic_ALE_z_offline_tracers and updated the MOM_override for that test case in NOAA-GFDL/MOM6-examples#110
@adcroft adcroft merged commit fe2e8f3 into mom-ocean:dev/master Oct 24, 2016
alperaltuntas pushed a commit to iangrooms/MOM6 that referenced this pull request Jul 31, 2025
Refactored MOM_stochastics for dimensional and rotational consistency.  This
involved correcting the dimensions of a hard-coded area, adding missing
conversion factors to the register_diag_field calls for 6 stochastics
diagnostics, and adding descriptions of the units in comments describing 7
variables in MOM_stochastics.  This commit also adds the new runtime parameter
STOCHASTICS_ANSWER_DATE that can be set to a value of 20250701 or higher to use
rotationally symmetric expressions.  The stochastic physics package itself is
external to MOM6 and works in unscaled mks units, so fields passed to it (such
as the timestep) need to be unscaled back to mks units.   As a part of this
change, new unit_scale_type arguments were added to stochastics_init and
apply_skeb.  By default the answers should be bitwise identical in cases without
dimensional consistency testing, but the diagnostic conversion factors should
correct the problems with dimensional rescaling.
iangrooms added a commit to iangrooms/MOM6 that referenced this pull request Aug 28, 2025
This PR does two things

It pre-calculates some coefficients in the stochastic GM+E parameterization, which reduces computational cost. This will change answers when stochastic GM+E is in use, but only due to roundoff.
It adds docs to the MOM_stochastics module.
Originally this was aimed at Bob's fork, to go in with his PR mom-ocean#367 (see comment). Since that PR has been merged, I'm re-directing this PR directly to dev/ncar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants