WAVEWATCH III  beta 0.0.1
yowfunction Module Reference

Functions/Subroutines

subroutine pdlib_abort (istat)
 
subroutine computelistnp_listnpa_listiplg_kernel
 
subroutine computelistnp_listnpa_listiplg
 
subroutine computeboundaryinformation
 

Function/Subroutine Documentation

◆ computeboundaryinformation()

subroutine yowfunction::computeboundaryinformation

Definition at line 283 of file yowfunction.F90.

283  use yownodepool, only: listnp, listnpa, listiplg
284  USE w3gdatmd, ONLY: iobp
285  USE w3odatmd, only : iaproc, naproc
286  IMPLICIT NONE
287  integer ListFirst(NAPROC), NbSend(NAPROC)
288  integer IPROC, eSend, IP, IP_glob, NPAloc
289  listfirst=0
290  DO iproc=2,naproc
291  listfirst(iproc)=listfirst(iproc-1) + listnpa(iproc-1)
292  END DO
293  DO iproc=1,naproc
294  npaloc=listnpa(iproc)
295  esend=0
296  DO ip=1,npaloc
297  ip_glob=listiplg(ip + listfirst(iproc))
298  IF (iobp(ip_glob) .eq. 1) THEN
299  esend=esend + 1
300  END IF
301  END DO
302  nbsend(iproc)=esend
303  END DO

References w3odatmd::iaproc, w3gdatmd::iobp, yownodepool::listiplg, yownodepool::listnp, yownodepool::listnpa, and w3odatmd::naproc.

◆ computelistnp_listnpa_listiplg()

subroutine yowfunction::computelistnp_listnpa_listiplg

Definition at line 195 of file yowfunction.F90.

195  USE w3odatmd, only : iaproc, naproc, ntproc
196  USE w3adatmd, ONLY: mpi_comm_wave
197  USE yowdatapool, only: rtype, istatus
198  USE yownodepool, only: npa, np, iplg
199  USE yownodepool, only: listnp, listnpa, listiplg
200  IMPLICIT NONE
201  include "mpif.h"
202  INTEGER sumNP, iProc, ierr, istat
203 #ifdef W3_DEBUGINIT
204  WRITE(740+iaproc,*) 'Before ComputeListNP_ListNPA_Kernel'
205  FLUSH(740+iaproc)
206 #endif
207  IF (iaproc .le. naproc) THEN
208  CALL computelistnp_listnpa_listiplg_kernel
209  END IF
210 #ifdef W3_DEBUGINIT
211  WRITE(740+iaproc,*) ' After ComputeListNP_ListNPA_Kernel'
212  FLUSH(740+iaproc)
213 #endif
214  IF (iaproc .eq. 1) THEN
215 #ifdef W3_DEBUGINIT
216  WRITE(740+iaproc,*) 'Doing the send'
217  FLUSH(740+iaproc)
218 #endif
219  sumnp=sum(listnpa)
220  DO iproc=naproc+1,ntproc
221 #ifdef W3_DEBUGINIT
222  WRITE(740+iaproc,*) 'Loop state 1, iProc=', iproc
223  FLUSH(740+iaproc)
224 #endif
225  CALL mpi_send(listnp, naproc,mpi_integer, iproc-1, 20, mpi_comm_wave, ierr)
226 #ifdef W3_DEBUGINIT
227  WRITE(740+iaproc,*) 'Loop state 2, iProc=', iproc
228  FLUSH(740+iaproc)
229 #endif
230  CALL mpi_send(listnpa,naproc,mpi_integer, iproc-1, 21, mpi_comm_wave, ierr)
231 #ifdef W3_DEBUGINIT
232  WRITE(740+iaproc,*) 'Loop state 3, iProc=', iproc
233  FLUSH(740+iaproc)
234 #endif
235  CALL mpi_send(listiplg, sumnp,mpi_integer, iproc-1, 271, mpi_comm_wave, ierr)
236 #ifdef W3_DEBUGINIT
237  WRITE(740+iaproc,*) 'Loop state 4, iProc=', iproc
238  FLUSH(740+iaproc)
239 #endif
240  END DO
241  END IF
242  IF (iaproc .gt. naproc) THEN
243 #ifdef W3_DEBUGINIT
244  WRITE(740+iaproc,*) 'Before allocation'
245  FLUSH(740+iaproc)
246 #endif
247  allocate(listnp(naproc), listnpa(naproc), stat=istat)
248 #ifdef W3_DEBUGINIT
249  WRITE(740+iaproc,*) 'Before receiving of data 1'
250  FLUSH(740+iaproc)
251 #endif
252  CALL mpi_recv(listnp ,naproc,mpi_integer, 0, 20, mpi_comm_wave, istatus, ierr)
253 #ifdef W3_DEBUGINIT
254  WRITE(740+iaproc,*) 'Before receiving of data 2'
255  FLUSH(740+iaproc)
256 #endif
257  CALL mpi_recv(listnpa,naproc,mpi_integer, 0, 21, mpi_comm_wave, istatus, ierr)
258 #ifdef W3_DEBUGINIT
259  WRITE(740+iaproc,*) 'Before computing sumNP'
260  FLUSH(740+iaproc)
261 #endif
262  sumnp=sum(listnpa)
263 #ifdef W3_DEBUGINIT
264  WRITE(740+iaproc,*) 'Before allocating ListIPLG'
265  FLUSH(740+iaproc)
266 #endif
267  allocate(listiplg(sumnp), stat=istat)
268 #ifdef W3_DEBUGINIT
269  WRITE(740+iaproc,*) 'Before receiving ListIPLG'
270  FLUSH(740+iaproc)
271 #endif
272  CALL mpi_recv(listiplg,sumnp,mpi_integer, 0, 271, mpi_comm_wave, istatus, ierr)
273 #ifdef W3_DEBUGINIT
274  WRITE(740+iaproc,*) 'After receiving ListIPLG'
275  FLUSH(740+iaproc)
276 #endif
277  END IF

