-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Option to Specify Tracer Advection Time Step #757
base: dev/gfdl
Are you sure you want to change the base?
Add Option to Specify Tracer Advection Time Step #757
Conversation
Add an option to seperate the tracer advection from the diabatic processes in MOM_step_thermo. Previously the advection and diabatic codes were seperated but called with the same timestep. If DT_TADVECT is not specified, then DT_THERM is used. The comments describing DT_THERM and DT_TADVECT have been modified to refelect this change.
Currently, this option is not intended to be used if diabatic_first is true, so a fatal error flag has been added. This will be addressed in a future pull request.
I don't like DT_TADVECT as a name, I would call this DT_ADVECT or perhaps DT_TRADVECT The description of DR_THERM should say "Ideally DT_THERM should be an integer multiple of DT and of DT_TADVECT " It seems that if the coupling time step is 3600, for example, then DT_TADVECT=10000 DT_THERM=20000, both SPANS_COUPLING, would be silently converted to DT_TADVECT=7200 and DT_THERM=18000 and the later isn't an integer multiple of DT_TADVECT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I really like this contribution, and I think that the figures in the conversation demonstrate what a valuable addition this is. However, I concur with the suggestion that the new variable should be called DT_TR_ADVECT
instead of DT_TADVECT
.
Also, I think that it should be possible to use tracer timesteps that are not the same with each step, so that in the case of Alan's example where DT_THERMO
is reset to 18000 s but DT_TR_ADVECT
becomes 7200 s, the actual sequence of tracer advection timesteps would be 7200 s, 7200 s, 3600 s within a single DT_THERMO
of 18000 s. I am confident that the iterative tracer advection scheme can handle this, and the logic setting the tracer advection and thermodynamics timesteps should not be too bad. I would, however, be satisfied if this option were held for another PR, especially if for now we added some error handling to deal with the cases where DT_THERMO
is not an integer multiple of DT_TR_ADVECT
Thanks Alan and Bob for the suggestions. I am happy to rename the time step to make things clearer. |
I agree some of the reccomendations for the timesteps in their descriptions could be modified and the possible options for timesteps could be handled better.
I can make this change as well.
I believe the current logic would support this example if thermo spans coupling is false. In that case, if If thermo spans coupling is true, the elapsed time since the last advection step is checked. But I will add an additional requirement to do advection if the |
Change DT_TADVECT to DT_TRACER_ADVECT to be clearer. dt_tadvect has been changed to dt_tr_adv and tadvect_spans_coupling to tradv_spans_coupling. An additional check has been added before the advection step. If thermo_spans_coupling is true, do_advection is true if t_dyn_rel_thermo is ~DT_THERM so that the thermodynamics step would happen at the next possible time. This ensures that the thermodynamics step is not prevented because advection has not been resolved.
I have updated the variable names in the code and the description of this PR. I added line 949: I tested these changes for reproducibility across restarts in the 0.25 degree Baltic domains with the time steps listed above and two new options:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this valuable new capability to set the tracer advection and thermodynamic timesteps separately.
In the coupled_AM2_LM3_SIS2/Intersperse_ice_1deg test case, this new code is failing with what the intel compiler reports as an integer division by zero, perhaps at line 968 of MOM.F90. |
@theresa-morrison, I conducted several runtime experiments for this new feature in both physics-only and OBGC-coupled modes using the NWA domains. The summarized results are presented in the table below. In the physics-only configuration, the runtime improvement was modest, achieving only a 4% reduction. However, in the OBGC-coupled mode, the runtime showed a significant reduction of approximately 17-19% (dachieved by doubling Avg runtime (mins)
|
The do_diabatic check should only be done if do_thermo is true. This is relevant when do_dyn or do_thermo are being used from outside step_MOM to order the updates of the thermodynamics and dynamics, such as when the interspesed coupling is used.
I was able to recreate this error in an interspersed Baltic test case. The solution I found was to add an additional check that |
@@ -962,10 +962,12 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS | |||
|
|||
!=========================================================================== | |||
! This is the second place where the diabatic processes and remapping could occur. | |||
if (thermo_does_span_coupling .or. .not.do_dyn) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It now appears that there are cases where do_diabatic
is not being initialized, but it is being used on line 972. Logically the value of do_diabatic
does not matter, but the use of an uninitialized variable will be flagged when certain debugging capabilities are enabled. Please consider adding else ; do_diabatic = .false.
just before line 971.
There are changes being implemented and a failed test so I'm removing the approval to avoid confusion
Introduction
MOM6 separates dynamic and thermodynamic, or diabatic, processes and users have the option to specify a dynamic time step (
DT
) and a thermodynamic time step (DT_THERM
). The dynamic time step is limited by the CLF, butDT_THERM
is not and therefore is often longer thanDT
. Tracer advection is done using accumulated fluxes from one or more dynamic steps, such that the tracers are advected for the length of a thermodynamic step.However, in higher resolution regional domains we have found that a tracer advective CFL may be providing a practical limit on tracer advection and therefore
DT_THERM
. We also know that model results are depend on the choice ofDT_THERM
(such as in Issue #773).This PR introduces a new time step for tracer advection which can be less than or equal to the time step for diabatic processes. The tracer advection time step is
DT_TRACER_ADVECT
and can be an integer multiple ofDT
;DT_THERM
should be an integer multiple ofDT_TRACER_ADVECT
. IfDT_THERM
is greater than the coupling time step,DT_TRACER_ADVECT
can also be greater than the coupling time step. IfDIABATIC_FIRST
is true,DT_TRACER_ADVECT
must equalDT_THERM
, this limitation will be addressed in the near future. By default,DT_TRACER_ADVECT
equalsDT_THERM
, which recovers old answers. The comments describingDT_THERM
andDT_TRACER_ADVECT
have been modified to reflect this change. Because the thermodynamics and tracer advection routines were already called separately there were no changes to those routines.Results in NWA12
The sensitivity to
DT_THERM
can be clearly observed in the regional Northwest Atlantic 1/12th degree domain. These experiments all use shorter time steps in the first year, withDT
=400s, andDT_THERM
=800s. After the first year,DT
=600s andDT_THERM
is set to 1800s, or 3600s. Using a tracer advection time step shorter than 3600s improved the Gulf Stream position withDT_THERM
=3600, but more detailed analysis is needed. Here the position of the Gulf Stream is shown for the different combinations of timesteps.Experiment 1:
DT
=600,DT_THERM
=1800Experiment 2:
DT
=600,DT_THERM
=3600Experiment 3:
DT
=600,DT_TRACER_ADVECT
=1800,DT_THERM
=3600Experiment 4:
DT
=600,DT_TRACER_ADVECT
=1200,DT_THERM
=3600Testing
This change was tested in the 0.25 degree Baltic domain for reproducibility across restarts for a combination of time step options:
DT
= 300,DT_TRACER_ADVECT
= 600,DT_THERM
= 1200,DT_coupled
= 2400DT
= 300,DT_TRACER_ADVECT
= 600,DT_coupled
= 1200,DT_THERM
= 2400DT
= 300,DT_coupled
= 600,DT_TRACER_ADVECT
= 1200,DT_THERM
= 2400Note that the new option
TRADV_SPANS_COUPLING
has been added, and should be used where appropriate. Because grid generation and remapping are done instep_MOM_thermo
at the end of every thermodynamic time step,DT_TRACER_ADVECT
must be less thanDT_THERM
.