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

Contents of /MITgcm/pkg/compon_communic/mitcoupler_register.F

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


Revision 1.2 - (show annotations) (download)
Mon Oct 8 23:58:20 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: +3 -0 lines
add missing cvs $Header:$ or $Name:$

1 C $Header: $
2 C $Name: $
3
4 !=======================================================================
5 subroutine MITCOUPLER_register( compName, nnx, nny )
6 implicit none
7
8 ! Arguments
9 character*(*) compName
10 integer nnx, nny
11
12 ! MPI variables
13 #include "mpif.h"
14
15 ! Predefined constants/arrays
16 #include "CPLR_SIG.h"
17
18 ! Functions
19 integer mitcplr_match_comp
20 integer generate_tag
21
22 ! Local
23 integer n,numprocs
24 integer comm
25 integer compind,count,dtype,tag,rank
26 integer ierr, rc
27 integer stat(MPI_STATUS_SIZE)
28 integer j,numtiles,nx,ny,i0,j0
29
30 ! ------------------------------------------------------------------
31
32 ! Establish who I am communicating with
33 compind=mitcplr_match_comp( compName )
34 if (compind.le.0) stop 'MITCOUPLER_register: Bad component'
35 comm=MPI_COMM_compcplr( compind )
36 numprocs=num_component_procs(compind)
37 if (numprocs.lt.1) then
38 write(LogUnit,*) 'MITCOUPLER_register: compind = ',compind
39 stop 'MITCOUPLER_register: numprocs < 1'
40 endif
41
42 ! Foreach component process
43 do n=1,numprocs
44
45 ! Receive message
46 count=MAX_IBUF
47 dtype=MPI_INTEGER
48 tag=generate_tag(115,n,'Register')
49 rank=rank_component_procs(n,compind)
50
51 call MPI_Recv(ibuf, count, dtype, rank, tag, comm, stat, ierr)
52
53 if (ierr.ne.0) then
54 write(LogUnit,*) 'MITCOUPLER_register: rank(W,G)=',
55 & my_rank_in_world,my_rank_in_global,
56 & ' ierr=',ierr
57 stop 'MITCOUPLER_register: MPI_Recv failed'
58 endif
59
60 ! Extract data
61 numtiles=ibuf(1)
62 nx=ibuf(2)
63 ny=ibuf(3)
64 i0=ibuf(4)
65 j0=ibuf(5)
66
67 if (numtiles.ne.1) then
68 write(LogUnit,*) 'MITCOUPLER_tile_register: #tiles = ',numtiles
69 stop 'MITCOUPLER_tile_register: invalid value for numtiles'
70 endif
71 if (nx.lt.1) then
72 write(LogUnit,*) 'MITCOUPLER_register: nx = ',nx
73 stop 'MITCOUPLER_register: invalid value for nx'
74 endif
75 if (ny.lt.1) then
76 write(LogUnit,*) 'MITCOUPLER_register: ny = ',ny
77 stop 'MITCOUPLER_register: invalid value for ny'
78 endif
79 if (i0.lt.1) then
80 write(LogUnit,*) 'MITCOUPLER_register: i0 = ',i0
81 stop 'MITCOUPLER_register: invalid value for i0'
82 endif
83 if (j0.lt.1) then
84 write(LogUnit,*) 'MITCOUPLER_register: j0 = ',j0
85 stop 'MITCOUPLER_register: invalid value for j0'
86 endif
87 if (i0+nx-1.gt.nnx) then
88 write(LogUnit,*) 'MITCOUPLER_register: i0 = ',i0
89 stop 'MITCOUPLER_register: i0 + nx -1 > nnx'
90 endif
91 if (j0+ny-1.gt.nny) then
92 write(LogUnit,*) 'MITCOUPLER_register: j0 = ',j0
93 stop 'MITCOUPLER_register: j0 + ny -1 > nny'
94 endif
95
96 component_num_tiles(n,compind)=1
97 component_tile_nx(1,n,compind)=nx
98 component_tile_ny(1,n,compind)=ny
99 component_tile_i0(1,n,compind)=i0
100 component_tile_j0(1,n,compind)=j0
101
102 enddo ! n
103
104 do n=1,numprocs
105 write(LogUnit,*) 'MITCOUPLER_register: proc,nx,ny = ',n,
106 & component_tile_nx(1,n,compind),component_tile_ny(1,n,compind)
107 enddo ! n
108
109 ! ------------------------------------------------------------------
110 call flush(LogUnit)
111 return
112 end
113 !=======================================================================

  ViewVC Help
Powered by ViewVC 1.1.22