References computelistnp_listnpa_listiplg_kernel(), w3odatmd::iaproc, include(), yownodepool::iplg, yowdatapool::istatus, yownodepool::listiplg, yownodepool::listnp, yownodepool::listnpa, w3adatmd::mpi_comm_wave, w3odatmd::naproc, yownodepool::np, yownodepool::npa, w3odatmd::ntproc, and yowdatapool::rtype.

Referenced by pdlib_w3profsmd::pdlib_init().

◆ computelistnp_listnpa_listiplg_kernel()

subroutine yowfunction::computelistnp_listnpa_listiplg_kernel

Definition at line 57 of file yowfunction.F90.

57  USE w3odatmd, only : iaproc, naproc, ntproc
58  USE w3adatmd, ONLY: mpi_comm_wcmp
59  USE yowdatapool, only: rtype, istatus
60  USE yownodepool, only: npa, np, iplg
61  USE yownodepool, only: listnp, listnpa, listiplg
62  IMPLICIT NONE
63  include "mpif.h"
64  integer IPROC, idx, IP, len, istat, sumNP, ierr
65  integer, allocatable :: iVect(:)
66  !
67  ! Computing ListNP and ListNPA
68  !
69 #ifdef W3_DEBUGINIT
70  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 1'
71  FLUSH(740+iaproc)
72 #endif
73  allocate(listnp(naproc), listnpa(naproc), ivect(2), stat=istat)
74 #ifdef W3_DEBUGINIT
75  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 2'
76  FLUSH(740+iaproc)
77 #endif
78  IF (istat /= 0) CALL pdlib_abort(1)
79 #ifdef W3_DEBUGINIT
80  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 3'
81  FLUSH(740+iaproc)
82 #endif
83  IF (iaproc .eq. 1) THEN
84  listnp(1)=np
85  listnpa(1)=npa
86  DO iproc=2,naproc
87  CALL mpi_recv(ivect,2,mpi_integer, iproc-1, 19, mpi_comm_wcmp, istatus, ierr)
88  listnp(iproc)=ivect(1)
89  listnpa(iproc)=ivect(2)
90  END DO
91  DO iproc=2,naproc
92  CALL mpi_send(listnp, naproc,mpi_integer, iproc-1, 20, mpi_comm_wcmp, ierr)
93  CALL mpi_send(listnpa,naproc,mpi_integer, iproc-1, 21, mpi_comm_wcmp, ierr)
94  END DO
95  ELSE
96  ivect(1)=np
97  ivect(2)=npa
98  CALL mpi_send(ivect,2,mpi_integer, 0, 19, mpi_comm_wcmp, ierr)
99  CALL mpi_recv(listnp ,naproc,mpi_integer, 0, 20, mpi_comm_wcmp, istatus, ierr)
100  CALL mpi_recv(listnpa,naproc,mpi_integer, 0, 21, mpi_comm_wcmp, istatus, ierr)
101  END IF
102  deallocate(ivect)
103 #ifdef W3_DEBUGINIT
104  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 4'
105  FLUSH(740+iaproc)
106 #endif
107  !
108  ! ListIPLG
109  !
110  sumnp=sum(listnpa)
111 #ifdef W3_DEBUGINIT
112  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 5, sumNP=', sumnp
113  FLUSH(740+iaproc)
114 #endif
115  allocate(listiplg(sumnp), stat=istat)
116 #ifdef W3_DEBUGINIT
117  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 6'
118  FLUSH(740+iaproc)
119 #endif
120  IF (istat /= 0) CALL pdlib_abort(2)
121 #ifdef W3_DEBUGINIT
122  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 7'
123  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, NAPROC=', naproc, ' NTPROC=', ntproc
124  FLUSH(740+iaproc)
125 #endif
126  IF (iaproc .eq. 1) THEN
127 #ifdef W3_DEBUGINIT
128  WRITE(740+iaproc,*) 'Main node 1'
129  FLUSH(740+iaproc)
130 #endif
131  idx=0
132  DO ip=1,npa
133  idx=idx+1
134  listiplg(ip)=iplg(ip)
135  END DO
136 #ifdef W3_DEBUGINIT
137  WRITE(740+iaproc,*) 'Main node 2'
138  FLUSH(740+iaproc)
139 #endif
140  DO iproc=2,naproc
141  len=listnpa(iproc)
142  allocate(ivect(len), stat=istat)
143  IF (istat /= 0) CALL pdlib_abort(3)
144  CALL mpi_recv(ivect,len,mpi_integer, iproc-1, 269, mpi_comm_wcmp, istatus, ierr)
145  DO ip=1,len
146  idx=idx+1
147  listiplg(idx)=ivect(ip)
148  END DO
149  deallocate(ivect)
150  END DO
151 #ifdef W3_DEBUGINIT
152  WRITE(740+iaproc,*) 'Main node 3'
153  FLUSH(740+iaproc)
154 #endif
155  DO iproc=2,naproc
156 #ifdef W3_DEBUGINIT
157  WRITE(740+iaproc,*) 'Before mpi_send IPROC=', iproc
158  FLUSH(740+iaproc)
159 #endif
160  CALL mpi_send(listiplg, sumnp,mpi_integer, iproc-1, 271, mpi_comm_wcmp, ierr)
161 #ifdef W3_DEBUGINIT
162  WRITE(740+iaproc,*) 'After mpi_send IPROC=', iproc
163  FLUSH(740+iaproc)
164 #endif
165  END DO
166 #ifdef W3_DEBUGINIT
167  WRITE(740+iaproc,*) 'Main node 4'
168  FLUSH(740+iaproc)
169 #endif
170  ELSE
171 #ifdef W3_DEBUGINIT
172  WRITE(740+iaproc,*) 'Peripheral node 1'
173  FLUSH(740+iaproc)
174 #endif
175  CALL mpi_send(iplg, npa,mpi_integer, 0, 269, mpi_comm_wcmp, ierr)
176 #ifdef W3_DEBUGINIT
177  WRITE(740+iaproc,*) 'Peripheral node 2'
178  FLUSH(740+iaproc)
179 #endif
180  CALL mpi_recv(listiplg,sumnp,mpi_integer, 0, 271, mpi_comm_wcmp, istatus, ierr)
181 #ifdef W3_DEBUGINIT
182  WRITE(740+iaproc,*) 'Peripheral node 3'
183  FLUSH(740+iaproc)
184 #endif
185  END IF
186 #ifdef W3_DEBUGINIT
187  WRITE(740+iaproc,*) 'ComputeListNP_ListNPA_Kernel, step 8'
188  FLUSH(740+iaproc)
189 #endif

