[Draft] Adding new nml options to gradually increase timestep size #1295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR proposes two new namelist options,
config_dt_init
andconfig_dt_rampup_duration
, in order to slowly ramp up the time step size of the model upto the standard timestep size given byconfig_dt
. Initially the model starts with a timestep size equal toconfig_dt_init
and with every time advancement, increases the timestep size by adt_incr
, which is (temporarily) defined as a module level variabe inmpas_atm_core
. This accumulation of timestep size occurs until the elapsed time has reachedconfig_dt_rampup_duration
. At the end of this period, the timestep size is exactly equal to the specifiedconfig_dt
To compute the
dt_incr
, we assume that the accumulation of the timestep size occurs in an arithmetic sequence,where
a
is the initial timestep sizeconfig_dt_init
andd
would be thedt_incr
. We know that the sum of the arithmetic sequence for integers above is given by:which must equal
config_dt_rampup_duration
. With this, we can solve forn
asFrom which we can derive
dt_incr
In practice, while the timestep size at the end of the ramp up period exactly matches
config_dt
, the total time advancement duration may not necessarily matchconfig_dt_rampup_duration
, perhaps due to using an integer summation formula for floats. So we limitn
to the floor of the real value, and compute the difference betweenconfig_dt_rampup_duration
and the estimated time advanced after the first n timesteps, and set this difference as the first model timestep. The second timestep usesconfig_dt_init
as the timestep size.In addition to the above changes, this PR also includes changes to parts of the code which assume a constant timestep size. This is still work in progress