Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Registry/Registry.EM_COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,8 @@ rconfig integer time_step_fract_num namelist,domains 1 0
rconfig integer time_step_fract_den namelist,domains 1 1 ih "time_step_fract_den"
rconfig integer time_step_dfi namelist,domains 1 -1 ih "time_step_dfi"

rconfig real reasonable_time_step_ratio namelist,domains 1 10. ih "reasonable_time_step_ratio" "Any d01, real-data case with a time step ratio larger than this is stopped"

rconfig integer min_time_step namelist,domains max_domains -1 h "min_time_step"
rconfig integer min_time_step_den namelist,domains max_domains 0 h "min_time_step denominator"
rconfig integer max_time_step namelist,domains max_domains -1 h "max_time_step"
Expand Down
26 changes: 26 additions & 0 deletions dyn_em/start_em.F
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
! CCN for MP=18 initializatio
REAL :: ccn_max_val

REAL :: dt_s, dx_km


REAL :: max_mf, max_rot_angle
CALL get_ijk_from_grid ( grid , &
ids, ide, jds, jde, kds, kde, &
Expand Down Expand Up @@ -153,6 +156,29 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
CALL wrf_error_fatal ( message )
END IF

!-----------------------------------------------------------------------
! Do a gross check on the time step for the most coarse grid (not for
! adaptive time steps. If the value is significantly larger than reasonable,
! then stop immediately. Likely the user made a mistake.
! If the rule of thumb is 6 DX = DT, then anything > 10 is flagged.
! Only look at domain 1, only look at real-data cases (where the map
! projection is not Cartesian), and only look at user-specified time steps
! (not the adaptive dt option).
!-----------------------------------------------------------------------
IF ( ( grid%id .EQ. 1 ) .AND. &
( config_flags%map_proj .NE. 0 ) .AND. &
( .NOT. config_flags%use_adaptive_time_step ) ) THEN
dt_s = REAL(config_flags%time_step) + &
REAL(config_flags%time_step_fract_num) / &
REAL(config_flags%time_step_fract_den)
dx_km = MIN ( config_flags%dx , config_flags%dy ) / 1000.
IF ( dt_s / dx_km > config_flags%reasonable_time_step_ratio ) THEN
WRITE (message,*) 'Time step = ',dt_s, ' (s), Grid distance = ',dx_km, ' (km)'
CALL wrf_message ( TRIM(message) )
CALL wrf_error_fatal ( '--- ERROR: The time step is too large for this grid distance')

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.

Perhaps we could add a recommended time step?

END IF
END IF

IF ( config_flags%polar ) THEN
!write(0,*)"<stdin>",__LINE__,' clat ',ips,ipe,jps,jpe
!do j = jps,jpe
Expand Down