Changeset 3579 for palm/trunk


Ignore:
Timestamp:
Nov 29, 2018 3:32:39 PM (6 years ago)
Author:
suehring
Message:

Bugfix in initialization of synthetic turbulence generator and calculation of turbulence scaling parameters in case of topography; checks for synthetic turbulence generator and offline nesting added

Location:
palm/trunk/SOURCE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/Makefile

    r3569 r3579  
    2525# -----------------
    2626# $Id$
     27# Dependency for check_parameters on nesting_offl_mod added
     28#
     29# 3569 2018-11-27 17:03:40Z kanani
    2730# dom_dwd_user, Schrempf:
    2831# New dependencies for biometeorology_mod,
     
    847850        mod_kinds.o \
    848851        modules.o \
     852        nesting_offl_mod.o \
    849853        netcdf_data_input_mod.o \
    850854        netcdf_interface_mod.o \
  • palm/trunk/SOURCE/check_parameters.f90

    r3575 r3579  
    2525! -----------------
    2626! $Id$
     27! Call nesting_offl_check_parameters
     28!
     29! 3575 2018-11-28 15:06:32Z kanani
    2730! Bugfix for output time levels in parallel NetCDF output with spinup
    2831!
     
    777780        ONLY:  damp_level_1d, damp_level_ind_1d
    778781
     782    USE nesting_offl_mod,                                                      &
     783        ONLY:  nesting_offl_check_parameters
     784       
    779785    USE netcdf_data_input_mod,                                                 &
    780786        ONLY:  init_model, input_pids_static, netcdf_data_input_check_dynamic, &
     
    15251531                                CALL lsf_nudging_check_parameters
    15261532    IF ( land_surface )         CALL lsm_check_parameters
     1533    IF ( nesting_offline )      CALL nesting_offl_check_parameters   
    15271534    IF ( ocean_mode )           CALL ocean_check_parameters
    15281535    IF ( plant_canopy )         CALL pcm_check_parameters
  • palm/trunk/SOURCE/init_3d_model.f90

    r3569 r3579  
    2525! -----------------
    2626! $Id$
     27! Bugfix in initialization of turbulence generator
     28!
     29! 3569 2018-11-27 17:03:40Z kanani
    2730! dom_dwd_user, Schrempf:
    2831! Remove uv exposure model code, this is now part of biometeorology_mod,
     
    13591362!--       fluxes, etc.
    13601363          CALL init_surfaces
     1364!
     1365!--       Initialize synthetic turbulence generator if required
     1366          IF( use_syn_turb_gen )  CALL stg_init
    13611367
    13621368          CALL location_message( 'finished', .TRUE. )
     
    13661372
    13671373          CALL location_message( 'initializing with constant profiles', .FALSE. )
    1368 !
    1369 !--       Overwrite initial profiles in case of synthetic turbulence generator
    1370           IF( use_syn_turb_gen )  CALL stg_init
    13711374
    13721375!
     
    14301433!--       fluxes, etc.
    14311434          CALL init_surfaces
    1432 
     1435!
     1436!--       Initialize synthetic turbulence generator if required
     1437          IF( use_syn_turb_gen )  CALL stg_init
     1438         
    14331439          CALL location_message( 'finished', .TRUE. )
    14341440
  • palm/trunk/SOURCE/nesting_offl_mod.f90

    r3413 r3579  
    2525! -----------------
    2626! $Id$
     27! Check implemented for offline nesting in child domain
     28!
     29! 3413 2018-10-24 10:28:44Z suehring
    2730! Keyword ID set
    2831!
     
    7982!
    8083!-- Public subroutines
    81     PUBLIC nesting_offl_bc, nesting_offl_header, nesting_offl_init,            &
    82            nesting_offl_mass_conservation, nesting_offl_parin
     84    PUBLIC nesting_offl_bc, nesting_offl_check_parameters, nesting_offl_header,&
     85           nesting_offl_init, nesting_offl_mass_conservation, nesting_offl_parin
    8386!
    8487!-- Public variables
     
    8891       MODULE PROCEDURE nesting_offl_bc
    8992    END INTERFACE nesting_offl_bc
     93   
     94    INTERFACE nesting_offl_check_parameters
     95       MODULE PROCEDURE nesting_offl_check_parameters
     96    END INTERFACE nesting_offl_check_parameters
    9097   
    9198    INTERFACE nesting_offl_header
     
    879886!------------------------------------------------------------------------------!
    880887    SUBROUTINE nesting_offl_check_parameters
     888   
     889       USE control_parameters,                                                    &
     890        ONLY:  child_domain, message_string, nesting_offline
    881891
    882892       IMPLICIT NONE
    883893!
    884894!--    Perform checks
     895       IF ( nesting_offline  .AND.  child_domain )  THEN
     896          message_string = 'Offline nesting is only applicable in root model.'
     897          CALL message( 'stg_check_parameters', 'PA0622', 1, 2, 0, 6, 0 )       
     898       ENDIF
    885899
    886900
  • palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90

    r3376 r3579  
    2525! -----------------
    2626! $Id$
     27! - Bugfix in calculation of turbulence scaling parameters for turbulence
     28!   generator in case of topography
     29! - Additional checks implemented - no STG in RANS-RANS nesting or LES-LES
     30!   nesting
     31!
     32! 3376 2018-10-19 10:15:32Z suehring
    2733! Error messages and numbers reivsed.
    2834!
     
    408414    IF ( use_syn_turb_gen )  THEN
    409415
     416       IF ( child_domain  .AND.  .NOT. rans_mode  .AND.                        &
     417                                 .NOT. rans_mode_parent )  THEN
     418          message_string = 'Using synthetic turbulence generator ' //          &
     419                           'is not allowed in LES-LES nesting.'
     420          CALL message( 'stg_check_parameters', 'PA0620', 1, 2, 0, 6, 0 )
     421       
     422       ENDIF
     423       
     424       IF ( child_domain  .AND.  rans_mode  .AND.                              &
     425                                 rans_mode_parent )  THEN
     426          message_string = 'Using synthetic turbulence generator ' //          &
     427                           'is not allowed in RANS-RANS nesting.'
     428          CALL message( 'stg_check_parameters', 'PA0621', 1, 2, 0, 6, 0 )
     429       
     430       ENDIF
     431   
    410432       IF ( .NOT. nesting_offline  .AND.  .NOT. child_domain )  THEN
    411433       
     
    413435        .AND.  INDEX( initializing_actions, 'read_restart_data' ) == 0 )  THEN
    414436             message_string = 'Using synthetic turbulence generator ' //       &
    415                               'requires %initializing_actions = '         //   &
    416                               '"set_constant_profiles" or "read_restart_data"' //&
    417                               ', if not offline nesting is applied.'
     437                            'requires %initializing_actions = '         //     &
     438                            '"set_constant_profiles" or "read_restart_data"' //&
     439                            ', if not offline nesting is applied.'
    418440             CALL message( 'stg_check_parameters', 'PA0015', 1, 2, 0, 6, 0 )
    419441          ENDIF
     
    427449          IF ( bc_ns /= 'cyclic' )  THEN
    428450             message_string = 'Using synthetic turbulence generator ' //       &
    429                               'requires &bc_ns = "cyclic", ' //               &
     451                              'requires &bc_ns = "cyclic", ' //                &
    430452                              'if not offline nesting is applied.'
    431453             CALL message( 'stg_check_parameters', 'PA0037', 1, 2, 0, 6, 0 )
     
    17261748          r32(k) = 10E-8_wp
    17271749       ENDIF
    1728 !        write(9,*) zu(k), r11(k), r33(k), r31(k), zi_ribulk, scale_us, scale_wm, scale_l
    17291750    ENDDO
    17301751
     
    19701991       
    19711992    USE surface_mod,                                                           &
    1972         ONLY:  surf_def_h, surf_lsm_h, surf_usm_h
     1993        ONLY:  get_topography_top_index_ji, surf_def_h, surf_lsm_h, surf_usm_h
    19731994
    19741995    IMPLICIT NONE
     
    19771998    INTEGER(iwp) :: j            !< loop index in y-direction
    19781999    INTEGER(iwp) :: k            !< loop index in z-direction
    1979     INTEGER(iwp) :: k_ref        !< index in z-direction for reference height
     2000    INTEGER(iwp) :: k_ref        !< index in z-direction for COSMO reference height
     2001    INTEGER(iwp) :: k_topo       !< topography top index
    19802002    INTEGER(iwp) :: m            !< surface element index
    19812003
     
    20302052!-- However, friction velocity is used for turbulence
    20312053!-- parametrization, so that more physically meaningful values are important.
    2032 !-- Hence, derive friction velocity from wind speed at a reference height.
     2054!-- Hence, derive friction velocity from wind speed at a reference height,
     2055!-- which is 10 m, according to the height of the 1st vertical grid level
     2056!-- in the COSMO level. However, in case of topography that is higher than
     2057!-- the reference level, the k index is determined from the 1st vertical
     2058!-- PALM grid level instead.
    20332059!-- For a first guess use 20 m, which is in the range of the first
    20342060!-- COSMO vertical level.
     
    20422068       DO  j = nys, nyn
    20432069!
     2070!--       Determine the k index and topography top index
     2071          k_topo = MAX( get_topography_top_index_ji( j, i, 'u' ),              &
     2072                        get_topography_top_index_ji( j, i, 'v' ) )
     2073          k      = MAX( k_ref, k_topo + 1 )
     2074!
    20442075!--       Note, in u- and v- component the imposed perturbations
    20452076!--       from the STG are already included. Check whether this
    20462077!--       makes any difference compared to using the pure-mean
    20472078!--       inflow profiles.
    2048           u_int = MERGE( u(k_ref,j,i+1), u(k_ref,j,i), bc_dirichlet_l )
    2049           v_int = v(k_ref,j,i)
     2079          u_int = MERGE( u(k,j,i+1), u(k,j,i), bc_dirichlet_l )
     2080          v_int = v(k,j,i)
    20502081!
    20512082!--       Calculate friction velocity and sum-up. Therefore, assume
     
    20532084          friction_vel_l = friction_vel_l + kappa *                            &
    20542085                            SQRT( u_int * u_int + v_int * v_int )  /           &
    2055                             LOG( zu(k_ref) / z0_mean )
     2086                            LOG( ( zu(k) - zu(k_topo) ) / z0_mean )
    20562087         
    20572088       ENDDO
     
    20652096       DO  i = nxl, nxr
    20662097         
    2067           u_int = u(k_ref,j,i)
    2068           v_int = MERGE( v(k_ref,j+1,i), v(k_ref,j,i), bc_dirichlet_s )
     2098          k_topo = MAX( get_topography_top_index_ji( j, i, 'u' ),              &
     2099                        get_topography_top_index_ji( j, i, 'v' ) )
     2100          k      = MAX( k_ref, k_topo + 1 )
     2101         
     2102          u_int = u(k,j,i)
     2103          v_int = MERGE( v(k,j+1,i), v(k,j,i), bc_dirichlet_s )
    20692104 
    20702105          friction_vel_l = friction_vel_l + kappa *                            &
    20712106                            SQRT( u_int * u_int + v_int * v_int )  /           &
    2072                             LOG( zu(k_ref) / z0_mean )                       
     2107                            LOG( ( zu(k) - zu(k_topo) ) / z0_mean )                       
    20732108         
    20742109       ENDDO
Note: See TracChangeset for help on using the changeset viewer.