source: palm/trunk/SOURCE/pmc_handle_communicator_mod.f90 @ 2279

Last change on this file since 2279 was 2279, checked in by suehring, 7 years ago

Bugfix, set filepointer to the beginning of the file after namelist read

  • Property svn:keywords set to Id
File size: 18.3 KB
RevLine 
[1938]1  MODULE PMC_handle_communicator
[1762]2
[2000]3!------------------------------------------------------------------------------!
[1762]4! This file is part of PALM.
5!
[2000]6! PALM is free software: you can redistribute it and/or modify it under the
7! terms of the GNU General Public License as published by the Free Software
8! Foundation, either version 3 of the License, or (at your option) any later
9! version.
[1762]10!
11! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
12! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14!
15! You should have received a copy of the GNU General Public License along with
16! PALM. If not, see <http://www.gnu.org/licenses/>.
17!
[2101]18! Copyright 1997-2017 Leibniz Universitaet Hannover
[2000]19!------------------------------------------------------------------------------!
[1762]20!
21! Current revisions:
22! ------------------
[2279]23! Bugfix, set filepointer to the beginning of the file after namelist read,
24! in order to assure that further namelists are also found.
[1851]25!
[1792]26! Former revisions:
27! -----------------
28! $Id: pmc_handle_communicator_mod.f90 2279 2017-06-12 15:23:44Z suehring $
[2271]29! Error message text changed
30!
31! 2101 2017-01-05 16:42:31Z suehring
[1792]32!
[2014]33! 2013 2016-09-21 13:07:56Z suehring
34! Bugfix in format descriptor
35!
[2001]36! 2000 2016-08-20 18:09:15Z knoop
37! Forced header and separation lines into 80 columns
38!
[1939]39! 1938 2016-06-13 15:26:05Z hellstea
40! Minor clean-up.
41!
[1933]42! 1901 2016-05-04 15:39:38Z raasch
43! Initial version of purely vertical nesting introduced.
44! Code clean up. The words server/client changed to parent/child.
45!
[1901]46! 1900 2016-05-04 15:27:53Z raasch
47! re-formatting to match PALM style
48!
[1883]49! 1882 2016-04-20 15:24:46Z hellstea
50! MPI_BCAST-calls to broadcast nesting_mode and nesting_datatransfer_mode
51! are moved out from the DO i = 1, m_ncpl loop.
52!
[1851]53! 1850 2016-04-08 13:29:27Z maronga
54! Module renamed
55!
[1809]56! 1808 2016-04-05 19:44:00Z raasch
57! MPI module used by default on all machines
58!
[1798]59! 1797 2016-03-21 16:50:28Z raasch
60! introduction of different datatransfer modes,
61! export of comm_world_nesting
62!
[1792]63! 1791 2016-03-11 10:41:25Z raasch
[1791]64! m_nrofcpl renamed m_ncpl,
65! pmc_get_local_model_info renamed pmc_get_model_info, some keywords also
66! renamed and some added,
67! debug write-statements commented out
[1765]68!
[1787]69! 1786 2016-03-08 05:49:27Z raasch
70! Bugfix: nesting_mode is broadcast now
71!
[1780]72! 1779 2016-03-03 08:01:28Z raasch
73! only the total number of PEs is given in the nestpar-NAMELIST,
74! additional comments included
75!
[1765]76! 1764 2016-02-28 12:45:19Z raasch
[1764]77! pmc_layout type: comm_cpl and comm_parent removed, character "name" moved at
78! the beginning of the variable list,
79! domain layout is read with new NAMELIST nestpar from standard file PARIN,
80! MPI-datatype REAL8 replaced by REAL, kind=8 replaced by wp,
81! variable domain_layouts instead of m_couplers introduced for this NAMELIST,
82! general format changed to PALM style
[1762]83!
[1763]84! 1762 2016-02-25 12:31:13Z hellstea
85! Initial revision by K. Ketelsen
86!
[1762]87! Description:
88! ------------
[1764]89! Handle MPI communicator in PALM model coupler
[1933]90!-------------------------------------------------------------------------------!
[1762]91
[1764]92#if defined( __parallel )
93    USE kinds
[1762]94
[1808]95#if defined( __mpifh )
96    INCLUDE "mpif.h"
97#else
[1764]98    USE MPI
99#endif
[1762]100
[1933]101    USE pmc_general,                                                            &
[1900]102        ONLY: pmc_status_ok, pmc_status_error, pmc_max_models
[1933]103    USE control_parameters,                                                     &
104        ONLY: message_string
[1762]105
[1900]106    IMPLICIT NONE
[1762]107
[1900]108    TYPE pmc_layout
[1762]109
[1900]110       CHARACTER(LEN=32) ::  name
[1762]111
[1900]112       INTEGER  ::  id            !<
113       INTEGER  ::  parent_id     !<
114       INTEGER  ::  npe_total     !<
[1762]115
[1900]116       REAL(wp) ::  lower_left_x  !<
117       REAL(wp) ::  lower_left_y  !<
[1762]118
[1900]119    END TYPE pmc_layout
[1764]120
[1900]121    PUBLIC  pmc_status_ok, pmc_status_error
[1764]122
[1900]123    INTEGER, PARAMETER, PUBLIC ::  pmc_error_npes        = 1  !< illegal number of PEs
124    INTEGER, PARAMETER, PUBLIC ::  pmc_namelist_error    = 2  !< error(s) in nestpar namelist
125    INTEGER, PARAMETER, PUBLIC ::  pmc_no_namelist_found = 3  !< no couple layout namelist found
[1764]126
[1900]127    INTEGER ::  m_world_comm  !< global nesting communicator
[2279]128    INTEGER ::  m_my_cpl_id   !< coupler id of this modelfortran return
[1900]129    INTEGER ::  m_parent_id   !< coupler id of parent of this model
130    INTEGER ::  m_ncpl        !< number of couplers given in nestpar namelist
[1762]131
[1900]132    TYPE(pmc_layout), DIMENSION(pmc_max_models) ::  m_couplers  !< information of all couplers
[1762]133
[1900]134    INTEGER, PUBLIC ::  m_model_comm          !< communicator of this model
[1933]135    INTEGER, PUBLIC ::  m_to_parent_comm      !< communicator to the parent
[1900]136    INTEGER, PUBLIC ::  m_world_rank          !<
137    INTEGER         ::  m_world_npes          !<
138    INTEGER, PUBLIC ::  m_model_rank          !<
139    INTEGER, PUBLIC ::  m_model_npes          !<
[1933]140    INTEGER         ::  m_parent_remote_size  !< number of parent PEs
[1791]141
[1933]142    INTEGER, DIMENSION(pmc_max_models), PUBLIC ::  m_to_child_comm    !< communicator to the child(ren)
143    INTEGER, DIMENSION(:), POINTER, PUBLIC ::  pmc_parent_for_child   !<
[1762]144
145
[1900]146    INTERFACE pmc_is_rootmodel
147       MODULE PROCEDURE pmc_is_rootmodel
148    END INTERFACE pmc_is_rootmodel
[1762]149
[1900]150    INTERFACE pmc_get_model_info
151       MODULE PROCEDURE pmc_get_model_info
152    END INTERFACE pmc_get_model_info
[1762]153
[1900]154    PUBLIC pmc_get_model_info, pmc_init_model, pmc_is_rootmodel
[1762]155
[1764]156 CONTAINS
[1762]157
[1933]158 SUBROUTINE pmc_init_model( comm, nesting_datatransfer_mode, nesting_mode,      &
[1797]159                              pmc_status )
[1762]160
[1933]161    USE control_parameters,                                                     &
[1900]162        ONLY:  message_string
[1764]163
[1933]164    USE pegrid,                                                                 &
[1900]165        ONLY:  myid
[1764]166
167      IMPLICIT NONE
168
[1933]169    CHARACTER(LEN=8), INTENT(OUT) ::  nesting_mode               !<
[1900]170    CHARACTER(LEN=7), INTENT(OUT) ::  nesting_datatransfer_mode  !<
[1764]171
[1900]172    INTEGER, INTENT(OUT) ::  comm        !<
173    INTEGER, INTENT(OUT) ::  pmc_status  !<
[1764]174
[1933]175    INTEGER ::  childcount     !<
[1900]176    INTEGER ::  i              !<
177    INTEGER ::  ierr           !<
178    INTEGER ::  istat          !<
179    INTEGER ::  m_my_cpl_rank  !<
180    INTEGER ::  tag            !<
[1764]181
[1933]182    INTEGER, DIMENSION(pmc_max_models)   ::  activeparent  ! I am active parent for this child ID
[1900]183    INTEGER, DIMENSION(pmc_max_models+1) ::  start_pe
[1762]184
[1900]185    pmc_status   = pmc_status_ok
186    comm         = -1
187    m_world_comm = MPI_COMM_WORLD
188    m_my_cpl_id  = -1
[1933]189    childcount   =  0
190    activeparent = -1
[1900]191    start_pe(:)  =  0
192
193    CALL MPI_COMM_RANK( MPI_COMM_WORLD, m_world_rank, istat )
194    CALL MPI_COMM_SIZE( MPI_COMM_WORLD, m_world_npes, istat )
[1764]195!
[1900]196!-- Only PE 0 of root model reads
197    IF ( m_world_rank == 0 )  THEN
[1762]198
[1933]199       CALL read_coupling_layout( nesting_datatransfer_mode, nesting_mode,      &
[1900]200                                  pmc_status )
[1762]201
[1933]202       IF ( pmc_status /= pmc_no_namelist_found  .AND.                          &
203            pmc_status /= pmc_namelist_error )                                  &
[1900]204       THEN
[1764]205!
[1900]206!--       Calculate start PE of every model
207          start_pe(1) = 0
208          DO  i = 2, m_ncpl+1
209             start_pe(i) = start_pe(i-1) + m_couplers(i-1)%npe_total
210          ENDDO
[1762]211
[1764]212!
[1900]213!--       The number of cores provided with the run must be the same as the
214!--       total sum of cores required by all nest domains
215          IF ( start_pe(m_ncpl+1) /= m_world_npes )  THEN
[2013]216             WRITE ( message_string, '(2A,I6,2A,I6,A)' )                        &
[1933]217                             'nesting-setup requires different number of ',     &
218                             'MPI procs (', start_pe(m_ncpl+1), ') than ',      &
219                             'provided (', m_world_npes,')'
[1900]220             CALL message( 'pmc_init_model', 'PA0229', 3, 2, 0, 6, 0 )
221          ENDIF
[1762]222
[1900]223       ENDIF
[1762]224
[1900]225    ENDIF
[1764]226!
[1900]227!-- Broadcast the read status. This synchronises all other PEs with PE 0 of
228!-- the root model. Without synchronisation, they would not behave in the
229!-- correct way (e.g. they would not return in case of a missing NAMELIST)
230    CALL MPI_BCAST( pmc_status, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, istat )
[1762]231
[1900]232    IF ( pmc_status == pmc_no_namelist_found )  THEN
[1764]233!
[1900]234!--    Not a nested run; return the MPI_WORLD communicator
235       comm = MPI_COMM_WORLD
236       RETURN
[1762]237
[1900]238    ELSEIF ( pmc_status == pmc_namelist_error )  THEN
[1764]239!
[1900]240!--    Only the root model gives the error message. Others are aborted by the
241!--    message-routine with MPI_ABORT. Must be done this way since myid and
242!--    comm2d have not yet been assigned at this point.
243       IF ( m_world_rank == 0 )  THEN
244          message_string = 'errors in \$nestpar'
245          CALL message( 'pmc_init_model', 'PA0223', 3, 2, 0, 6, 0 )
246       ENDIF
[1762]247
[1900]248    ENDIF
[1762]249
[1900]250    CALL MPI_BCAST( m_ncpl,          1, MPI_INTEGER, 0, MPI_COMM_WORLD, istat)
251    CALL MPI_BCAST( start_pe, m_ncpl+1, MPI_INTEGER, 0, MPI_COMM_WORLD, istat)
[1762]252
[1764]253!
[1900]254!-- Broadcast coupling layout
255    DO  i = 1, m_ncpl
[1933]256       CALL MPI_BCAST( m_couplers(i)%name, LEN( m_couplers(i)%name ),           &
[1900]257                       MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )
[1933]258       CALL MPI_BCAST( m_couplers(i)%id,           1, MPI_INTEGER, 0,           &
[1900]259                       MPI_COMM_WORLD, istat )
[1933]260       CALL MPI_BCAST( m_couplers(i)%Parent_id,    1, MPI_INTEGER, 0,           &
[1900]261                       MPI_COMM_WORLD, istat )
[1933]262       CALL MPI_BCAST( m_couplers(i)%npe_total,    1, MPI_INTEGER, 0,           &
[1900]263                       MPI_COMM_WORLD, istat )
[1933]264       CALL MPI_BCAST( m_couplers(i)%lower_left_x, 1, MPI_REAL,    0,           &
[1900]265                       MPI_COMM_WORLD, istat )
[1933]266       CALL MPI_BCAST( m_couplers(i)%lower_left_y, 1, MPI_REAL,    0,           &
[1900]267                       MPI_COMM_WORLD, istat )
268    ENDDO
[1933]269    CALL MPI_BCAST( nesting_mode, LEN( nesting_mode ), MPI_CHARACTER, 0,        &
[1900]270                    MPI_COMM_WORLD, istat )
[1933]271    CALL MPI_BCAST( nesting_datatransfer_mode, LEN(nesting_datatransfer_mode),  &
[1900]272                    MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )
[1762]273
[1764]274!
[1900]275!-- Assign global MPI processes to individual models by setting the couple id
276    DO  i = 1, m_ncpl
[1933]277       IF ( m_world_rank >= start_pe(i)  .AND.  m_world_rank < start_pe(i+1) )  &
[1900]278       THEN
279          m_my_cpl_id = i
280          EXIT
281       ENDIF
282    ENDDO
283    m_my_cpl_rank = m_world_rank - start_pe(i)
[1762]284
[1764]285!
[1900]286!-- MPI_COMM_WORLD is the communicator for ALL models (MPI-1 approach).
287!-- The communictors for the individual models as created by MPI_COMM_SPLIT.
288!-- The color of the model is represented by the coupler id
[1933]289    CALL MPI_COMM_SPLIT( MPI_COMM_WORLD, m_my_cpl_id, m_my_cpl_rank, comm,      &
[1900]290                         istat )
[1764]291!
[1900]292!-- Get size and rank of the model running on this PE
293    CALL  MPI_COMM_RANK( comm, m_model_rank, istat )
294    CALL  MPI_COMM_SIZE( comm, m_model_npes, istat )
[1762]295
[1764]296!
[1900]297!-- Broadcast (from PE 0) the parent id and id of every model
298    DO  i = 1, m_ncpl
[1933]299       CALL MPI_BCAST( m_couplers(i)%parent_id, 1, MPI_INTEGER, 0,              &
[1900]300                       MPI_COMM_WORLD, istat )
[1933]301       CALL MPI_BCAST( m_couplers(i)%id,        1, MPI_INTEGER, 0,              &
[1900]302                       MPI_COMM_WORLD, istat )
303    ENDDO
[1762]304
[1764]305!
[1900]306!-- Save the current model communicator for pmc internal use
307    m_model_comm = comm
[1762]308
[1764]309!
[1933]310!-- Create intercommunicator between parent and children.
[1900]311!-- MPI_INTERCOMM_CREATE creates an intercommunicator between 2 groups of
312!-- different colors.
313!-- The grouping was done above with MPI_COMM_SPLIT
314    DO  i = 2, m_ncpl
[1762]315
[1900]316       IF ( m_couplers(i)%parent_id == m_my_cpl_id )  THEN
[1764]317!
[1933]318!--       Collect parent PEs.
[1900]319!--       Every model exept the root model has a parent model which acts as
[1933]320!--       parent model. Create an intercommunicator to connect current PE to
321!--       all children PEs
[1900]322          tag = 500 + i
[1933]323          CALL MPI_INTERCOMM_CREATE( comm, 0, MPI_COMM_WORLD, start_pe(i),      &
324                                     tag, m_to_child_comm(i), istat)
325          childcount = childcount + 1
326          activeparent(i) = 1
[1762]327
[1900]328       ELSEIF ( i == m_my_cpl_id)  THEN
[1764]329!
[1933]330!--       Collect children PEs.
331!--       Every model except the root model has a parent model.
332!--       Create an intercommunicator to connect current PE to all parent PEs
[1900]333          tag = 500 + i
[1933]334          CALL MPI_INTERCOMM_CREATE( comm, 0, MPI_COMM_WORLD,                   &
335                                     start_pe(m_couplers(i)%parent_id),         &
336                                     tag, m_to_parent_comm, istat )
[1900]337       ENDIF
[1762]338
[1900]339    ENDDO
[1762]340
[1764]341!
[1933]342!-- If I am parent, count the number of children that I have
343!-- Although this loop is symmetric on all processes, the "activeparent" flag
[1900]344!-- is true (==1) on the respective individual PE only.
[1933]345    ALLOCATE( pmc_parent_for_child(childcount+1) )
[1762]346
[1933]347    childcount = 0
[1900]348    DO  i = 2, m_ncpl
[1933]349       IF ( activeparent(i) == 1 )  THEN
350          childcount = childcount + 1
351          pmc_parent_for_child(childcount) = i
[1900]352       ENDIF
353    ENDDO
[1764]354!
[1933]355!-- Get the size of the parent model
[1900]356    IF ( m_my_cpl_id > 1 )  THEN
[1933]357       CALL MPI_COMM_REMOTE_SIZE( m_to_parent_comm, m_parent_remote_size,       &
[1900]358                                  istat)
359    ELSE
[1764]360!
[1933]361!--    The root model does not have a parent
362       m_parent_remote_size = -1
[1900]363    ENDIF
[1764]364!
[1900]365!-- Set myid to non-tero value except for the root domain. This is a setting
366!-- for the message routine which is called at the end of pmci_init. That
367!-- routine outputs messages for myid = 0, only. However, myid has not been
368!-- assigened so far, so that all PEs of the root model would output a
369!-- message. To avoid this, set myid to some other value except for PE0 of the
370!-- root domain.
371    IF ( m_world_rank /= 0 )  myid = 1
[1762]372
[1900]373 END SUBROUTINE PMC_init_model
[1762]374
375
[1900]376
[1933]377 SUBROUTINE pmc_get_model_info( comm_world_nesting, cpl_id, cpl_name,           &
378                                cpl_parent_id, lower_left_x, lower_left_y,      &
[1900]379                                ncpl, npe_total, request_for_cpl_id )
[1764]380!
[1791]381!-- Provide module private variables of the pmc for PALM
[1762]382
[1900]383    USE kinds
[1762]384
[1900]385    IMPLICIT NONE
[1762]386
[1933]387    CHARACTER(LEN=*), INTENT(OUT), OPTIONAL ::  cpl_name   !<
[1762]388
[1933]389    INTEGER, INTENT(IN), OPTIONAL ::  request_for_cpl_id   !<
[1762]390
[1900]391    INTEGER, INTENT(OUT), OPTIONAL ::  comm_world_nesting  !<
392    INTEGER, INTENT(OUT), OPTIONAL ::  cpl_id              !<
393    INTEGER, INTENT(OUT), OPTIONAL ::  cpl_parent_id       !<
394    INTEGER, INTENT(OUT), OPTIONAL ::  ncpl                !<
395    INTEGER, INTENT(OUT), OPTIONAL ::  npe_total           !<
[1762]396
[1900]397    INTEGER ::  requested_cpl_id  !<
[1764]398
[1900]399    REAL(wp), INTENT(OUT), OPTIONAL ::  lower_left_x  !<
400    REAL(wp), INTENT(OUT), OPTIONAL ::  lower_left_y  !<
[1764]401
[1791]402!
[1900]403!-- Set the requested coupler id
404    IF ( PRESENT( request_for_cpl_id ) )  THEN
405       requested_cpl_id = request_for_cpl_id
[1791]406!
[1900]407!--    Check for allowed range of values
408       IF ( requested_cpl_id < 1  .OR.  requested_cpl_id > m_ncpl )  RETURN
409    ELSE
410       requested_cpl_id = m_my_cpl_id
411    ENDIF
[1791]412
413!
[1900]414!-- Return the requested information
415    IF ( PRESENT( comm_world_nesting )  )  THEN
416       comm_world_nesting = m_world_comm
417    ENDIF
418    IF ( PRESENT( cpl_id )        )  THEN
419       cpl_id = requested_cpl_id
420    ENDIF
421    IF ( PRESENT( cpl_parent_id ) )  THEN
422       cpl_parent_id = m_couplers(requested_cpl_id)%parent_id
423    ENDIF
424    IF ( PRESENT( cpl_name )      )  THEN
425       cpl_name = m_couplers(requested_cpl_id)%name
426    ENDIF
427    IF ( PRESENT( ncpl )          )  THEN
428       ncpl = m_ncpl
429    ENDIF
430    IF ( PRESENT( npe_total )     )  THEN
431       npe_total = m_couplers(requested_cpl_id)%npe_total
432    ENDIF
433    IF ( PRESENT( lower_left_x )  )  THEN
434       lower_left_x = m_couplers(requested_cpl_id)%lower_left_x
435    ENDIF
436    IF ( PRESENT( lower_left_y )  )  THEN
437       lower_left_y = m_couplers(requested_cpl_id)%lower_left_y
438    ENDIF
[1791]439
[1900]440 END SUBROUTINE pmc_get_model_info
[1791]441
442
443
[1900]444 LOGICAL function pmc_is_rootmodel( )
[1764]445
[1900]446    IMPLICIT NONE
[1764]447
[1900]448    pmc_is_rootmodel = ( m_my_cpl_id == 1 )
[1764]449
[1900]450 END FUNCTION pmc_is_rootmodel
[1764]451
452
453
[1933]454 SUBROUTINE read_coupling_layout( nesting_datatransfer_mode, nesting_mode,      &
[1797]455                                  pmc_status )
[1762]456
[1764]457    IMPLICIT NONE
[1762]458
[1933]459    CHARACTER(LEN=8), INTENT(INOUT) ::  nesting_mode
[1797]460    CHARACTER(LEN=7), INTENT(INOUT) ::  nesting_datatransfer_mode
[1764]461
[1933]462    INTEGER(iwp), INTENT(INOUT) ::  pmc_status
463    INTEGER(iwp)                ::  bad_llcorner
464    INTEGER(iwp)                ::  i
465    INTEGER(iwp)                ::  istat
[1764]466
[1900]467    TYPE(pmc_layout), DIMENSION(pmc_max_models) ::  domain_layouts
[1764]468
[1797]469    NAMELIST /nestpar/  domain_layouts, nesting_datatransfer_mode, nesting_mode
[1764]470
471!
472!-- Initialize some coupling variables
[1900]473    domain_layouts(1:pmc_max_models)%id = -1
[1791]474    m_ncpl =   0
[1762]475
[1764]476    pmc_status = pmc_status_ok
477
478!
479!-- Open the NAMELIST-file and read the nesting layout
480    CALL check_open( 11 )
481    READ ( 11, nestpar, IOSTAT=istat )
[2279]482!
483!-- Set filepointer to the beginning of the file. Otherwise PE0 will later
484!-- be unable to read the inipar-NAMELIST
485    REWIND ( 11 )
[1764]486
487    IF ( istat < 0 )  THEN
[1933]488
[1764]489!
490!--    No nestpar-NAMELIST found
491       pmc_status = pmc_no_namelist_found
[1933]492
[1762]493       RETURN
494
[1764]495    ELSEIF ( istat > 0 )  THEN
[1933]496
[1764]497!
498!--    Errors in reading nestpar-NAMELIST
499       pmc_status = pmc_namelist_error
500       RETURN
[1762]501
[1764]502    ENDIF
[1762]503
[1764]504!
505!-- Output location message
506    CALL location_message( 'initialize communicators for nesting', .FALSE. )
[1933]507
[1764]508!
509!-- Assign the layout to the internally used variable
510    m_couplers = domain_layouts
[1762]511
[1764]512!
513!-- Get the number of nested models given in the nestpar-NAMELIST
[1900]514    DO  i = 1, pmc_max_models
[1764]515!
[1791]516!--    When id=-1 is found for the first time, the list of domains is finished
[1933]517        IF ( m_couplers(i)%id == -1  .OR.  i == pmc_max_models )  THEN
[1791]518          IF ( m_couplers(i)%id == -1 )  THEN
519             m_ncpl = i - 1
520             EXIT
521          ELSE
[1900]522             m_ncpl = pmc_max_models
[1791]523          ENDIF
[1764]524       ENDIF
525
526    ENDDO
527
[1933]528!
529!-- Make sure that all domains have equal lower left corner in case of vertical
530!-- nesting
531    IF ( nesting_mode == 'vertical' )  THEN
532       bad_llcorner = 0
533       DO  i = 1, m_ncpl
534          IF ( domain_layouts(i)%lower_left_x /= 0.0_wp .OR.                    &
535               domain_layouts(i)%lower_left_y /= 0.0_wp )  THEN
536             bad_llcorner = bad_llcorner + 1
537             domain_layouts(i)%lower_left_x = 0.0_wp
538             domain_layouts(i)%lower_left_y = 0.0_wp
539          ENDIF
540       ENDDO
541       IF ( bad_llcorner /= 0)  THEN
[2271]542          WRITE ( message_string, *)  'at least one dimension of lower ',       &
543                                      'left corner of one domain is not 0. ',   &
544                                      'All lower left corners were set to (0, 0)'
[1933]545          CALL message( 'read_coupling_layout', 'PA0427', 0, 0, 0, 6, 0 )
546       ENDIF
547    ENDIF
548
[1764]549 END SUBROUTINE read_coupling_layout
550
551#endif
552 END MODULE pmc_handle_communicator
Note: See TracBrowser for help on using the repository browser.