Ignore:
Timestamp:
Feb 28, 2016 12:45:19 PM (5 years ago)
Author:
raasch
Message:

update of the nested domain system + some bugfixes

File:
1 edited

Legend:

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

    r1763 r1764  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! cpp-statements for nesting removed, communicator settings cleaned up
    2222!
    2323! Former revisions:
     
    148148    USE pegrid
    149149
    150 #if defined( PMC_ACTIVE )
    151150    USE pmc_interface,                                                         &
    152         ONLY:  cpl_id, pmci_init, pmci_modelconfiguration
    153 #endif
     151        ONLY:  cpl_id, nested_run, pmci_init, pmci_modelconfiguration
    154152
    155153    USE statistics,                                                            &
     
    185183    CALL MPI_INIT( ierr )
    186184
    187 #if defined( PMC_ACTIVE )
    188185!
    189186!-- Initialize the coupling for nested-domain runs
     187!-- comm_palm is the communicator which includes all PEs (MPI processes)
     188!-- available for this (nested) model. If it is not a nested run, comm_palm
     189!-- is returned as MPI_COMM_WORLD
    190190    CALL pmci_init( comm_palm )
    191191    comm2d = comm_palm
    192 
    193     IF ( cpl_id >= 2 )  THEN
    194        nest_domain = .TRUE.
    195        WRITE( coupling_char, '(A1,I1.1)') '_', cpl_id
    196     ENDIF
    197 
    198     CALL MPI_COMM_SIZE( comm_palm, numprocs, ierr )
    199     CALL MPI_COMM_RANK( comm_palm, myid, ierr )
    200 #else
    201     CALL MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
    202     CALL MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
    203     comm_palm = MPI_COMM_WORLD
    204     comm2d    = MPI_COMM_WORLD
    205 !
    206 !-- Initialize PE topology in case of coupled atmosphere-ocean runs (comm_palm
    207 !-- will be splitted in init_coupling)
    208     CALL init_coupling
    209 #endif
     192!
     193!-- Get the (preliminary) number of MPI processes and the local PE-id (in case
     194!-- of a further communicator splitting in init_coupling, these numbers will
     195!-- be changed in init_pegrid).
     196    IF ( nested_run )  THEN
     197!--    TO_DO: move the following two settings somewehere to the pmc_interface
     198       IF ( cpl_id >= 2 )  THEN
     199          nest_domain = .TRUE.
     200          WRITE( coupling_char, '(A1,I1.1)') '_', cpl_id
     201       ENDIF
     202
     203       CALL MPI_COMM_SIZE( comm_palm, numprocs, ierr )
     204       CALL MPI_COMM_RANK( comm_palm, myid, ierr )
     205
     206    ELSE
     207
     208       CALL MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
     209       CALL MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
     210!
     211!--    Initialize PE topology in case of coupled atmosphere-ocean runs (comm_palm
     212!--    will be splitted in init_coupling)
     213       CALL init_coupling
     214    ENDIF
    210215#endif
    211216
     
    316321    CALL init_3d_model
    317322
    318 #if defined( PMC_ACTIVE )
    319323!
    320324!-- Coupling protocol setup for nested-domain runs
    321     CALL pmci_modelconfiguration
    322 #endif
     325    IF ( nested_run )  THEN
     326       CALL pmci_modelconfiguration
     327    ENDIF
    323328
    324329!
Note: See TracChangeset for help on using the changeset viewer.