Ignore:
Timestamp:
Mar 3, 2016 8:01:28 AM (5 years ago)
Author:
raasch
Message:

pmc array management changed from linked list to sequential loop; further small changes and cosmetics for the pmc

File:
1 edited

Legend:

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

    r1765 r1779  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! changes regarding nested domain removed: virtual PE grid will be automatically
     22! calculated for nested runs too
    2223!
    2324! Former revisions:
     
    154155    USE pegrid
    155156 
    156     USE pmc_interface,                                                         &
    157         ONLY:  cpl_npex, cpl_npey, nested_run
    158 
    159157    USE transpose_indices,                                                     &
    160158        ONLY:  nxl_y, nxl_yd, nxl_z, nxr_y, nxr_yd, nxr_z, nyn_x, nyn_z, nys_x,&
     
    217215                           .FALSE. )
    218216
    219     IF ( nested_run )  THEN
    220 !
    221 !--    In case of nested-domain runs, the processor grid is explicitly given
    222 !--    by the user in the nestpar-NAMELIST
    223        pdims(1) = cpl_npex
    224        pdims(2) = cpl_npey
     217!
     218!--    Determine the processor topology or check it, if prescribed by the user
     219    IF ( npex == -1  .AND.  npey == -1 )  THEN
     220
     221!
     222!--       Automatic determination of the topology
     223       numproc_sqr = SQRT( REAL( numprocs, KIND=wp ) )
     224       pdims(1)    = MAX( numproc_sqr , 1 )
     225       DO  WHILE ( MOD( numprocs , pdims(1) ) /= 0 )
     226          pdims(1) = pdims(1) - 1
     227       ENDDO
     228       pdims(2) = numprocs / pdims(1)
     229
     230    ELSEIF ( npex /= -1  .AND.  npey /= -1 )  THEN
     231
     232!
     233!--    Prescribed by user. Number of processors on the prescribed topology
     234!--    must be equal to the number of PEs available to the job
     235       IF ( ( npex * npey ) /= numprocs )  THEN
     236          WRITE( message_string, * ) 'number of PEs of the prescribed ',   &
     237              'topology (', npex*npey,') does not match & the number of ', &
     238              'PEs available to the job (', numprocs, ')'
     239          CALL message( 'init_pegrid', 'PA0221', 1, 2, 0, 6, 0 )
     240       ENDIF
     241       pdims(1) = npex
     242       pdims(2) = npey
    225243
    226244    ELSE
    227245!
    228 !--    Determine the processor topology or check it, if prescribed by the user
    229        IF ( npex == -1  .AND.  npey == -1 )  THEN
    230 
    231 !
    232 !--       Automatic determination of the topology
    233           numproc_sqr = SQRT( REAL( numprocs, KIND=wp ) )
    234           pdims(1)    = MAX( numproc_sqr , 1 )
    235           DO  WHILE ( MOD( numprocs , pdims(1) ) /= 0 )
    236              pdims(1) = pdims(1) - 1
    237           ENDDO
    238           pdims(2) = numprocs / pdims(1)
    239 
    240        ELSEIF ( npex /= -1  .AND.  npey /= -1 )  THEN
    241 
    242 !
    243 !--       Prescribed by user. Number of processors on the prescribed topology
    244 !--       must be equal to the number of PEs available to the job
    245           IF ( ( npex * npey ) /= numprocs )  THEN
    246              WRITE( message_string, * ) 'number of PEs of the prescribed ',   &
    247                  'topology (', npex*npey,') does not match & the number of ', &
    248                  'PEs available to the job (', numprocs, ')'
    249              CALL message( 'init_pegrid', 'PA0221', 1, 2, 0, 6, 0 )
    250           ENDIF
    251           pdims(1) = npex
    252           pdims(2) = npey
    253 
    254        ELSE
    255 !
    256 !--       If the processor topology is prescribed by the user, the number of
    257 !--       PEs must be given in both directions
    258           message_string = 'if the processor topology is prescribed by th' //  &
    259                    'e user& both values of "npex" and "npey" must be given' // &
    260                    ' in the &NAMELIST-parameter file'
    261           CALL message( 'init_pegrid', 'PA0222', 1, 2, 0, 6, 0 )
    262 
    263        ENDIF
    264 
    265     ENDIF
    266 
     246!--    If the processor topology is prescribed by the user, the number of
     247!--    PEs must be given in both directions
     248       message_string = 'if the processor topology is prescribed by th' //  &
     249                'e user& both values of "npex" and "npey" must be given' // &
     250                ' in the &NAMELIST-parameter file'
     251       CALL message( 'init_pegrid', 'PA0222', 1, 2, 0, 6, 0 )
     252
     253    ENDIF
    267254
    268255!
Note: See TracChangeset for help on using the changeset viewer.