Changeset 3288 for palm


Ignore:
Timestamp:
Sep 28, 2018 10:23:08 AM (6 years ago)
Author:
suehring
Message:

Bugfix in allocation of mean_inflow_profiles in case of restarts

Location:
palm/trunk/SOURCE
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/init_3d_model.f90

    r3274 r3288  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! Introduce module parameter for number of inflow profiles
    2323!
    2424! Former revisions:
     
    798798    ALLOCATE( drho_air(nzb:nzt+1) )
    799799    ALLOCATE( drho_air_zw(nzb:nzt+1) )
    800 
    801800!
    802801!-- Density profile calculation for anelastic approximation
     
    12351234             ENDDO
    12361235          ENDIF
    1237 
    12381236!
    12391237!--       Set velocity components at non-atmospheric / oceanic grid points to
     
    16381636!--       profiles from the prerun. Alternatively, prescribed profiles
    16391637!--       for u,v-components can be used.
    1640           ALLOCATE( mean_inflow_profiles(nzb:nzt+1,7) )
     1638          ALLOCATE( mean_inflow_profiles(nzb:nzt+1,1:num_mean_inflow_profiles) )
    16411639
    16421640          IF ( use_prescribed_profile_data )  THEN
  • palm/trunk/SOURCE/modules.f90

    r3274 r3288  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! +num_mean_inflow_profiles
    2323!
    2424! Former revisions:
     
    12031203    INTEGER(iwp) ::  n_sor                             !< number of iterations to be used in SOR-scheme
    12041204    INTEGER(iwp) ::  normalizing_region = 0            !< namelist parameter
     1205    INTEGER(iwp) ::  num_mean_inflow_profiles = 7      !< number of mean inflow profiles in case of turbulent inflow
    12051206    INTEGER(iwp) ::  num_leg=0                         !< number of different legs in virtual flight measurements
    12061207    INTEGER(iwp) ::  num_var_fl                        !< number of sampling/output variables in virtual flight measurements
  • palm/trunk/SOURCE/read_restart_data_mod.f90

    r3274 r3288  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Introduce module parameter for number of inflow profiles
    2323!
    2424! Former revisions:
     
    460460             CASE ( 'mean_inflow_profiles' )
    461461                IF ( .NOT. ALLOCATED( mean_inflow_profiles ) )  THEN
    462                    ALLOCATE( mean_inflow_profiles(0:nz+1,7) )
     462                   ALLOCATE( mean_inflow_profiles(0:nz+1,1:num_mean_inflow_profiles) )
    463463                ENDIF
    464464                READ ( 13 )  mean_inflow_profiles
  • palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90

    r3274 r3288  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Introduce module parameter for number of inflow profiles
    2323!
    2424! Former revisions:
     
    152152
    153153    USE control_parameters,                                                    &
    154         ONLY:  initializing_actions, message_string, syn_turb_gen
     154        ONLY:  initializing_actions, num_mean_inflow_profiles, message_string, &
     155               syn_turb_gen
    155156
    156157    USE cpulog,                                                                &
     
    439440
    440441    USE arrays_3d,                                                             &
    441         ONLY:  ddzw, u_init, v_init, zu
     442        ONLY:  dzw, ddzw, u_init, v_init, zu, zw
    442443
    443444    USE control_parameters,                                                    &
     
    445446
    446447    USE grid_variables,                                                        &
    447         ONLY:  ddx, ddy
     448        ONLY:  ddx, ddy, dx, dy
    448449
    449450    USE indices,                                                               &
     
    510511
    511512    IF ( .NOT. ALLOCATED( mean_inflow_profiles ) )                             &
    512        ALLOCATE( mean_inflow_profiles(nzb:nzt+1,5) )
     513       ALLOCATE( mean_inflow_profiles(nzb:nzt+1,1:num_mean_inflow_profiles) )
    513514
    514515    ALLOCATE ( a11(nzb:nzt+1), a21(nzb:nzt+1), a22(nzb:nzt+1),                 &
     
    528529    IF ( MOD( nz , pdims(1) ) /= 0  .AND.  myidx == id_stg_right )             &
    529530       nzt_x_stg = nzt_x_stg + myidx * ( nnz - INT( nnz ) )
    530 !        nzt_x_stg = myidx * nnz + MOD( nz , pdims(1) )
    531531
    532532    IF ( nesting_offline   .OR.  ( child_domain  .AND.  rans_mode_parent       &
     
    538538       IF ( MOD( nz , pdims(2) ) /= 0  .AND.  myidy == id_stg_north )          &
    539539          nzt_y_stg = nzt_y_stg + myidy * ( nnz - INT( nnz ) )
    540 !           nzt_y_stg = myidy * nnz + MOD( nz , pdims(2) )
    541540    ENDIF
    542541
     
    670669    ELSE
    671670!
    672 !--    Set-up defaul length scales. Assume exponentially decreasing length
    673 !--    scales and isotropic turbulence.
     671!--    Set-up default turbulent length scales. From the numerical point of
     672!--    view the imposed perturbations should not be immediately dissipated
     673!--    by the numerics. The numerical dissipation, however, acts on scales
     674!--    up to 8 x the grid spacing. For this reason, set the turbulence
     675!--    length scale to 8 time the grid spacing. Further, above the boundary
     676!--    layer height, set turbulence lenght scales to zero (equivalent to not
     677!--    imposing any perturbations) in order to save computational costs.
    674678!--    Typical length (time) scales of 100 m (s) should be a good compromise
    675679!--    between all stratrifications. Near-surface variances are fixed to
     
    684688                                  zu(k) > 0.3 * zu(nzt)                        &
    685689                                )
    686           length_scale_z = length_scale_surface * EXP( dum_exp )
     690          length_scale_z = 8.0_wp * MIN( dx, dy, dzw(k) )
     691         
     692!           IF ( zu(k) > zi_richardson ) 
    687693
    688694          nux(k) = MAX( INT( length_scale_z * ddx     ), 1 )
     
    709715
    710716       ENDDO
     717       
    711718       nux(nzb) = nux(nzb+1)
    712719       nuy(nzb) = nuy(nzb+1)
Note: See TracChangeset for help on using the changeset viewer.