Changeset 807 for palm/trunk/SOURCE


Ignore:
Timestamp:
Jan 25, 2012 11:53:51 AM (13 years ago)
Author:
maronga
Message:

new utility check_namelist_files implemented

Location:
palm/trunk/SOURCE
Files:
2 added
10 edited

Legend:

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

    r766 r807  
    44! Current revisions:
    55! -----------------
    6 !
     6! New cpp directive "__check" implemented which is used by check_namelist_files
     7!
    78!
    89! Former revisions:
     
    116117    IF ( openfile(file_id)%opened )  RETURN
    117118
     119#if .NOT. defined ( __check )
    118120!
    119121!-- Only certain files are allowed to be re-opened
     
    138140       END SELECT
    139141    ENDIF
     142#endif
    140143
    141144!
     
    189192       CASE ( 11 )
    190193
     194#if defined ( __check )
     195!
     196!--       In case of a prior parameter file check, the p3d data is stored in
     197!--       PARIN, while the p3df is stored in PARINF. This only applies to
     198!--       check_namelist_files!
     199          IF ( check_restart == 2 ) THEN
     200             OPEN ( 11, FILE='PARINF'//coupling_char, FORM='FORMATTED', &
     201                        STATUS='OLD' )
     202          ELSE
     203             OPEN ( 11, FILE='PARIN'//coupling_char, FORM='FORMATTED', &
     204                        STATUS='OLD' )
     205          END IF
     206#else
     207
    191208          OPEN ( 11, FILE='PARIN'//coupling_char, FORM='FORMATTED', &
    192209                     STATUS='OLD' )
     210#endif
    193211
    194212       CASE ( 13 )
     
    219237                CALL local_system( 'mkdir  BINOUT' // coupling_char )
    220238             ENDIF
    221 #if defined( __parallel )
     239#if defined( __parallel ) .AND. .NOT. defined ( __check )
    222240!
    223241!--          Set a barrier in order to allow that all other processors in the
     
    258276                        FORM='UNFORMATTED', POSITION='APPEND' )
    259277          ELSE
    260 #if defined( __parallel )
     278#if defined( __parallel ) .AND. .NOT. defined ( __check )
    261279!
    262280!--          Set a barrier in order to allow that all other processors in the
     
    639657                CALL local_system( 'mkdir  PARTICLE_INFOS' // coupling_char )
    640658             ENDIF
    641 #if defined( __parallel )
     659#if defined( __parallel ) .AND. .NOT. defined ( __check )
    642660!
    643661!--          Set a barrier in order to allow that thereafter all other
     
    688706                CALL local_system( 'mkdir  PARTICLE_DATA' // coupling_char )
    689707             ENDIF
    690 #if defined( __parallel )
     708#if defined( __parallel ) .AND. .NOT. defined ( __check )
    691709!
    692710!--          Set a barrier in order to allow that thereafter all other
     
    12911309                                       TRIM( coupling_char ) // '/' )
    12921310                ENDIF
    1293 #if defined( __parallel )
    1294 !
     1311#if defined( __parallel ) .AND. .NOT. defined ( __check )
     1312! 
    12951313!--             Set a barrier in order to allow that all other processors in the
    12961314!--             directory created by PE0 can open their file
  • palm/trunk/SOURCE/check_parameters.f90

    r775 r807  
    44! Current revisions:
    55! -----------------
    6 !
     6! New cpp directive "__check" implemented which is used by check_namelist_files
    77!
    88! Former revisions:
     
    217217
    218218#if defined( __parallel )
     219
     220#if defined( __check )
     221
     222!
     223!--    NOTE: coupled runs have not been implemented in the check_namelist_files
     224!--    program.
     225!--    check_namelist_files will need the following information of the other
     226!--    model (atmosphere/ocean).
     227       dt_coupling = remote
     228       dt_max = remote
     229       restart_time = remote
     230       dt_restart= remote
     231       simulation_time_since_reference = remote
     232       dx = remote
     233
     234#endif
     235
     236#if .NOT. defined( __check )
    219237       IF ( myid == 0 ) THEN
    220238          CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, &
     
    224242       ENDIF
    225243       CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr)
    226       
     244#endif     
    227245       IF ( dt_coupling /= remote )  THEN
    228246          WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &
     
    232250       ENDIF
    233251       IF ( dt_coupling <= 0.0 )  THEN
     252#if .NOT. defined( __check )
    234253          IF ( myid == 0  ) THEN
    235254             CALL MPI_SEND( dt_max, 1, MPI_REAL, target_id, 19, comm_inter, ierr )
     
    238257          ENDIF   
    239258          CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr)
    240          
     259#endif         
    241260          dt_coupling = MAX( dt_max, remote )
    242261          WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &
     
    245264          CALL message( 'check_parameters', 'PA0005', 0, 1, 0, 6, 0 )
    246265       ENDIF
     266#if .NOT. defined( __check )
    247267       IF ( myid == 0 ) THEN
    248268          CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, &
     
    252272       ENDIF
    253273       CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr)
    254      
     274#endif     
    255275       IF ( restart_time /= remote )  THEN
    256276          WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &
     
    259279          CALL message( 'check_parameters', 'PA0006', 1, 2, 0, 6, 0 )
    260280       ENDIF
     281#if .NOT. defined( __check )
    261282       IF ( myid == 0 ) THEN
    262283          CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, &
     
    266287       ENDIF   
    267288       CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr)
    268      
     289#endif     
    269290       IF ( dt_restart /= remote )  THEN
    270291          WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &
     
    275296
    276297       simulation_time_since_reference = end_time - coupling_start_time
     298#if .NOT. defined( __check )
    277299       IF  ( myid == 0 ) THEN
    278300          CALL MPI_SEND( simulation_time_since_reference, 1, MPI_REAL, target_id, &
     
    282304       ENDIF
    283305       CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr)
    284      
     306#endif     
    285307       IF ( simulation_time_since_reference /= remote )  THEN
    286308          WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &
     
    291313       ENDIF
    292314
    293  
     315#if .NOT. defined( __check )
    294316       IF ( myid == 0 ) THEN
    295317          CALL MPI_SEND( dx, 1, MPI_REAL, target_id, 15, comm_inter, ierr )
     
    299321       CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr)
    300322
    301 
     323#endif
    302324       IF ( coupling_mode == 'atmosphere_to_ocean') THEN
    303325
     
    318340       ENDIF
    319341
     342#if .NOT. defined( __check )
    320343       IF ( myid == 0) THEN
    321344          CALL MPI_SEND( dy, 1, MPI_REAL, target_id, 16, comm_inter, ierr )
     
    324347       ENDIF
    325348       CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr)
    326 
     349#endif
    327350       IF ( coupling_mode == 'atmosphere_to_ocean') THEN
    328351
     
    365388    ENDIF
    366389
    367 #if defined( __parallel )
     390#if defined( __parallel ) .AND. .NOT. defined ( __check )
    368391!
    369392!-- Exchange via intercommunicator
     
    29332956!
    29342957
     2958#if .NOT. defined( __check )
    29352959!-- Check netcdf precison
    29362960    ldum = .FALSE.
    29372961    CALL define_netcdf_header( 'ch', ldum, 0 )
    2938 
     2962#endif
    29392963!
    29402964!-- Check, whether a constant diffusion coefficient shall be used
  • palm/trunk/SOURCE/init_grid.f90

    r760 r807  
    44! Current revisions:
    55! -----------------
    6 !
     6! New cpp directive "__check" implemented which is used by check_namelist_files
    77!
    88! Former revisions:
     
    534534
    535535             ENDIF
    536 #if defined( __parallel )
     536#if defined( __parallel ) .AND. .NOT. defined ( __check )
    537537             CALL MPI_BARRIER( comm2d, ierr )
    538538#endif
     
    739739          ENDIF
    740740       ENDDO
    741 
     741#if .NOT. defined ( __check )
    742742!
    743743!--    Exchange of lateral boundary values (parallel computers) and cyclic
     
    766766         
    767767       ENDIF
    768 
     768#endif
    769769    ENDIF
    770770
     771#if .NOT. defined ( __check )
    771772!
    772773!-- Preliminary: to be removed after completion of the topography code!
     
    11601161                nzb_tmp, vertical_influence, wall_l, wall_n, wall_r, wall_s )
    11611162
     1163#endif
    11621164
    11631165 END SUBROUTINE init_grid
  • palm/trunk/SOURCE/init_masks.f90

    r773 r807  
    44! Current revisions:
    55! -----------------
     6! New cpp directive "__check" implemented which is used by check_namelist_files
    67!
    78! Former revisions:
     
    346347!--    Set global masks along all three dimensions (required by
    347348!--    define_netcdf_header).
    348 #if defined( __parallel )
     349#if defined( __parallel ) .AND. .NOT. defined ( __check )
    349350!
    350351!--    PE0 receives partial arrays from all processors of the respective mask
    351352!--    and outputs them. Here a barrier has to be set, because otherwise
    352353!--    "-MPI- FATAL: Remote protocol queue full" may occur.
     354
    353355       CALL MPI_BARRIER( comm2d, ierr )
    354356
     
    438440       ENDIF
    439441
    440 #else
     442#elif .NOT. defined ( __parallel )
    441443!
    442444!--    Local arrays can be relocated directly.
  • palm/trunk/SOURCE/init_pegrid.f90

    r781 r807  
    44! Current revisions:
    55! -----------------
    6 !
     6! New cpp directive "__check" implemented which is used by check_namelist_files
    77!
    88! ATTENTION: nnz_x undefined problem still has to be solved!!!!!!!!
     
    215215    IF ( bc_ns /= 'cyclic' )  cyclic(2) = .FALSE.
    216216
     217
     218#if .NOT. defined( __check)
    217219!
    218220!-- Create the virtual processor grid
     
    240242    CALL MPI_COMM_RANK( comm1dy, myidy, ierr )
    241243
     244#endif
    242245
    243246!
     
    525528    DEALLOCATE( nxlf , nxrf , nynf , nysf )
    526529
     530
     531#if .NOT. defined( __check)
    527532!
    528533!-- Collect index bounds from other PEs (to be written to restart file later)
     
    554559
    555560    ENDIF
     561
     562#endif
    556563
    557564#if defined( __print )
     
    589596#endif
    590597
    591 #if defined( __parallel )
     598#if defined( __parallel ) .AND. .NOT. defined( __check)
    592599#if defined( __mpi2 )
    593600!
     
    933940
    934941          IF ( i == mg_switch_to_pe0_level )  THEN
    935 #if defined( __parallel )
     942#if defined( __parallel ) .AND. .NOT. defined( __check )
    936943!
    937944!--          Save the grid size of the subdomain at the switch level, because
     
    966973                              ( nzt_l - nzb + 2 )
    967974
    968 #else
     975#elif .NOT. defined ( __parallel )
    969976             message_string = 'multigrid gather/scatter impossible ' // &
    970977                          'in non parallel mode'
     
    10081015    grid_level = 0
    10091016
    1010 #if defined( __parallel )
     1017#if defined( __parallel ) .AND. .NOT. defined ( __check )
    10111018!
    10121019!-- Gridpoint number for the exchange of ghost points (y-line for 2D-arrays)
     
    10911098#endif
    10921099
    1093 #if defined( __parallel )
     1100#if defined( __parallel ) .AND. .NOT. defined ( __check )
    10941101!
    10951102!-- Setting of flags for inflow/outflow conditions in case of non-cyclic
     
    11511158                        comm1dx, ierr )
    11521159
    1153 #else
     1160#elif .NOT. defined ( __parallel )
    11541161    IF ( bc_lr == 'dirichlet/radiation' )  THEN
    11551162       inflow_l  = .TRUE.
     
    11681175    ENDIF
    11691176#endif
     1177
    11701178!
    11711179!-- At the outflow, u or v, respectively, have to be calculated for one more
  • palm/trunk/SOURCE/local_stop.f90

    r668 r807  
    44! Current revisions:
    55! -----------------
     6! New cpp directive "__check" implemented which is used by check_namelist_files
    67!
    78! Former revisions:
     
    4142
    4243
    43 #if defined( __parallel )
     44#if defined( __parallel ) .AND. .NOT. defined ( __check )
    4445    IF ( coupling_mode == 'uncoupled' )  THEN
    4546       IF ( abort_mode == 1 )  THEN
  • palm/trunk/SOURCE/modules.f90

    r806 r807  
    55! Current revisions:
    66! -----------------
    7 !
     7! New cpp directive "__check" implemented which is used by check_namelist_files.
     8! New parameter check_restart has been defined which is needed by
     9! check_namelist_files only.
    810!
    911! Former revisions:
     
    351353          w_av
    352354 END MODULE averaging
    353 
    354355
    355356
     
    520521                vg_vertical_gradient_level_ind(10) = -9999, &
    521522                subs_vertical_gradient_level_i(10) = -9999
     523
     524#if defined ( __check )
     525    INTEGER :: check_restart = 0
     526#endif
    522527
    523528    INTEGER, DIMENSION(:), ALLOCATABLE ::  grid_level_count
     
    12551260!------------------------------------------------------------------------------!
    12561261
    1257 #if defined( __parallel )
     1262#if defined( __parallel ) .AND. .NOT. defined ( __check )
    12581263#if defined( __lc )
    12591264    USE MPI
     
    12851290                type_x, type_x_int, type_xy, type_y, type_y_int
    12861291
    1287     INTEGER ::  ibuf(12), pcoord(2), pdims(2), status(MPI_STATUS_SIZE)
     1292    INTEGER ::  ibuf(12), pcoord(2), pdims(2)
     1293
     1294#if .NOT. defined ( __check )
     1295    INTEGER ::  status(MPI_STATUS_SIZE)
     1296#endif
     1297
    12881298
    12891299    INTEGER, DIMENSION(:), ALLOCATABLE ::  ngp_yz, type_xz, type_yz
  • palm/trunk/SOURCE/parin.f90

    r786 r807  
    44! Current revisions:
    55! -----------------
    6 !
     6! New cpp directive "__check" implemented which is used by check_namelist_files
    77!
    88! Former revisions:
     
    255255!--       machines one can not distinguish between errors produced by a wrong
    256256!--       "inipar" namelist or because this namelist is totally missing.
    257           READ ( 11, inipar, ERR=10, END=11 )
    258           GOTO 12
     257           READ ( 11, inipar, ERR=10, END=11 )
     258
     259#if defined ( __check )
     260!
     261!--       In case of a namelist file check, &inipar from the p3d file is
     262!--       used. The p3d file here must be closed and the p3df file for reading
     263!--       3dpar is opened.
     264          IF ( check_restart == 1 ) THEN
     265             CALL close_file( 11 )
     266             check_restart = 2
     267             CALL check_open( 11 )             
     268             initializing_actions = 'read_restart_data'
     269          END IF
     270#endif
     271           GOTO 12
     272
    259273 10       message_string = 'errors in \$inipar &or no \$inipar-namelist ' // &
    260274                           'found (CRAY-machines only)'
     
    268282!--       a prior run). All PEs are reading from file created by PE0 (see
    269283!--       check_open)
     284
     285
    270286 12       IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
    271 
     287#if .NOT. defined ( __check )
    272288             CALL read_var_list
    273289!
     
    278294!--          Increment the run count
    279295             runnr = runnr + 1
    280 
     296#endif
    281297          ENDIF
    282298
     
    342358
    343359       ENDIF
    344 #if defined( __parallel )
     360#if defined( __parallel ) .AND. .NOT. ( __check )
    345361       CALL MPI_BARRIER( MPI_COMM_WORLD, ierr )
    346362#endif
  • palm/trunk/SOURCE/poisfft.f90

    r764 r807  
    44! Current revisions:
    55! -----------------
    6 !
     6! New cpp directive "__check" implemented which is used by check_namelist_files
     7! (most of the code is unneeded by check_namelist_files).
     8!
    79!
    810! Former revisions:
     
    106108
    107109    PRIVATE
     110
     111#if .NOT. defined ( __check )
    108112    PUBLIC  poisfft, poisfft_init
    109113
     
    115119       MODULE PROCEDURE poisfft_init
    116120    END INTERFACE poisfft_init
     121#else
     122    PUBLIC  poisfft_init
     123
     124    INTERFACE poisfft_init
     125       MODULE PROCEDURE poisfft_init
     126    END INTERFACE poisfft_init
     127#endif
    117128
    118129 CONTAINS
     
    124135    END SUBROUTINE poisfft_init
    125136
    126 
     137#if .NOT. defined ( __check )
    127138    SUBROUTINE poisfft( ar, work )
    128139
     
    15811592
    15821593#endif
    1583 
     1594#endif
    15841595 END MODULE poisfft_mod
  • palm/trunk/SOURCE/poisfft_hybrid.f90

    r668 r807  
    44! Current revisions:
    55! -----------------
     6! New cpp directive "__check" implemented which is used by check_namelist_files
     7! (most of the code is unneeded by check_namelist_files).
    68!
    79! Former revisions:
     
    1315!
    1416! 415 2009-12-15 10:26:23Z raasch
    15 ! Dimension of array stat in cascade change to prevent type problems with
     17! Dimension of array stat in cascade change to prevent type problems with___
    1618! mpi2 libraries
    1719!
     
    6062    IMPLICIT NONE
    6163
    62     PRIVATE
    63     PUBLIC poisfft_hybrid, poisfft_hybrid_ini
    64 
    6564    INTEGER, PARAMETER ::  switch_per_lpar = 2
    6665
     
    8483                     nodes,               & ! number of nodes
    8584                     tasks_per_logical_node = -1    ! default no cluster
    86                      
     85
     86
     87    PRIVATE
     88
     89
     90#if .NOT. defined ( __check )
     91    PUBLIC poisfft_hybrid, poisfft_hybrid_ini
     92
    8793
    8894!
     
    117123       MODULE PROCEDURE cascade
    118124    END INTERFACE cascade
     125#else
     126    PUBLIC poisfft_hybrid_ini
     127
     128!
     129!-- Public interfaces
     130    INTERFACE poisfft_hybrid_ini
     131       MODULE PROCEDURE poisfft_hybrid_ini
     132    END INTERFACE poisfft_hybrid_ini
     133#endif
    119134
    120135 CONTAINS
    121136 
    122  
     137
    123138    SUBROUTINE poisfft_hybrid_ini
    124139
     
    153168       nwords = ( nxr_p-nxl_p+1 ) * nz * ( nyn_p-nys_p+1 )
    154169
    155 #if defined( __KKMP )
     170#if defined( __KKMP ) .AND. .NOT. defined ( __check )
    156171       CALL LOCAL_GETENV( 'OMP_NUM_THREADS', 15, cdummy, idummy )
    157172       READ ( cdummy, '(I8)' )  n_omp_threads
     
    209224       IF ( tasks_per_logical_node >= 2 )  THEN
    210225
    211 #if defined( __parallel )
     226#if defined( __parallel ) .AND. .NOT. defined ( __check )
    212227          nodes   = ( numprocs + tasks_per_logical_node - 1 ) / &
    213228                    tasks_per_logical_node
     
    231246!          write(0,*) 'who am i',myid,me,me_node,me_task,nodes,&
    232247!                     tasks_per_logical_node
    233 #else
     248#elif .NOT. defined( __parallel )
    234249          message_string = 'parallel environment (MPI) required'
    235250          CALL message( 'poisfft_hybrid_ini', 'PA0282', 1, 2, 0, 6, 0 )
     
    239254    END SUBROUTINE poisfft_hybrid_ini
    240255
    241 
     256#if .NOT. defined ( __check )
    242257    SUBROUTINE poisfft_hybrid( ar )
    243258
     
    10631078
    10641079    END SUBROUTINE cascade
    1065 
     1080#endif
    10661081 END MODULE poisfft_hybrid_mod
Note: See TracChangeset for help on using the changeset viewer.