Adaptive time step for small grid distance #154
Merged
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.
TYPE: bug fix
KEYWORDS: adaptive time step
SOURCE: Bryan Reen (US Army)
DESCRIPTION OF CHANGES:
(1) In dyn_em/adapt_timestep_em.F
-When reducing the time step it calculates "factor" to determine what to
multiply the old timestep by to get the new timestep. However, the way this
is calculated sometimes results in a negative multiplier. Now, the factor is
limited to being at least 0.1.
-When determining whether we are currently at the first time step (and thus
should use time step lengths specified for the first time step) it
previously incorrectly checked for advanceCount==1 instead of
advanceCount==0. Now it checks for advanceCount==0.
(2) in dyn_em/start_em.F
-Previously, denominators in starting time steps were effectively ignored.
This could result in a much larger timestep than desired at the first time
step which could result in model crashes due to CFL criteria. Now,
denominators specified for starting time steps are used.
(3) in frame/module_domain.F
-Previously, some initializations of new_grid were overwritten immediately
after having been made. For example, previously new_grid%last_step_updated
would be set to -1, but then immediately set to 0 by alloc_space_field. Then
adapt_timestep would see at time step 0 that last_step_updated=0 and so
assume that it had already calculated a timestep for the current time step
when it actually had not. Therefore, now some initializations of new_grid
have been moved down slightly to prevent them from being overwritten.
(4) external/esmf_time_f90/Meat.F90
-Add call to the subroutine simplify to simplify fractions relating to time
steps whenever they are normalized.
LIST OF MODIFIED FILES:
M dyn_em/adapt_timestep_em.F
M dyn_em/start_em.F
M external/esmf_time_f90/Meat.F90
M frame/module_domain.F
TESTS CONDUCTED:
@davegill Please review these changes to see if they are correct