Changeset 145 for palm/trunk


Ignore:
Timestamp:
Jan 9, 2008 8:17:38 AM (16 years ago)
Author:
raasch
Message:

second preliminary update for turbulent inflow

Location:
palm/trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mrun

    r129 r145  
    207207 read_from_config=""
    208208 restart_run=false
    209  return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
     209# return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
    210210 if [[ $return_addres = 130.75.105.158 ]]
    211211 then
  • palm/trunk/SOURCE/CURRENT_MODIFICATIONS

    r144 r145  
    1717User-defined spectra.
    1818
    19 calc_spectra, check_open, data_output_spectra, netcdf, read_var_list, read_3d_binary, user_interface, write_3d_binary
     19calc_spectra, check_open, data_output_spectra, init_pegrid, modules, netcdf, read_var_list, read_3d_binary, user_interface, write_var_list, write_3d_binary
    2020
    2121
  • palm/trunk/SOURCE/init_grid.f90

    r139 r145  
    428428!
    429429!-- Test output of nzb_local -1:ny+1,-1:nx+1
    430     WRITE (9,*)  '*** nzb_local ***'
    431     DO  j = ny+1, -1, -1
    432        WRITE (9,'(194(1X,I2))')  ( nzb_local(j,i), i = -1, nx+1 )
    433     ENDDO
     430!    WRITE (9,*)  '*** nzb_local ***'
     431!    DO  j = ny+1, -1, -1
     432!       WRITE (9,'(194(1X,I2))')  ( nzb_local(j,i), i = -1, nx+1 )
     433!    ENDDO
    434434
    435435!
     
    865865!
    866866!--       Test output of flag arrays
    867           i = nxl_l
    868           WRITE (9,*)  ' '
    869           WRITE (9,*)  '*** mg level ', l, ' ***', mg_switch_to_pe0_level
    870           WRITE (9,*)  '    inc=', inc, '  i =', nxl_l
    871           WRITE (9,*)  '    nxl_l',nxl_l,' nxr_l=',nxr_l,' nys_l=',nys_l,' nyn_l=',nyn_l
    872           DO  k = nzt_l+1, nzb, -1
    873              WRITE (9,'(194(1X,I2))')  ( flags(k,j,i), j = nys_l-1, nyn_l+1 )
    874           ENDDO
     867!          i = nxl_l
     868!          WRITE (9,*)  ' '
     869!          WRITE (9,*)  '*** mg level ', l, ' ***', mg_switch_to_pe0_level
     870!          WRITE (9,*)  '    inc=', inc, '  i =', nxl_l
     871!          WRITE (9,*)  '    nxl_l',nxl_l,' nxr_l=',nxr_l,' nys_l=',nys_l,' nyn_l=',nyn_l
     872!          DO  k = nzt_l+1, nzb, -1
     873!             WRITE (9,'(194(1X,I2))')  ( flags(k,j,i), j = nys_l-1, nyn_l+1 )
     874!          ENDDO
    875875
    876876          inc = inc * 2
  • palm/trunk/SOURCE/init_pegrid.f90

    r139 r145  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Collect on PE0 horizontal index bounds from all other PEs
    77! TEST OUTPUT (TO BE REMOVED) logging mpi2 ierr values
    88!
     
    458458    DEALLOCATE( nxlf , nxrf , nynf , nysf )
    459459
     460!
     461!-- Collect index bounds from other PEs (to be written to restart file later)
     462    ALLOCATE( hor_index_bounds(4,0:numprocs-1) )
     463
     464    IF ( myid == 0 )  THEN
     465
     466       hor_index_bounds(1,0) = nxl
     467       hor_index_bounds(2,0) = nxr
     468       hor_index_bounds(3,0) = nys
     469       hor_index_bounds(4,0) = nyn
     470
     471!
     472!--    Receive data from all other PEs
     473       DO  i = 1, numprocs-1
     474          CALL MPI_RECV( ibuf, 4, MPI_INTEGER, i, MPI_ANY_TAG, comm2d, status, &
     475                         ierr )
     476          hor_index_bounds(:,i) = ibuf(1:4)
     477       ENDDO
     478
     479    ELSE
     480!
     481!--    Send index bounds to PE0
     482       ibuf(1) = nxl
     483       ibuf(2) = nxr
     484       ibuf(3) = nys
     485       ibuf(4) = nyn
     486       CALL MPI_SEND( ibuf, 4, MPI_INTEGER, 0, myid, comm2d, ierr )
     487
     488    ENDIF
     489
    460490#if defined( __print )
    461491!
     
    606636    nzta = nz
    607637    nnz  = nz
     638
     639    ALLOCATE( hor_index_bounds(4,0:0) )
     640    hor_index_bounds(1,0) = nxl
     641    hor_index_bounds(2,0) = nxr
     642    hor_index_bounds(3,0) = nys
     643    hor_index_bounds(4,0) = nyn
    608644
    609645!
  • palm/trunk/SOURCE/modules.f90

    r139 r145  
    55! Actual revisions:
    66! -----------------
    7 !
     7! +hor_index_bounds, hor_index_bounds_previous_run, numprocs_previous_run
    88!
    99! Former revisions:
     
    959959    CHARACTER(LEN=5)       ::  myid_char = '', myid_char_14 = ''
    960960    INTEGER                ::  myid=0, npex = -1, npey = -1, numprocs = 1, &
     961                               numprocs_previous_run = -1,                 &
    961962                               tasks_per_node = -9999, threads_per_task = 1
     963
     964    INTEGER, DIMENSION(:,:), ALLOCATABLE ::  hor_index_bounds, &
     965                                             hor_index_bounds_previous_run
    962966
    963967#if defined( __parallel )
  • palm/trunk/SOURCE/parin.f90

    r143 r145  
    246246                 u_init(0:nz+1), v_init(0:nz+1),                            &
    247247                 hom(0:nz+1,2,pr_palm+max_pr_user,0:statistic_regions),     &
    248                  hom_sum(nzb:nzt+1,pr_palm+max_pr_user,0:statistic_regions) )
     248                 hom_sum(0:nz+1,pr_palm+max_pr_user,0:statistic_regions) )
    249249       hom = 0.0
    250250
  • palm/trunk/SOURCE/read_3d_binary.f90

    r143 r145  
    55! -----------------
    66! Restart file has to be re-opened on all PEs except PE0
     7! +call of user_read_restart_data,
    78! -dopr_time_count,
    8 ! hom_sum moved, volume_flow_area, volume_flow_initial moved to read_var_list,
     9! hom_sum, volume_flow_area, volume_flow_initial moved to read_var_list,
    910! reading of old profil parameters (cross_..., dopr_crossindex, profile_***)
    1011! removed
     
    7374!-- First compare the version numbers
    7475    READ ( 13 )  version_on_file
    75     binary_version = '3.0'
     76    binary_version = '3.1'
    7677    IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
    7778       IF ( myid == 0 )  THEN
     
    405406
    406407!
     408!-- Read user-defined restart data
     409    CALL user_read_restart_data
     410
     411!
    407412!-- End of time measuring for reading binary data
    408413    CALL cpu_log( log_point_s(14), 'read_3d_binary', 'stop' )
  • palm/trunk/SOURCE/read_var_list.f90

    r143 r145  
    55! -----------------
    66! After reading the global variables, unit 13 is closed for all PEs except PE0
    7 ! -cross_ts_*,
    8 ! hom_sum moved, volume_flow_area, volume_flow_initial moved from
     7! +numprocs_previous_run, hor_index_bounds_previous_run,
     8! -cross_ts_*, npex, npey,
     9! hom_sum, volume_flow_area, volume_flow_initial moved from
    910! read_3d_binary to here
    1011!
     
    7273!-- Make version number check first
    7374    READ ( 13 )  version_on_file
    74     binary_version = '3.1'
     75    binary_version = '3.2'
    7576    IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
    7677       IF ( myid == 0 )  THEN
     
    8485       CALL local_stop
    8586    ENDIF
     87
     88!
     89!-- Read number of PEs and horizontal index bounds of all PEs used in previous
     90!-- run
     91    READ ( 13 )  variable_chr
     92    IF ( TRIM( variable_chr ) /= 'numprocs' )  THEN
     93       PRINT*, '+++ read_var_list: numprocs not found in data from prior run', &
     94                    ' on PE ', myid
     95       CALL local_stop
     96    ENDIF
     97    READ ( 13 )  numprocs_previous_run
     98
     99    ALLOCATE( hor_index_bounds_previous_run(4,0:numprocs_previous_run-1) )
     100
     101    READ ( 13 )  variable_chr
     102    IF ( TRIM( variable_chr ) /= 'hor_index_bounds' )  THEN
     103       PRINT*, '+++ read_var_list: hor_index_bounds not found in data from ', &
     104                    'prior run on PE ', myid
     105       CALL local_stop
     106    ENDIF
     107    READ ( 13 )  hor_index_bounds_previous_run
    86108
    87109!
     
    124146    READ ( 13 )  statistic_regions
    125147    ALLOCATE( ug(0:nz+1), u_init(0:nz+1), vg(0:nz+1), v_init(0:nz+1), &
    126               pt_init(0:nz+1), q_init(0:nz+1), sa_init(0:nz+1), &
    127               hom(0:nz+1,2,pr_palm+max_pr_user,0:statistic_regions) )
     148              pt_init(0:nz+1), q_init(0:nz+1), sa_init(0:nz+1),       &
     149              hom(0:nz+1,2,pr_palm+max_pr_user,0:statistic_regions),  &
     150              hom_sum(0:nz+1,pr_palm+max_pr_user,0:statistic_regions) )
    128151
    129152!
     
    283306          CASE ( 'netcdf_precision' )
    284307             READ ( 13 )  netcdf_precision
    285           CASE ( 'npex' )
    286              READ ( 13 )  npex
    287           CASE ( 'npey' )
    288              READ ( 13 )  npey
    289308          CASE ( 'nsor_ini' )
    290309             READ ( 13 )  nsor_ini
  • palm/trunk/SOURCE/user_interface.f90

    r144 r145  
    44! Actual revisions:
    55! -----------------
    6 ! new subroutine user_spectra
     6! +routines user_read_restart_data, user_spectra
    77!
    88! Former revisions:
     
    177177
    178178
    179  SUBROUTINE user_init
    180 
    181 !------------------------------------------------------------------------------!
    182 !
    183 ! Description:
    184 ! ------------
    185 ! Execution of user-defined initializing actions
     179 SUBROUTINE user_read_restart_data
     180
     181!------------------------------------------------------------------------------!
     182!
     183! Description:
     184! ------------
     185! Reading restart data from file(s)
    186186!------------------------------------------------------------------------------!
    187187
    188188    USE control_parameters
    189189    USE indices
    190     USE netcdf_control
    191190    USE pegrid
    192191    USE user
     
    196195    CHARACTER (LEN=20) :: field_char
    197196!
    198 !-- Here the user-defined initializing actions follow:
     197!-- Here the reading of user-defined restart data follows:
    199198!-- Sample for user-defined output
    200199!    ALLOCATE( u2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
     
    224223!    ENDIF
    225224
    226 !
     225 END SUBROUTINE user_read_restart_data
     226
     227
     228
     229 SUBROUTINE user_init
     230
     231!------------------------------------------------------------------------------!
     232!
     233! Description:
     234! ------------
     235! Execution of user-defined initializing actions
     236!------------------------------------------------------------------------------!
     237
     238    USE control_parameters
     239    USE indices
     240    USE netcdf_control
     241    USE pegrid
     242    USE user
     243
     244    IMPLICIT NONE
     245
     246    CHARACTER (LEN=20) :: field_char
     247!
     248!-- Here the user-defined initializing actions follow:
    227249!-- Sample for user-defined time series
    228250!-- For each time series quantity you have to give a label and a unit,
  • palm/trunk/SOURCE/write_3d_binary.f90

    r143 r145  
    6969!
    7070!-- Write arrays.
    71     binary_version = '3.0'
     71    binary_version = '3.1'
    7272
    7373    WRITE ( 14 )  binary_version
  • palm/trunk/SOURCE/write_var_list.f90

    r143 r145  
    44! Actual revisions:
    55! -----------------
    6 ! -cross_ts_*,
     6! +numprocs, hor_index_bounds, -cross_ts_*, npex, npey
    77! hom_sum, volume_flow_area, volume_flow_initial moved from write_3d_binary
    88! to here
     
    4444! Description:
    4545! ------------
    46 ! Writing values of control variables to restart-file (binary format)
     46! Writing values of control variables to restart-file (binary format).
     47! These informations are only written to the file opened by PE0.
    4748!------------------------------------------------------------------------------!
    4849
     
    6364
    6465
    65 
    66     binary_version = '3.1'
    67 
    68     WRITE ( 14 )  binary_version    ! opened in write_3d_binary
    69 
     66    binary_version = '3.2'
     67
     68    WRITE ( 14 )  binary_version
     69
     70    WRITE ( 14 )  'numprocs                      '
     71    WRITE ( 14 )  numprocs
     72    WRITE ( 14 )  'hor_index_bounds              '
     73    WRITE ( 14 )  hor_index_bounds
    7074    WRITE ( 14 )  'nz                            '
    7175    WRITE ( 14 )  nz
     
    227231    WRITE ( 14 )  'netcdf_precision              '
    228232    WRITE ( 14 )  netcdf_precision
    229     WRITE ( 14 )  'npex                          '
    230     WRITE ( 14 )  npex
    231     WRITE ( 14 )  'npey                          '
    232     WRITE ( 14 )  npey
    233233    WRITE ( 14 )  'nsor_ini                      '
    234234    WRITE ( 14 )  nsor_ini
Note: See TracChangeset for help on using the changeset viewer.