Ignore:
Timestamp:
Mar 21, 2016 4:50:28 PM (6 years ago)
Author:
raasch
Message:

Introduction of different data transfer modes; restart mechanism adjusted for nested runs; parameter consistency checks for nested runs; further formatting cleanup

File:
1 edited

Legend:

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

    r1792 r1797  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! introduction of different datatransfer modes,
     23! export of comm_world_nesting
    2324!
    2425! Former revisions:
     
    9091   ! Coupler Setup
    9192
     93   INTEGER                                    :: m_world_comm !global nesting communicator
    9294   INTEGER                                    :: m_my_CPL_id  !Coupler id of this model
    9395   INTEGER                                    :: m_Parent_id  !Coupler id of parent of this model
     
    125127 CONTAINS
    126128
    127    SUBROUTINE pmc_init_model( comm, nesting_mode, pmc_status )
     129   SUBROUTINE pmc_init_model( comm, nesting_datatransfer_mode, nesting_mode,   &
     130                              pmc_status )
    128131
    129132      USE control_parameters,                                                  &
     
    136139
    137140      CHARACTER(LEN=7), INTENT(OUT) ::  nesting_mode
     141      CHARACTER(LEN=7), INTENT(OUT) ::  nesting_datatransfer_mode
    138142
    139143      INTEGER, INTENT(OUT)                ::  comm
     
    148152      pmc_status   = pmc_status_ok
    149153      comm         = -1
     154      m_world_comm = MPI_COMM_WORLD
    150155      m_my_cpl_id  = -1
    151156      clientcount  =  0
     
    159164      IF ( m_world_rank == 0 )  THEN
    160165
    161          CALL read_coupling_layout( nesting_mode, pmc_status )
     166         CALL read_coupling_layout( nesting_datatransfer_mode, nesting_mode,   &
     167                                    pmc_status )
    162168
    163169         IF ( pmc_status /= pmc_no_namelist_found  .AND.                       &
     
    221227         CALL MPI_BCAST( m_couplers(i)%lower_left_x, 1, MPI_REAL,    0, MPI_COMM_WORLD, istat )
    222228         CALL MPI_BCAST( m_couplers(i)%lower_left_y, 1, MPI_REAL,    0, MPI_COMM_WORLD, istat )
     229!--      TO_DO: the next two calls can and should probably moved outside this loop
    223230         CALL MPI_BCAST( nesting_mode, LEN( nesting_mode ), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )
     231         CALL MPI_BCAST( nesting_datatransfer_mode, LEN(nesting_datatransfer_mode), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )
    224232      ENDDO
    225233
     
    329337!
    330338!-- Provide module private variables of the pmc for PALM
    331     SUBROUTINE pmc_get_model_info( cpl_id, cpl_name, cpl_parent_id,            &
    332                                    lower_left_x, lower_left_y, ncpl, npe_total,&
    333                                    request_for_cpl_id )
     339    SUBROUTINE pmc_get_model_info( comm_world_nesting, cpl_id, cpl_name,       &
     340                                   cpl_parent_id, lower_left_x, lower_left_y,  &
     341                                   ncpl, npe_total, request_for_cpl_id )
    334342
    335343      USE kinds
     
    341349      INTEGER, INTENT(IN), OPTIONAL ::  request_for_cpl_id
    342350
     351      INTEGER, INTENT(OUT), OPTIONAL ::  comm_world_nesting
    343352      INTEGER, INTENT(OUT), OPTIONAL ::  cpl_id
    344353      INTEGER, INTENT(OUT), OPTIONAL ::  cpl_parent_id
     
    364373!
    365374!--   Return the requested information
     375      IF ( PRESENT( comm_world_nesting )  )  THEN
     376         comm_world_nesting = m_world_comm
     377      ENDIF
    366378      IF ( PRESENT( cpl_id )        )  THEN
    367          cpl_id        = requested_cpl_id
     379         cpl_id = requested_cpl_id
    368380      ENDIF
    369381      IF ( PRESENT( cpl_parent_id ) )  THEN
     
    371383      ENDIF
    372384      IF ( PRESENT( cpl_name )      )  THEN
    373          cpl_name      = m_couplers(requested_cpl_id)%name
     385         cpl_name = m_couplers(requested_cpl_id)%name
    374386      ENDIF
    375387      IF ( PRESENT( ncpl )          )  THEN
    376          ncpl          = m_ncpl
     388         ncpl = m_ncpl
    377389      ENDIF
    378390      IF ( PRESENT( npe_total )     )  THEN
    379          npe_total     = m_couplers(requested_cpl_id)%npe_total
     391         npe_total = m_couplers(requested_cpl_id)%npe_total
    380392      ENDIF
    381393      IF ( PRESENT( lower_left_x )  )  THEN
    382          lower_left_x  = m_couplers(requested_cpl_id)%lower_left_x
     394         lower_left_x = m_couplers(requested_cpl_id)%lower_left_x
    383395      ENDIF
    384396      IF ( PRESENT( lower_left_y )  )  THEN
    385          lower_left_y  = m_couplers(requested_cpl_id)%lower_left_y
     397         lower_left_y = m_couplers(requested_cpl_id)%lower_left_y
    386398      ENDIF
    387399
     
    400412
    401413
    402  SUBROUTINE read_coupling_layout( nesting_mode, pmc_status )
     414 SUBROUTINE read_coupling_layout( nesting_datatransfer_mode, nesting_mode,     &
     415                                  pmc_status )
    403416
    404417    IMPLICIT NONE
    405418
    406     CHARACTER(LEN=7) ::  nesting_mode
     419    CHARACTER(LEN=7), INTENT(INOUT) ::  nesting_mode
     420    CHARACTER(LEN=7), INTENT(INOUT) ::  nesting_datatransfer_mode
    407421
    408422    INTEGER, INTENT(INOUT) ::  pmc_status
     
    412426
    413427
    414     NAMELIST /nestpar/  domain_layouts, nesting_mode
     428    NAMELIST /nestpar/  domain_layouts, nesting_datatransfer_mode, nesting_mode
    415429
    416430!
Note: See TracChangeset for help on using the changeset viewer.