Changeset 151 for palm/trunk/SOURCE


Ignore:
Timestamp:
Mar 7, 2008 1:42:18 PM (17 years ago)
Author:
raasch
Message:

preliminary update for the turbulence recycling method

Location:
palm/trunk/SOURCE
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/CURRENT_MODIFICATIONS

    r150 r151  
    2626User-defined spectra.
    2727
    28 advec_particles, calc_spectra, check_open, check_parameters, data_output_spectra, init_particles, init_pegrid, init_3d_model, modules, netcdf, particle_boundary_conds, read_var_list, read_3d_binary, user_interface, write_var_list, write_3d_binary
     28advec_particles, calc_spectra, check_open, check_parameters, data_output_spectra, init_particles, init_pegrid, init_3d_model, modules, netcdf, particle_boundary_conds, read_var_list, read_3d_binary, time_integration, user_interface, write_var_list, write_3d_binary
     29
     30New: inflow_turbulence
    2931
    3032
     
    6466Bugfix: extra '*' removed in user_statistics sample code (user_interface)
    6567Bugfix: a stop command was missing in some cases of the parallel branch (local_stop)
     68Bugfix in volume flow control for non-cyclic boundary conditions (pres)
    6669
    6770
     71flow_statistics, local_stop, plant_canopy_model, pres, read_3d_binary, user_interface, write_3d_binary
    6872
    69 flow_statistics, local_stop, plant_canopy_model, read_3d_binary, user_interface, write_3d_binary
    70 
  • palm/trunk/SOURCE/Makefile

    r138 r151  
    44# Actual revisions:
    55# -----------------
    6 # +plant_canopy_model
     6# +plant_canopy_model, inflow_turbulence
    77#
    88# +surface_coupler
     
    5555        disturb_heatflux.f90 eqn_state_seawater.f90 exchange_horiz.f90 exchange_horiz_2d.f90 \
    5656        fft_xy.f90 flow_statistics.f90 global_min_max.f90 header.f90 \
    57         impact_of_latent_heat.f90 init_1d_model.f90 init_3d_model.f90 \
    58         init_advec.f90 init_cloud_physics.f90 init_dvrp.f90 init_grid.f90 \
    59         init_ocean.f90 init_particles.f90 init_pegrid.f90 init_pt_anomaly.f90 \
    60         init_rankine.f90 init_slope.f90 interaction_droplets_ptq.f90 \
    61         local_flush.f90 local_getenv.f90 local_stop.f90 local_system.f90 local_tremain.f90 \
     57        impact_of_latent_heat.f90 inflow_turbulence.f90 init_1d_model.f90 \
     58        init_3d_model.f90 init_advec.f90 init_cloud_physics.f90 init_dvrp.f90 \
     59        init_grid.f90 init_ocean.f90 init_particles.f90 init_pegrid.f90 \
     60        init_pt_anomaly.f90 init_rankine.f90 init_slope.f90 \
     61        interaction_droplets_ptq.f90 local_flush.f90 local_getenv.f90 \
     62        local_stop.f90 local_system.f90 local_tremain.f90 \
    6263        local_tremain_ini.f90 modules.f90 netcdf.f90 package_parin.f90 \
    6364        palm.f90 parin.f90 particle_boundary_conds.f90 \
     
    8788        disturb_heatflux.o eqn_state_seawater.o exchange_horiz.o exchange_horiz_2d.o fft_xy.o \
    8889        flow_statistics.o global_min_max.o header.o impact_of_latent_heat.o \
    89         init_1d_model.o init_3d_model.o init_advec.o init_cloud_physics.o \
     90        inflow_turbulence.o init_1d_model.o init_3d_model.o init_advec.o init_cloud_physics.o \
    9091        init_dvrp.o init_grid.o init_ocean.o init_particles.o init_pegrid.o \
    9192        init_pt_anomaly.o init_rankine.o init_slope.o \
     
    182183header.o: modules.o
    183184impact_of_latent_heat.o: modules.o
     185inflow_turbulence.o: modules.o
    184186init_1d_model.o: modules.o
    185187init_3d_model.o: modules.o random_function.o
  • palm/trunk/SOURCE/check_parameters.f90

    r147 r151  
    44! Actual revisions:
    55! -----------------
    6 ! Case of reading data for recycling included in initializing_actions
     6! Case of reading data for recycling included in initializing_actions,
     7! check of turbulent_inflow and calculation of recycling_plane
    78!
    89! Former revisions:
     
    29812982
    29822983!
     2984!-- A turbulent inflow requires Dirichlet conditions at the respective inflow
     2985!-- boundary (so far, a turbulent inflow is realized from the left side only)
     2986    IF ( turbulent_inflow  .AND.  bc_lr /= 'dirichlet/radiation' )  THEN
     2987       IF ( myid == 0 )  THEN
     2988          PRINT*, '+++ check_parameters:'
     2989          PRINT*, '    turbulent_inflow = .T. requires a Dirichlet condition', &
     2990                  ' at the inflow boundary'
     2991       ENDIF
     2992       CALL local_stop
     2993    ENDIF
     2994
     2995!
     2996!-- In case of turbulent inflow calculate the index of the recycling plane
     2997    IF ( turbulent_inflow )  THEN
     2998       IF ( recycling_width == 9999999.9 )  THEN
     2999!
     3000!--       Set the default value for the width of the recycling domain
     3001          recycling_width = 0.1 * nx * dx
     3002       ELSE
     3003          IF ( recycling_width < dx  .OR.  recycling_width > nx * dx )  THEN
     3004             IF ( myid == 0 )  THEN
     3005                PRINT*, '+++ check_parameters:'
     3006                PRINT*, '    illegal value for recycling_width: ', &
     3007                        recycling_width
     3008             ENDIF
     3009             CALL local_stop
     3010          ENDIF
     3011       ENDIF
     3012!
     3013!--    Calculate the index
     3014       recycling_plane = recycling_width / dx
     3015    ENDIF
     3016
     3017!
    29833018!-- Check random generator
    29843019    IF ( random_generator /= 'system-specific'  .AND. &
  • palm/trunk/SOURCE/header.f90

    r147 r151  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Output of turbulence recycling informations
    77!
    88! Former revisions:
     
    514514       WRITE ( io, 304 )
    515515       IF ( coupling_mode == 'uncoupled' )  THEN
    516           WRITE ( io, 319 )  top_momentumflux_u, top_momentumflux_v
     516          WRITE ( io, 320 )  top_momentumflux_u, top_momentumflux_v
    517517          IF ( constant_top_heatflux )  THEN
    518518             WRITE ( io, 306 )  top_heatflux
     
    548548    IF ( bc_lr /= 'cyclic'  .OR.  bc_ns /= 'cyclic' )  THEN
    549549       WRITE ( io, 318 )  outflow_damping_width, km_damp_max
     550       IF ( turbulent_inflow )  THEN
     551          WRITE ( io, 319 )  recycling_width, recycling_plane, &
     552                             inflow_damping_height, inflow_damping_width
     553       ENDIF
    550554    ENDIF
    551555
    552556!
    553557!-- Listing of 1D-profiles
    554     WRITE ( io, 320 )  dt_dopr_listing
     558    WRITE ( io, 325 )  dt_dopr_listing
    555559    IF ( averaging_interval_pr /= 0.0 )  THEN
    556        WRITE ( io, 321 )  averaging_interval_pr, dt_averaging_input_pr
     560       WRITE ( io, 326 )  averaging_interval_pr, dt_averaging_input_pr
    557561    ENDIF
    558562
     
    561565    WRITE ( io, 330 )
    562566    IF ( averaging_interval_pr /= 0.0 )  THEN
    563        WRITE ( io, 321 )  averaging_interval_pr, dt_averaging_input_pr
     567       WRITE ( io, 326 )  averaging_interval_pr, dt_averaging_input_pr
    564568    ENDIF
    565569
     
    14141418318 FORMAT (/'       outflow damping layer width: ',I3,' gridpoints with km_', &
    14151419                    'max =',F5.1,' m**2/s')
    1416 319 FORMAT ('       Predefined constant momentumflux:  u: ',F9.6,' m**2/s**2'/ &
     1420319 FORMAT ('       turbulence recycling at inflow switched on'/ &
     1421            '       width of recycling domain: ',F7.1,' m   grid index: ',I4/ &
     1422            '       inflow damping height: ',F6.1,' m   width: ',F6.1,' m')
     1423320 FORMAT ('       Predefined constant momentumflux:  u: ',F9.6,' m**2/s**2'/ &
    14171424            '                                          v: ',F9.6,' m**2/s**2')
    1418 320 FORMAT (//' List output:'/ &
     1425325 FORMAT (//' List output:'/ &
    14191426             ' -----------'//  &
    14201427            '    1D-Profiles:'/    &
    14211428            '       Output every             ',F8.2,' s')
    1422 321 FORMAT ('       Time averaged over       ',F8.2,' s'/ &
     1429326 FORMAT ('       Time averaged over       ',F8.2,' s'/ &
    14231430            '       Averaging input every    ',F8.2,' s')
    14241431330 FORMAT (//' Data output:'/ &
  • palm/trunk/SOURCE/init_3d_model.f90

    r147 r151  
    602602
    603603!
    604 !--    apply channel flow boundary condition
     604!--    Apply channel flow boundary condition
    605605       IF ( TRIM( bc_uv_t ) == 'dirichlet_0' )  THEN
    606606
     
    608608          v(nzt+1,:,:) = 0.0
    609609
    610 !--       for the Dirichlet condition to be correctly applied at the top, set
     610!--       For the Dirichlet condition to be correctly applied at the top, set
    611611!--       ug and vg to zero there
    612612          ug(nzt+1)    = 0.0
     
    755755
    756756!
     757!--    For the moment, perturbation pressure and vertical velocity are zero
     758       p = 0.0; w = 0.0
     759
     760!
     761!--    Initialize array sums (must be defined in first call of pres)
     762       sums = 0.0
     763
     764!
     765!--    Treating cloud physics, liquid water content and precipitation amount
     766!--    are zero at beginning of the simulation
     767       IF ( cloud_physics )  THEN
     768          ql = 0.0
     769          IF ( precipitation )  precipitation_amount = 0.0
     770       ENDIF
     771
     772!
     773!--    Impose vortex with vertical axis on the initial velocity profile
     774       IF ( INDEX( initializing_actions, 'initialize_vortex' ) /= 0 )  THEN
     775          CALL init_rankine
     776       ENDIF
     777
     778!
     779!--    Impose temperature anomaly (advection test only)
     780       IF ( INDEX( initializing_actions, 'initialize_ptanom' ) /= 0 )  THEN
     781          CALL init_pt_anomaly
     782       ENDIF
     783
     784!
     785!--    If required, change the surface temperature at the start of the 3D run
     786       IF ( pt_surface_initial_change /= 0.0 )  THEN
     787          pt(nzb,:,:) = pt(nzb,:,:) + pt_surface_initial_change
     788       ENDIF
     789
     790!
     791!--    If required, change the surface humidity/scalar at the start of the 3D
     792!--    run
     793       IF ( ( humidity .OR. passive_scalar ) .AND. &
     794            q_surface_initial_change /= 0.0 )  THEN
     795          q(nzb,:,:) = q(nzb,:,:) + q_surface_initial_change
     796       ENDIF
     797
     798!
     799!--    Initialize the random number generator (from numerical recipes)
     800       CALL random_function_ini
     801
     802!
     803!--    Impose random perturbation on the horizontal velocity field and then
     804!--    remove the divergences from the velocity field
     805       IF ( create_disturbances )  THEN
     806          CALL disturb_field( nzb_u_inner, tend, u )
     807          CALL disturb_field( nzb_v_inner, tend, v )
     808          n_sor = nsor_ini
     809          CALL pres
     810          n_sor = nsor
     811       ENDIF
     812
     813!
     814!--    Once again set the perturbation pressure explicitly to zero in order to
     815!--    assure that it does not generate any divergences in the first time step.
     816!--    At t=0 the velocity field is free of divergence (as constructed above).
     817!--    Divergences being created during a time step are not yet known and thus
     818!--    cannot be corrected during the time step yet.
     819       p = 0.0
     820
     821!
     822!--    Initialize old and new time levels.
     823       IF ( timestep_scheme(1:5) /= 'runge' )  THEN
     824          e_m = e; pt_m = pt; u_m = u; v_m = v; w_m = w; kh_m = kh; km_m = km
     825       ELSE
     826          te_m = 0.0; tpt_m = 0.0; tu_m = 0.0; tv_m = 0.0; tw_m = 0.0
     827       ENDIF
     828       e_p = e; pt_p = pt; u_p = u; v_p = v; w_p = w
     829
     830       IF ( humidity  .OR.  passive_scalar )  THEN
     831          IF ( ASSOCIATED( q_m ) )  q_m = q
     832          IF ( timestep_scheme(1:5) == 'runge' )  tq_m = 0.0
     833          q_p = q
     834          IF ( humidity  .AND.  ASSOCIATED( vpt_m ) )  vpt_m = vpt
     835       ENDIF
     836
     837       IF ( ocean )  THEN
     838          tsa_m = 0.0
     839          sa_p  = sa
     840       ENDIF
     841
     842
     843    ELSEIF ( TRIM( initializing_actions ) == 'read_restart_data'  .OR.    &
     844             TRIM( initializing_actions ) == 'read_data_for_recycling' )  &
     845    THEN
     846!
     847!--    When reading data for initializing the recycling method, first read
     848!--    some of the global variables from restart file
     849       IF ( TRIM( initializing_actions ) == 'read_data_for_recycling' )  THEN
     850
     851          WRITE (9,*) 'before read_parts_of_var_list'
     852          CALL local_flush( 9 )
     853          CALL read_parts_of_var_list
     854          WRITE (9,*) 'after read_parts_of_var_list'
     855          CALL local_flush( 9 )
     856          CALL close_file( 13 )
     857!
     858!--       Store temporally and horizontally averaged vertical profiles to be
     859!--       used as mean inflow profiles
     860          ALLOCATE( mean_inflow_profiles(nzb:nzt+1,5) )
     861
     862          mean_inflow_profiles(:,1) = hom_sum(:,1,0)    ! u
     863          mean_inflow_profiles(:,2) = hom_sum(:,2,0)    ! v
     864          mean_inflow_profiles(:,4) = hom_sum(:,4,0)    ! pt
     865          mean_inflow_profiles(:,5) = hom_sum(:,8,0)    ! e
     866
     867!
     868!--       Use these mean profiles for the inflow (provided that Dirichlet
     869!--       conditions are used)
     870          IF ( inflow_l )  THEN
     871             DO  j = nys-1, nyn+1
     872                DO  k = nzb, nzt+1
     873                   u(k,j,-1)  = mean_inflow_profiles(k,1)
     874                   v(k,j,-1)  = mean_inflow_profiles(k,2)
     875                   w(k,j,-1)  = 0.0
     876                   pt(k,j,-1) = mean_inflow_profiles(k,4)
     877                   e(k,j,-1)  = mean_inflow_profiles(k,5)
     878                ENDDO
     879             ENDDO
     880          ENDIF
     881
     882!
     883!--       Calculate the damping factors to be used at the inflow. For a
     884!--       turbulent inflow the turbulent fluctuations have to be limited
     885!--       vertically because otherwise the turbulent inflow layer will grow
     886!--       in time.
     887          IF ( inflow_damping_height == 9999999.9 )  THEN
     888!
     889!--          Default: use the inversion height calculated by the prerun
     890             inflow_damping_height = hom_sum(nzb+6,pr_palm,0)
     891
     892          ENDIF
     893
     894          IF ( inflow_damping_width == 9999999.9 )  THEN
     895!
     896!--          Default for the transition range: one tenth of the undamped layer
     897             inflow_damping_width = 0.1 * inflow_damping_height
     898
     899          ENDIF
     900
     901          ALLOCATE( inflow_damping_factor(nzb:nzt+1) )
     902
     903          DO  k = nzb, nzt+1
     904
     905             IF ( zu(k) <= inflow_damping_height )  THEN
     906                inflow_damping_factor(k) = 1.0
     907             ELSEIF ( zu(k) <= inflow_damping_height + inflow_damping_width ) &
     908             THEN
     909                inflow_damping_factor(k) = 1.0 -                               &
     910                                           ( zu(k) - inflow_damping_height ) / &
     911                                           inflow_damping_width
     912             ELSE
     913                inflow_damping_factor(k) = 0.0
     914             ENDIF
     915
     916          ENDDO
     917
     918       ENDIF
     919
     920
     921!
     922!--    Read binary data from restart file
     923          WRITE (9,*) 'before read_3d_binary'
     924          CALL local_flush( 9 )
     925       CALL read_3d_binary
     926          WRITE (9,*) 'after read_3d_binary'
     927          CALL local_flush( 9 )
     928
     929!
     930!--    Calculate initial temperature field and other constants used in case
     931!--    of a sloping surface
     932       IF ( sloping_surface )  CALL init_slope
     933
     934!
     935!--    Initialize new time levels (only done in order to set boundary values
     936!--    including ghost points)
     937       e_p = e; pt_p = pt; u_p = u; v_p = v; w_p = w
     938       IF ( humidity  .OR.  passive_scalar )  q_p = q
     939       IF ( ocean )  sa_p = sa
     940
     941    ELSE
     942!
     943!--    Actually this part of the programm should not be reached
     944       IF ( myid == 0 )  PRINT*,'+++ init_3d_model: unknown initializing ', &
     945                                                    'problem'
     946       CALL local_stop
     947    ENDIF
     948
     949
     950    IF (  TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
     951!
     952!--    Initialize old timelevels needed for radiation boundary conditions
     953       IF ( outflow_l )  THEN
     954          u_m_l(:,:,:) = u(:,:,1:2)
     955          v_m_l(:,:,:) = v(:,:,0:1)
     956          w_m_l(:,:,:) = w(:,:,0:1)
     957       ENDIF
     958       IF ( outflow_r )  THEN
     959          u_m_r(:,:,:) = u(:,:,nx-1:nx)
     960          v_m_r(:,:,:) = v(:,:,nx-1:nx)
     961          w_m_r(:,:,:) = w(:,:,nx-1:nx)
     962       ENDIF
     963       IF ( outflow_s )  THEN
     964          u_m_s(:,:,:) = u(:,0:1,:)
     965          v_m_s(:,:,:) = v(:,1:2,:)
     966          w_m_s(:,:,:) = w(:,0:1,:)
     967       ENDIF
     968       IF ( outflow_n )  THEN
     969          u_m_n(:,:,:) = u(:,ny-1:ny,:)
     970          v_m_n(:,:,:) = v(:,ny-1:ny,:)
     971          w_m_n(:,:,:) = w(:,ny-1:ny,:)
     972       ENDIF
     973
     974!
    757975!--    Calculate the initial volume flow at the right and north boundary
    758976       IF ( conserve_volume_flow )  THEN
     
    8001018       ENDIF
    8011019
    802 !
    803 !--    For the moment, perturbation pressure and vertical velocity are zero
    804        p = 0.0; w = 0.0
    805 
    806 !
    807 !--    Initialize array sums (must be defined in first call of pres)
    808        sums = 0.0
    809 
    810 !
    811 !--    Treating cloud physics, liquid water content and precipitation amount
    812 !--    are zero at beginning of the simulation
    813        IF ( cloud_physics )  THEN
    814           ql = 0.0
    815           IF ( precipitation )  precipitation_amount = 0.0
    816        ENDIF
    817 
    818 !
    819 !--    Impose vortex with vertical axis on the initial velocity profile
    820        IF ( INDEX( initializing_actions, 'initialize_vortex' ) /= 0 )  THEN
    821           CALL init_rankine
    822        ENDIF
    823 
    824 !
    825 !--    Impose temperature anomaly (advection test only)
    826        IF ( INDEX( initializing_actions, 'initialize_ptanom' ) /= 0 )  THEN
    827           CALL init_pt_anomaly
    828        ENDIF
    829 
    830 !
    831 !--    If required, change the surface temperature at the start of the 3D run
    832        IF ( pt_surface_initial_change /= 0.0 )  THEN
    833           pt(nzb,:,:) = pt(nzb,:,:) + pt_surface_initial_change
    834        ENDIF
    835 
    836 !
    837 !--    If required, change the surface humidity/scalar at the start of the 3D
    838 !--    run
    839        IF ( ( humidity .OR. passive_scalar ) .AND. &
    840             q_surface_initial_change /= 0.0 )  THEN
    841           q(nzb,:,:) = q(nzb,:,:) + q_surface_initial_change
    842        ENDIF
    843 
    844 !
    845 !--    Initialize the random number generator (from numerical recipes)
    846        CALL random_function_ini
    847 
    848 !
    849 !--    Impose random perturbation on the horizontal velocity field and then
    850 !--    remove the divergences from the velocity field
    851        IF ( create_disturbances )  THEN
    852           CALL disturb_field( nzb_u_inner, tend, u )
    853           CALL disturb_field( nzb_v_inner, tend, v )
    854           n_sor = nsor_ini
    855           CALL pres
    856           n_sor = nsor
    857        ENDIF
    858 
    859 !
    860 !--    Once again set the perturbation pressure explicitly to zero in order to
    861 !--    assure that it does not generate any divergences in the first time step.
    862 !--    At t=0 the velocity field is free of divergence (as constructed above).
    863 !--    Divergences being created during a time step are not yet known and thus
    864 !--    cannot be corrected during the time step yet.
    865        p = 0.0
    866 
    867 !
    868 !--    Initialize old and new time levels.
    869        IF ( timestep_scheme(1:5) /= 'runge' )  THEN
    870           e_m = e; pt_m = pt; u_m = u; v_m = v; w_m = w; kh_m = kh; km_m = km
    871        ELSE
    872           te_m = 0.0; tpt_m = 0.0; tu_m = 0.0; tv_m = 0.0; tw_m = 0.0
    873        ENDIF
    874        e_p = e; pt_p = pt; u_p = u; v_p = v; w_p = w
    875 
    876        IF ( humidity  .OR.  passive_scalar )  THEN
    877           IF ( ASSOCIATED( q_m ) )  q_m = q
    878           IF ( timestep_scheme(1:5) == 'runge' )  tq_m = 0.0
    879           q_p = q
    880           IF ( humidity  .AND.  ASSOCIATED( vpt_m ) )  vpt_m = vpt
    881        ENDIF
    882 
    883        IF ( ocean )  THEN
    884           tsa_m = 0.0
    885           sa_p  = sa
    886        ENDIF
    887 
    888 !
    889 !--    Initialize old timelevels needed for radiation boundary conditions
    890        IF ( outflow_l )  THEN
    891           u_m_l(:,:,:) = u(:,:,1:2)
    892           v_m_l(:,:,:) = v(:,:,0:1)
    893           w_m_l(:,:,:) = w(:,:,0:1)
    894        ENDIF
    895        IF ( outflow_r )  THEN
    896           u_m_r(:,:,:) = u(:,:,nx-1:nx)
    897           v_m_r(:,:,:) = v(:,:,nx-1:nx)
    898           w_m_r(:,:,:) = w(:,:,nx-1:nx)
    899        ENDIF
    900        IF ( outflow_s )  THEN
    901           u_m_s(:,:,:) = u(:,0:1,:)
    902           v_m_s(:,:,:) = v(:,1:2,:)
    903           w_m_s(:,:,:) = w(:,0:1,:)
    904        ENDIF
    905        IF ( outflow_n )  THEN
    906           u_m_n(:,:,:) = u(:,ny-1:ny,:)
    907           v_m_n(:,:,:) = v(:,ny-1:ny,:)
    908           w_m_n(:,:,:) = w(:,ny-1:ny,:)
    909        ENDIF
    910 
    911     ELSEIF ( TRIM( initializing_actions ) == 'read_restart_data'  .OR.    &
    912              TRIM( initializing_actions ) == 'read_data_for_recycling' )  &
    913     THEN
    914 !
    915 !--    When reading data for initializing the recycling method, first read
    916 !--    some of the global variables from restart file
    917        IF ( TRIM( initializing_actions ) == 'read_data_for_recycling' )  THEN
    918           WRITE (9,*) 'before read_parts_of_var_list'
    919           CALL local_flush( 9 )
    920           CALL read_parts_of_var_list
    921           WRITE (9,*) 'after read_parts_of_var_list'
    922           CALL local_flush( 9 )
    923           CALL close_file( 13 )
    924        ENDIF
    925 
    926 !
    927 !--    Read binary data from restart file
    928           WRITE (9,*) 'before read_3d_binary'
    929           CALL local_flush( 9 )
    930        CALL read_3d_binary
    931           WRITE (9,*) 'after read_3d_binary'
    932           CALL local_flush( 9 )
    933 
    934 !
    935 !--    Calculate initial temperature field and other constants used in case
    936 !--    of a sloping surface
    937        IF ( sloping_surface )  CALL init_slope
    938 
    939 !
    940 !--    Initialize new time levels (only done in order to set boundary values
    941 !--    including ghost points)
    942        e_p = e; pt_p = pt; u_p = u; v_p = v; w_p = w
    943        IF ( humidity  .OR.  passive_scalar )  q_p = q
    944        IF ( ocean )  sa_p = sa
    945 
    946     ELSE
    947 !
    948 !--    Actually this part of the programm should not be reached
    949        IF ( myid == 0 )  PRINT*,'+++ init_3d_model: unknown initializing ', &
    950                                                     'problem'
    951        CALL local_stop
    9521020    ENDIF
    9531021
  • palm/trunk/SOURCE/init_pegrid.f90

    r145 r151  
    44! Actual revisions:
    55! -----------------
    6 ! Collect on PE0 horizontal index bounds from all other PEs
     6! Collect on PE0 horizontal index bounds from all other PEs,
     7! broadcast the id of the inflow PE (using the respective communicator)
    78! TEST OUTPUT (TO BE REMOVED) logging mpi2 ierr values
    89!
     
    5758    IMPLICIT NONE
    5859
    59     INTEGER ::  gathered_size, i, ind(5), j, k, maximum_grid_level_l,     &
    60                 mg_switch_to_pe0_level_l, mg_levels_x, mg_levels_y,      &
    61                 mg_levels_z, nnx_y, nnx_z, nny_x, nny_z, nnz_x, nnz_y,    &
    62                 numproc_sqr, nx_total, nxl_l, nxr_l, nyn_l, nys_l, nzb_l, &
    63                 nzt_l, omp_get_num_threads, subdomain_size
     60    INTEGER ::  gathered_size, i, id_inflow_l, ind(5), j, k,                 &
     61                maximum_grid_level_l, mg_switch_to_pe0_level_l, mg_levels_x, &
     62                mg_levels_y, mg_levels_z, nnx_y, nnx_z, nny_x, nny_z, nnz_x, &
     63                nnz_y, numproc_sqr, nx_total, nxl_l, nxr_l, nyn_l, nys_l,    &
     64                nzb_l, nzt_l, omp_get_num_threads, subdomain_size
    6465
    6566    INTEGER, DIMENSION(:), ALLOCATABLE ::  ind_all, nxlf, nxrf, nynf, nysf
     
    918919    ENDIF
    919920
     921!
     922!-- Broadcast the id of the inflow PE
     923    IF ( inflow_l )  THEN
     924       id_inflow_l = myid
     925    ELSE
     926       id_inflow_l = 0
     927    ENDIF
     928    CALL MPI_ALLREDUCE( id_inflow_l, id_inflow, 1, MPI_INTEGER, MPI_SUM, &
     929                        comm1dx, ierr )
     930
    920931#else
    921932    IF ( bc_lr == 'dirichlet/radiation' )  THEN
  • palm/trunk/SOURCE/modules.f90

    r150 r151  
    55! Actual revisions:
    66! -----------------
    7 ! +hor_index_bounds, hor_index_bounds_previous_run, numprocs_previous_run,
    8 ! nx_on_file, ny_on_file, offset_ocean_*
     7! +hor_index_bounds, hor_index_bounds_previous_run, id_inflow,
     8! inflow_damping_*, mean_inflow_profiles, numprocs_previous_run, nx_on_file,
     9! ny_on_file, offset_ocean_*, recycling_plane, recycling_width, turbulent_inflow
    910! -myid_char_14
    1011!
     
    115116
    116117    REAL, DIMENSION(:), ALLOCATABLE ::                                         &
    117           ddzu, dd2zu, dzu, ddzw, dzw, hyp, km_damp_x, km_damp_y, lad, l_grid, &
    118           pt_init, q_init, rdf, sa_init, ug, u_init, u_nzb_p1_for_vfc, vg,     &
    119           v_init, v_nzb_p1_for_vfc, zu, zw
     118          ddzu, dd2zu, dzu, ddzw, dzw, hyp, inflow_damping_factor, km_damp_x, &
     119          km_damp_y, lad, l_grid, pt_init, q_init, rdf, sa_init, ug, u_init,   &
     120          u_nzb_p1_for_vfc, vg, v_init, v_nzb_p1_for_vfc, zu, zw
    120121
    121122    REAL, DIMENSION(:,:), ALLOCATABLE ::                                       &
    122           c_u, c_v, c_w, dzu_mg, dzw_mg, f1_mg, f2_mg, f3_mg, pt_slope_ref,    &
    123           qs, qswst_remote, ts, us, z0
     123          c_u, c_v, c_w, dzu_mg, dzw_mg, f1_mg, f2_mg, f3_mg,                  &
     124          mean_inflow_profiles, pt_slope_ref, qs, qswst_remote, ts, us, z0
    124125
    125126    REAL, DIMENSION(:,:), ALLOCATABLE, TARGET ::                               &
     
    309310                nsor_ini = 100, n_sor, normalizing_region = 0, &
    310311                nz_do1d, nz_do3d = -9999, outflow_damping_width = -1, &
    311                 prt_time_count = 0, runnr = 0, skip_do_avs = 0, &
    312                 terminate_coupled = 0, terminate_coupled_remote = 0, &
    313                 timestep_count = 0
     312                prt_time_count = 0, recycling_plane, runnr = 0, &
     313                skip_do_avs = 0, terminate_coupled = 0, &
     314                terminate_coupled_remote = 0, timestep_count = 0
    314315
    315316    INTEGER ::  dist_nxl(0:1), dist_nxr(0:1), dist_nyn(0:1), dist_nys(0:1), &
     
    357358                random_heatflux = .FALSE., run_control_header = .FALSE., &
    358359                sloping_surface = .FALSE., stop_dt = .FALSE., &
    359                 terminate_run = .FALSE., use_prior_plot1d_parameters = .FALSE.,&
    360                 use_reference = .FALSE., use_surface_fluxes = .FALSE., &
    361                 use_top_fluxes = .FALSE., use_ug_for_galilei_tr = .TRUE., &
    362                 use_upstream_for_tke = .FALSE., wall_adjustment = .TRUE.
     360                terminate_run = .FALSE., turbulent_inflow = .FALSE., &
     361                use_prior_plot1d_parameters = .FALSE., use_reference = .FALSE.,&
     362                use_surface_fluxes = .FALSE., use_top_fluxes = .FALSE., &
     363                use_ug_for_galilei_tr = .TRUE., use_upstream_for_tke = .FALSE.,&
     364                wall_adjustment = .TRUE.
    363365
    364366    LOGICAL ::  data_output_xy(0:1) = .FALSE., data_output_xz(0:1) = .FALSE., &
     
    392394             dz_stretch_level = 100000.0, e_init = 0.0, e_min = 0.0, &
    393395             end_time = 0.0, &
    394              f = 0.0, fs = 0.0, g = 9.81, kappa = 0.4, km_constant = -1.0, &
     396             f = 0.0, fs = 0.0, g = 9.81, inflow_damping_height = 9999999.9, &
     397             inflow_damping_width = 9999999.9, kappa = 0.4, km_constant = -1.0,&
    395398             km_damp_max = -1.0, lad_surface = 0.0, long_filter_factor = 0.0, &
    396399             maximum_cpu_time_allowed = 0.0, molecular_viscosity = 1.461E-5, &
     
    405408             q_surface = 0.0, q_surface_initial_change = 0.0, &
    406409             rayleigh_damping_factor = -1.0, rayleigh_damping_height = -1.0, &
    407              residual_limit = 1.0E-4, restart_time = 9999999.9, rho_reference, &
    408              rho_surface, rif_max = 1.0, &
     410             recycling_width = 9999999.9, residual_limit = 1.0E-4, &
     411             restart_time = 9999999.9, rho_reference, rho_surface, &
     412             rif_max = 1.0, &
    409413             rif_min = -5.0, roughness_length = 0.1, sa_surface = 35.0, &
    410414             simulated_time = 0.0, simulated_time_at_begin, sin_alpha_surface, &
     
    961965#endif
    962966    CHARACTER(LEN=5)       ::  myid_char = ''
    963     INTEGER                ::  myid=0, npex = -1, npey = -1, numprocs = 1, &
    964                                numprocs_previous_run = -1,                &
     967    INTEGER                ::  id_inflow, myid=0, npex = -1, npey = -1, &
     968                               numprocs = 1, numprocs_previous_run = -1, &
    965969                               tasks_per_node = -9999, threads_per_task = 1
    966970
  • palm/trunk/SOURCE/parin.f90

    r147 r151  
    44! Actual revisions:
    55! -----------------
     6! +inflow_damping_height, inflow_damping_width, recycling_width,
     7! turbulent_inflow in inipar
    68! Allocation of hom_sum moved from init_3d_model to here,
    79! npex, npey moved from inipar to d3par, setting of myid_char_14 removed,
     
    8587             dz_stretch_level, e_init, e_min, end_time_1d, fft_method, &
    8688             galilei_transformation, grid_matching, humidity, &
     89             inflow_damping_height, inflow_damping_width, &
    8790             inflow_disturbance_begin, inflow_disturbance_end, &
    8891             initializing_actions, km_constant, km_damp_max, lad_surface, &
     
    97100             pt_vertical_gradient_level, q_surface, q_surface_initial_change, &
    98101             q_vertical_gradient, q_vertical_gradient_level, radiation, &
    99              random_generator, random_heatflux, rif_max, rif_min, &
    100              roughness_length, sa_surface, sa_vertical_gradient, &
     102             random_generator, random_heatflux, recycling_width, rif_max, &
     103             rif_min, roughness_length, sa_surface, sa_vertical_gradient, &
    101104             sa_vertical_gradient_level, scalar_advec, statistic_regions, &
    102105             surface_heatflux, surface_pressure, surface_scalarflux, &
     
    104107             s_vertical_gradient, s_vertical_gradient_level, top_heatflux, &
    105108             top_momentumflux_u, top_momentumflux_v, top_salinityflux, &
    106              timestep_scheme, topography, ug_surface, &
     109             timestep_scheme, topography, turbulent_inflow, ug_surface, &
    107110             ug_vertical_gradient, ug_vertical_gradient_level, ups_limit_e, &
    108111             ups_limit_pt, ups_limit_u, ups_limit_v, ups_limit_w, &
  • palm/trunk/SOURCE/pres.f90

    r110 r151  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Bugfix in volume flow control for non-cyclic boundary conditions
    77!
    88! Former revisions:
     
    110110                               / volume_flow_area(1)
    111111
    112        DO  j = nys, nyn
     112       DO  j = nys-1, nyn+1
    113113          DO  k = nzb_v_inner(j,i) + 1, nzt
    114114             u(k,j,i) = u(k,j,i) + volume_flow_offset(1)
    115115          ENDDO
    116116       ENDDO
    117 
    118        CALL exchange_horiz( u )
    119117
    120118    ENDIF
     
    150148                               / volume_flow_area(2)
    151149
    152        DO  i = nxl, nxr
     150       DO  i = nxl-1, nxr+1
    153151          DO  k = nzb_v_inner(j,i) + 1, nzt
    154152             v(k,j,i) = v(k,j,i) + volume_flow_offset(2)
    155153          ENDDO
    156154       ENDDO
    157 
    158        CALL exchange_horiz( v )
    159155
    160156    ENDIF
  • palm/trunk/SOURCE/read_var_list.f90

    r147 r151  
    44! Actual revisions:
    55! -----------------
    6 ! +numprocs_previous_run, hor_index_bounds_previous_run,
     6! +numprocs_previous_run, hor_index_bounds_previous_run, inflow_damping_factor,
     7! inflow_damping_height, inflow_damping_width, mean_inflow_profiles,
     8! recycling_width, turbulent_inflow,
    79! -cross_ts_*, npex, npey,
    810! hom_sum, volume_flow_area, volume_flow_initial moved from
     
    279281          CASE ( 'hom_sum' )
    280282             READ ( 13 )  hom_sum
     283          CASE ( 'humidity' )
     284             READ ( 13 )  humidity
     285          CASE ( 'inflow_damping_factor' )
     286             IF ( .NOT. ALLOCATED( inflow_damping_factor ) )  THEN
     287                ALLOCATE( inflow_damping_factor(0:nz+1) )
     288             ENDIF
     289             READ ( 13 )  inflow_damping_factor
     290          CASE ( 'inflow_damping_height' )
     291             READ ( 13 )  inflow_damping_height
     292          CASE ( 'inflow_damping_width' )
     293             READ ( 13 )  inflow_damping_width
    281294          CASE ( 'inflow_disturbance_begin' )
    282295             READ ( 13 )  inflow_disturbance_begin
     
    303316          CASE ( 'loop_optimization' )
    304317             READ ( 13 )  loop_optimization
     318          CASE ( 'mean_inflow_profiles' )
     319             IF ( .NOT. ALLOCATED( mean_inflow_profiles ) )  THEN
     320                ALLOCATE( mean_inflow_profiles(0:nz+1,5) )
     321             ENDIF
     322             READ ( 13 )  mean_inflow_profiles
    305323          CASE ( 'mixing_length_1d' )
    306324             READ ( 13 )  mixing_length_1d
    307           CASE ( 'humidity' )
    308              READ ( 13 )  humidity
    309325          CASE ( 'momentum_advec' )
    310326             READ ( 13 )  momentum_advec
     
    381397          CASE ( 'random_heatflux' )
    382398             READ ( 13 )  random_heatflux
     399          CASE ( 'recycling_width' )
     400             READ ( 13 )  recycling_width
    383401          CASE ( 'rif_max' )
    384402             READ ( 13 )  rif_max
     
    467485          CASE ( 'tsc' )
    468486             READ ( 13 )  tsc
     487          CASE ( 'turbulent_inflow' )
     488             READ ( 13 )  turbulent_inflow
    469489          CASE ( 'u_init' )
    470490             READ ( 13 )  u_init
     
    552572! Skipping the global control variables from restart-file (binary format)
    553573! except some informations needed when reading restart data from a previous
    554 ! run which used a smaller total domain.
     574! run which used a smaller total domain or/and a different domain decomposition.
    555575!------------------------------------------------------------------------------!
    556576
     577    USE arrays_3d
    557578    USE control_parameters
    558579    USE indices
     
    568589                statistic_regions_on_file
    569590
     591    REAL, DIMENSION(:,:,:),   ALLOCATABLE ::  hom_sum_on_file
    570592    REAL, DIMENSION(:,:,:,:), ALLOCATABLE ::  hom_on_file
    571593
     
    672694       SELECT CASE ( TRIM( variable_chr ) )
    673695
     696          CASE ( 'average_count_pr' )
     697             READ ( 13 )  average_count_pr
     698             IF ( average_count_pr /= 0  .AND.  myid == 0 )  THEN
     699                PRINT*, '+++ read_parts_of_var_list:'
     700                PRINT*, '    WARNING: inflow profiles not temporally averaged.'
     701                PRINT*, '    Averaging will be done now using ', &
     702                        average_count_pr, ' samples.'
     703             ENDIF
     704
    674705          CASE ( 'hom' )
    675706             ALLOCATE( hom_on_file(0:nz+1,2,pr_palm+max_pr_user_on_file, &
     
    678709             hom = hom_on_file(:,:,1:pr_palm+max_pr_user,0:statistic_regions)
    679710             DEALLOCATE( hom_on_file )
     711
     712          CASE ( 'hom_sum' )
     713             ALLOCATE( hom_sum_on_file(0:nz+1,pr_palm+max_pr_user_on_file, &
     714                       0:statistic_regions_on_file) )
     715             READ ( 13 )  hom_sum_on_file
     716             hom_sum = hom_sum_on_file(:,1:pr_palm+max_pr_user, &
     717                                       0:statistic_regions)
     718             DEALLOCATE( hom_sum_on_file )
    680719
    681720          CASE ( 'nx' )
     
    710749    ENDDO
    711750
     751!
     752!-- Calculate the temporal average of vertical profiles, if neccessary
     753    IF ( average_count_pr /= 0 )  THEN
     754       hom_sum = hom_sum / REAL( average_count_pr )
     755    ENDIF
     756
    712757
    713758 END SUBROUTINE read_parts_of_var_list
  • palm/trunk/SOURCE/time_integration.f90

    r110 r151  
    44! Actual revisions:
    55! -----------------
    6 !
     6! inflow turbulence is imposed by calling new routine inflow_turbulence
    77!
    88! Former revisions:
     
    214214
    215215!
     216!--       Impose a turbulent inflow using the recycling method
     217          IF ( turbulent_inflow )  CALL  inflow_turbulence
     218
     219!
    216220!--       Impose a random perturbation on the horizontal velocity field
    217221          IF ( create_disturbances  .AND.                                      &
  • palm/trunk/SOURCE/write_var_list.f90

    r145 r151  
    44! Actual revisions:
    55! -----------------
    6 ! +numprocs, hor_index_bounds, -cross_ts_*, npex, npey
     6! +numprocs, hor_index_bounds, inflow_damping_height, inflow_damping_width,
     7! mean_inflow_profiles, recycling_width, turbulent_inflow,
     8! -cross_ts_*, npex, npey
    79! hom_sum, volume_flow_area, volume_flow_initial moved from write_3d_binary
    810! to here
     
    199201    WRITE ( 14 )  'hom_sum                       '
    200202    WRITE ( 14 )  hom_sum
     203    WRITE ( 14 )  'humidity                      '
     204    WRITE ( 14 )  humidity
     205    IF ( ALLOCATED( inflow_damping_factor ) )  THEN
     206       WRITE ( 14 )  'inflow_damping_factor         '
     207       WRITE ( 14 )  inflow_damping_factor
     208    ENDIF
     209    WRITE ( 14 )  'inflow_damping_height         '
     210    WRITE ( 14 )  inflow_damping_height
     211    WRITE ( 14 )  'inflow_damping_width          '
     212    WRITE ( 14 )  inflow_damping_width
    201213    WRITE ( 14 )  'inflow_disturbance_begin      '
    202214    WRITE ( 14 )  inflow_disturbance_begin
     
    223235    WRITE ( 14 )  'loop_optimization             '
    224236    WRITE ( 14 )  loop_optimization
     237    IF ( ALLOCATED( mean_inflow_profiles ) )  THEN
     238       WRITE ( 14 )  'mean_inflow_profiles          '
     239       WRITE ( 14 )  mean_inflow_profiles
     240    ENDIF
    225241    WRITE ( 14 )  'mixing_length_1d              '
    226242    WRITE ( 14 )  mixing_length_1d
    227     WRITE ( 14 )  'humidity                      '
    228     WRITE ( 14 )  humidity
    229243    WRITE ( 14 )  'momentum_advec                '
    230244    WRITE ( 14 )  momentum_advec
     
    299313    WRITE ( 14 )  'random_heatflux               '
    300314    WRITE ( 14 )  random_heatflux
     315    WRITE ( 14 )  'recycling_width               '
     316    WRITE ( 14 )  recycling_width
    301317    WRITE ( 14 )  'rif_max                       '
    302318    WRITE ( 14 )  rif_max
     
    385401    WRITE ( 14 )  'tsc                           '
    386402    WRITE ( 14 )  tsc
     403    WRITE ( 14 )  'turbulent_inflow              '
     404    WRITE ( 14 )  turbulent_inflow
    387405    WRITE ( 14 )  'u_init                        '
    388406    WRITE ( 14 )  u_init
Note: See TracChangeset for help on using the changeset viewer.