/[MITgcm]/MITgcm/pkg/compon_communic/mitcplr_init2a.F
ViewVC logotype

Annotation of /MITgcm/pkg/compon_communic/mitcplr_init2a.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Mon Oct 8 23:58:21 2007 UTC (16 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64q, checkpoint64p, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.1: +6 -3 lines
add missing cvs $Header:$ or $Name:$

1 jmc 1.2 C $Header: $
2     C $Name: $
3    
4 jmc 1.1 !=======================================================================
5     subroutine mitcplr_init2a( myTypeStr )
6     implicit none
7     ! Arguments
8     character*(*) myTypeStr
9     ! Predefined constants/arrays
10     #include "CPLR_SIG.h"
11     ! MPI variables
12     #include "mpif.h"
13     integer myid, numprocs, ierr
14     ! Local
15     integer n,j,lenbuf
16     ! ------------------------------------------------------------------
17    
18     ! Find-out my position (rank) in the "global" communicator
19     call MPI_COMM_RANK( MPI_COMM_myglobal, myid, ierr )
20     if (ierr.ne.0) write(LogUnit,*) 'MITCPLR_init2a: ',
21     & ' Rank = ',myid,' MPI_COMM_RANK ierr=',ierr
22     ! How big is the "global" comminicator?
23     call MPI_COMM_SIZE( MPI_COMM_myglobal, numprocs, ierr )
24     if (ierr.ne.0) write(LogUnit,*) 'MITCPLR_init2a: ',
25     & ' Size = ',numprocs,' MPI_COMM_RANK ierr=',ierr
26     if (VERB) write(LogUnit,*) 'MITCPLR_init2a: ',
27     & ' Rank/Size = ',myid,' /',numprocs
28    
29 jmc 1.2 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
30 jmc 1.1
31     ! Assume nothing again
32     num_coupler_procs=0
33    
34     ! Receive a message from each of the other processes in "myglobal"
35     do n=0,numprocs-1
36     ibuf( 1)=myid
37     ibuf( 2)=0
38     ibuf( 3)=0
39     ibuf( 4)=0
40     ibuf( 5)=0
41     ibuf( 6)=0
42     ibuf( 7)=0
43     ibuf( 8)=0
44     ibuf( 9)=0
45     ibuf(10)=0
46     ibuf(11)=0
47     ibuf(12)=0
48     lenbuf=12
49     call MPI_Bcast(
50     & ibuf, lenbuf, MPI_INTEGER,
51 jmc 1.2 & n,
52 jmc 1.1 & MPI_COMM_myglobal, ierr )
53     if (ierr.ne.0) write(LogUnit,*) 'MITCPLR_init2a: ',
54     & ' MPI_Bcast from ',ibuf(1),ibuf(2),' ierr=',ierr
55    
56     if ( ibuf(2).eq.MITCPLR_COUPLER ) then
57     ! If the broadcaster is the "coupler"
58     num_coupler_procs=num_coupler_procs + 1
59     num_procs_in_global=num_procs_in_global+1
60     rank_coupler_procs(num_coupler_procs) = ibuf(1)
61     else
62     ! If the broadcaster is a "component"
63     num_procs_in_local=num_procs_in_local+1
64     num_procs_in_global=num_procs_in_global+1
65     endif
66    
67     enddo
68    
69     if (num_coupler_procs .ne. 1) then
70     stop 'MITCPLR_init2a: I can only handle one coupling process'
71     endif
72    
73 jmc 1.2 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
74 jmc 1.1
75     ! Find-out my position (rank) in the "world" communicator
76     call MPI_COMM_RANK( MPI_COMM_World, n, ierr )
77     if (ierr.ne.0) write(LogUnit,*) 'MITCPLR_init2a: ',
78     & ' Rank = ',myid,' MPI_COMM_RANK ierr=',ierr
79     ! Find-out my position (rank) in the "local" communicator
80     call MPI_COMM_RANK( MPI_COMM_myglobal, j, ierr )
81     if (ierr.ne.0) write(LogUnit,*) 'MITCPLR_init2a: ',
82     & ' Rank = ',myid,' MPI_COMM_RANK ierr=',ierr
83    
84     ! Store the information
85     my_coupler_rank=rank_coupler_procs(1)
86     my_rank_in_world=n
87     my_rank_in_global=myid
88     my_rank_in_local=j
89    
90     if (VERB) write(LogUnit,*) 'MITCPLR_init2a: ',
91     & ' rank (W,G,L) =',
92     & my_rank_in_world,my_rank_in_global,my_rank_in_local,
93     & ' my_coupler_rank =',my_coupler_rank,' /',numprocs
94    
95     ! ------------------------------------------------------------------
96     call flush(LogUnit)
97     return
98     end
99     !=======================================================================

  ViewVC Help
Powered by ViewVC 1.1.22