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

Bugfix in allocation of mean_inflow_profiles in case of restarts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.