References w3odatmd::iaproc, include(), yownodepool::iplg, yowdatapool::istatus, yownodepool::listiplg, yownodepool::listnp, yownodepool::listnpa, w3adatmd::mpi_comm_wcmp, w3odatmd::naproc, yownodepool::np, yownodepool::npa, w3odatmd::ntproc, pdlib_abort(), and yowdatapool::rtype.

Referenced by computelistnp_listnpa_listiplg().

◆ pdlib_abort()

subroutine yowfunction::pdlib_abort ( integer, intent(in)  istat)
include
cmake src_list cmake include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_switches.cmake) check_switches("$
Definition: CMakeLists.txt:15
yowfunction::pdlib_abort
subroutine pdlib_abort(istat)
Definition: yowfunction.F90:48
w3adatmd
Define data structures to set up wave model auxiliary data for several models simultaneously.
Definition: w3adatmd.F90:26
w3odatmd::ntproc
integer, pointer ntproc
Definition: w3odatmd.F90:457
w3odatmd::iaproc
integer, pointer iaproc
Definition: w3odatmd.F90:457
yownodepool::iplg
integer, dimension(:), allocatable, public iplg
Node local to global mapping.
Definition: yownodepool.F90:116
yownodepool::npa
integer, public npa
number of ghost + resident nodes this partition holds
Definition: yownodepool.F90:99
yownodepool::listiplg
integer, dimension(:), allocatable, target, public listiplg
Definition: yownodepool.F90:86
yownodepool
Has data that belong to nodes.
Definition: yownodepool.F90:39
w3odatmd
Definition: w3odatmd.F90:3
yownodepool::listnpa
integer, dimension(:), allocatable, target, public listnpa
Definition: yownodepool.F90:86
w3odatmd::naproc
integer, pointer naproc
Definition: w3odatmd.F90:457
yownodepool::listnp
integer, dimension(:), allocatable, target, public listnp
Definition: yownodepool.F90:86
yownodepool::np
integer, public np
number of nodes, local
Definition: yownodepool.F90:93
yowdatapool
Has fancy data.
Definition: yowdatapool.F90:39
yowerr::abort
subroutine abort(string, line, file, errno)
print various error strings and exit.
Definition: yowerr.F90:93
w3gdatmd::iobp
integer *2, dimension(:), pointer iobp
Definition: w3gdatmd.F90:1129
w3adatmd::mpi_comm_wave
integer, pointer mpi_comm_wave
Definition: w3adatmd.F90:676
w3gdatmd
Definition: w3gdatmd.F90:16
w3adatmd::mpi_comm_wcmp
integer, pointer mpi_comm_wcmp
Definition: w3adatmd.F90:676