Ignore:
Timestamp:
Jun 19, 2018 2:03:12 PM (6 years ago)
Author:
gronemeier
Message:

merge with branch rans

Location:
palm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk

  • palm/trunk/SOURCE

  • palm/trunk/SOURCE/timestep.f90

    r3049 r3083  
    2525! -----------------
    2626! $Id$
     27! limit dt_3d to be at maximum 2*old_dt; define old_dt at beginning of routine
     28! Add km/kh_max
     29!
     30! 3049 2018-05-29 13:52:36Z Giersch
    2731! Error messages revised
    2832!
     
    161165    INTEGER(iwp) ::  j !<
    162166    INTEGER(iwp) ::  k !<
     167    INTEGER(iwp) ::  km_max_ijk(3) = -1  !< index values (i,j,k) of location where km_max occurs
     168    INTEGER(iwp) ::  kh_max_ijk(3) = -1  !< index values (i,j,k) of location where kh_max occurs
    163169
    164170    LOGICAL ::  stop_dt_local !< local switch for controlling the time stepping
     
    173179    REAL(wp) ::  dt_w              !<
    174180    REAL(wp) ::  dt_w_l            !<
     181    REAL(wp) ::  km_max            !< maximum of Km in entire domain
     182    REAL(wp) ::  kh_max            !< maximum of Kh in entire domain
    175183    REAL(wp) ::  u_gtrans_l        !<
    176184    REAL(wp) ::  u_max_l           !<
     
    190198
    191199
    192 
    193200    CALL cpu_log( log_point(12), 'calculate_timestep', 'start' )
     201!
     202!--    Save former time step as reference
     203       old_dt = dt_3d
    194204
    195205!
     
    318328!--    The time step is the minimum of the 3-4 components and the diffusion time
    319329!--    step minus a reduction (cfl_factor) to be on the safe side.
    320 !--    The time step must not exceed the maximum allowed value.
     330!--    The time step must not exceed the maximum allowed value and must not
     331!--    increase by more than a factor of 10.
    321332       dt_3d = cfl_factor * MIN( dt_diff, dt_u, dt_v, dt_w, dt_precipitation )
    322        dt_3d = MIN( dt_3d, dt_max )
     333       dt_3d = MIN( dt_3d, dt_max, 2.0_wp * old_dt )
    323334
    324335!
     
    334345       IF ( dt_3d < ( 0.00001_wp * dt_max ) )  THEN
    335346          stop_dt = .TRUE.
     347
     348!
     349!--       Determine the maxima of the diffusion coefficients, including their
     350!--       grid index positions.
     351          CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, km, 'abs',  &
     352                               0.0_wp, km_max, km_max_ijk )
     353          CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, kh, 'abs',  &
     354                               0.0_wp, kh_max, kh_max_ijk )
    336355
    337356          WRITE( message_string, * ) 'Time step has reached minimum limit.',   &
     
    342361               '&dt_w            = ', dt_w, ' s',                              &
    343362               '&dt_diff         = ', dt_diff, ' s',                           &
    344                '&u_max           = ', u_max, ' m/s   k=', u_max_ijk(1),        &
     363               '&u_max           = ', u_max, ' m/s    k=', u_max_ijk(1),       &
    345364               '  j=', u_max_ijk(2), '  i=', u_max_ijk(3),                     &
    346                '&v_max           = ', v_max, ' m/s   k=', v_max_ijk(1),        &
     365               '&v_max           = ', v_max, ' m/s    k=', v_max_ijk(1),       &
    347366               '  j=', v_max_ijk(2), '  i=', v_max_ijk(3),                     &
    348                '&w_max           = ', w_max, ' m/s   k=', w_max_ijk(1),        &
    349                '  j=', w_max_ijk(2), '  i=', w_max_ijk(3)
     367               '&w_max           = ', w_max, ' m/s    k=', w_max_ijk(1),       &
     368               '  j=', w_max_ijk(2), '  i=', w_max_ijk(3),                     &
     369               '&km_max          = ', km_max, ' m2/s2  k=', km_max_ijk(1),     &
     370               '  j=', km_max_ijk(2), '  i=', km_max_ijk(3),                   &
     371               '&kh_max          = ', kh_max, ' m2/s2  k=', kh_max_ijk(1),     &
     372                '  j=', kh_max_ijk(2), '  i=', kh_max_ijk(3)
    350373          CALL message( 'timestep', 'PA0312', 0, 1, 0, 6, 0 )
    351374!
     
    388411       dt_3d = NINT( dt_3d * 100.0_wp / div ) * div / 100.0_wp
    389412
    390 !
    391 !--    Adjust the time step
    392        old_dt = dt_3d
    393 
    394413    ENDIF
    395414
Note: See TracChangeset for help on using the changeset viewer.