WAVEWATCH III  beta 0.0.1
w3initmd.F90
Go to the documentation of this file.
1 
6 
7 #include "w3macros.h"
8 
13 !/ ------------------------------------------------------------------- /
14 MODULE w3initmd
15  !/
16  !/ +-----------------------------------+
17  !/ | WAVEWATCH III NOAA/NCEP |
18  !/ | H. L. Tolman |
19  !/ | FORTRAN 90 |
20  !/ | Last update : 22-Mar-2021 |
21  !/ +-----------------------------------+
22  !/
23  !/ 28-Dec-2004 : Origination (out of W3WAVEMD). ( version 3.06 )
24  !/ Multiple grid version.
25  !/ 03-Jan-2005 : Add US2x to MPI communication. ( version 3.06 )
26  !/ 04-Jan-2005 : Add grid output flags to W3INIT. ( version 3.06 )
27  !/ 07-Feb-2005 : Combined vs. separate test output. ( version 3.07 )
28  !/ 04-May-2005 : Change to MPI_COMM_WAVE. ( version 3.07 )
29  !/ 21-Jul-2005 : Add output fields. ( version 3.07 )
30  !/ 09-Nov-2005 : Drying out of points added. ( version 3.08 )
31  !/ 13-Jun-2006 : Splitting STORE in G/SSTORE. ( version 3.09 )
32  !/ 26-Jun-2006 : adding wiring for output type 6. ( version 3.09 )
33  !/ 27-Jun-2006 : Adding file name preamble. ( version 3.09 )
34  !/ 04-Jul-2006 : Consolidate stress arrays. ( version 3.09 )
35  !/ 02-Aug-2006 : Adding W3MPIP. ( version 3.10 )
36  !/ 02-Nov-2006 : Adding partitioning options. ( version 3.10 )
37  !/ 11-Jan-2007 : Updating IAPPRO computation. ( version 3.10 )
38  !/ 02-Apr-2007 : Add partitioned field data. ( version 3.11 )
39  !/ Add user-defined field data.
40  !/ 01-May-2007 : Move O7a output to W3IOPP. ( version 3.11 )
41  !/ 08-May-2007 : Starting from calm as an option. ( version 3.11 )
42  !/ 17-May-2007 : Adding NTPROC/NAPROC separation. ( version 3.11 )
43  !/ 21-Jun-2007 : Dedicated output processes. ( version 3.11 )
44  !/ 29-Feb-2008 : Add NEC compiler directives. ( version 3.13 )
45  !/ 29-May-2009 : Preparing distribution version. ( version 3.14 )
46  !/ 23-Jul-2009 : Implement unstructured grids ( version 3.14 )
47  !/ 30-Oct-2009 : Implement run-time grid selection. ( version 3.14 )
48  !/ (W. E. Rogers & T. J. Campbell, NRL)
49  !/ 30-Oct-2009 : Implement curvilinear grid type. ( version 3.14 )
50  !/ (W. E. Rogers & T. J. Campbell, NRL)
51  !/ 06-Dec-2010 : Change from GLOBAL (logical) to ICLOSE (integer) to
52  !/ specify index closure for a grid. ( version 3.14 )
53  !/ (T. J. Campbell, NRL)
54  !/ 02-Sep.2012 : Set up for > 999 test files. ( version 4.10 )
55  !/ Reset UST initialization.
56  !/ 03-Sep-2012 : Switch test file on/off (TSTOUT) ( version 4.10 )
57  !/ 03-Sep-2012 : Clean up of UG grids ( version 4.08 )
58  !/ 30-Sep-2012 : Implemetation of tidal constituents ( version 4.09 )
59  !/ 07-Dec-2012 : Initialize UST non-zero. ( version 4.11 )
60  !/ 12-Dec-2012 : Changes for SMC grid. JG_Li ( version 4.11 )
61  !/ 26-Dec-2012 : Modify field output MPI for new ( version 4.11 )
62  !/ structure and smaller memory footprint.
63  !/ 02-Jul-2013 : Bug fix MPI_FLOAT -> MPI_REAL. ( version 4.11 )
64  !/ 10-Oct-2013 : CG and WN values at DMIN for ISEA=0 ( version 4.12 )
65  !/ 14-Nov-2013 : Remove UST(DIR) initialization. ( version 4.13 )
66  !/ 15-Dec-2013 : Adds fluxes to ice ( version 5.01 )
67  !/ 01-May-2017 : Adds directional MSS parameters ( version 6.04 )
68  !/ 05-Jun-2018 : Adds PDLIB/MEMCHECK/DEBUG ( version 6.04 )
69  !/ 21-Aug-2018 : Add WBT parameter ( version 6.06 )
70  !/ 26-Aug-2018 : UOST (Mentaschi et al. 2015, 2018) ( version 6.06 )
71  !/ 25-Sep-2020 : Extra fields for coupling restart ( version 7.10 )
72  !/ 22-Mar-2021 : Extra coupling fields ( version 7.13 )
73  !/ 22-Jun-2021 : GKE NL5 (Q. Liu) ( version 7.13 )
74  !/
75  !/ Copyright 2009-2013 National Weather Service (NWS),
76  !/ National Oceanic and Atmospheric Administration. All rights
77  !/ reserved. WAVEWATCH III is a trademark of the NWS.
78  !/ No unauthorized use without permission.
79  !/
80  !/ Note: Changes in version numbers not logged above.
81  !/
82  ! 1. Purpose :
83  !
84  ! 2. Variables and types :
85  !
86  ! Name Type Scope Description
87  ! ----------------------------------------------------------------
88  ! CRITOS R.P. Public Critical percentage of resources used
89  ! for output to trigger warning.
90  ! WWVER C*10 Public Model version number.
91  ! SWITCHES C*256 Public switches taken from bin/switch
92  ! ----------------------------------------------------------------
93  !
94  ! 3. Subroutines and functions :
95  !
96  ! Name Type Scope Description
97  ! ----------------------------------------------------------------
98  ! W3INIT Subr. Public Wave model initialization.
99  ! W3MPII Subr. Public Initialize MPI data transpose.
100  ! W3MPIO Subr. Public Initialize MPI output gathering.
101  ! W3MPIP Subr. Public Initialize MPI point output gathering.
102  ! ----------------------------------------------------------------
103  !
104  ! 4. Subroutines and functions used :
105  !
106  ! See subroutine documentation.
107  !
108  ! 5. Remarks :
109  !
110  ! 6. Switches :
111  !
112  ! !/SHRD Switch for shared / distributed memory architecture.
113  ! !/DIST Id.
114  ! !/MPI Id.
115  !
116  ! !/S Enable subroutine tracing.
117  ! !/Tn Enable test output.
118  ! !/MPIT Enable test output (MPI).
119  !
120  ! 7. Source code :
121  !
122  !/ ------------------------------------------------------------------- /
123  ! module default
124  implicit none
125 
126  PUBLIC
127  !/
128  REAL, PARAMETER :: critos = 15.
129  CHARACTER(LEN=10), PARAMETER :: wwver = '7.14 '
130  CHARACTER(LEN=512), PARAMETER :: switches = &
131  __ww3_switches__
132  !/
133 CONTAINS
134  !/ ------------------------------------------------------------------- /
162  SUBROUTINE w3init ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, &
163  FLG2, NPT, XPT, YPT, PNAMES, IPRT, PRTFRM, MPI_COMM, FLAGSTIDEIN)
164  !/
165  !/ +-----------------------------------+
166  !/ | WAVEWATCH III NOAA/NCEP |
167  !/ | H. L. Tolman |
168  !/ | FORTRAN 90 |
169  !/ | Last update : 03-Sep-2012 |
170  !/ +-----------------------------------+
171  !/
172  !/ 17-Mar-1999 : Distributed FORTRAN 77 version. ( version 1.18 )
173  !/ 13-Jan-2000 : Upgrade to FORTRAN 90 ( version 2.00 )
174  !/ Major changes to logistics.
175  !/ 14-Feb-2000 : Exact-NL added. ( version 2.01 )
176  !/ 24-Jan-2001 : Flat grid version. ( version 2.06 )
177  !/ 24-Jan-2002 : Zero time step for data ass. ( version 2.17 )
178  !/ 18-Feb-2002 : Point output diagnostics added. ( version 2.18 )
179  !/ 13-Nov-2002 : Add stress vector. ( version 3.00 )
180  !/ 20-Aug-2003 : Output server options added. ( version 3.04 )
181  !/ 28-Dec-2004 : Multiple grid version. ( version 3.06 )
182  !/ Taken out of W3WAVE.
183  !/ 04-Jan-2005 : Add grid output flags to par list. ( version 3.06 )
184  !/ 07-Feb-2005 : Combined vs. separate test output. ( version 3.07 )
185  !/ 04-May-2005 : Change to MPI_COMM_WAVE. ( version 3.07 )
186  !/ 09-Nov-2005 : Drying out of points added. ( version 3.08 )
187  !/ 26-Jun-2006 : adding wiring for output type 6. ( version 3.09 )
188  !/ 27-Jun-2006 : Adding file name preamble. ( version 3.09 )
189  !/ 02-Aug-2006 : Adding W3MPIP. ( version 3.10 )
190  !/ 02-Nov-2006 : Adding partitioning options. ( version 3.10 )
191  !/ 11-Jan-2007 : Updating IAPPRO computation. ( version 3.10 )
192  !/ 01-May-2007 : Move O7a output to W3IOPP. ( version 3.11 )
193  !/ 08-May-2007 : Starting from calm as an option. ( version 3.11 )
194  !/ 17-May-2007 : Adding NTPROC/NAPROC separation. ( version 3.11 )
195  !/ 21-Jun-2007 : Dedicated output processes. ( version 3.11
196  !/ 13-Sep-2009 : Add coupling option ( version 3.14 )
197  !/ 30-Oct-2009 : Implement run-time grid selection. ( version 3.14 )
198  !/ (W. E. Rogers & T. J. Campbell, NRL)
199  !/ 30-Oct-2009 : Implement curvilinear grid type. ( version 3.14 )
200  !/ (W. E. Rogers & T. J. Campbell, NRL)
201  !/ 29-Oct-2010 : Implement unstructured grids ( version 3.14.1 )
202  !/ (A. Roland and F. Ardhuin)
203  !/ 06-Dec-2010 : Change from GLOBAL (logical) to ICLOSE (integer) to
204  !/ specify index closure for a grid. ( version 3.14 )
205  !/ (T. J. Campbell, NRL)
206  !/ 02-Sep.2012 : Set up for > 999 test files. ( version 4.10 )
207  !/ 03-Sep-2012 : Switch test file on/off (TSTOUT) ( version 4.10 )
208  !/ 03-Sep-2012 : Clean up of UG grids ( version 4.08 )
209  !/
210  ! 1. Purpose :
211  !
212  ! Initialize WAVEWATCH III.
213  !
214  ! 2. Method :
215  !
216  ! Initialize data structure and wave fields from data files.
217  ! Initialize grid from local and instantaneous data.
218  !
219  ! 3. Parameters :
220  !
221  ! Parameter list
222  ! ----------------------------------------------------------------
223  ! IMOD Int. I Model number.
224  ! FEXT Char I Extension of data files.
225  ! MDS I.A. I Array with dataset numbers (see below),
226  ! saved as NDS in W3ODATMD.
227  ! 1: General output unit number ("log file").
228  ! 2: Error output unit number.
229  ! 3: Test output unit number.
230  ! 4: "screen", i.e., direct output location,
231  ! can be the screen or the output file of
232  ! the shell.
233  ! 5: Model definition file unit number.
234  ! 6: Restart file unit number.
235  ! 7: Grid output file unit number.
236  ! 8: Point output file unit number.
237  ! 9: Input boundary data file unit number.
238  ! 10: Output boundary data file unit number
239  ! (first).
240  ! 11: Track information file unit number.
241  ! 12: Track output file unit number.
242  ! 13: Wave separation output file unit number.
243  ! 14: Grid output file unit number.
244  ! 15: Point output file unit number. ascii
245  ! MTRACE I.A. I Array with subroutine tracing information.
246  ! 1: Output unit number for trace.
247  ! 2: Maximum number of trace prints.
248  ! ODAT I.A. I Output data, five parameters per output type
249  ! 1-5 Data for OTYPE = 1; gridded fields.
250  ! 1 YYYMMDD for first output.
251  ! 2 HHMMSS for first output.
252  ! 3 Output interval in seconds.
253  ! 4 YYYMMDD for last output.
254  ! 5 HHMMSS for last output.
255  ! 6-10 Id. for OTYPE = 2; point output.
256  ! 11-15 Id. for OTYPE = 3; track point output.
257  ! 16-20 Id. for OTYPE = 4; restart files.
258  ! 21-25 Id. for OTYPE = 5; boundary data.
259  ! 31-35 Id. for OTYPE = 7; coupling data.
260  ! 36-40 Id. for OTYPE = 8; second restart file
261  ! FLGRD L.A. I Flags for gridded output.
262  ! FLGR2 L.A. I Flags for coupling output.
263  ! NPT Int. I Number of output points
264  ! X/YPT R.A. I Coordinates of output points.
265  ! PNAMES C.A. I Output point names.
266  ! IPRT I.A. I Partitioning grid info.
267  ! PRTFRM I.A. I Partitioning format flag.
268  ! MPI_COMM Int. I MPI communicator to be used for model.
269  ! ----------------------------------------------------------------
270  !
271  ! 4. Subroutines used :
272  !
273  ! Name Type Module Description
274  ! ----------------------------------------------------------------
275  ! W3SETG Subr. W3GDATMD Point to data structure.
276  ! W3SETW Subr. W3WDATMD Point to data structure.
277  ! W3DIMW Subr. Id. Set array sizes in data structure.
278  ! W3SETA Subr. W3ADATMD Point to data structure.
279  ! W3DIMA Subr. Id. Set array sizes in data structure.
280  ! W3SETI Subr. W3IDATMD Point to data structure.
281  ! W3DIMI Subr. Id. Set array sizes in data structure.
282  ! W3SETO Subr. W3ODATMD Point to data structure.
283  ! W3DMO5 Subr. Id. Set array sizes in data structure.
284  ! ITRACE Subr. W3SERVMD Subroutine tracing initialization.
285  ! STRACE Subr. Id. Subroutine tracing.
286  ! EXTCDE Subr. Id. Program abort.
287  ! WWDATE Subr. Id. System date.
288  ! WWTIME Subr. Id. System time.
289  ! DSEC21 Func. W3TIMEMD Compute time difference.
290  ! TICK21 Func. Id. Advance the clock.
291  ! STME21 Func. Id. Print the time readable.
292  ! PRTBLK Func. W3ARRYMD Print plot of array.
293  ! W3IOGR Subr. W3IOGRMD Read/write model definition file.
294  ! W3IORS Subr. W3IORSMD Read/write restart file.
295  ! W3IOPP Subr. W3IOPOMD Preprocess point output.
296  ! CALL MPI_COMM_SIZE, CALL MPI_COMM_RANK
297  ! Subr. mpif.h Standard MPI routines.
298  ! ----------------------------------------------------------------
299  !
300  ! 5. Called by :
301  !
302  ! Any program shell or integrated model which uses WAVEWATCH III.
303  !
304  ! 6. Error messages :
305  !
306  ! On opening of log file only. Other error messages are generated
307  ! by W3IOGR and W3IORS.
308  !
309  ! 7. Remarks :
310  !
311  ! - The log file is called 'log.FEXT', where FEXT is passed to
312  ! the routine.
313  ! - The test output file is called 'test.FEXT' in shared memory
314  ! version or testNNN.FEXT in distributed memory version.
315  ! - A water level and ice coverage are transferred with the
316  ! restart file. To assure consistency within the model, the
317  ! water level and ice coverage are re-evaluated at the 0th
318  ! time step in the actual wave model routine.
319  ! - When running regtests in cases where disk is non-local
320  ! (i.e. NFS used), there can be a huge improvment in compute
321  ! time by using /var/tmp/ for log files.
322  ! See commented line at "OPEN (MDS(1),FILE=..."
323  !
324  ! 8. Structure :
325  !
326  ! ----------------------------------------------------
327  ! 1. Set-up of idata structures and I/O.
328  ! a Point to proper data structures.
329  ! b Number of processors and processor number.
330  ! c Open files.
331  ! d Dataset unit numbers
332  ! e Subroutine tracing
333  ! f Initial and test outputs
334  ! 2. Model definition.
335  ! a Read model definition file ( W3IOGR )
336  ! b Save MAPSTA.
337  ! c MPP preparation
338  ! 3. Model initialization.
339  ! a Read restart file. ( W3IORS )
340  ! b Compare grid and restart MAPSTA.
341  ! c Initialize with winds if requested (set flag).
342  ! d Initialize calm conditions if requested.
343  ! e Preparations for prop. scheme.
344  ! 4. Set-up output times.
345  ! a Unpack ODAT.
346  ! b Check if output available.
347  ! c Get first time per output and overall.
348  ! d Prepare point output ( W3IOPP )
349  ! 5. Define wavenumber grid.
350  ! a Calculate depth.
351  ! b Fill wavenumber and group velocity arrays.
352  ! 6. Initialize arrays.
353  ! 7. Write info to log file.
354  ! 8. Final MPI set up ( W3MPII , W3MPIO , W3MPIP )
355  ! ----------------------------------------------------
356  !
357  ! 9. Switches :
358  !
359  ! !/SHRD Switch for shared / distributed memory architecture.
360  ! !/DIST Id.
361  ! !/MPI Id.
362  !
363  ! !/S Enable subroutine tracing.
364  ! !/Tn Enable test output.
365  !
366  ! 10. Source code :
367  !
368  !/ ------------------------------------------------------------------- /
369  use w3servmd, only : print_memcheck
370 
371  USE constants
372  !/
373  USE w3gdatmd, ONLY: w3setg, rstype
374  USE w3wdatmd, ONLY: w3setw, w3dimw
375  USE w3adatmd, ONLY: w3seta, w3dima
376  USE w3idatmd, ONLY: w3seti, w3dimi
377  USE w3odatmd, ONLY: w3seto, w3dmo5
378  USE w3iogomd, ONLY: w3flgrdupdt
379  USE w3iogrmd, ONLY: w3iogr
380  USE w3iorsmd, ONLY: w3iors
381  USE w3iopomd, ONLY: w3iopp
382  USE w3servmd, ONLY: itrace, extcde, wwdate, wwtime
383 #ifdef W3_S
384  USE w3servmd, ONLY: strace
385 #endif
386  USE w3timemd, ONLY: dsec21, tick21, stme21
387  USE w3arrymd, ONLY: prtblk
388  !/
389  USE w3gdatmd, ONLY: nx, ny, nsea, nseal, mapsta, mapst2, mapfs, &
390  mapsf, flagll, &
391  iclose, zb, trnx, trny, dmin, dtcfl, dtmax, &
392  flck, nk, nth, nspec, sig, gname
393 #ifdef W3_PDLIB
395 #endif
396  USE w3wdatmd, ONLY: time, tlev, tice, trho, wlv, ust, ustdir, va
397  USE w3odatmd, ONLY: ndso, ndse, ndst, screen, nds, ntproc, &
401  flout, flogrd, flbpo, nopts, ptnme, &
403  outpts, fnmpre, ix0, ixn, ixs, iy0, iyn, &
406 #ifdef W3_NL5
407  USE w3odatmd, ONLY: tosnl5
408 #endif
409  USE w3adatmd, ONLY: nsealm, iappro, flcold, fliwnd, dw, cg, wn, &
410  ua, ud, u10, u10d, as
411 #ifdef W3_MPI
413 #endif
414  USE w3idatmd, ONLY: fllev, flcur, flwind, flice, fltaua, flrhoa,&
415  flmdn, flmth, flmvs, flic1, flic2, flic3, &
416  flic4, flic5
417  USE w3dispmd, ONLY: wavnu1, wavnu3
418  USE w3parall, ONLY: set_up_nseal_nsealm
419 #ifdef W3_PDLIB
421  use yownodepool, only: npa
422  use yowrankmodule, only : rank
423 #endif
424  USE w3gdatmd, ONLY: gtype, ungtype
425 #ifdef W3_PDLIB
428  use yowdatapool, only: istatus
429 #endif
430 #ifdef W3_SETUP
431  USE w3wavset, ONLY : preparation_fd_scheme
432  USE w3wdatmd, ONLY: zeta_setup
433  USE w3gdatmd, ONLY : do_change_wlv
434 #endif
437  USE w3gdatmd, ONLY: fsrefraction, fsfreqshift
439 #ifdef W3_TIMINGS
440  USE w3parall, ONLY: print_my_time
441 #endif
442 #if defined W3_PDLIB && defined W3_DEBUGCOH
444 #endif
445 #if defined W3_PDLIB && defined W3_DEBUGINIT
447 #endif
448 #ifdef W3_UOST
449  USE w3uostmd, ONLY: uost_setgrid
450 #endif
451  !/
452 #ifdef W3_MPI
453  include "mpif.h"
454 #endif
455  !/
456  !/ ------------------------------------------------------------------- /
457  !/ Parameter list
458  !/
459  INTEGER, INTENT(IN) :: IMOD, MDS(15), MTRACE(2), &
460  ODAT(40),NPT, IPRT(6),&
461  MPI_COMM
462  LOGICAL, INTENT(IN) :: IsMulti
463  REAL, INTENT(INOUT) :: XPT(NPT), YPT(NPT)
464  LOGICAL, INTENT(INOUT) :: FLGRD(NOGRP,NGRPP), FLGD(NOGRP),&
465  FLGR2(NOGRP,NGRPP), FLG2(NOGRP),&
466  PRTFRM
467  CHARACTER, INTENT(IN) :: FEXT*(*)
468  CHARACTER(LEN=40), INTENT(IN) :: PNAMES(NPT)
469  LOGICAL, INTENT(IN), OPTIONAL :: FLAGSTIDEIN(4)
470  INTEGER :: NSEALout, NSEALMout
471  !/
472  !/ ------------------------------------------------------------------- /
473  !/ Local parameters
474  !/
475  integer :: IRANK, I, ISTAT
476  INTEGER :: IE, IFL, IFT, IERR, NTTOT, NTLOC, &
477  NTTARG, IK, IP, ITH, IX, IY, &
478  J, J0, TOUT(2), TLST(2), ISEA, IS, &
479  K, I1, I2, JSEA, NTTMAX
480 #ifdef W3_DIST
481  INTEGER :: ISTEP, ISP, IW
482 #endif
483 #ifdef W3_MPI
484  INTEGER :: IERR_MPI, BGROUP, LGROUP
485 #endif
486 #ifdef W3_S
487  INTEGER, SAVE :: IENT = 0
488 #endif
489 #ifdef W3_T
490  INTEGER :: NX0, NXN
491  INTEGER, ALLOCATABLE :: MAPOUT(:,:)
492 #endif
493 #ifdef W3_MPI
494  INTEGER, ALLOCATABLE :: TMPRNK(:)
495 #endif
496  INTEGER, ALLOCATABLE :: NT(:), MAPTST(:,:)
497 #ifdef W3_T
498  INTEGER, SAVE :: NXS = 49
499 #endif
500  REAL :: DTTST, DEPTH, FRACOS
501  REAL :: FACTOR
502  REAL :: WLVeff
503 #ifdef W3_T
504  REAL, ALLOCATABLE :: XOUT(:,:)
505 #endif
506  LOGICAL :: OPENED
507  CHARACTER(LEN=8) :: STTIME
508  CHARACTER(LEN=10) :: STDATE
509  INTEGER :: ISPROC
510 #ifdef W3_DIST
511  CHARACTER(LEN=12) :: FORMAT
512 #endif
513  CHARACTER(LEN=23) :: DTME21
514  CHARACTER(LEN=30) :: LFILE, TFILE
515 #ifdef W3_PDLIB
516  INTEGER :: IScal(1), IPROC
517 #endif
518  integer :: memunit
519  !/
520  !/ ------------------------------------------------------------------- /
521  !
522  ! 1. Set-up of data structures and I/O ----------------------------- /
523  ! 1.a Point to proper data structures.
524 
525  CALL w3seto ( imod, mds(2), mds(3) )
526 
527  memunit = 10000+iaproc
528  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 1a')
529 
530  CALL w3setg ( imod, mds(2), mds(3) )
531  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 1b')
532 
533  CALL w3setw ( imod, mds(2), mds(3) )
534  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 1c')
535 
536  CALL w3seta ( imod, mds(2), mds(3) )
537  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 1d')
538 
539  CALL w3seti ( imod, mds(2), mds(3) )
540 #ifdef W3_UOST
541  CALL uost_setgrid(imod)
542 #endif
543 #ifdef W3_TIMINGS
544  CALL print_my_time("Case 2")
545 #endif
546  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 1e')
547  !
548  !
549  ! 1.b Number of processors and processor number.
550  ! Overwrite some initializations from W3ODATMD.
551  !
552  ! *******************************************************
553  ! *** NOTE : OUTPUT PROCESSOR ASSIGNMENT NEEDS TO BE ***
554  ! *** CONSISTENT WITH ASSIGNMENT IN WMINIT. ***
555  ! *******************************************************
556  !
557 #ifdef W3_SHRD
558  ntproc = 1
559  naproc = 1
560  iaproc = 1
561  iostyp = 1
562 #endif
563  !
564 #ifdef W3_MPI
565  mpi_comm_wave = mpi_comm
566  CALL mpi_comm_size ( mpi_comm_wave, ntproc, ierr_mpi )
567  naproc = ntproc
568  CALL mpi_comm_rank ( mpi_comm_wave, iaproc, ierr_mpi )
569  iaproc = iaproc + 1
570 #endif
571  memunit = 10000+iaproc
572  !
573  IF ( iostyp .LE. 1 ) THEN
574  !
575  napfld = max(1,naproc-1)
576  nappnt = max(1,naproc-2)
577  naptrk = max(1,naproc-5)
578  naprst = naproc
579  napbpt = max(1,naproc-3)
580  napprt = max(1,naproc-4)
581  !
582  ELSE
583  !
584  nappnt = naproc
585  IF ( unipts .AND. upproc ) naproc = max(1,ntproc - 1)
586  napfld = naproc
587  naprst = naproc
588  napbpt = naproc
589  naptrk = naproc
590  napprt = naproc
591  !
592  IF ( iostyp .EQ. 2 ) THEN
593  naproc = max(1,naproc-1)
594  ELSE IF ( iostyp .EQ. 3 ) THEN
595  !
596  ! For field or coupling output
597  !
598  IF ( odat( 3).GT.0 .OR. odat(33).GT.0 ) THEN
599  napfld = naproc
600  naproc = max(1,naproc-1)
601  END IF
602  IF ( odat(13).GT.0 ) THEN
603  naptrk = naproc
604  naproc = max(1,naproc-1)
605  END IF
606  IF ( odat(28).GT.0 ) THEN
607  napprt = naproc
608  naproc = max(1,naproc-1)
609  END IF
610  IF ( odat( 8).GT.0 ) nappnt = naproc
611  IF ( odat(18).GT.0 ) naprst = naproc
612  IF ( odat(23).GT.0 ) napbpt = naproc
613  IF ( ( odat( 8).GT.0 .OR. odat(18).GT.0 .OR. &
614  odat(23).GT.0 ) ) naproc = max(1,naproc-1)
615  END IF
616  END IF
617  !
618  fracos = 100. * real(ntproc-naproc) / real(ntproc)
619  IF ( fracos.GT.critos .AND. iaproc.EQ.naperr ) WRITE (ndse,8002) fracos
620  !
621 #ifdef W3_MPI
622  IF ( naproc .EQ. ntproc ) THEN
624  ELSE
625  CALL mpi_comm_group ( mpi_comm_wave, bgroup, ierr_mpi )
626  ALLOCATE ( tmprnk(naproc) )
627  DO j=1, naproc
628  tmprnk(j) = j - 1
629  END DO
630  CALL mpi_group_incl ( bgroup, naproc, tmprnk, lgroup, ierr_mpi )
631  CALL mpi_comm_create ( mpi_comm_wave, lgroup, mpi_comm_wcmp, ierr_mpi )
632  CALL mpi_group_free ( lgroup, ierr_mpi )
633  CALL mpi_group_free ( bgroup, ierr_mpi )
634  DEALLOCATE ( tmprnk )
635  END IF
636 #endif
637  !
638  lpdlib = .false.
639 #ifdef W3_PDLIB
640  lpdlib = .true.
641 #endif
642  IF (fstotalimp .and. .NOT. lpdlib) THEN
643  WRITE(ndse,*) 'IMPTOTAL is selected'
644  WRITE(ndse,*) 'But PDLIB is not'
645  CALL flush(ndse)
646  stop
647  ELSE IF (fstotalexp .and. .NOT. lpdlib) THEN
648  WRITE(ndse,*) 'EXPTOTAL is selected'
649  WRITE(ndse,*) 'But PDLIB is not'
650  CALL flush(ndse)
651  stop
652  END IF
653 #ifdef W3_PDLIB
654  IF (b_jgs_block_gauss_seidel .AND. .NOT. b_jgs_use_jacobi) THEN
655  WRITE(ndse,*) 'B_JGS_BLOCK_GAUSS_SEIDEL is used but the Jacobi solver is not choosen'
656  WRITE(ndse,*) .eqv.'Please set JGS_USE_JACOBI .true.'
657  CALL flush(ndse)
658  stop
659  ENDIF
660 #endif
661 
662  !
663  ! 1.c Open files without unpacking MDS ,,,
664  !
665  ie = len_trim(fext)
666  lfile = 'log.' // fext(:ie)
667  ifl = len_trim(lfile)
668 #ifdef W3_SHRD
669  tfile = 'test.' // fext(:ie)
670 #endif
671 #ifdef W3_DIST
672  iw = 1 + int( log10( real(naproc) + 0.5 ) )
673  iw = max( 3 , min( 9 , iw ) )
674  WRITE (FORMAT,'(A5,I1.1,A1,I1.1,A4)') &
675  '(A4,I', iw, '.', iw, ',2A)'
676  WRITE (tfile,format) 'test', &
677  outpts(imod)%IAPROC, '.', fext(:ie)
678 #endif
679  ift = len_trim(tfile)
680  j = len_trim(fnmpre)
681  !
682  IF ( outpts(imod)%IAPROC .EQ. outpts(imod)%NAPLOG ) &
683  OPEN (mds(1), file=fnmpre(:j)//lfile(:ifl),err=888,iostat=ierr)
684  !
685  IF ( mds(3).NE.mds(1) .AND. mds(3).NE.mds(4) .AND. tstout ) THEN
686  INQUIRE (mds(3),opened=opened)
687  IF ( .NOT. opened ) OPEN (mds(3),file=fnmpre(:j)//tfile(:ift), err=889, &
688  iostat=ierr)
689  END IF
690  !
691  ! 1.d Dataset unit numbers
692  !
693  nds = mds
694  ndso = nds(1)
695  ndse = nds(2)
696  ndst = nds(3)
697  screen = nds(4)
698  !
699  ! 1.e Subroutine tracing
700  !
701  CALL itrace ( mtrace(1), mtrace(2) )
702  !
703  ! 1.f Initial and test outputs
704  !
705  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2')
706  !
707  IF ( iaproc .EQ. naplog ) THEN
708  CALL wwdate ( stdate )
709  CALL wwtime ( sttime )
710  WRITE (ndso,900) wwver, stdate, sttime
711  END IF
712  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2a')
713  !
714 #ifdef W3_S
715  CALL strace (ient, 'W3INIT')
716 #endif
717 #ifdef W3_T
718  WRITE(ndst,9000) imod, fext(:ie)
719  WRITE (ndst,9001) ntproc, naproc, iaproc, naplog, napout, &
720  naperr, napfld, nappnt, naptrk, naprst, napbpt, napprt
721  WRITE (ndst,9002) ndso, ndse, ndst, screen
722  WRITE (ndst,9003) lfile(:ifl), tfile(:ift)
723 #endif
724  !
725  ! 2. Model definition ---------------------------------------------- /
726  ! 2.a Read model definition file
727  !
728  CALL w3iogr ( 'READ', nds(5), imod, fext )
729  IF (gtype .eq. ungtype) THEN
730  CALL spatial_grid
731  CALL nvectri
732  CALL coordmax
733 #ifdef W3_PDLIB
734  IF(.false.) THEN
735 #endif
736  CALL area_si(1)
737 #ifdef W3_PDLIB
738  ENDIF
739 #endif
740  ENDIF
741  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2b')
742 #ifdef W3_PDLIB
743  IF (gtype .ne. ungtype) THEN
744 #endif
745 #ifdef W3_SETUP
746  CALL preparation_fd_scheme(imod)
747 #endif
748 #ifdef W3_PDLIB
749  ELSE
750 #endif
751 
752 #ifdef W3_PDLIB
753  CALL pdlib_init(imod)
754 #endif
755  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2c')
756 
757 #ifdef W3_TIMINGS
758  CALL print_my_time("After PDLIB_INIT")
759 #endif
760 
761 #ifdef W3_PDLIB
762  CALL synchronize_ipgl_etc_array(imod, ismulti)
763 #endif
764  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2cc')
765 
766 #ifdef W3_PDLIB
767  END IF
768 #endif
769  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2d')
770 
771  ! Update of output parameter flags based on mod_def parameters (for 3D arrays)
772 
773  CALL w3flgrdupdt ( ndso, ndse, flgrd, flgr2, flgd, flg2 )
774 
775 #ifdef W3_TIMINGS
776  CALL print_my_time("After W3FLGRDUPDT")
777 #endif
778 
779  IF ( flagll ) THEN
780  factor = 1.
781  ELSE
782  factor = 1.e-3
783  END IF
784  IF ( iaproc .EQ. naplog ) WRITE (ndso,920)
785  !
786  ! 2.b Save MAPSTA
787  !
788  ALLOCATE ( maptst(ny,nx) )
789  maptst = mapsta
790  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2e')
791  !
792  !
793  ! 2.c MPP preparation
794  ! 2.c.1 Set simple counters and variables
795  !
796  CALL set_up_nseal_nsealm(nsealout, nsealmout)
797  nseal = nsealout
798  nsealm = nsealmout
799  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2f')
800 #ifdef W3_DIST
801  IF ( nsea .LT. naproc ) GOTO 820
802  IF (lpdlib .eqv. .false.) THEN
803  IF ( nspec .LT. naproc ) GOTO 821
804  END IF
805 #endif
806 
807 #ifdef W3_PDLIB
808  IF ((iaproc .LE. naproc).and.(gtype .eq. ungtype)) THEN
809  CALL block_solver_init(imod)
810  CALL pdlib_iobp_init(imod)
811  CALL set_iobpa_pdlib
812  IF (fstotalexp) THEN
813  CALL block_solver_explicit_init()
814  ENDIF
815  ENDIF
816 #endif
817 
818 #ifdef W3_TIMINGS
819  CALL print_my_time("After BLOCK_SOLVER_INIT")
820 #endif
821  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2g')
822  !
823  !
824  ! 2.c.2 Allocate arrays
825  !
826  IF ( iaproc .LE. naproc ) THEN
827  CALL w3dimw ( imod, ndse, ndst )
828  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2h')
829  ELSE
830  CALL w3dimw ( imod, ndse, ndst, .false. )
831  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2i')
832  END IF
833 #ifdef W3_TIMINGS
834  CALL print_my_time("After W3DIMW")
835 #endif
836  CALL w3dima ( imod, ndse, ndst )
837  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 2j')
838 
839  CALL w3dimi ( imod, ndse, ndst , flagstidein )
840 #ifdef W3_TIMINGS
841  CALL print_my_time("After W3DIMI")
842 #endif
843  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 3')
844  !
845  ! 2.c.3 Calculated expected number of prop. calls per processor
846  !
847  nttot = 0
848  DO ik=1, nk
849  ntloc = 1 + int(dtmax/(dtcfl*sig(ik)/sig(1))-0.001)
850  nttot = nttot + ntloc*nth
851  END DO
852  nttarg = 1 + (nttot-1)/naproc
853  nttarg = nttarg + int(dtmax/(dtcfl*sig(nk)/sig(1))-0.001)
854  nttmax = nttarg + 5
855  !
856  ! 2.c.4 Initialize IAPPRO
857  !
858  iappro = 1
859  ALLOCATE ( nt(nspec) )
860  nt = nttot
861 #ifdef W3_DIST
862  IF (lpdlib .eqv. .false.) THEN
863  !
864  DO
865  !
866  ! 2.c.5 First sweep filling IAPPRO
867  !
868  DO ip=1, naproc
869  istep = ip
870  isp = 0
871  nt(ip) = 0
872  DO j=1, 1+nspec/naproc
873  isp = isp + istep
874  IF ( mod(j,2) .EQ. 1 ) THEN
875  istep = 2*(naproc-ip) + 1
876  ELSE
877  istep = 2*ip - 1
878  END IF
879  IF ( isp .LE. nspec ) THEN
880  ik = 1 + (isp-1)/nth
881  ntloc = 1 + int(dtmax/(dtcfl*sig(ik)/sig(1))-0.001)
882  IF ( nt(ip)+ntloc .LE. nttarg ) THEN
883  iappro(isp) = ip
884  nt(ip) = nt(ip) + ntloc
885  ELSE
886  iappro(isp) = -1
887  END IF
888  END IF
889  END DO
890  END DO
891  !
892  ! 2.c.6 Second sweep filling IAPPRO
893  !
894  DO ip=1, naproc
895  IF ( nt(ip) .LT. nttarg ) THEN
896  DO isp=1, nspec
897  IF ( iappro(isp) .EQ. -1 ) THEN
898  ik = 1 + (isp-1)/nth
899  ntloc = 1 + int(dtmax/(dtcfl*sig(ik)/sig(1))-0.001)
900  IF ( nt(ip)+ntloc .LE. nttarg ) THEN
901  iappro(isp) = ip
902  nt(ip) = nt(ip) + ntloc
903  END IF
904  END IF
905  END DO
906  END IF
907  END DO
908  !
909  ! 2.c.7 Check if all served
910  !
911  IF ( minval(iappro(1:nspec)) .GT. 0 ) THEN
912  EXIT
913  ELSE
914  nttarg = nttarg + 1
915  IF ( nttarg .GE. nttmax ) EXIT
916  IF ( iaproc .EQ. naperr ) WRITE (ndse,8028)
917  END IF
918  !
919  END DO
920  END IF
921 #endif
922  !
923 #ifdef W3_TIMINGS
924  CALL print_my_time("After Case 14")
925 #endif
926  ! 2.c.8 Test output
927  !
928 #ifdef W3_T
929  WRITE (ndst,9020)
930  DO ip=1, naproc
931  WRITE (ndst,9021) ip, nt(ip), nttarg
932  END DO
933  !
934  WRITE (ndst,9025)
935  DO ik=nk, 1, -1
936  WRITE (ndst,9026) ik, (iappro(ith+(ik-1)*nth),ith=1,min(24,nth))
937  IF ( nth .GT. 24 ) WRITE (ndst,9027) (iappro(ith+(ik-1)*nth),ith=25,nth)
938  END DO
939 #endif
940  !
941  ! 2.c.9 Test if any spectral points are left out
942  !
943 #ifdef W3_DIST
944  IF (lpdlib .eqv. .false.) THEN
945  DO isp=1, nspec
946  IF ( iappro(isp) .EQ. -1. ) GOTO 829
947  END DO
948  END IF
949 #endif
950  DEALLOCATE ( nt )
951  !
952  ! 3. Model initialization ------------------------------------------- /
953  ! 3.a Read restart file
954  !
955  va(:,:) = 0.
956 #ifdef W3_DEBUGCOH
957  CALL all_va_integral_print(imod, "Before W3IORS call", 1)
958 #endif
959 #ifdef W3_TIMINGS
960  CALL print_my_time("Before W3IORS")
961 #endif
962  CALL w3iors ( 'READ', nds(6), sig(nk), imod)
963 #ifdef W3_TIMINGS
964  CALL print_my_time("After W3IORS")
965 #endif
966  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 3a')
967 
968 #ifdef W3_DEBUGCOH
969  CALL all_va_integral_print(imod, "After W3IORS call", 1)
970 #endif
971  flcold = rstype.LE.1 .OR. rstype.EQ.4
972  IF ( iaproc .EQ. naplog ) THEN
973  IF (rstype.EQ.0) THEN
974  WRITE (ndso,930) 'cold start (idealized).'
975  ELSE IF ( rstype .EQ. 1 ) THEN
976  WRITE (ndso,930) 'cold start (wind).'
977  ELSE IF ( rstype .EQ. 4 ) THEN
978  WRITE (ndso,930) 'cold start (calm).'
979  ELSE
980  WRITE (ndso,930) 'full restart.'
981  END IF
982  END IF
983 #ifdef W3_DEBUGCOH
984  CALL all_va_integral_print(imod, "W3INIT, step 4.2", 1)
985 #endif
986 #ifdef W3_TIMINGS
987  CALL print_my_time("After restart inits")
988 #endif
989 
990  !
991  ! 3.b Compare MAPSTA from grid and restart
992  !
993  DO ix=1, nx
994  DO iy=1, ny
995  IF ( abs(mapsta(iy,ix)).EQ.2 .OR. &
996  abs(maptst(iy,ix)).EQ.2 ) THEN
997  mapsta(iy,ix) = sign( maptst(iy,ix) , mapsta(iy,ix) )
998  END IF
999  END DO
1000  END DO
1001  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 3b')
1002  !
1003 #ifdef W3_DEBUGCOH
1004  CALL all_va_integral_print(imod, "W3INIT, step 4.3", 1)
1005 #endif
1006  !
1007  ! 3.b2 Set MAPSTA associated to PDLIB
1008  !
1009 #ifdef W3_PDLIB
1010  IF (gtype .eq. ungtype) THEN
1011  CALL pdlib_mapsta_init(imod)
1012  END IF
1013 #endif
1014  !
1015  ! 3.c Initialization from wind fields
1016  !
1017  fliwnd = rstype.EQ.1
1018 #ifdef W3_T
1019  IF ( fliwnd ) WRITE (ndst,9030)
1020 #endif
1021  !
1022  ! 3.d Initialization with calm conditions
1023  !
1024 #ifdef W3_DEBUGCOH
1025  CALL all_va_integral_print(imod, "W3INIT, step 5", 1)
1026 #endif
1027  IF ( rstype .EQ. 4 ) THEN
1028  va(:,:) = 0.
1029 #ifdef W3_T
1030  WRITE (ndst,9031)
1031 #endif
1032  END IF
1033  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 4')
1034  !
1035  ! 3.e Prepare propagation scheme
1036  !
1037  IF ( .NOT. flcur ) flck = .false.
1038 #ifdef W3_PDLIB
1039  IF (fstotalimp .and. fsrefraction) THEN
1040  flcth = .false.
1041  END IF
1042  IF (fstotalimp .and. fsfreqshift) THEN
1043  flck = .false.
1044  END IF
1045 #endif
1046  !
1047  ! 4. Set-up output times -------------------------------------------- *
1048  ! 4.a Unpack ODAT
1049  !
1050  DO j=1, notype
1051  j0 = (j-1)*5
1052  tonext(1,j) = odat(j0+1)
1053  tonext(2,j) = odat(j0+2)
1054  dtout( j) = real( odat(j0+3) )
1055  tolast(1,j) = odat(j0+4)
1056  tolast(2,j) = odat(j0+5)
1057  END DO
1058  !
1059  ! J=8, second stream of restart files
1060  j=8
1061  j0 = (j-1)*5
1062  IF(odat(j0+1) .NE. 0) THEN
1063  tonext(1,j) = odat(j0+1)
1064  tonext(2,j) = odat(j0+2)
1065  dtout( j) = real( odat(j0+3) )
1066  tolast(1,j) = odat(j0+4)
1067  tolast(2,j) = odat(j0+5)
1068  flout(8) = .true.
1069  ELSE
1070  flout(8) = .false.
1071  END IF
1072  !
1073  ! 4.b Check if output available
1074  !
1075  flout(1) = .false.
1076  flogrd = flgrd
1077  flogd = flgd
1078  DO j=1, nogrp
1079  DO k=1, ngrpp
1080  flout(1) = flout(1) .OR. flogrd(j,k)
1081  END DO
1082  END DO
1083 #ifdef W3_DEBUGCOH
1084  CALL all_va_integral_print(imod, "W3INIT, step 6", 1)
1085 #endif
1086  !
1087  flout(7) = .false.
1088  flogr2 = flgr2
1089  flog2 = flg2
1090  DO j=1, nogrp
1091  DO k=1, ngrpp
1092  flout(7) = flout(7) .OR. flogr2(j,k)
1093  END DO
1094  END DO
1095  !
1096  flout(2) = npt .GT. 0
1097  !
1098  flout(3) = .true.
1099  !
1100  flout(4) = .true.
1101  !
1102  flout(5) = flbpo
1103  IF ( flbpo ) THEN
1104  CALL w3dmo5 ( imod, ndse, ndst, 4 )
1105  ELSE
1106  dtout(5) = 0.
1107  END IF
1108  !
1109  ix0 = max( 1, iprt(1) )
1110  ixn = min( nx, iprt(2) )
1111  ixs = max( 1, iprt(3) )
1112  iy0 = max( 1, iprt(4) )
1113  iyn = min( ny, iprt(5) )
1114  iys = max( 1, iprt(6) )
1115  flform = prtfrm
1116  flout(6) = ix0.LE.ixn .AND. iy0.LE.iyn
1117  !
1118  ! 4.c Get first time per output and overall.
1119  !
1120  tofrst(1) = -1
1121  tofrst(2) = 0
1122  !
1123  ! WRITE(*,*) 'We set NOTYPE=0 just for DEBUGGING'
1124  ! NOTYPE=0 ! ONLY FOR DEBUGGING PURPOSE
1125 #ifdef W3_DEBUGCOH
1126  CALL all_va_integral_print(imod, "W3INIT, step 7", 1)
1127 #endif
1128 #ifdef W3_TIMINGS
1129  CALL print_my_time("Before NOTYPE loop")
1130 #endif
1131  DO j=1, notype
1132  !
1133  ! ... check time step
1134  !
1135  dtout(j) = max( 0. , dtout(j) )
1136  flout(j) = flout(j) .AND. ( dtout(j) .GT. 0.5 )
1137  !
1138  ! ... get first time
1139  !
1140  IF ( flout(j) ) THEN
1141 #ifdef W3_NL5
1142  IF (j .EQ. 2) tosnl5 = tonext(:, 2)
1143 #endif
1144  tout = tonext(:,j)
1145  tlst = tolast(:,j)
1146  !
1147  DO
1148  dttst = dsec21( time , tout )
1149  IF ( ( j.NE.4 .AND. dttst.LT.0. ) .OR. &
1150  ( j.EQ.4 .AND. dttst.LE.0. ) ) THEN
1151  CALL tick21 ( tout, dtout(j) )
1152  ELSE
1153  EXIT
1154  END IF
1155  END DO
1156  !
1157  ! ... reset first time
1158  !
1159  tonext(:,j) = tout
1160  !
1161  ! ... check last time
1162  !
1163  dttst = dsec21( tout , tlst )
1164  IF ( dttst.LT.0.) flout(j) = .false.
1165  !
1166  ! ... check overall first time
1167  !
1168  IF ( flout(j) ) THEN
1169  IF ( tofrst(1).EQ.-1 ) THEN
1170  tofrst = tout
1171  ELSE
1172  dttst = dsec21( tout , tofrst )
1173  IF ( dttst.GT.0.) THEN
1174  tofrst = tout
1175  END IF
1176  END IF
1177  END IF
1178  !
1179  END IF
1180  !
1181  END DO
1182  !
1183  ! J=8, second stream of restart files
1184  !
1185  j=8
1186  !
1187  ! ... check time step
1188  !
1189  dtout(j) = max( 0. , dtout(j) )
1190  flout(j) = flout(j) .AND. ( dtout(j) .GT. 0.5 )
1191  !
1192  ! ... get first time
1193  !
1194  IF ( flout(j) ) THEN
1195  tout = tonext(:,j)
1196  tlst = tolast(:,j)
1197  !
1198  DO
1199  dttst = dsec21( time , tout )
1200  IF ( ( j.NE.4 .AND. dttst.LT.0. ) .OR. &
1201  ( j.EQ.4 .AND. dttst.LE.0. ) ) THEN
1202  CALL tick21 ( tout, dtout(j) )
1203  ELSE
1204  EXIT
1205  END IF
1206  END DO
1207  !
1208  ! ... reset first time
1209  !
1210  tonext(:,j) = tout
1211  !
1212  ! ... check last time
1213  !
1214  dttst = dsec21( tout , tlst )
1215  IF ( dttst.LT.0.) flout(j) = .false.
1216  !
1217  ! ... check overall first time
1218  !
1219  IF ( flout(j) ) THEN
1220  IF ( tofrst(1).EQ.-1 ) THEN
1221  tofrst = tout
1222  ELSE
1223  dttst = dsec21( tout , tofrst )
1224  IF ( dttst.GT.0.) THEN
1225  tofrst = tout
1226  END IF
1227  END IF
1228  END IF
1229  !
1230  END IF
1231  ! END J=8
1232  !
1233  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 5')
1234 #ifdef W3_TIMINGS
1235  CALL print_my_time("After NOTYPE loop")
1236 #endif
1237 #ifdef W3_DEBUGCOH
1238  CALL all_va_integral_print(imod, "W3INIT, step 8.1", 1)
1239 #endif
1240  !
1241  ! 4.d Preprocessing for point output.
1242  !
1243  IF ( flout(2) ) CALL w3iopp ( npt, xpt, ypt, pnames, imod )
1244 #ifdef W3_PDLIB
1245  CALL deallocate_pdlib_global(imod)
1246 #endif
1247  !
1248 #ifdef W3_T
1249  WRITE (ndst,9040)
1250  DO j=1, 5
1251  WRITE (ndst,9041) tonext(1,j),tonext(2,j),dtout(j),flout(j)
1252  END DO
1253  WRITE (ndst,9042)
1254  WRITE (ndst,9043) tofrst
1255 #endif
1256  !
1257  ! 5. Define wavenumber grid ----------------------------------------- *
1258  ! 5.a Calculate depth
1259  !
1260 #ifdef W3_T
1261  ALLOCATE ( mapout(nx,ny), xout(nx,ny) )
1262  xout = -1.
1263 #endif
1264  !
1265  maptst = mod(mapst2/2,2)
1266  mapst2 = mapst2 - 2*maptst
1267 
1268  !
1269  !Li For multi-resolution SMC grid, these 1-NX and 1-NY nested loops
1270  !Li may miss the refined cells as they are not 1-1 corresponding to
1271  !Li the (Nx,NY) regular grid. The loop is now modified to run over
1272  !Li full NSEA points. JGLi24Jan2012
1273  !Li DO IY=1, NY
1274  !Li DO IX=1, NX
1275  !Li ISEA = MAPFS(IY,IX)
1276 #ifdef W3_DEBUGSTP
1277  max_val = 0
1278  min_val = 0
1279 #endif
1280  DO isea=1, nsea
1281  ix = mapsf(isea,1)
1282  iy = mapsf(isea,2)
1283 #ifdef W3_T
1284  mapout(ix,iy) = mapsta(iy,ix)
1285 #endif
1286  !Li IF ( ISEA .NE. 0) THEN
1287  wlveff=wlv(isea)
1288 #ifdef W3_SETUP
1289  IF (do_change_wlv) THEN
1290  wlveff=wlveff + zeta_setup(isea)
1291  END IF
1292 #endif
1293 #ifdef W3_DEBUGSTP
1294  max_val = max(max_val, wlveff)
1295  min_val = min(min_val, wlveff)
1296 #endif
1297  dw(isea) = max( 0. , wlveff-zb(isea) )
1298 #ifdef W3_T
1299  xout(ix,iy) = dw(isea)
1300 #endif
1301  IF ( wlveff-zb(isea) .LE.0. ) THEN
1302  maptst(iy,ix) = 1
1303  mapsta(iy,ix) = -abs(mapsta(iy,ix))
1304  END IF
1305  !Li END IF
1306  END DO
1307  !Li END DO
1308 #ifdef W3_DEBUGSTP
1309  WRITE(740+iaproc,*) 'w3initmd 1: max/min(WLVeff)=', max_val, min_val
1310  FLUSH(740+iaproc)
1311  max_val = 0
1312  min_val = 0
1313 #endif
1314  DO jsea=1, nseal
1315  CALL init_get_isea(isea, jsea)
1316  wlveff=wlv(isea)
1317 #ifdef W3_SETUP
1318  IF (do_change_wlv) THEN
1319  wlveff=wlveff + zeta_setup(isea)
1320  END IF
1321 #endif
1322 #ifdef W3_DEBUGSTP
1323  max_val = max(max_val, wlveff)
1324  min_val = min(min_val, wlveff)
1325 #endif
1326  dw(isea) = max( 0. , wlveff-zb(isea) )
1327  IF ( wlveff-zb(isea) .LE.0. ) THEN
1328  va(:,jsea) = 0.
1329  END IF
1330  END DO
1331 #ifdef W3_DEBUGSTP
1332  WRITE(740+iaproc,*) 'w3initmd 2: max/min(WLVeff)=', max_val, min_val
1333  FLUSH(740+iaproc)
1334 #endif
1335  !
1336 #ifdef W3_PDLIB
1337  IF ( iaproc .LE. naproc ) THEN
1338  CALL set_iobdp_pdlib
1339  ENDIF
1340 #endif
1341 
1342  !
1343 #ifdef W3_DEBUGCOH
1344  CALL all_va_integral_print(imod, "W3INIT, step 8.2", 1)
1345 #endif
1346 
1347  !
1348  mapst2 = mapst2 + 2*maptst
1349  !
1350  DEALLOCATE ( maptst )
1351  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 6')
1352  !
1353 #ifdef W3_T
1354  WRITE (ndst,9050)
1355  nx0 = 1
1356  DO
1357  nxn = min( nx0+nxs-1 , nx )
1358  CALL prtblk (ndst, nx, ny, nx, xout, mapout, 0, 0., nx0, nxn, 1, 1, &
1359  ny, 1, 'Depth', 'm')
1360  IF ( nxn .NE. nx ) THEN
1361  nx0 = nx0 + nxs
1362  ELSE
1363  EXIT
1364  END IF
1365  END DO
1366  DEALLOCATE ( mapout, xout )
1367 #endif
1368 #ifdef W3_TIMINGS
1369  CALL print_my_time("Before section 5.b")
1370 #endif
1371  !
1372  ! 5.b Fill wavenumber and group velocity arrays.
1373  !
1374  DO is=0, nsea
1375  IF (is.GT.0) THEN
1376  depth = max( dmin , dw(is) )
1377  ELSE
1378  depth = dmin
1379  END IF
1380  !
1381 #ifdef W3_T1
1382  WRITE (ndst,9051) is, depth
1383 #endif
1384  !
1385  DO ik=0, nk+1
1386  !
1387  ! Calculate wavenumbers and group velocities.
1388 #ifdef W3_PDLIB
1389  CALL wavnu3(sig(ik),depth,wn(ik,is),cg(ik,is))
1390 #else
1391  CALL wavnu1(sig(ik),depth,wn(ik,is),cg(ik,is))
1392 #endif
1393  !
1394 #ifdef W3_T1
1395  WRITE (ndst,9052) ik, tpi/sig(ik), wn(ik,is), cg(ik,is)
1396 #endif
1397  !
1398  END DO
1399  END DO
1400 
1401  !
1402  ! 6. Initialize arrays ---------------------------------------------- /
1403  ! Some initialized in W3IORS
1404  !
1405  ua = 0.
1406  ud = 0.
1407  u10 = 0.
1408  u10d = 0.
1409  !
1410  as = undef
1411  !
1412  as(0) = 0.
1413  dw(0) = 0.
1414  !
1415  ! 7. Write info to log file ----------------------------------------- /
1416  !
1417  IF ( iaproc .EQ. naplog ) THEN
1418  !
1419  WRITE (ndso,970) gname
1420  IF ( fllev ) WRITE (ndso,971) 'Prescribed'
1421  IF (.NOT. fllev ) WRITE (ndso,971) 'No'
1422  IF ( flcur ) WRITE (ndso,972) 'Prescribed'
1423  IF (.NOT. flcur ) WRITE (ndso,972) 'No'
1424  IF ( flwind ) WRITE (ndso,973) 'Prescribed'
1425  IF (.NOT. flwind) WRITE (ndso,973) 'No'
1426  IF ( flice ) WRITE (ndso,974) 'Prescribed'
1427  IF (.NOT. flice ) WRITE (ndso,974) 'No'
1428  IF ( fltaua ) WRITE (ndso,988) 'Prescribed'
1429  IF (.NOT. fltaua) WRITE (ndso,988) 'No'
1430  IF ( flrhoa ) WRITE (ndso,989) 'Prescribed'
1431  IF (.NOT. flrhoa) WRITE (ndso,989) 'No'
1432  !
1433  IF ( flmdn ) WRITE (ndso,9972) 'Prescribed'
1434  IF (.NOT. flmdn ) WRITE (ndso,9972) 'No'
1435  IF ( flmth ) WRITE (ndso,9971) 'Prescribed'
1436  IF (.NOT. flmth ) WRITE (ndso,9971) 'No'
1437  IF ( flmvs ) WRITE (ndso,9970) 'Prescribed'
1438  IF (.NOT. flmvs ) WRITE (ndso,9970) 'No'
1439 
1440  IF ( flic1 ) WRITE (ndso,9973) 'Prescribed'
1441  IF (.NOT. flic1 ) WRITE (ndso,9973) 'No'
1442  IF ( flic2 ) WRITE (ndso,9974) 'Prescribed'
1443  IF (.NOT. flic2 ) WRITE (ndso,9974) 'No'
1444  IF ( flic3 ) WRITE (ndso,9975) 'Prescribed'
1445  IF (.NOT. flic3 ) WRITE (ndso,9975) 'No'
1446  IF ( flic4 ) WRITE (ndso,9976) 'Prescribed'
1447  IF (.NOT. flic4 ) WRITE (ndso,9976) 'No'
1448  IF ( flic5 ) WRITE (ndso,9977) 'Prescribed'
1449  IF (.NOT. flic5 ) WRITE (ndso,9977) 'No'
1450 
1451  IF ( flout(1) ) THEN
1452  WRITE (ndso,975)
1453  DO j=1,nogrp
1454  DO k=1,ngrpp
1455  IF ( flogrd(j,k) ) WRITE (ndso,976) idout(j,k)
1456  END DO
1457  END DO
1458  END IF
1459  !
1460  IF ( flout(7) ) THEN
1461  WRITE (ndso,987)
1462  DO j=1,nogrp
1463  DO k=1,ngrpp
1464  IF ( flogr2(j,k) ) WRITE (ndso,976) idout(j,k)
1465  END DO
1466  END DO
1467  END IF
1468  !
1469  IF ( flout(2) ) THEN
1470  WRITE (ndso,977) nopts
1471  IF ( nopts .EQ. 0 ) THEN
1472  WRITE (ndso,978)
1473  ELSE
1474  IF ( flagll ) THEN
1475  WRITE (ndso,979)
1476  ELSE
1477  WRITE (ndso,985)
1478  END IF
1479  DO ip=1, nopts
1480  IF ( flagll ) THEN
1481  WRITE (ndso,980) ip, factor*ptloc(1,ip), factor*ptloc(2,ip), ptnme(ip)
1482  ELSE
1483  WRITE (ndso,986) ip, factor*ptloc(1,ip), factor*ptloc(2,ip), ptnme(ip)
1484  END IF
1485  END DO
1486  END IF
1487  END IF
1488  !
1489  CALL stme21 ( time , dtme21 )
1490  WRITE (ndso,981) dtme21
1491  IF (fllev) THEN
1492  CALL stme21 ( tlev , dtme21 )
1493  WRITE (ndso,982) dtme21
1494  END IF
1495  IF (flice) THEN
1496  CALL stme21 ( tice , dtme21 )
1497  WRITE (ndso,983) dtme21
1498  END IF
1499  IF (flrhoa) THEN
1500  CALL stme21 ( trho , dtme21 )
1501  WRITE (ndso,990) dtme21
1502  END IF
1503  !
1504  WRITE (ndso,984)
1505  !
1506  END IF
1507  !
1508  IF ( nopts .EQ. 0 ) flout(2) = .false.
1509  call print_memcheck(memunit, 'memcheck_____:'//' WW3_INIT SECTION 7 - After allocation of group velocities')
1510  !
1511  ! Boundary set up for the directions
1512  !
1513 #ifdef W3_DEBUGCOH
1514  CALL all_va_integral_print(imod, "W3INIT, step 8.3", 1)
1515 #endif
1516  !
1517  ! 8. Final MPI set up ----------------------------------------------- /
1518  !
1519 #ifdef W3_MPI
1520  CALL w3mpii ( imod )
1521  CALL w3mpio ( imod )
1522  IF ( flout(2) ) CALL w3mpip ( imod )
1523 #endif
1524  !
1525 #ifdef W3_DEBUGINIT
1526  CALL print_wn_statistic("W3INIT leaving")
1527 #endif
1528 #ifdef W3_TIMINGS
1529  CALL print_my_time("Leaving W3INIT")
1530 #endif
1531  RETURN
1532  !
1533  ! Escape locations read errors :
1534  !
1535 #ifdef W3_DIST
1536 820 CONTINUE
1537  IF ( iaproc .EQ. naperr ) WRITE (ndse,8020) nsea, naproc
1538  CALL extcde ( 820 )
1539  !
1540 821 CONTINUE
1541  IF ( iaproc .EQ. naperr ) WRITE (ndse,8021) nspec, naproc
1542  CALL extcde ( 821 )
1543  !
1544 829 CONTINUE
1545  IF ( iaproc .EQ. naperr ) WRITE (ndse,8029)
1546  CALL extcde ( 829 )
1547 #endif
1548 
1549  !
1550 888 CONTINUE
1551  IF ( iaproc .EQ. naperr ) WRITE (ndse,8000) ierr
1552  CALL extcde ( 1 )
1553  !
1554 889 CONTINUE
1555  ! === no process number filtering for test file !!! ===
1556  WRITE (ndse,8001) ierr
1557  CALL extcde ( 2 )
1558  !
1559  ! Formats
1560  !
1561 900 FORMAT ( ' WAVEWATCH III log file ', &
1562  ' version ',a/ &
1563  ' ==================================', &
1564  '==================================='/ &
1565  50x,'date : ',a10/50x,'time : ',a8)
1566 920 FORMAT (/' Model definition file read.')
1567 930 FORMAT ( ' Restart file read; ',a)
1568  !
1569 970 FORMAT (/' Grid name : ',a)
1570 971 FORMAT (/' ',a,' water levels.')
1571 972 FORMAT ( ' ',a,' curents.')
1572 973 FORMAT ( ' ',a,' winds.')
1573 974 FORMAT ( ' ',a,' ice fields.')
1574 988 FORMAT ( ' ',a,' momentum')
1575 989 FORMAT ( ' ',a,' air density')
1576 9972 FORMAT( ' ',a,' mud density.')
1577 9971 FORMAT( ' ',a,' mud thickness.')
1578 9970 FORMAT( ' ',a,' mud viscosity.')
1579 9973 FORMAT( ' ',a,' ice parameter 1')
1580 9974 FORMAT( ' ',a,' ice parameter 2')
1581 9975 FORMAT( ' ',a,' ice parameter 3')
1582 9976 FORMAT( ' ',a,' ice parameter 4')
1583 9977 FORMAT( ' ',a,' ice parameter 5')
1584  !
1585 975 FORMAT (/' Gridded output fields : '/ &
1586  '--------------------------------------------------')
1587 976 FORMAT ( ' ',a)
1588  !
1589 977 FORMAT (/' Point output requested for',i6,' points : '/ &
1590  '------------------------------------------')
1591 978 FORMAT (/' Point output disabled')
1592 979 FORMAT &
1593  (/' point | longitude | latitude | name '/ &
1594  ' --------|-------------|-------------|----------------')
1595 985 FORMAT &
1596  (/' point | X | Y | name '/ &
1597  ' --------|-------------|-------------|----------------')
1598 980 FORMAT ( 5x,i5,' |',2(f10.2,' |'),2x,a)
1599 986 FORMAT ( 5x,i5,' |',2(f8.1,'E3 |'),2x,a)
1600  !
1601 981 FORMAT (/' Initial time : ',a)
1602 982 FORMAT ( ' Water level time : ',a)
1603 983 FORMAT ( ' Ice field time : ',a)
1604 990 FORMAT ( ' Air density time : ',a)
1605  !
1606 984 FORMAT (// &
1607  37x,' | input | output |'/ &
1608  37x,' |-----------------------|------------------|'/ &
1609  2x,' step | pass | date time |', &
1610  ' b w l c t r i i1 i5 d | g p t r b f c r2 |'/ &
1611  2x,'--------|------|---------------------|', &
1612  '-----------------------|------------------|'/ &
1613  2x,'--------+------+---------------------+', &
1614  '---------------------------+--------------+')
1615 987 FORMAT (/' Coupling output fields : '/ &
1616  '--------------------------------------------------')
1617  !
1618 8000 FORMAT (/' *** WAVEWATCH III ERROR IN W3INIT : '/ &
1619  ' ERROR IN OPENING LOG FILE'/ &
1620  ' IOSTAT =',i5/)
1621 8001 FORMAT (/' *** WAVEWATCH III ERROR IN W3INIT : '/ &
1622  ' ERROR IN OPENING TEST FILE'/ &
1623  ' IOSTAT =',i5/)
1624 8002 FORMAT (/' *** WAVEWATCH III WARNING IN W3INIT : '/ &
1625  ' SIGNIFICANT PART OF RESOURCES RESERVED FOR', &
1626  ' OUTPUT :',f6.1,'%'/)
1627 #ifdef W3_DIST
1628 8020 FORMAT (/' *** WAVEWATCH III ERROR IN W3INIT : '/ &
1629  ' NUMBER OF SEA POINTS LESS THAN NUMBER OF PROC.'/ &
1630  ' NSEA, NAPROC =',2i8/)
1631 8021 FORMAT (/' *** WAVEWATCH III ERROR IN W3INIT : '/ &
1632  ' NUMBER OF SPECTRAL POINTS LESS THAN NUMBER OF PROC.'/ &
1633  ' NSPEC, NAPROC =',2i8/)
1634 8028 FORMAT (/' *** WAVEWATCH III WARNING IN W3INIT : '/ &
1635  ' INCREASING TARGET IN MPP PROPAGATION MAP.'/ &
1636  ' IMBALANCE BETWEEN OVERALL AND CFL TIME STEPS'/)
1637 8029 FORMAT (/' *** WAVEWATCH III ERROR IN W3INIT : '/ &
1638  ' SOMETHING WRONG WITH MPP PROPAGATION MAP.'/ &
1639  ' CALL HENDRIK !!!'/)
1640 #endif
1641  !
1642 #ifdef W3_T
1643 9000 FORMAT ( 'TEST W3INIT: MOD. NR. AND FILE EXT.: ',i4,' [',a,']')
1644 9001 FORMAT ( ' NR. OF PROCESSORS : ',3i4/ &
1645  ' ASSIGNED PROCESSORS ',9i4)
1646 9002 FORMAT ( ' DATA SET NUMBERS : ',4i4)
1647 9003 FORMAT ( ' LOG FILE : [',a,']'/ &
1648  ' TEST FILE : [',a,']')
1649  !
1650 9020 FORMAT (' TEST W3INIT : IP, NTTOT, NTTARG :')
1651 9021 FORMAT ( ' ',3i8)
1652 9025 FORMAT (' TEST W3INIT : MPP PROPAGATION MAP SPECTRAL COMP.')
1653 9026 FORMAT (4x,i4,2x,24i4)
1654 9027 FORMAT (10x,24i4)
1655  !
1656 9030 FORMAT (' TEST W3INIT : INITIALIZATION USING WINDS, ', &
1657  'PERFORMED IN W3WAVE')
1658 9031 FORMAT (' TEST W3INIT : STARTING FROM CALM CONDITIONS')
1659  !
1660 9040 FORMAT (' TEST W3INIT : OUTPUT DATA, FIRST TIME, STEP, FLAG')
1661 9041 FORMAT (' ',i9.8,i7.6,f8.1,3x,l1)
1662 9042 FORMAT (' TEST W3INIT : FIRST TIME :')
1663 9043 FORMAT (' ',i9.8,i7.6)
1664  !
1665 9050 FORMAT (' TEST W3INIT : INITIAL DEPTHS')
1666 #endif
1667 #ifdef W3_T1
1668 9051 FORMAT (' TEST W3INIT : ISEA =',i6,' DEPTH =',f7.1, &
1669  ' IK, T, K, CG :')
1670 9052 FORMAT (' ',i3,f8.2,f8.4,f8.2)
1671 #endif
1672  !/
1673  !/ End of W3INIT ----------------------------------------------------- /
1674  !/
1675  END SUBROUTINE w3init
1676  !/ ------------------------------------------------------------------- /
1690  SUBROUTINE w3mpii ( IMOD )
1691  !/
1692  !/ +-----------------------------------+
1693  !/ | WAVEWATCH III NOAA/NCEP |
1694  !/ | H. L. Tolman |
1695  !/ | FORTRAN 90 |
1696  !/ | Last update : 11-May-2007 |
1697  !/ +-----------------------------------+
1698  !/
1699  !/ 04-Jan-1999 : Distributed FORTRAN 77 version. ( version 1.18 )
1700  !/ 13-Jan-2000 : Upgrade to FORTRAN 90 ( version 2.00 )
1701  !/ 28-Dec-2004 : Multiple grid version. ( version 3.06 )
1702  !/ Taken out of W3WAVE.
1703  !/ 04-May-2005 : Change to MPI_COMM_WAVE. ( version 3.07 )
1704  !/ 13-Jun-2006 : Splitting STORE in G/SSTORE. ( version 3.09 )
1705  !/ 11-May-2007 : Adding NTPROC/NAPROC separation. ( version 3.11 )
1706  !/
1707  ! 1. Purpose :
1708  !
1709  ! Perform initializations for MPI version of model.
1710  ! Data transpose only.
1711  !
1712  ! 2. Method :
1713  !
1714  ! Some derived data types are defined. All communiction in
1715  ! W3GATH, W3SCAT and W3WAVE are initialized so that all
1716  ! communication can be performed with single MPI_STARTALL,
1717  ! MPI_TESTALL and MPI_WAITALL calls.
1718  !
1719  ! 3. Parameters :
1720  !
1721  ! Parameter list
1722  ! ----------------------------------------------------------------
1723  ! IMOD Int. I Model number.
1724  ! ----------------------------------------------------------------
1725  !
1726  ! 4. Subroutines used :
1727  !
1728  ! Name Type Module Description
1729  ! ----------------------------------------------------------------
1730  ! STRACE Subr. W3SERVMD Subroutine tracing.
1731  !
1732  ! MPI_TYPE_VECTOR, MPI_TYPE_COMMIT
1733  ! Subr. mpif.h MPI derived data type routines.
1734  !
1735  ! MPI_SEND_INIT, MPI_RECV_INIT
1736  ! Subr. mpif.h MPI persistent communication calls.
1737  ! ----------------------------------------------------------------
1738  !
1739  ! 5. Called by :
1740  !
1741  ! Name Type Module Description
1742  ! ----------------------------------------------------------------
1743  ! W3INIT Subr. W3INITMD Wave model initialization routine.
1744  ! ----------------------------------------------------------------
1745  !
1746  ! 6. Error messages :
1747  !
1748  ! None.
1749  !
1750  ! 7. Remarks :
1751  !
1752  ! - Basic MPP set up partially performed in W3INIT.
1753  ! - Each processor has to be able to send out individual error
1754  ! messages in this routine !
1755  ! - No testing on IMOD, since only called by W3INIT.
1756  ! - In version 3.09 STORE was split into a send and receive
1757  ! buffer, to avoid/reduce possible conflicts between the FORTRAN
1758  ! and MPI standards when a gather is posted in a given buffer
1759  ! right after a send is completed.
1760  !
1761  ! 8. Structure :
1762  !
1763  ! See source code.
1764  !
1765  ! 9. Switches :
1766  !
1767  ! !/SHRD Switch for shared / distributed memory architecture.
1768  ! !/DIST Id.
1769  ! !/MPI MPI communication calls.
1770  !
1771  ! !/S Subroutine tracing,
1772  ! !/T Test output, general.
1773  ! !/MPIT Test output, MPI communications details.
1774  !
1775  ! 10. Source code :
1776  !
1777  !/ ------------------------------------------------------------------- /
1778  !
1779 #ifdef W3_S
1780  USE w3servmd, ONLY: strace
1781 #endif
1782  !
1783  USE w3gdatmd, ONLY: nsea
1784  USE w3adatmd, ONLY: nsealm
1785  USE w3gdatmd, ONLY: gtype, ungtype
1786  USE constants, ONLY: lpdlib
1787 #ifdef W3_MPI
1788  USE w3gdatmd, ONLY: nspec
1789  USE w3wdatmd, ONLY: va
1790  USE w3adatmd, ONLY: mpi_comm_wave, ww3_field_vec, &
1792  nrqsg1, irqsg1, nrqsg2, irqsg2, &
1793  gstore, sstore, mpibuf, bstat, &
1795 #endif
1796  USE w3odatmd, ONLY: ndst, naproc, iaproc
1797  !/
1798 #ifdef W3_MPI
1799  include "mpif.h"
1800 #endif
1801  !/
1802  !/ ------------------------------------------------------------------- /
1803  !/ Parameter list
1804  !/
1805  INTEGER, INTENT(IN) :: IMOD
1806  !/
1807  !/ ------------------------------------------------------------------- /
1808  !/ Local parameters
1809  !/
1810  INTEGER :: NXXXX
1811 #ifdef W3_MPI
1812  INTEGER :: IERR_MPI, ISP, IH, ITARG, &
1813  IERR1, IERR2, IP
1814 #endif
1815 #ifdef W3_S
1816  INTEGER, SAVE :: IENT = 0
1817 #endif
1818  !/
1819  !/ ------------------------------------------------------------------- /
1820  !/
1821 #ifdef W3_S
1822  CALL strace (ient, 'W3MPII')
1823 #endif
1824  !
1825  ! 1. Set up derived data types -------------------------------------- /
1826  !
1827  nxxxx = nsealm * naproc
1828  !
1829 #ifdef W3_MPI
1830  CALL mpi_type_vector ( nsealm, 1, naproc, mpi_real, ww3_field_vec, ierr_mpi )
1831  CALL mpi_type_vector ( nsealm, 1, nspec, mpi_real, ww3_spec_vec, ierr_mpi )
1832  CALL mpi_type_commit ( ww3_field_vec, ierr_mpi )
1833  CALL mpi_type_commit ( ww3_spec_vec, ierr_mpi )
1834 #endif
1835  !
1836 #ifdef W3_MPIT
1837  WRITE (ndst,9010) ww3_field_vec, ww3_spec_vec
1838 #endif
1839  !
1840 #ifdef W3_MPI
1841  IF( iaproc .GT. naproc ) THEN
1842  nsploc = 0
1843  nrqsg1 = 0
1844  nrqsg2 = 0
1845 #endif
1846 #ifdef W3_MPIT
1847  WRITE (ndst,9011)
1848 #endif
1849 #ifdef W3_MPI
1850  RETURN
1851  END IF
1852 #endif
1853  !
1854  ! 2. Set up scatters and gathers for W3WAVE ------------------------- /
1855  ! ( persistent communication calls )
1856  !
1857 #ifdef W3_DIST
1858  IF (lpdlib .eqv. .false.) THEN
1859 #endif
1860 #ifdef W3_MPI
1861  nsploc = 0
1862  DO isp=1, nspec
1863  IF ( iappro(isp) .EQ. iaproc ) nsploc = nsploc + 1
1864  END DO
1865  !
1866  nrqsg1 = nspec - nsploc
1867  ALLOCATE ( wadats(imod)%IRQSG1(max(1,nrqsg1),2) )
1868  irqsg1 => wadats(imod)%IRQSG1
1869  ih = 0
1870 #endif
1871  !
1872 #ifdef W3_MPIT
1873  WRITE (ndst,9021)
1874 #endif
1875 #ifdef W3_MPI
1876  DO isp=1, nspec
1877  IF ( iappro(isp) .NE. iaproc ) THEN
1878  itarg = iappro(isp) - 1
1879  ih = ih + 1
1880  CALL mpi_send_init ( va(isp,1), 1, ww3_spec_vec, itarg, isp, mpi_comm_wave, &
1881  irqsg1(ih,1), ierr1 )
1882  CALL mpi_recv_init ( va(isp,1), 1, ww3_spec_vec, itarg, isp, mpi_comm_wave, &
1883  irqsg1(ih,2), ierr2 )
1884 #endif
1885 #ifdef W3_MPIT
1886  WRITE (ndst,9022) ih, isp, itarg+1, irqsg1(ih,1), ierr1, irqsg1(ih,2), ierr2
1887 #endif
1888 #ifdef W3_MPI
1889  END IF
1890  END DO
1891 #endif
1892 #ifdef W3_MPIT
1893  WRITE (ndst,9023)
1894  WRITE (ndst,9020) nrqsg1
1895 #endif
1896  !
1897  ! 3. Set up scatters and gathers for W3SCAT and W3GATH -------------- /
1898  ! Also set up buffering of data.
1899  !
1900 #ifdef W3_MPI
1901  nrqsg2 = max( 1 , naproc-1 )
1902  ALLOCATE ( wadats(imod)%IRQSG2(nrqsg2*nsploc,2), &
1903  wadats(imod)%GSTORE(naproc*nsealm,mpibuf), &
1904  wadats(imod)%SSTORE(naproc*nsealm,mpibuf) )
1905  nrqsg2 = naproc - 1
1906  !
1907  irqsg2 => wadats(imod)%IRQSG2
1908  gstore => wadats(imod)%GSTORE
1909  sstore => wadats(imod)%SSTORE
1910  !
1911  ih = 0
1912  isploc = 0
1913  ibfloc = 0
1914  wadats(imod)%GSTORE = 0.
1915  wadats(imod)%SSTORE = 0.
1916 #endif
1917  !
1918  ! 3.a Loop over local spectral components
1919  !
1920 #ifdef W3_MPIT
1921  WRITE (ndst,9031)
1922 #endif
1923  !
1924 #ifdef W3_MPI
1925  DO isp=1, nspec
1926  IF ( iappro(isp) .EQ. iaproc ) THEN
1927  !
1928  isploc = isploc + 1
1929  ibfloc = ibfloc + 1
1930  IF ( ibfloc .GT. mpibuf ) ibfloc = 1
1931  !
1932  ! 3.b Loop over non-local processes
1933  !
1934  DO ip=1, naproc
1935  IF ( ip .NE. iaproc ) THEN
1936  !
1937  itarg = ip - 1
1938  ih = ih + 1
1939  !
1940  CALL mpi_recv_init ( wadats(imod)%GSTORE(ip,ibfloc), 1, ww3_field_vec, &
1941  itarg, isp, mpi_comm_wave, irqsg2(ih,1), ierr2 )
1942  CALL mpi_send_init ( wadats(imod)%SSTORE(ip,ibfloc), 1, ww3_field_vec, &
1943  itarg, isp, mpi_comm_wave, irqsg2(ih,2), ierr2 )
1944 #endif
1945 #ifdef W3_MPIT
1946  WRITE (ndst,9032) ih, isp, itarg+1, ibfloc, irqsg2(ih,1), ierr1, &
1947  irqsg2(ih,2), ierr2
1948 #endif
1949  !
1950  ! ... End of loops
1951  !
1952 #ifdef W3_MPI
1953  END IF
1954  END DO
1955  !
1956  END IF
1957  END DO
1958 #endif
1959  !
1960 #ifdef W3_MPIT
1961  WRITE (ndst,9033)
1962  WRITE (ndst,9030) nsploc, nrqsg2, ih
1963 #endif
1964  !
1965  ! 4. Initialize buffer management ----------------------------------- /
1966  !
1967 #ifdef W3_MPI
1968  bstat = 0
1969  bispl = 0
1970  isploc = 0
1971  ibfloc = 0
1972 #endif
1973  !
1974 #ifdef W3_DIST
1975  END IF
1976 #endif
1977  RETURN
1978  !
1979  ! Format statements
1980  !
1981 #ifdef W3_MPIT
1982 9010 FORMAT ( ' TEST W3MPII: DATA TYPES DEFINED'/ &
1983  ' WW3_FIELD_VEC : ',i10/ &
1984  ' WW3_SPEC_VEC : ',i10)
1985 9011 FORMAT ( ' TEST W3MPII: NO COMPUTATIONS ON THIS NODE')
1986 9020 FORMAT ( ' TEST W3MPII: W3WAVE COMM. SET UP FINISHED'/ &
1987  ' NRQSG1 : ',i10)
1988 9021 FORMAT (/' TEST W3MPII: COMMUNICATION CALLS FOR W3WAVE '/ &
1989  ' +------+------+------+--------------+--------------+'/ &
1990  ' | IH | ISP | TARG | SCATTER | GATHER |'/ &
1991  ' | | | | handle err | handle err |'/ &
1992  ' +------+------+------+--------------+--------------+')
1993 9022 FORMAT ( ' |',3(i5,' |'),2(i9,i4,' |'))
1994 9023 FORMAT ( &
1995  ' +------+------+------+--------------+--------------+'/)
1996 9030 FORMAT ( ' TEST W3MPII: GATH/SCAT COMM. SET UP FINISHED'/ &
1997  ' NSPLOC : ',i10/ &
1998  ' NRQSG2 : ',i10/ &
1999  ' TOTAL REQ. : ',i10/)
2000 9031 FORMAT (/' TEST W3MPII: COMM. CALLS FOR W3GATH/W3SCAT '/ &
2001  ' +------+------+------+------+--------------+', &
2002  '--------------+'/ &
2003  ' | IH | ISP | TARG | IBFR | GATHER |', &
2004  ' SCATTER |'/ &
2005  ' | | | | | handle err |', &
2006  ' handle err |'/ &
2007  ' +------+------+------+------+--------------+', &
2008  '--------------+')
2009 9032 FORMAT ( ' |',4(i5,' |'),2(i9,i4,' |'))
2010 9033 FORMAT ( ' +------+------+------+------+--------------+', &
2011  '--------------+'/)
2012 #endif
2013  !/
2014  !/ End of W3MPII ----------------------------------------------------- /
2015  !/
2016  END SUBROUTINE w3mpii
2017  !/ ------------------------------------------------------------------- /
2031  SUBROUTINE w3mpio ( IMOD )
2032  !/
2033  !/ +-----------------------------------+
2034  !/ | WAVEWATCH III NOAA/NCEP |
2035  !/ | H. L. Tolman |
2036  !/ | FORTRAN 90 |
2037  !/ | Last update : 11-Nov-2015 |
2038  !/ +-----------------------------------+
2039  !/
2040  !/ 17-Mar-1999 : Distributed FORTRAN 77 version. ( version 1.18 )
2041  !/ 11-Jan-2000 : Upgrade to FORTRAN 90 ( version 2.00 )
2042  !/ 20-Aug-2003 : Output server options added. ( version 3.04 )
2043  !/ 28-Dec-2004 : Multiple grid version. ( version 3.06 )
2044  !/ Taken out of W3WAVE.
2045  !/ 03-Jan-2005 : Add US2x to MPI communication. ( version 3.06 )
2046  !/ 04-May-2005 : Change to MPI_COMM_WAVE. ( version 3.07 )
2047  !/ 21-Jul-2005 : Add output fields. ( version 3.07 )
2048  !/ 04-Jul-2006 : Consolidate stress arrays. ( version 3.09 )
2049  !/ 02-Aug-2006 : W3MPIP split off. ( version 3.10 )
2050  !/ 02-Apr-2007 : Add partitioned field data. ( version 3.11 )
2051  !/ Add user-defined field data.
2052  !/ 17-May-2007 : Adding NTPROC/NAPROC separation. ( version 3.11 )
2053  !/ 21-Jun-2007 : Dedicated output processes. ( version 3.11 )
2054  !/ 25-Dec-2012 : Modify field output MPI for new ( version 4.11 )
2055  !/ structure and smaller memory footprint.
2056  !/ 02-Jul-2013 : Bug fix MPI_FLOAT -> MPI_REAL. ( version 4.11 )
2057  !/ 11-Nov-2015 : Added ICEF ( version 5.08 )
2058  !/
2059  ! 1. Purpose :
2060  !
2061  ! Prepare MPI persistent communication needed for WAVEWATCH I/O
2062  ! routines.
2063  !
2064  ! 2. Method :
2065  !
2066  ! Create handles as needed.
2067  !
2068  ! 3. Parameters :
2069  !
2070  ! Parameter list
2071  ! ----------------------------------------------------------------
2072  ! IMOD Int. I Model number.
2073  ! ----------------------------------------------------------------
2074  !
2075  ! 4. Subroutines used :
2076  !
2077  ! Name Type Module Description
2078  ! ----------------------------------------------------------------
2079  ! W3XDMA Subr. W3ADATMD Dimension expanded output arrays.
2080  ! W3SETA Subr. " Set pointers for output arrays
2081  ! STRACE Subr. W3SERVMD Subroutine tracing.
2082  !
2083  ! MPI_SEND_INIT, MPI_RECV_INIT
2084  ! Subr. mpif.h MPI persistent communication calls.
2085  ! ----------------------------------------------------------------
2086  !
2087  ! 5. Called by :
2088  !
2089  ! Name Type Module Description
2090  ! ----------------------------------------------------------------
2091  ! W3INIT Subr. W3INITMD Wave model initialization routine.
2092  ! ----------------------------------------------------------------
2093  !
2094  ! 6. Error messages :
2095  !
2096  ! 7. Remarks :
2097  !
2098  ! - The communication as set up in W3MPII uses tags with number
2099  ! ranging from 1 through NSPEC. New and unique tags for IO
2100  ! related communication are assigned here dynamically.
2101  ! - No testing on IMOD, since only called by W3INIT.
2102  !
2103  ! 8. Structure :
2104  !
2105  ! See source code.
2106  !
2107  ! 9. Switches :
2108  !
2109  ! !/MPI MPI communication calls.
2110  !
2111  ! !/S Enable subroutine tracing.
2112  ! !/MPIT Enable test output.
2113  !
2114  ! 10. Source code :
2115  !
2116  !/ ------------------------------------------------------------------- /
2117  !
2118 #ifdef W3_MPI
2119  USE w3adatmd, ONLY: w3xdma, w3seta, w3xeta
2120  USE w3iorsmd, ONLY: oarst
2121 #endif
2122  USE w3servmd, ONLY: extcde
2123 #ifdef W3_S
2124  USE w3servmd, ONLY: strace
2125 #endif
2126  !/
2127  USE w3gdatmd, ONLY: nsea
2128  USE w3adatmd, ONLY: nsealm
2129 #ifdef W3_MPI
2130  USE w3gdatmd, ONLY: nx, nspec, mapfs, e3df, p2msf, us3df, usspf
2131  USE w3wdatmd, ONLY: va, ust, ustdir, asf, fpis, icef
2133  USE w3adatmd, ONLY: hs, wlm, t02
2134 #endif
2135 
2136 
2137 #ifdef W3_MPI
2138  USE w3adatmd, ONLY: t0m1, thm, ths, fp0, thp0, &
2139  dtdyn, fcut, sppnt, aba, abd, uba, ubd, &
2140  sxx, syy, sxy, usero, phs, ptp, plp, &
2141  pdir, psi, pws, pwst, pnr, phiaw, phioc, &
2142  tusx, tusy, tauwix, tauwiy, tauox, &
2143  tauoy, ussx, ussy, mssx, mssy, mssd, &
2144  mscx, mscy, mscd, prms, tpms, charn, &
2145  tws, tauwnx, tauwny, bhd, cge, &
2147  bedforms, phibbl, taubbl, t01, &
2148  p2sms, us3d, ef, th1m, sth1m, th2m, &
2149  sth2m, hsig, phice, tauice, ussp, &
2150  stmaxe, stmaxd, hmaxe, hcmaxe, hmaxd, &
2151  hcmaxd, qp, pthp0, pqp, ppe, pgw, psw, &
2152  ptm1, pt1, pt2, pep, wbt, cx, cy, &
2154 #endif
2155 
2156 #ifdef W3_MPI
2157  USE w3gdatmd, ONLY: nk
2158  USE w3odatmd, ONLY: ndst, iaproc, naproc, ntproc, flout, &
2160  nogrp, ngrpp, noge, flogrr
2161  USE w3odatmd, ONLY: outpts, nrqgo, nrqgo2, irqgo, irqgo2, &
2163  nopts, iptint, nrqrs, irqrs, nblkrs, &
2164  rsblks, irqrss, vaaux, nrqbp, nrqbp2, &
2165  irqbp1, irqbp2, nfbpo, nbo2, isbpo, &
2166  abpos, nrqtr, irqtr, it0pnt, it0trk, &
2167  it0prt, noswll, noextr, ndse, iostyp, &
2168  flogr2
2169  USE w3parall, ONLY : init_get_jsea_isproc
2170 #endif
2171  USE w3gdatmd, ONLY: gtype, ungtype
2172  USE constants, ONLY: lpdlib
2173  !/
2174 #ifdef W3_MPI
2175  include "mpif.h"
2176 #endif
2177  !/
2178  !/ ------------------------------------------------------------------- /
2179  !/ Parameter list
2180  !/
2181  INTEGER, INTENT(IN) :: IMOD
2182  !/
2183  !/ ------------------------------------------------------------------- /
2184  !/ Local parameters
2185  !/
2186 #ifdef W3_MPI
2187  INTEGER :: IK, IFJ
2188  INTEGER :: IH, IT0, IROOT, IT, IERR, I0, &
2189  IFROM, IX(4), IY(4), IS(4), &
2190  IP(4), I, J, JSEA, ITARG, IB, &
2191  JSEA0, JSEAN, NSEAB, IBOFF, &
2192  ISEA, ISPROC, K, NRQMAX
2193 #endif
2194 #ifdef W3_S
2195  INTEGER, SAVE :: IENT
2196 #endif
2197 #ifdef W3_MPI
2198  LOGICAL :: FLGRDALL(NOGRP,NGRPP)
2199  LOGICAL :: FLGRDARST(NOGRP,NGRPP)
2200 #endif
2201 #ifdef W3_MPIT
2202  CHARACTER(LEN=5) :: STRING
2203 #endif
2204  !/
2205  !/ ------------------------------------------------------------------- /
2206  !/
2207 #ifdef W3_S
2208  CALL strace (ient, 'W3MPIO')
2209 #endif
2210  !
2211  ! 1. Set-up for W3IOGO ---------------------------------------------- /
2212  !
2213 #ifdef W3_MPI
2214  DO j=1, nogrp
2215  DO k=1, ngrpp
2216  flgrdall(j,k) = (flogrd(j,k) .OR. flogr2(j,k))
2217  flgrdarst(j,k) = (flgrdall(j,k) .OR. flogrr(j,k))
2218  END DO
2219  END DO
2220  !
2221  nrqgo = 0
2222  nrqgo2 = 0
2223  it0 = nspec
2224  iroot = napfld - 1
2225  !
2226  !
2227  IF ((flout(1) .OR. flout(7)) .and. (.not. lpdlib)) THEN
2228  !
2229  ! NRQMAX is the maximum number of output fields that require MPI communication,
2230  ! aimed to gather field values stored in each processor into one processor in
2231  ! charge of model output; for each of such fields, this routine requires one
2232  ! call to MPI_SEND_INIT and MPI_RECV_INIT storing the communication request
2233  ! handles in the vectors IRQGO and IRQGO2 respectively.
2234  ! NRQMAX is calculated as the sum of all fields described before (Hs)
2235  ! + 2 or 3 component fields (CUR) + 3 component fields + extra fields
2236  ! For group 1 fields except ICEF, all processors contain information on all
2237  ! grid points because they are input fields, and therefore this MPI
2238  ! communication is not necessary and they do not contribute to NRQMAX.
2239  !
2240  ! Calculation of NRQMAX splitted by output groups and field type
2241  ! scalar 2-comp 3-comp
2242  nrqmax = 1 + 0 + 0 + & ! group 1
2243  18 + 0 + 0 + & ! group 2
2244  0 + 0 + 0 + & ! group 3 (extra contributions below)
2245  2+(noge(4)-2)*(noswll+1) + 0 + 0 + & ! group 4
2246  11 + 3 + 1 + & ! group 5
2247  12 + 7 + 1 + & ! group 6 (extra contributions below)
2248  5 + 4 + 1 + & ! group 7
2249  5 + 2 + 0 + & ! group 8
2250  5 + 0 + 0 + & ! group 9
2251  noextr + 0 + 0 ! group 10
2252 
2253  ! Extra contributions to NRQMAX from group 3
2254  DO ifj=1,5
2255  IF ( flgrdall( 3,ifj)) nrqmax = nrqmax + e3df(3,ifj) - e3df(2,ifj) + 1
2256  END DO
2257  ! Extra contributions to NRQMAX from group 6
2258  IF ( flgrdall( 6,9)) nrqmax = nrqmax + p2msf(3) - p2msf(2) + 1
2259  IF ( flgrdall( 6, 8) ) nrqmax = nrqmax + 2*nk
2260  IF ( flgrdall( 6,12) ) nrqmax = nrqmax + 2*nk
2261  !
2262  IF ( nrqmax .GT. 0 ) THEN
2263  ALLOCATE ( outpts(imod)%OUT1%IRQGO(nrqmax) )
2264  ALLOCATE ( outpts(imod)%OUT1%IRQGO2(nrqmax*naproc) )
2265  END IF
2266  irqgo => outpts(imod)%OUT1%IRQGO
2267  irqgo2 => outpts(imod)%OUT1%IRQGO2
2268  !
2269  ! 1.a Sends of fields
2270  !
2271  ih = 0
2272  !
2273  IF ( iaproc .LE. naproc ) THEN
2274  it = it0
2275 #ifdef W3_MPIT
2276  WRITE (ndst,9010) '(SEND)'
2277 #endif
2278  !
2279  IF ( flgrdall( 1, 12) ) THEN
2280  ih = ih + 1
2281  it = it + 1
2282  CALL mpi_send_init (icef(iaproc), 1, ww3_field_vec, iroot, it, &
2283  mpi_comm_wave, irqgo(ih), ierr)
2284 #ifdef W3_MPIT
2285  WRITE (ndst,9011) ih, ' 1/09', iroot, it, irqgo(ih), ierr
2286 #endif
2287  END IF
2288  !
2289  IF ( flgrdall( 2, 1) ) THEN
2290  ih = ih + 1
2291  it = it + 1
2292  CALL mpi_send_init (hs(1),nsealm , mpi_real, iroot, &
2293  it, mpi_comm_wave, irqgo(ih), ierr)
2294 #ifdef W3_MPIT
2295  WRITE (ndst,9011) ih, ' 2/01', iroot, it, irqgo(ih), ierr
2296 #endif
2297  END IF
2298  !
2299  IF ( flgrdall( 2, 2) ) THEN
2300  ih = ih + 1
2301  it = it + 1
2302  CALL mpi_send_init (wlm(1),nsealm , mpi_real, iroot, &
2303  it, mpi_comm_wave, irqgo(ih), ierr)
2304 #ifdef W3_MPIT
2305  WRITE (ndst,9011) ih, ' 2/02', iroot, it, irqgo(ih), ierr
2306 #endif
2307  END IF
2308  !
2309  IF ( flgrdall( 2, 3) ) THEN
2310  ih = ih + 1
2311  it = it + 1
2312  CALL mpi_send_init (t02(1),nsealm , mpi_real, iroot, &
2313  it, mpi_comm_wave, irqgo(ih), ierr)
2314 #ifdef W3_MPIT
2315  WRITE (ndst,9011) ih, ' 2/03', iroot, it, irqgo(ih), ierr
2316 #endif
2317  END IF
2318  !
2319  IF ( flgrdall( 2, 4) ) THEN
2320  ih = ih + 1
2321  it = it + 1
2322  CALL mpi_send_init (t0m1(1),nsealm , mpi_real, iroot, &
2323  it, mpi_comm_wave, irqgo(ih), ierr)
2324 #ifdef W3_MPIT
2325  WRITE (ndst,9011) ih, ' 2/04', iroot, it, irqgo(ih), ierr
2326 #endif
2327  END IF
2328  !
2329  IF ( flgrdall( 2, 5) ) THEN
2330  ih = ih + 1
2331  it = it + 1
2332  CALL mpi_send_init (t01(1),nsealm , mpi_real, iroot, &
2333  it, mpi_comm_wave, irqgo(ih), ierr)
2334 #ifdef W3_MPIT
2335  WRITE (ndst,9011) ih, ' 2/05', iroot, it, irqgo(ih), ierr
2336 #endif
2337  END IF
2338  !
2339  IF ( flgrdall( 2, 6) .OR. flgrdall( 2,18) ) THEN
2340  ! TP output shares FP0 internal field with FP
2341  ih = ih + 1
2342  it = it + 1
2343  CALL mpi_send_init (fp0(1),nsealm , mpi_real, iroot, &
2344  it, mpi_comm_wave, irqgo(ih), ierr)
2345 #ifdef W3_MPIT
2346  WRITE (ndst,9011) ih, ' 2/06', iroot, it, irqgo(ih), ierr
2347 #endif
2348  END IF
2349  !
2350  IF ( flgrdall( 2, 7) ) THEN
2351  ih = ih + 1
2352  it = it + 1
2353  CALL mpi_send_init (thm(1),nsealm , mpi_real, iroot, &
2354  it, mpi_comm_wave, irqgo(ih), ierr)
2355 #ifdef W3_MPIT
2356  WRITE (ndst,9011) ih, ' 2/07', iroot, it, irqgo(ih), ierr
2357 #endif
2358  END IF
2359  !
2360  IF ( flgrdall( 2, 8) ) THEN
2361  ih = ih + 1
2362  it = it + 1
2363  CALL mpi_send_init (ths(1),nsealm , mpi_real, iroot, &
2364  it, mpi_comm_wave, irqgo(ih), ierr)
2365 #ifdef W3_MPIT
2366  WRITE (ndst,9011) ih, ' 2/09', iroot, it, irqgo(ih), ierr
2367 #endif
2368  END IF
2369  !
2370  IF ( flgrdall( 2, 9) ) THEN
2371  ih = ih + 1
2372  it = it + 1
2373  CALL mpi_send_init (thp0(1),nsealm , mpi_real, iroot, &
2374  it, mpi_comm_wave, irqgo(ih), ierr)
2375 #ifdef W3_MPIT
2376  WRITE (ndst,9011) ih, ' 2/09', iroot, it, irqgo(ih), ierr
2377 #endif
2378  END IF
2379  !
2380  IF ( flgrdall( 2, 10) ) THEN
2381  ih = ih + 1
2382  it = it + 1
2383  CALL mpi_send_init (hsig(1),nsealm , mpi_real, iroot, &
2384  it, mpi_comm_wave, irqgo(ih), ierr)
2385 #ifdef W3_MPIT
2386  WRITE (ndst,9011) ih, ' 2/10', iroot, it, irqgo(ih), ierr
2387 #endif
2388  END IF
2389  !
2390  IF ( flgrdall( 2, 11) ) THEN
2391  ih = ih + 1
2392  it = it + 1
2393  CALL mpi_send_init (stmaxe(1),nsealm , mpi_real, iroot, &
2394  it, mpi_comm_wave, irqgo(ih), ierr)
2395 #ifdef W3_MPIT
2396  WRITE (ndst,9011) ih, ' 2/11', iroot, it, irqgo(ih), ierr
2397 #endif
2398  END IF
2399  !
2400  IF ( flgrdall( 2, 12) ) THEN
2401  ih = ih + 1
2402  it = it + 1
2403  CALL mpi_send_init (stmaxd(1),nsealm , mpi_real, iroot, &
2404  it, mpi_comm_wave, irqgo(ih), ierr)
2405 #ifdef W3_MPIT
2406  WRITE (ndst,9011) ih, ' 2/12', iroot, it, irqgo(ih), ierr
2407 #endif
2408  END IF
2409  !
2410  IF ( flgrdall( 2, 13) ) THEN
2411  ih = ih + 1
2412  it = it + 1
2413  CALL mpi_send_init (hmaxe(1),nsealm , mpi_real, iroot, &
2414  it, mpi_comm_wave, irqgo(ih), ierr)
2415 #ifdef W3_MPIT
2416  WRITE (ndst,9011) ih, ' 2/13', iroot, it, irqgo(ih), ierr
2417 #endif
2418  END IF
2419  !
2420  IF ( flgrdall( 2, 14) ) THEN
2421  ih = ih + 1
2422  it = it + 1
2423  CALL mpi_send_init (hcmaxe(1),nsealm , mpi_real, iroot, &
2424  it, mpi_comm_wave, irqgo(ih), ierr)
2425 #ifdef W3_MPIT
2426  WRITE (ndst,9011) ih, ' 2/14', iroot, it, irqgo(ih), ierr
2427 #endif
2428  END IF
2429  !
2430  IF ( flgrdall( 2, 15) ) THEN
2431  ih = ih + 1
2432  it = it + 1
2433  CALL mpi_send_init (hmaxd(1),nsealm , mpi_real, iroot, &
2434  it, mpi_comm_wave, irqgo(ih), ierr)
2435 #ifdef W3_MPIT
2436  WRITE (ndst,9011) ih, ' 2/15', iroot, it, irqgo(ih), ierr
2437 #endif
2438  END IF
2439  !
2440  IF ( flgrdall( 2, 16) ) THEN
2441  ih = ih + 1
2442  it = it + 1
2443  CALL mpi_send_init (hcmaxd(1),nsealm , mpi_real, iroot, &
2444  it, mpi_comm_wave, irqgo(ih), ierr)
2445 #ifdef W3_MPIT
2446  WRITE (ndst,9011) ih, ' 2/16', iroot, it, irqgo(ih), ierr
2447 #endif
2448  END IF
2449  !
2450  IF ( flgrdall( 2, 17) ) THEN
2451  ih = ih + 1
2452  it = it + 1
2453  CALL mpi_send_init (wbt(1),nsealm , mpi_real, iroot, &
2454  it, mpi_comm_wave, irqgo(ih), ierr)
2455 #ifdef W3_MPIT
2456  WRITE (ndst,9011) ih, ' 2/17', iroot, it, irqgo(ih), ierr
2457 #endif
2458  END IF
2459  !
2460  IF ( flgrdall( 2, 19) ) THEN
2461  ih = ih + 1
2462  it = it + 1
2463  CALL mpi_send_init (wnmean(1),nsealm , mpi_real, iroot, &
2464  it, mpi_comm_wave, irqgo(ih), ierr)
2465 #ifdef W3_MPIT
2466  WRITE (ndst,9011) ih, ' 2/19', iroot, it, irqgo(ih), ierr
2467 #endif
2468  END IF
2469  !
2470  IF ( flgrdall( 3, 1) ) THEN
2471  DO ik=e3df(2,1),e3df(3,1)
2472  ih = ih + 1
2473  it = it + 1
2474  CALL mpi_send_init (ef(1,ik),nsealm , mpi_real, iroot, &
2475  it, mpi_comm_wave, irqgo(ih), ierr)
2476 #ifdef W3_MPIT
2477  WRITE (ndst,9011) ih, 'EF', iroot, it, irqgo(ih), ierr
2478 #endif
2479  END DO
2480  END IF
2481  !
2482  IF ( flgrdall( 3, 2) ) THEN
2483  DO ik=e3df(2,2),e3df(3,2)
2484  ih = ih + 1
2485  it = it + 1
2486  CALL mpi_send_init (th1m(1,ik),nsealm , mpi_real, iroot, &
2487  it, mpi_comm_wave, irqgo(ih), ierr)
2488 #ifdef W3_MPIT
2489  WRITE (ndst,9011) ih, 'TH1M', iroot, it, irqgo(ih), ierr
2490 #endif
2491  END DO
2492  END IF
2493  !
2494  IF ( flgrdall( 3, 3) ) THEN
2495  DO ik=e3df(2,3),e3df(3,3)
2496  ih = ih + 1
2497  it = it + 1
2498  CALL mpi_send_init (sth1m(1,ik),nsealm , mpi_real, iroot, &
2499  it, mpi_comm_wave, irqgo(ih), ierr)
2500 #ifdef W3_MPIT
2501  WRITE (ndst,9011) ih, 'STH1M', iroot, it, irqgo(ih), ierr
2502 #endif
2503  END DO
2504  END IF
2505  !
2506  IF ( flgrdall( 3, 4) ) THEN
2507  DO ik=e3df(2,4),e3df(3,4)
2508  ih = ih + 1
2509  it = it + 1
2510  CALL mpi_send_init (th2m(1,ik),nsealm , mpi_real, iroot, &
2511  it, mpi_comm_wave, irqgo(ih), ierr)
2512 #ifdef W3_MPIT
2513  WRITE (ndst,9011) ih, 'TH2M', iroot, it, irqgo(ih), ierr
2514 #endif
2515  END DO
2516  END IF
2517  !
2518  IF ( flgrdall( 3, 5) ) THEN
2519  DO ik=e3df(2,5),e3df(3,5)
2520  ih = ih + 1
2521  it = it + 1
2522  CALL mpi_send_init (sth2m(1,ik),nsealm , mpi_real, iroot, &
2523  it, mpi_comm_wave, irqgo(ih), ierr)
2524 #ifdef W3_MPIT
2525  WRITE (ndst,9011) ih, 'STH2M', iroot, it, irqgo(ih), ierr
2526 #endif
2527  END DO
2528  END IF
2529  !
2530  IF ( flgrdall( 4, 1) ) THEN
2531  DO k=0, noswll
2532  ih = ih + 1
2533  it = it + 1
2534  CALL mpi_send_init (phs(1,k),nsealm , mpi_real, iroot, &
2535  it, mpi_comm_wave, irqgo(ih), ierr)
2536 #ifdef W3_MPIT
2537  WRITE (ndst,9011) ih, ' 4/01', iroot, it, irqgo(ih), ierr
2538 #endif
2539  END DO
2540  END IF
2541  !
2542  IF ( flgrdall( 4, 2) ) THEN
2543  DO k=0, noswll
2544  ih = ih + 1
2545  it = it + 1
2546  CALL mpi_send_init (ptp(1,k),nsealm , mpi_real, iroot, &
2547  it, mpi_comm_wave, irqgo(ih), ierr)
2548 #ifdef W3_MPIT
2549  WRITE (ndst,9011) ih, ' 4/02', iroot, it, irqgo(ih), ierr
2550 #endif
2551  END DO
2552  END IF
2553  !
2554  IF ( flgrdall( 4, 3) ) THEN
2555  DO k=0, noswll
2556  ih = ih + 1
2557  it = it + 1
2558  CALL mpi_send_init (plp(1,k),nsealm , mpi_real, iroot, &
2559  it, mpi_comm_wave, irqgo(ih), ierr)
2560 #ifdef W3_MPIT
2561  WRITE (ndst,9011) ih, ' 4/03', iroot, it, irqgo(ih), ierr
2562 #endif
2563  END DO
2564  END IF
2565  !
2566  IF ( flgrdall( 4, 4) ) THEN
2567  DO k=0, noswll
2568  ih = ih + 1
2569  it = it + 1
2570  CALL mpi_send_init (pdir(1,k),nsealm , mpi_real, iroot, &
2571  it, mpi_comm_wave, irqgo(ih), ierr)
2572 #ifdef W3_MPIT
2573  WRITE (ndst,9011) ih, ' 4/04', iroot, it, irqgo(ih), ierr
2574 #endif
2575  END DO
2576  END IF
2577  !
2578  IF ( flgrdall( 4, 5) ) THEN
2579  DO k=0, noswll
2580  ih = ih + 1
2581  it = it + 1
2582  CALL mpi_send_init (psi(1,k),nsealm , mpi_real, iroot, &
2583  it, mpi_comm_wave, irqgo(ih), ierr)
2584 #ifdef W3_MPIT
2585  WRITE (ndst,9011) ih, ' 4/05', iroot, it, irqgo(ih), ierr
2586 #endif
2587  END DO
2588  END IF
2589  !
2590  IF ( flgrdall( 4, 6) ) THEN
2591  DO k=0, noswll
2592  ih = ih + 1
2593  it = it + 1
2594  CALL mpi_send_init (pws(1,k),nsealm , mpi_real, iroot, &
2595  it, mpi_comm_wave, irqgo(ih), ierr)
2596 #ifdef W3_MPIT
2597  WRITE (ndst,9011) ih, ' 4/06', iroot, it, irqgo(ih), ierr
2598 #endif
2599  END DO
2600  END IF
2601  !
2602  IF ( flgrdall( 4, 7) ) THEN
2603  DO k=0, noswll
2604  ih = ih + 1
2605  it = it + 1
2606  CALL mpi_send_init (pthp0(1,k),nsealm , mpi_real, iroot, &
2607  it, mpi_comm_wave, irqgo(ih), ierr)
2608 #ifdef W3_MPIT
2609  WRITE (ndst,9011) ih, ' 4/07', iroot, it, irqgo(ih), ierr
2610 #endif
2611  END DO
2612  END IF
2613  !
2614  IF ( flgrdall( 4, 8) ) THEN
2615  DO k=0, noswll
2616  ih = ih + 1
2617  it = it + 1
2618  CALL mpi_send_init (pqp(1,k),nsealm , mpi_real, iroot, &
2619  it, mpi_comm_wave, irqgo(ih), ierr)
2620 #ifdef W3_MPIT
2621  WRITE (ndst,9011) ih, ' 4/08', iroot, it, irqgo(ih), ierr
2622 #endif
2623  END DO
2624  END IF
2625  !
2626  IF ( flgrdall( 4, 9) ) THEN
2627  DO k=0, noswll
2628  ih = ih + 1
2629  it = it + 1
2630  CALL mpi_send_init (ppe(1,k),nsealm , mpi_real, iroot, &
2631  it, mpi_comm_wave, irqgo(ih), ierr)
2632 #ifdef W3_MPIT
2633  WRITE (ndst,9011) ih, ' 4/09', iroot, it, irqgo(ih), ierr
2634 #endif
2635  END DO
2636  END IF
2637  !
2638  IF ( flgrdall( 4,10) ) THEN
2639  DO k=0, noswll
2640  ih = ih + 1
2641  it = it + 1
2642  CALL mpi_send_init (pgw(1,k),nsealm , mpi_real, iroot, &
2643  it, mpi_comm_wave, irqgo(ih), ierr)
2644 #ifdef W3_MPIT
2645  WRITE (ndst,9011) ih, ' 4/10', iroot, it, irqgo(ih), ierr
2646 #endif
2647  END DO
2648  END IF
2649  !
2650  IF ( flgrdall( 4,11) ) THEN
2651  DO k=0, noswll
2652  ih = ih + 1
2653  it = it + 1
2654  CALL mpi_send_init (psw(1,k),nsealm , mpi_real, iroot, &
2655  it, mpi_comm_wave, irqgo(ih), ierr)
2656 #ifdef W3_MPIT
2657  WRITE (ndst,9011) ih, ' 4/11', iroot, it, irqgo(ih), ierr
2658 #endif
2659  END DO
2660  END IF
2661  !
2662  IF ( flgrdall( 4,12) ) THEN
2663  DO k=0, noswll
2664  ih = ih + 1
2665  it = it + 1
2666  CALL mpi_send_init (ptm1(1,k),nsealm , mpi_real, iroot, &
2667  it, mpi_comm_wave, irqgo(ih), ierr)
2668 #ifdef W3_MPIT
2669  WRITE (ndst,9011) ih, ' 4/12', iroot, it, irqgo(ih), ierr
2670 #endif
2671  END DO
2672  END IF
2673  !
2674  !
2675  IF ( flgrdall( 4,13) ) THEN
2676  DO k=0, noswll
2677  ih = ih + 1
2678  it = it + 1
2679  CALL mpi_send_init (pt1(1,k),nsealm , mpi_real, iroot, &
2680  it, mpi_comm_wave, irqgo(ih), ierr)
2681 #ifdef W3_MPIT
2682  WRITE (ndst,9011) ih, ' 4/13', iroot, it, irqgo(ih), ierr
2683 #endif
2684  END DO
2685  END IF
2686  !
2687  IF ( flgrdall( 4,14) ) THEN
2688  DO k=0, noswll
2689  ih = ih + 1
2690  it = it + 1
2691  CALL mpi_send_init (pt2(1,k),nsealm , mpi_real, iroot, &
2692  it, mpi_comm_wave, irqgo(ih), ierr)
2693 #ifdef W3_MPIT
2694  WRITE (ndst,9011) ih, ' 4/14', iroot, it, irqgo(ih), ierr
2695 #endif
2696  END DO
2697  END IF
2698  !
2699  IF ( flgrdall( 4,15) ) THEN
2700  DO k=0, noswll
2701  ih = ih + 1
2702  it = it + 1
2703  CALL mpi_send_init (pep(1,k),nsealm , mpi_real, iroot, &
2704  it, mpi_comm_wave, irqgo(ih), ierr)
2705 #ifdef W3_MPIT
2706  WRITE (ndst,9011) ih, ' 4/15', iroot, it, irqgo(ih), ierr
2707 #endif
2708  END DO
2709  END IF
2710  !
2711  IF ( flgrdall( 4,16) ) THEN
2712  ih = ih + 1
2713  it = it + 1
2714  CALL mpi_send_init (pwst(1),nsealm , mpi_real, iroot, &
2715  it, mpi_comm_wave, irqgo(ih), ierr)
2716 #ifdef W3_MPIT
2717  WRITE (ndst,9011) ih, ' 4/16', iroot, it, irqgo(ih), ierr
2718 #endif
2719  END IF
2720  !
2721  IF ( flgrdall( 4,17) ) THEN
2722  ih = ih + 1
2723  it = it + 1
2724  CALL mpi_send_init (pnr(1),nsealm , mpi_real, iroot, &
2725  it, mpi_comm_wave, irqgo(ih), ierr)
2726 #ifdef W3_MPIT
2727  WRITE (ndst,9011) ih, ' 4/17', iroot, it, irqgo(ih), ierr
2728 #endif
2729  END IF
2730  !
2731  IF ( flgrdall( 5, 1) ) THEN
2732  ih = ih + 1
2733  it = it + 1
2734  CALL mpi_send_init (ust(iaproc), 1, ww3_field_vec, &
2735  iroot, it, mpi_comm_wave, irqgo(ih), ierr )
2736 #ifdef W3_MPIT
2737  WRITE (ndst,9011) ih, ' 5/01', iroot, it, irqgo(ih), ierr
2738 #endif
2739  ih = ih + 1
2740  it = it + 1
2741  CALL mpi_send_init (ustdir(iaproc), 1, ww3_field_vec, &
2742  iroot, it, mpi_comm_wave, irqgo(ih), ierr )
2743 #ifdef W3_MPIT
2744  WRITE (ndst,9011) ih, ' 5/01', iroot, it, irqgo(ih), ierr
2745 #endif
2746  ih = ih + 1
2747  it = it + 1
2748  CALL mpi_send_init (asf(iaproc), 1, ww3_field_vec, &
2749  iroot, it, mpi_comm_wave, irqgo(ih), ierr )
2750 #ifdef W3_MPIT
2751  WRITE (ndst,9011) ih, ' 5/01', iroot, it, irqgo(ih), ierr
2752 #endif
2753  END IF
2754  !
2755  IF ( flgrdall( 5, 2) ) THEN
2756  ih = ih + 1
2757  it = it + 1
2758  CALL mpi_send_init (charn(1),nsealm , mpi_real, iroot, &
2759  it, mpi_comm_wave, irqgo(ih), ierr)
2760 #ifdef W3_MPIT
2761  WRITE (ndst,9011) ih, ' 5/02', iroot, it, irqgo(ih), ierr
2762 #endif
2763  END IF
2764  !
2765  IF ( flgrdall( 5, 3) ) THEN
2766  ih = ih + 1
2767  it = it + 1
2768  CALL mpi_send_init (cge(1),nsealm , mpi_real, iroot, &
2769  it, mpi_comm_wave, irqgo(ih), ierr)
2770 #ifdef W3_MPIT
2771  WRITE (ndst,9011) ih, ' 5/03', iroot, it, irqgo(ih), ierr
2772 #endif
2773  END IF
2774  !
2775  IF ( flgrdall( 5, 4) ) THEN
2776  ih = ih + 1
2777  it = it + 1
2778  CALL mpi_send_init (phiaw(1),nsealm , mpi_real, iroot, &
2779  it, mpi_comm_wave, irqgo(ih), ierr)
2780 #ifdef W3_MPIT
2781  WRITE (ndst,9011) ih, ' 5/04', iroot, it, irqgo(ih), ierr
2782 #endif
2783  END IF
2784  !
2785  IF ( flgrdall( 5, 5) ) THEN
2786  ih = ih + 1
2787  it = it + 1
2788  CALL mpi_send_init (tauwix(1),nsealm , mpi_real, iroot, &
2789  it, mpi_comm_wave, irqgo(ih), ierr)
2790 #ifdef W3_MPIT
2791  WRITE (ndst,9011) ih, ' 5/05', iroot, it, irqgo(ih), ierr
2792 #endif
2793  ih = ih + 1
2794  it = it + 1
2795  CALL mpi_send_init (tauwiy(1),nsealm , mpi_real, iroot, &
2796  it, mpi_comm_wave, irqgo(ih), ierr)
2797 #ifdef W3_MPIT
2798  WRITE (ndst,9011) ih, ' 5/05', iroot, it, irqgo(ih), ierr
2799 #endif
2800  END IF
2801  !
2802  IF ( flgrdall( 5, 6) ) THEN
2803  ih = ih + 1
2804  it = it + 1
2805  CALL mpi_send_init (tauwnx(1),nsealm , mpi_real, iroot, &
2806  it, mpi_comm_wave, irqgo(ih), ierr)
2807 #ifdef W3_MPIT
2808  WRITE (ndst,9011) ih, ' 5/06', iroot, it, irqgo(ih), ierr
2809 #endif
2810  ih = ih + 1
2811  it = it + 1
2812  CALL mpi_send_init (tauwny(1),nsealm , mpi_real, iroot, &
2813  it, mpi_comm_wave, irqgo(ih), ierr)
2814 #ifdef W3_MPIT
2815  WRITE (ndst,9011) ih, ' 5/06', iroot, it, irqgo(ih), ierr
2816 #endif
2817  END IF
2818  !
2819  IF ( flgrdall( 5, 7) ) THEN
2820  ih = ih + 1
2821  it = it + 1
2822  CALL mpi_send_init (whitecap(1,1),nsealm , mpi_real, iroot,&
2823  it, mpi_comm_wave, irqgo(ih), ierr)
2824 #ifdef W3_MPIT
2825  WRITE (ndst,9011) ih, ' 5/07', iroot, it, irqgo(ih), ierr
2826 #endif
2827  END IF
2828  !
2829  IF ( flgrdall( 5, 8) ) THEN
2830  ih = ih + 1
2831  it = it + 1
2832  CALL mpi_send_init (whitecap(1,2),nsealm , mpi_real, iroot,&
2833  it, mpi_comm_wave, irqgo(ih), ierr)
2834 #ifdef W3_MPIT
2835  WRITE (ndst,9011) ih, ' 5/08', iroot, it, irqgo(ih), ierr
2836 #endif
2837  END IF
2838  !
2839  IF ( flgrdall( 5, 9) ) THEN
2840  ih = ih + 1
2841  it = it + 1
2842  CALL mpi_send_init (whitecap(1,3),nsealm , mpi_real, iroot,&
2843  it, mpi_comm_wave, irqgo(ih), ierr)
2844 #ifdef W3_MPIT
2845  WRITE (ndst,9011) ih, ' 5/09', iroot, it, irqgo(ih), ierr
2846 #endif
2847  END IF
2848  !
2849  IF ( flgrdall( 5,10) ) THEN
2850  ih = ih + 1
2851  it = it + 1
2852  CALL mpi_send_init (whitecap(1,4),nsealm , mpi_real, iroot,&
2853  it, mpi_comm_wave, irqgo(ih), ierr)
2854 #ifdef W3_MPIT
2855  WRITE (ndst,9011) ih, ' 5/10', iroot, it, irqgo(ih), ierr
2856 #endif
2857  END IF
2858  !
2859  IF ( flgrdall( 5, 11) ) THEN
2860  ih = ih + 1
2861  it = it + 1
2862  CALL mpi_send_init (tws(1),nsealm , mpi_real, iroot, &
2863  it, mpi_comm_wave, irqgo(ih), ierr)
2864 #ifdef W3_MPIT
2865  WRITE (ndst,9011) ih, ' 5/11', iroot, it, irqgo(ih), ierr
2866 #endif
2867  END IF
2868  !
2869  IF ( flgrdall( 6, 1) ) THEN
2870  ih = ih + 1
2871  it = it + 1
2872  CALL mpi_send_init (sxx(1),nsealm , mpi_real, iroot, &
2873  it, mpi_comm_wave, irqgo(ih), ierr)
2874 #ifdef W3_MPIT
2875  WRITE (ndst,9011) ih, ' 6/01', iroot, it, irqgo(ih), ierr
2876 #endif
2877  ih = ih + 1
2878  it = it + 1
2879  CALL mpi_send_init (syy(1),nsealm , mpi_real, iroot, &
2880  it, mpi_comm_wave, irqgo(ih), ierr)
2881 #ifdef W3_MPIT
2882  WRITE (ndst,9011) ih, ' 6/01', iroot, it, irqgo(ih), ierr
2883 #endif
2884  ih = ih + 1
2885  it = it + 1
2886  CALL mpi_send_init (sxy(1),nsealm , mpi_real, iroot, &
2887  it, mpi_comm_wave, irqgo(ih), ierr)
2888 #ifdef W3_MPIT
2889  WRITE (ndst,9011) ih, ' 6/01', iroot, it, irqgo(ih), ierr
2890 #endif
2891  END IF
2892  !
2893  IF ( flgrdall( 6, 2) ) THEN
2894  ih = ih + 1
2895  it = it + 1
2896  CALL mpi_send_init (tauox(1),nsealm , mpi_real, iroot, &
2897  it, mpi_comm_wave, irqgo(ih), ierr)
2898 #ifdef W3_MPIT
2899  WRITE (ndst,9011) ih, ' 6/02', iroot, it, irqgo(ih), ierr
2900 #endif
2901  ih = ih + 1
2902  it = it + 1
2903  CALL mpi_send_init (tauoy(1),nsealm , mpi_real, iroot, &
2904  it, mpi_comm_wave, irqgo(ih), ierr)
2905 #ifdef W3_MPIT
2906  WRITE (ndst,9011) ih, ' 6/02', iroot, it, irqgo(ih), ierr
2907 #endif
2908  END IF
2909  !
2910  IF ( flgrdall( 6, 3) ) THEN
2911  ih = ih + 1
2912  it = it + 1
2913  CALL mpi_send_init (bhd(1),nsealm , mpi_real, iroot, &
2914  it, mpi_comm_wave, irqgo(ih), ierr)
2915 #ifdef W3_MPIT
2916  WRITE (ndst,9011) ih, ' 6/03', iroot, it, irqgo(ih), ierr
2917 #endif
2918  END IF
2919  !
2920  IF ( flgrdall( 6, 4) ) THEN
2921  ih = ih + 1
2922  it = it + 1
2923  CALL mpi_send_init (phioc(1),nsealm , mpi_real, iroot, &
2924  it, mpi_comm_wave, irqgo(ih), ierr)
2925 #ifdef W3_MPIT
2926  WRITE (ndst,9011) ih, ' 6/04', iroot, it, irqgo(ih), ierr
2927 #endif
2928  END IF
2929  !
2930  IF ( flgrdall( 6, 5) ) THEN
2931  ih = ih + 1
2932  it = it + 1
2933  CALL mpi_send_init (tusx(1),nsealm , mpi_real, iroot, &
2934  it, mpi_comm_wave, irqgo(ih), ierr)
2935 #ifdef W3_MPIT
2936  WRITE (ndst,9011) ih, ' 6/05', iroot, it, irqgo(ih), ierr
2937 #endif
2938  ih = ih + 1
2939  it = it + 1
2940  CALL mpi_send_init (tusy(1),nsealm , mpi_real, iroot, &
2941  it, mpi_comm_wave, irqgo(ih), ierr)
2942 #ifdef W3_MPIT
2943  WRITE (ndst,9011) ih, ' 6/05', iroot, it, irqgo(ih), ierr
2944 #endif
2945  END IF
2946  !
2947  IF ( flgrdall( 6, 6) ) THEN
2948  ih = ih + 1
2949  it = it + 1
2950  CALL mpi_send_init (ussx(1),nsealm , mpi_real, iroot, &
2951  it, mpi_comm_wave, irqgo(ih), ierr)
2952 #ifdef W3_MPIT
2953  WRITE (ndst,9011) ih, ' 6/06', iroot, it, irqgo(ih), ierr
2954 #endif
2955  ih = ih + 1
2956  it = it + 1
2957  CALL mpi_send_init (ussy(1),nsealm , mpi_real, iroot, &
2958  it, mpi_comm_wave, irqgo(ih), ierr)
2959 #ifdef W3_MPIT
2960  WRITE (ndst,9011) ih, ' 6/06', iroot, it, irqgo(ih), ierr
2961 #endif
2962  END IF
2963  !
2964  IF ( flgrdall( 6, 7) ) THEN
2965  ih = ih + 1
2966  it = it + 1
2967  CALL mpi_send_init (prms(1),nsealm , mpi_real, iroot, &
2968  it, mpi_comm_wave, irqgo(ih), ierr)
2969 #ifdef W3_MPIT
2970  WRITE (ndst,9011) ih, ' 6/07', iroot, it, irqgo(ih), ierr
2971 #endif
2972  ih = ih + 1
2973  it = it + 1
2974  CALL mpi_send_init (tpms(1),nsealm , mpi_real, iroot, &
2975  it, mpi_comm_wave, irqgo(ih), ierr)
2976 #ifdef W3_MPIT
2977  WRITE (ndst,9011) ih, ' 6/07', iroot, it, irqgo(ih), ierr
2978 #endif
2979  END IF
2980  !
2981  IF ( flgrdall( 6, 8) ) THEN
2982  DO ik=1,2*nk
2983  ih = ih + 1
2984  it = it + 1
2985  CALL mpi_send_init (us3d(1,ik),nsealm , mpi_real, iroot, &
2986  it, mpi_comm_wave, irqgo(ih), ierr)
2987 #ifdef W3_MPIT
2988  WRITE (ndst,9011) ih, 'US3D ', iroot, it, irqgo(ih), ierr
2989 #endif
2990  END DO
2991  END IF
2992  !
2993  IF ( flgrdall( 6, 9) ) THEN
2994  DO k=p2msf(2),p2msf(3)
2995  ih = ih + 1
2996  it = it + 1
2997  CALL mpi_send_init (p2sms(1,k),nsealm , mpi_real, iroot, &
2998  it, mpi_comm_wave, irqgo(ih), ierr)
2999 #ifdef W3_MPIT
3000  WRITE (ndst,9011) ih, 'P2SMS', iroot, it, irqgo(ih), ierr
3001 #endif
3002  END DO
3003  END IF
3004  !
3005  IF ( flgrdall( 6,10) ) THEN
3006  ih = ih + 1
3007  it = it + 1
3008  CALL mpi_send_init (tauice(1,1),nsealm , mpi_real, iroot, &
3009  it, mpi_comm_wave, irqgo(ih), ierr)
3010 #ifdef W3_MPIT
3011  WRITE (ndst,9011) ih, ' 6/10', iroot, it, irqgo(ih), ierr
3012 #endif
3013  ih = ih + 1
3014  it = it + 1
3015  CALL mpi_send_init (tauice(1,2),nsealm , mpi_real, iroot, &
3016  it, mpi_comm_wave, irqgo(ih), ierr)
3017 #ifdef W3_MPIT
3018  WRITE (ndst,9011) ih, ' 6/10', iroot, it, irqgo(ih), ierr
3019 #endif
3020  END IF
3021  !
3022  IF ( flgrdall( 6,11) ) THEN
3023  ih = ih + 1
3024  it = it + 1
3025  CALL mpi_send_init (phice(1),nsealm , mpi_real, iroot, &
3026  it, mpi_comm_wave, irqgo(ih), ierr)
3027 #ifdef W3_MPIT
3028  WRITE (ndst,9011) ih, ' 6/11', iroot, it, irqgo(ih), ierr
3029 #endif
3030  END IF
3031  !
3032  IF ( flgrdall( 6, 12) ) THEN
3033  DO ik=1,2*nk
3034  ih = ih + 1
3035  it = it + 1
3036  CALL mpi_send_init (ussp(1,ik),nsealm , mpi_real, iroot, &
3037  it, mpi_comm_wave, irqgo(ih), ierr)
3038 #ifdef W3_MPIT
3039  WRITE (ndst,9011) ih, 'USSP ', iroot, it, irqgo(ih), ierr
3040 #endif
3041  END DO
3042  END IF
3043  !
3044  IF ( flgrdall( 6, 13) ) THEN
3045  ih = ih + 1
3046  it = it + 1
3047  CALL mpi_send_init (tauocx(1),nsealm , mpi_real, iroot, &
3048  it, mpi_comm_wave, irqgo(ih), ierr)
3049 #ifdef W3_MPIT
3050  WRITE (ndst,9011) ih, ' 6/13', iroot, it, irqgo(ih), ierr
3051 #endif
3052  ih = ih + 1
3053  it = it + 1
3054  CALL mpi_send_init (tauocy(1),nsealm , mpi_real, iroot, &
3055  it, mpi_comm_wave, irqgo(ih), ierr)
3056 #ifdef W3_MPIT
3057  WRITE (ndst,9011) ih, ' 6/13', iroot, it, irqgo(ih), ierr
3058 #endif
3059  END IF
3060  !
3061  IF ( flgrdall( 7, 1) ) THEN
3062  ih = ih + 1
3063  it = it + 1
3064  CALL mpi_send_init (aba(1),nsealm , mpi_real, iroot, &
3065  it, mpi_comm_wave, irqgo(ih), ierr)
3066 #ifdef W3_MPIT
3067  WRITE (ndst,9011) ih, ' 7/01', iroot, it, irqgo(ih), ierr
3068 #endif
3069  ih = ih + 1
3070  it = it + 1
3071  CALL mpi_send_init (abd(1),nsealm , mpi_real, iroot, &
3072  it, mpi_comm_wave, irqgo(ih), ierr)
3073 #ifdef W3_MPIT
3074  WRITE (ndst,9011) ih, ' 7/01', iroot, it, irqgo(ih), ierr
3075 #endif
3076  END IF
3077  !
3078  IF ( flgrdall( 7, 2) ) THEN
3079  ih = ih + 1
3080  it = it + 1
3081  CALL mpi_send_init (uba(1),nsealm , mpi_real, iroot, &
3082  it, mpi_comm_wave, irqgo(ih), ierr)
3083 #ifdef W3_MPIT
3084  WRITE (ndst,9011) ih, ' 7/02', iroot, it, irqgo(ih), ierr
3085 #endif
3086  ih = ih + 1
3087  it = it + 1
3088  CALL mpi_send_init (ubd(1),nsealm , mpi_real, iroot, &
3089  it, mpi_comm_wave, irqgo(ih), ierr)
3090 #ifdef W3_MPIT
3091  WRITE (ndst,9011) ih, ' 7/02', iroot, it, irqgo(ih), ierr
3092 #endif
3093  END IF
3094  !
3095  IF ( flgrdall( 7, 3) ) THEN
3096  ih = ih + 1
3097  it = it + 1
3098  CALL mpi_send_init (bedforms(1,1),nsealm , mpi_real, &
3099  iroot, it, mpi_comm_wave, irqgo(ih), ierr)
3100 #ifdef W3_MPIT
3101  WRITE (ndst,9011) ih, ' 7/03', iroot, it, irqgo(ih), ierr
3102 #endif
3103  ih = ih + 1
3104  it = it + 1
3105  CALL mpi_send_init (bedforms(1,2),nsealm , mpi_real, &
3106  iroot, it, mpi_comm_wave, irqgo(ih), ierr)
3107 #ifdef W3_MPIT
3108  WRITE (ndst,9011) ih, ' 7/03', iroot, it, irqgo(ih), ierr
3109 #endif
3110  ih = ih + 1
3111  it = it + 1
3112  CALL mpi_send_init (bedforms(1,3),nsealm , mpi_real, &
3113  iroot, it, mpi_comm_wave, irqgo(ih), ierr)
3114 #ifdef W3_MPIT
3115  WRITE (ndst,9011) ih, ' 7/03', iroot, it, irqgo(ih), ierr
3116 #endif
3117  END IF
3118  !
3119  IF ( flgrdall( 7, 4) ) THEN
3120  ih = ih + 1
3121  it = it + 1
3122  CALL mpi_send_init (phibbl(1),nsealm , mpi_real, iroot, &
3123  it, mpi_comm_wave, irqgo(ih), ierr)
3124 #ifdef W3_MPIT
3125  WRITE (ndst,9011) ih, ' 7/04', iroot, it, irqgo(ih), ierr
3126 #endif
3127  END IF
3128  !
3129  IF ( flgrdall( 7, 5) ) THEN
3130  ih = ih + 1
3131  it = it + 1
3132  CALL mpi_send_init (taubbl(1,1),nsealm , mpi_real, &
3133  iroot, it, mpi_comm_wave, irqgo(ih), ierr)
3134 #ifdef W3_MPIT
3135  WRITE (ndst,9011) ih, ' 7/05', iroot, it, irqgo(ih), ierr
3136 #endif
3137  ih = ih + 1
3138  it = it + 1
3139  CALL mpi_send_init (taubbl(1,2),nsealm , mpi_real, &
3140  iroot, it, mpi_comm_wave, irqgo(ih), ierr)
3141 #ifdef W3_MPIT
3142  WRITE (ndst,9011) ih, ' 7/05', iroot, it, irqgo(ih), ierr
3143 #endif
3144  END IF
3145  !
3146  IF ( flgrdall( 8, 1) ) THEN
3147  ih = ih + 1
3148  it = it + 1
3149  CALL mpi_send_init (mssx(1),nsealm , mpi_real, iroot, &
3150  it, mpi_comm_wave, irqgo(ih), ierr)
3151 #ifdef W3_MPIT
3152  WRITE (ndst,9011) ih, ' 8/01', iroot, it, irqgo(ih), ierr
3153 #endif
3154  ih = ih + 1
3155  it = it + 1
3156  CALL mpi_send_init (mssy(1),nsealm , mpi_real, iroot, &
3157  it, mpi_comm_wave, irqgo(ih), ierr)
3158 #ifdef W3_MPIT
3159  WRITE (ndst,9011) ih, ' 8/01', iroot, it, irqgo(ih), ierr
3160 #endif
3161  END IF
3162  !
3163  IF ( flgrdall( 8, 2) ) THEN
3164  ih = ih + 1
3165  it = it + 1
3166  CALL mpi_send_init (mscx(1),nsealm , mpi_real, iroot, &
3167  it, mpi_comm_wave, irqgo(ih), ierr)
3168 #ifdef W3_MPIT
3169  WRITE (ndst,9011) ih, ' 8/02', iroot, it, irqgo(ih), ierr
3170 #endif
3171  ih = ih + 1
3172  it = it + 1
3173  CALL mpi_send_init (mscy(1),nsealm , mpi_real, iroot, &
3174  it, mpi_comm_wave, irqgo(ih), ierr)
3175 #ifdef W3_MPIT
3176  WRITE (ndst,9011) ih, ' 8/02', iroot, it, irqgo(ih), ierr
3177 #endif
3178  END IF
3179  !
3180  IF ( flgrdall( 8, 3) ) THEN
3181  ih = ih + 1
3182  it = it + 1
3183  CALL mpi_send_init (mssd(1),nsealm , mpi_real, iroot, &
3184  it, mpi_comm_wave, irqgo(ih), ierr)
3185 #ifdef W3_MPIT
3186  WRITE (ndst,9011) ih, ' 8/03', iroot, it, irqgo(ih), ierr
3187 #endif
3188  END IF
3189  !
3190  IF ( flgrdall( 8, 4) ) THEN
3191  ih = ih + 1
3192  it = it + 1
3193  CALL mpi_send_init (mscd(1),nsealm , mpi_real, iroot, &
3194  it, mpi_comm_wave, irqgo(ih), ierr)
3195 #ifdef W3_MPIT
3196  WRITE (ndst,9011) ih, ' 8/04', iroot, it, irqgo(ih), ierr
3197 #endif
3198  END IF
3199  !
3200  IF ( flgrdall( 8, 5) ) THEN
3201  ih = ih + 1
3202  it = it + 1
3203  CALL mpi_send_init (qp(1),nsealm , mpi_real, iroot, &
3204  it, mpi_comm_wave, irqgo(ih), ierr)
3205 #ifdef W3_MPIT
3206  WRITE (ndst,9011) ih, ' 8/05', iroot, it, irqgo(ih), ierr
3207 #endif
3208  END IF
3209  !
3210  IF ( flgrdall( 8, 6) ) THEN
3211  ih = ih + 1
3212  it = it + 1
3213  CALL mpi_send_init (qkk(1),nsealm , mpi_real, iroot, &
3214  it, mpi_comm_wave, irqgo(ih), ierr)
3215 #ifdef W3_MPIT
3216  WRITE (ndst,9011) ih, ' 8/06', iroot, it, irqgo(ih), ierr
3217 #endif
3218  END IF
3219  !
3220  IF ( flgrdall( 8, 7) ) THEN
3221  ih = ih + 1
3222  it = it + 1
3223  CALL mpi_send_init (skew(1),nsealm , mpi_real, iroot, &
3224  it, mpi_comm_wave, irqgo(ih), ierr)
3225 #ifdef W3_MPIT
3226  WRITE (ndst,9011) ih, ' 8/07', iroot, it, irqgo(ih), ierr
3227 #endif
3228  END IF
3229  !
3230  IF ( flgrdall( 8, 8) ) THEN
3231  ih = ih + 1
3232  it = it + 1
3233  CALL mpi_send_init (embia1(1),nsealm , mpi_real, iroot, &
3234  it, mpi_comm_wave, irqgo(ih), ierr)
3235 #ifdef W3_MPIT
3236  WRITE (ndst,9011) ih, ' 8/08', iroot, it, irqgo(ih), ierr
3237 #endif
3238  END IF
3239  !
3240  IF ( flgrdall( 8, 9) ) THEN
3241  ih = ih + 1
3242  it = it + 1
3243  CALL mpi_send_init (embia2(1),nsealm , mpi_real, iroot, &
3244  it, mpi_comm_wave, irqgo(ih), ierr)
3245 #ifdef W3_MPIT
3246  WRITE (ndst,9011) ih, ' 8/09', iroot, it, irqgo(ih), ierr
3247 #endif
3248  END IF
3249  !
3250  IF ( flgrdall( 9, 1) ) THEN
3251  ih = ih + 1
3252  it = it + 1
3253  CALL mpi_send_init (dtdyn(1),nsealm , mpi_real, iroot, &
3254  it, mpi_comm_wave, irqgo(ih), ierr)
3255 #ifdef W3_MPIT
3256  WRITE (ndst,9011) ih, ' 9/01', iroot, it, irqgo(ih), ierr
3257 #endif
3258  END IF
3259  !
3260  IF ( flgrdall( 9, 2) ) THEN
3261  ih = ih + 1
3262  it = it + 1
3263  CALL mpi_send_init (fcut(1),nsealm , mpi_real, iroot, &
3264  it, mpi_comm_wave, irqgo(ih), ierr)
3265 #ifdef W3_MPIT
3266  WRITE (ndst,9011) ih, ' 9/02', iroot, it, irqgo(ih), ierr
3267 #endif
3268  END IF
3269  !
3270  IF ( flgrdall( 9, 3) ) THEN
3271  ih = ih + 1
3272  it = it + 1
3273  CALL mpi_send_init (cflxymax(1),nsealm , mpi_real, iroot, &
3274  it, mpi_comm_wave, irqgo(ih), ierr)
3275 #ifdef W3_MPIT
3276  WRITE (ndst,9011) ih, ' 9/03', iroot, it, irqgo(ih), ierr
3277 #endif
3278  END IF
3279  !
3280  IF ( flgrdall( 9, 4) ) THEN
3281  ih = ih + 1
3282  it = it + 1
3283  CALL mpi_send_init (cflthmax(1),nsealm , mpi_real, iroot, &
3284  it, mpi_comm_wave, irqgo(ih), ierr)
3285 #ifdef W3_MPIT
3286  WRITE (ndst,9011) ih, ' 9/04', iroot, it, irqgo(ih), ierr
3287 #endif
3288  END IF
3289  !
3290  IF ( flgrdall( 9, 5) ) THEN
3291  ih = ih + 1
3292  it = it + 1
3293  CALL mpi_send_init (cflkmax(1),nsealm , mpi_real, iroot, &
3294  it, mpi_comm_wave, irqgo(ih), ierr)
3295 #ifdef W3_MPIT
3296  WRITE (ndst,9011) ih, ' 9/05', iroot, it, irqgo(ih), ierr
3297 #endif
3298  END IF
3299  !
3300  DO i=1, noextr
3301  IF ( flgrdall(10, i) ) THEN
3302  ih = ih + 1
3303  it = it + 1
3304  CALL mpi_send_init (usero(1,i),nsealm , mpi_real, iroot, &
3305  it, mpi_comm_wave, irqgo(ih), ierr)
3306 #ifdef W3_MPIT
3307  WRITE (string,'(A3,I2.2)') '10/', i
3308  WRITE (ndst,9011) ih, string, iroot, it, irqgo(ih), ierr
3309 #endif
3310  END IF
3311  END DO
3312  !
3313  nrqgo = ih
3314 #ifdef W3_MPIT
3315  WRITE (ndst,9012)
3316  WRITE (ndst,9013) nrqgo, nrqmax
3317 #endif
3318  !
3319  END IF !IF ( IAPROC .LE. NAPROC ) THEN
3320  !
3321  IF ( nrqgo .GT. nrqmax ) THEN
3322  WRITE (ndse,1010) nrqgo, nrqmax
3323  CALL extcde (10)
3324  END IF
3325  !
3326  IF ( iaproc .EQ. napfld ) THEN
3327  !
3328  ! 1.b Setting up expanded arrays
3329  !
3330  IF (napfld .EQ. naprst) THEN
3331  CALL w3xdma ( imod, ndse, ndst, flgrdarst )
3332  ELSE
3333  CALL w3xdma ( imod, ndse, ndst, flgrdall )
3334  ENDIF
3335  !
3336  ! 1.c Receives of fields
3337  !
3338  CALL w3xeta ( imod, ndse, ndst )
3339 #ifdef W3_MPIT
3340  WRITE (ndst,9010) '(RECV)'
3341 #endif
3342  !
3343  ih = 0
3344  !
3345  DO i0=1, naproc
3346  it = it0
3347  ifrom = i0 - 1
3348  !
3349  IF ( flgrdall( 1, 12) ) THEN
3350  ih = ih + 1
3351  it = it + 1
3352  CALL mpi_recv_init (icef(i0),1,ww3_field_vec, ifrom, it, &
3353  mpi_comm_wave, irqgo2(ih), ierr )
3354 #ifdef W3_MPIT
3355  WRITE (ndst,9011) ih, ' 1/09', ifrom, it, irqgo2(ih), ierr
3356 #endif
3357  END IF
3358  !
3359  IF ( flgrdall( 2, 1) ) THEN
3360  ih = ih + 1
3361  it = it + 1
3362  CALL mpi_recv_init (hs(i0),1,ww3_field_vec, ifrom, it, &
3363  mpi_comm_wave, irqgo2(ih), ierr )
3364 #ifdef W3_MPIT
3365  WRITE (ndst,9011) ih, ' 2/01', ifrom, it, irqgo2(ih), ierr
3366 #endif
3367  END IF
3368  !
3369  IF ( flgrdall( 2, 2) ) THEN
3370  ih = ih + 1
3371  it = it + 1
3372  CALL mpi_recv_init (wlm(i0),1,ww3_field_vec, ifrom, it, &
3373  mpi_comm_wave, irqgo2(ih), ierr )
3374 #ifdef W3_MPIT
3375  WRITE (ndst,9011) ih, ' 2/02', ifrom, it, irqgo2(ih), ierr
3376 #endif
3377  END IF
3378  !
3379  IF ( flgrdall( 2, 3) ) THEN
3380  ih = ih + 1
3381  it = it + 1
3382  CALL mpi_recv_init (t02(i0),1,ww3_field_vec, ifrom, it, &
3383  mpi_comm_wave, irqgo2(ih), ierr )
3384 #ifdef W3_MPIT
3385  WRITE (ndst,9011) ih, ' 2/03', ifrom, it, irqgo2(ih), ierr
3386 #endif
3387  END IF
3388  !
3389  IF ( flgrdall( 2, 4) ) THEN
3390  ih = ih + 1
3391  it = it + 1
3392  CALL mpi_recv_init (t0m1(i0),1,ww3_field_vec, ifrom, it, &
3393  mpi_comm_wave, irqgo2(ih), ierr )
3394 #ifdef W3_MPIT
3395  WRITE (ndst,9011) ih, ' 2/04', ifrom, it, irqgo2(ih), ierr
3396 #endif
3397  END IF
3398  !
3399  IF ( flgrdall( 2, 5) ) THEN
3400  ih = ih + 1
3401  it = it + 1
3402  CALL mpi_recv_init (t01(i0),1,ww3_field_vec, ifrom, it, &
3403  mpi_comm_wave, irqgo2(ih), ierr )
3404 #ifdef W3_MPIT
3405  WRITE (ndst,9011) ih, ' 2/05', ifrom, it, irqgo2(ih), ierr
3406 #endif
3407  END IF
3408  !
3409  IF ( flgrdall( 2, 6) .OR. flgrdall( 2,18) ) THEN
3410  ! TP output shares FP0 internal field with FP
3411  ih = ih + 1
3412  it = it + 1
3413  CALL mpi_recv_init (fp0(i0),1,ww3_field_vec, ifrom, it, &
3414  mpi_comm_wave, irqgo2(ih), ierr )
3415 #ifdef W3_MPIT
3416  WRITE (ndst,9011) ih, ' 2/06', ifrom, it, irqgo2(ih), ierr
3417 #endif
3418  END IF
3419  !
3420  IF ( flgrdall( 2, 7) ) THEN
3421  ih = ih + 1
3422  it = it + 1
3423  CALL mpi_recv_init (thm(i0),1,ww3_field_vec, ifrom, it, &
3424  mpi_comm_wave, irqgo2(ih), ierr )
3425 #ifdef W3_MPIT
3426  WRITE (ndst,9011) ih, ' 2/07', ifrom, it, irqgo2(ih), ierr
3427 #endif
3428  END IF
3429  !
3430  IF ( flgrdall( 2, 8) ) THEN
3431  ih = ih + 1
3432  it = it + 1
3433  CALL mpi_recv_init (ths(i0),1,ww3_field_vec, ifrom, it, &
3434  mpi_comm_wave, irqgo2(ih), ierr )
3435 #ifdef W3_MPIT
3436  WRITE (ndst,9011) ih, ' 2/08', ifrom, it, irqgo2(ih), ierr
3437 #endif
3438  END IF
3439  !
3440  IF ( flgrdall( 2, 9) ) THEN
3441  ih = ih + 1
3442  it = it + 1
3443  CALL mpi_recv_init (thp0(i0),1,ww3_field_vec, ifrom, it, &
3444  mpi_comm_wave, irqgo2(ih), ierr )
3445 #ifdef W3_MPIT
3446  WRITE (ndst,9011) ih, ' 2/09', ifrom, it, irqgo2(ih), ierr
3447 #endif
3448  END IF
3449  !
3450  IF ( flgrdall( 2, 10) ) THEN
3451  ih = ih + 1
3452  it = it + 1
3453  CALL mpi_recv_init (hsig(i0),1,ww3_field_vec, ifrom, it, &
3454  mpi_comm_wave, irqgo2(ih), ierr )
3455 #ifdef W3_MPIT
3456  WRITE (ndst,9011) ih, ' 2/10', ifrom, it, irqgo2(ih), ierr
3457 #endif
3458  END IF
3459  !
3460  IF ( flgrdall( 2, 11) ) THEN
3461  ih = ih + 1
3462  it = it + 1
3463  CALL mpi_recv_init (stmaxe(i0),1,ww3_field_vec, ifrom, it, &
3464  mpi_comm_wave, irqgo2(ih), ierr )
3465 #ifdef W3_MPIT
3466  WRITE (ndst,9011) ih, ' 2/11', ifrom, it, irqgo2(ih), ierr
3467 #endif
3468  END IF
3469  !
3470  IF ( flgrdall( 2, 12) ) THEN
3471  ih = ih + 1
3472  it = it + 1
3473  CALL mpi_recv_init (stmaxd(i0),1,ww3_field_vec, ifrom, it, &
3474  mpi_comm_wave, irqgo2(ih), ierr )
3475 #ifdef W3_MPIT
3476  WRITE (ndst,9011) ih, ' 2/12', ifrom, it, irqgo2(ih), ierr
3477 #endif
3478  END IF
3479  !
3480  IF ( flgrdall( 2, 13) ) THEN
3481  ih = ih + 1
3482  it = it + 1
3483  CALL mpi_recv_init (hmaxe(i0),1,ww3_field_vec, ifrom, it, &
3484  mpi_comm_wave, irqgo2(ih), ierr )
3485 #ifdef W3_MPIT
3486  WRITE (ndst,9011) ih, ' 2/13', ifrom, it, irqgo2(ih), ierr
3487 #endif
3488  END IF
3489  !
3490  IF ( flgrdall( 2, 14) ) THEN
3491  ih = ih + 1
3492  it = it + 1
3493  CALL mpi_recv_init (hcmaxe(i0),1,ww3_field_vec, ifrom, it, &
3494  mpi_comm_wave, irqgo2(ih), ierr )
3495 #ifdef W3_MPIT
3496  WRITE (ndst,9011) ih, ' 2/14', ifrom, it, irqgo2(ih), ierr
3497 #endif
3498  END IF
3499  !
3500  IF ( flgrdall( 2, 15) ) THEN
3501  ih = ih + 1
3502  it = it + 1
3503  CALL mpi_recv_init (hmaxd(i0),1,ww3_field_vec, ifrom, it, &
3504  mpi_comm_wave, irqgo2(ih), ierr )
3505 #ifdef W3_MPIT
3506  WRITE (ndst,9011) ih, ' 2/15', ifrom, it, irqgo2(ih), ierr
3507 #endif
3508  END IF
3509  !
3510  IF ( flgrdall( 2, 16) ) THEN
3511  ih = ih + 1
3512  it = it + 1
3513  CALL mpi_recv_init (hcmaxd(i0),1,ww3_field_vec, ifrom, it, &
3514  mpi_comm_wave, irqgo2(ih), ierr )
3515 #ifdef W3_MPIT
3516  WRITE (ndst,9011) ih, ' 2/16', ifrom, it, irqgo2(ih), ierr
3517 #endif
3518  END IF
3519  !
3520  IF ( flgrdall( 2, 17) ) THEN
3521  ih = ih + 1
3522  it = it + 1
3523  CALL mpi_recv_init (wbt(i0),1,ww3_field_vec, ifrom, it, &
3524  mpi_comm_wave, irqgo2(ih), ierr )
3525 #ifdef W3_MPIT
3526  WRITE (ndst,9011) ih, ' 2/17', ifrom, it, irqgo2(ih), ierr
3527 #endif
3528  END IF
3529  !
3530  IF ( flgrdall( 2, 19) ) THEN
3531  ih = ih + 1
3532  it = it + 1
3533  CALL mpi_recv_init (wnmean(i0),1,ww3_field_vec, ifrom, it, &
3534  mpi_comm_wave, irqgo2(ih), ierr )
3535 #ifdef W3_MPIT
3536  WRITE (ndst,9011) ih, ' 2/19', ifrom, it, irqgo2(ih), ierr
3537 #endif
3538  END IF
3539  !
3540  IF ( flgrdall( 3, 1) ) THEN
3541  DO ik=e3df(2,1),e3df(3,1)
3542  ih = ih + 1
3543  it = it + 1
3544  CALL mpi_recv_init (ef(i0,ik),1,ww3_field_vec, ifrom, it,&
3545  mpi_comm_wave, irqgo2(ih), ierr )
3546 #ifdef W3_MPIT
3547  WRITE (ndst,9011) ih, 'EF', ifrom, it, irqgo2(ih), ierr
3548 #endif
3549  END DO
3550  END IF
3551  !
3552  IF ( flgrdall( 3, 2) ) THEN
3553  DO ik=e3df(2,2),e3df(3,2)
3554  ih = ih + 1
3555  it = it + 1
3556  CALL mpi_recv_init (th1m(i0,ik),1,ww3_field_vec, ifrom, it,&
3557  mpi_comm_wave, irqgo2(ih), ierr )
3558 #ifdef W3_MPIT
3559  WRITE (ndst,9011) ih, 'TH1M', ifrom, it, irqgo2(ih), ierr
3560 #endif
3561  END DO
3562  END IF
3563  !
3564  IF ( flgrdall( 3, 3) ) THEN
3565  DO ik=e3df(2,3),e3df(3,3)
3566  ih = ih + 1
3567  it = it + 1
3568  CALL mpi_recv_init (sth1m(i0,ik),1,ww3_field_vec, ifrom, it,&
3569  mpi_comm_wave, irqgo2(ih), ierr )
3570 #ifdef W3_MPIT
3571  WRITE (ndst,9011) ih, 'STH1M', ifrom, it, irqgo2(ih), ierr
3572 #endif
3573  END DO
3574  END IF
3575  !
3576  IF ( flgrdall( 3, 4) ) THEN
3577  DO ik=e3df(2,4),e3df(3,4)
3578  ih = ih + 1
3579  it = it + 1
3580  CALL mpi_recv_init (th2m(i0,ik),1,ww3_field_vec, ifrom, it,&
3581  mpi_comm_wave, irqgo2(ih), ierr )
3582 #ifdef W3_MPIT
3583  WRITE (ndst,9011) ih, 'TH2M', ifrom, it, irqgo2(ih), ierr
3584 #endif
3585  END DO
3586  END IF
3587  !
3588  IF ( flgrdall( 3, 5) ) THEN
3589  DO ik=e3df(2,5),e3df(3,5)
3590  ih = ih + 1
3591  it = it + 1
3592  CALL mpi_recv_init (sth2m(i0,ik),1,ww3_field_vec, ifrom, it,&
3593  mpi_comm_wave, irqgo2(ih), ierr )
3594 #ifdef W3_MPIT
3595  WRITE (ndst,9011) ih, 'STH2M', ifrom, it, irqgo2(ih), ierr
3596 #endif
3597  END DO
3598  END IF
3599  !
3600  IF ( flgrdall( 4, 1) ) THEN
3601  DO k=0, noswll
3602  ih = ih + 1
3603  it = it + 1
3604  CALL mpi_recv_init (phs(i0,k),1,ww3_field_vec, ifrom, it, &
3605  mpi_comm_wave, irqgo2(ih), ierr )
3606 #ifdef W3_MPIT
3607  WRITE (ndst,9011) ih, ' 4/01', ifrom, it, irqgo2(ih), ierr
3608 #endif
3609  END DO
3610  END IF
3611  !
3612  IF ( flgrdall( 4, 2) ) THEN
3613  DO k=0, noswll
3614  ih = ih + 1
3615  it = it + 1
3616  CALL mpi_recv_init (ptp(i0,k),1,ww3_field_vec, ifrom, it, &
3617  mpi_comm_wave, irqgo2(ih), ierr )
3618 #ifdef W3_MPIT
3619  WRITE (ndst,9011) ih, ' 4/02', ifrom, it, irqgo2(ih), ierr
3620 #endif
3621  END DO
3622  END IF
3623  !
3624  IF ( flgrdall( 4, 3) ) THEN
3625  DO k=0, noswll
3626  ih = ih + 1
3627  it = it + 1
3628  CALL mpi_recv_init (plp(i0,k),1,ww3_field_vec, ifrom, it, &
3629  mpi_comm_wave, irqgo2(ih), ierr )
3630 #ifdef W3_MPIT
3631  WRITE (ndst,9011) ih, ' 4/03', ifrom, it, irqgo2(ih), ierr
3632 #endif
3633  END DO
3634  END IF
3635  !
3636  IF ( flgrdall( 4, 4) ) THEN
3637  DO k=0, noswll
3638  ih = ih + 1
3639  it = it + 1
3640  CALL mpi_recv_init (pdir(i0,k),1,ww3_field_vec, ifrom, it, &
3641  mpi_comm_wave, irqgo2(ih), ierr )
3642 #ifdef W3_MPIT
3643  WRITE (ndst,9011) ih, ' 4/04', ifrom, it, irqgo2(ih), ierr
3644 #endif
3645  END DO
3646  END IF
3647  !
3648  IF ( flgrdall( 4, 5) ) THEN
3649  DO k=0, noswll
3650  ih = ih + 1
3651  it = it + 1
3652  CALL mpi_recv_init (psi(i0,k),1,ww3_field_vec, ifrom, it, &
3653  mpi_comm_wave, irqgo2(ih), ierr )
3654 #ifdef W3_MPIT
3655  WRITE (ndst,9011) ih, ' 4/05', ifrom, it, irqgo2(ih), ierr
3656 #endif
3657  END DO
3658  END IF
3659  !
3660  IF ( flgrdall( 4, 6) ) THEN
3661  DO k=0, noswll
3662  ih = ih + 1
3663  it = it + 1
3664  CALL mpi_recv_init (pws(i0,k),1,ww3_field_vec, ifrom, it, &
3665  mpi_comm_wave, irqgo2(ih), ierr )
3666 #ifdef W3_MPIT
3667  WRITE (ndst,9011) ih, ' 4/06', ifrom, it, irqgo2(ih), ierr
3668 #endif
3669  END DO
3670  END IF
3671  !
3672  IF ( flgrdall( 4, 7) ) THEN
3673  DO k=0, noswll
3674  ih = ih + 1
3675  it = it + 1
3676  CALL mpi_recv_init (pthp0(i0,k),1,ww3_field_vec, ifrom, it,&
3677  mpi_comm_wave, irqgo2(ih), ierr )
3678 #ifdef W3_MPIT
3679  WRITE (ndst,9011) ih, ' 4/07', ifrom, it, irqgo2(ih), ierr
3680 #endif
3681  END DO
3682  END IF
3683  !
3684  IF ( flgrdall( 4, 8) ) THEN
3685  DO k=0, noswll
3686  ih = ih + 1
3687  it = it + 1
3688  CALL mpi_recv_init (pqp(i0,k),1,ww3_field_vec, ifrom, it, &
3689  mpi_comm_wave, irqgo2(ih), ierr )
3690 #ifdef W3_MPIT
3691  WRITE (ndst,9011) ih, ' 4/08', ifrom, it, irqgo2(ih), ierr
3692 #endif
3693  END DO
3694  END IF
3695  !
3696  IF ( flgrdall( 4, 9) ) THEN
3697  DO k=0, noswll
3698  ih = ih + 1
3699  it = it + 1
3700  CALL mpi_recv_init (ppe(i0,k),1,ww3_field_vec, ifrom, it, &
3701  mpi_comm_wave, irqgo2(ih), ierr )
3702 #ifdef W3_MPIT
3703  WRITE (ndst,9011) ih, ' 4/09', ifrom, it, irqgo2(ih), ierr
3704 #endif
3705  END DO
3706  END IF
3707  !
3708  IF ( flgrdall( 4,10) ) THEN
3709  DO k=0, noswll
3710  ih = ih + 1
3711  it = it + 1
3712  CALL mpi_recv_init (pgw(i0,k),1,ww3_field_vec, ifrom, it, &
3713  mpi_comm_wave, irqgo2(ih), ierr )
3714 #ifdef W3_MPIT
3715  WRITE (ndst,9011) ih, ' 4/10', ifrom, it, irqgo2(ih), ierr
3716 #endif
3717  END DO
3718  END IF
3719  !
3720  IF ( flgrdall( 4,11) ) THEN
3721  DO k=0, noswll
3722  ih = ih + 1
3723  it = it + 1
3724  CALL mpi_recv_init (psw(i0,k),1,ww3_field_vec, ifrom, it, &
3725  mpi_comm_wave, irqgo2(ih), ierr )
3726 #ifdef W3_MPIT
3727  WRITE (ndst,9011) ih, ' 4/11', ifrom, it, irqgo2(ih), ierr
3728 #endif
3729  END DO
3730  END IF
3731  !
3732  IF ( flgrdall( 4,12) ) THEN
3733  DO k=0, noswll
3734  ih = ih + 1
3735  it = it + 1
3736  CALL mpi_recv_init (ptm1(i0,k),1,ww3_field_vec, ifrom, it,&
3737  mpi_comm_wave, irqgo2(ih), ierr )
3738 #ifdef W3_MPIT
3739  WRITE (ndst,9011) ih, ' 4/12', ifrom, it, irqgo2(ih), ierr
3740 #endif
3741  END DO
3742  END IF
3743  !
3744  IF ( flgrdall( 4,13) ) THEN
3745  DO k=0, noswll
3746  ih = ih + 1
3747  it = it + 1
3748  CALL mpi_recv_init (pt1(i0,k),1,ww3_field_vec, ifrom, it, &
3749  mpi_comm_wave, irqgo2(ih), ierr )
3750 #ifdef W3_MPIT
3751  WRITE (ndst,9011) ih, ' 4/13', ifrom, it, irqgo2(ih), ierr
3752 #endif
3753  END DO
3754  END IF
3755  !
3756  IF ( flgrdall( 4,14) ) THEN
3757  DO k=0, noswll
3758  ih = ih + 1
3759  it = it + 1
3760  CALL mpi_recv_init (pt2(i0,k),1,ww3_field_vec, ifrom, it, &
3761  mpi_comm_wave, irqgo2(ih), ierr )
3762 #ifdef W3_MPIT
3763  WRITE (ndst,9011) ih, ' 4/14', ifrom, it, irqgo2(ih), ierr
3764 #endif
3765  END DO
3766  END IF
3767  !
3768  IF ( flgrdall( 4,15) ) THEN
3769  DO k=0, noswll
3770  ih = ih + 1
3771  it = it + 1
3772  CALL mpi_recv_init (pep(i0,k),1,ww3_field_vec, ifrom, it, &
3773  mpi_comm_wave, irqgo2(ih), ierr )
3774 #ifdef W3_MPIT
3775  WRITE (ndst,9011) ih, ' 4/15', ifrom, it, irqgo2(ih), ierr
3776 #endif
3777  END DO
3778  END IF
3779  !
3780  IF ( flgrdall( 4,16) ) THEN
3781  ih = ih + 1
3782  it = it + 1
3783  CALL mpi_recv_init (pwst(i0),1,ww3_field_vec, ifrom, it, &
3784  mpi_comm_wave, irqgo2(ih), ierr )
3785 #ifdef W3_MPIT
3786  WRITE (ndst,9011) ih, ' 4/16', ifrom, it, irqgo2(ih), ierr
3787 #endif
3788  END IF
3789  !
3790  IF ( flgrdall( 4,17) ) THEN
3791  ih = ih + 1
3792  it = it + 1
3793  CALL mpi_recv_init (pnr(i0),1,ww3_field_vec, ifrom, it, &
3794  mpi_comm_wave, irqgo2(ih), ierr )
3795 #ifdef W3_MPIT
3796  WRITE (ndst,9011) ih, ' 4/17', ifrom, it, irqgo2(ih), ierr
3797 #endif
3798  END IF
3799  !
3800  IF ( flgrdall( 5, 1) ) THEN
3801  ih = ih + 1
3802  it = it + 1
3803  CALL mpi_recv_init (ust(i0), 1, ww3_field_vec, ifrom, &
3804  it, mpi_comm_wave, irqgo2(ih), ierr )
3805 #ifdef W3_MPIT
3806  WRITE (ndst,9011) ih, ' 5/01', ifrom, it, irqgo2(ih), ierr
3807 #endif
3808  ih = ih + 1
3809  it = it + 1
3810  CALL mpi_recv_init (ustdir(i0), 1, ww3_field_vec, ifrom, &
3811  it, mpi_comm_wave, irqgo2(ih), ierr )
3812 #ifdef W3_MPIT
3813  WRITE (ndst,9011) ih, ' 5/01', ifrom, it, irqgo2(ih), ierr
3814 #endif
3815  ih = ih + 1
3816  it = it + 1
3817  CALL mpi_recv_init (asf(i0), 1, ww3_field_vec, ifrom, &
3818  it, mpi_comm_wave, irqgo2(ih), ierr )
3819 #ifdef W3_MPIT
3820  WRITE (ndst,9011) ih, ' 5/01', ifrom, it, irqgo2(ih), ierr
3821 #endif
3822  END IF
3823  !
3824  IF ( flgrdall( 5, 2) ) THEN
3825  ih = ih + 1
3826  it = it + 1
3827  CALL mpi_recv_init (charn(i0),1,ww3_field_vec, ifrom, it, &
3828  mpi_comm_wave, irqgo2(ih), ierr )
3829 #ifdef W3_MPIT
3830  WRITE (ndst,9011) ih, ' 5/02', ifrom, it, irqgo2(ih), ierr
3831 #endif
3832  END IF
3833  !
3834  IF ( flgrdall( 5, 3) ) THEN
3835  ih = ih + 1
3836  it = it + 1
3837  CALL mpi_recv_init (cge(i0),1,ww3_field_vec, ifrom, it, &
3838  mpi_comm_wave, irqgo2(ih), ierr )
3839 #ifdef W3_MPIT
3840  WRITE (ndst,9011) ih, ' 5/03', ifrom, it, irqgo2(ih), ierr
3841 #endif
3842  END IF
3843  !
3844  IF ( flgrdall( 5, 4) ) THEN
3845  ih = ih + 1
3846  it = it + 1
3847  CALL mpi_recv_init (phiaw(i0),1,ww3_field_vec, ifrom, it, &
3848  mpi_comm_wave, irqgo2(ih), ierr )
3849 #ifdef W3_MPIT
3850  WRITE (ndst,9011) ih, ' 5/04', ifrom, it, irqgo2(ih), ierr
3851 #endif
3852  END IF
3853  !
3854  IF ( flgrdall( 5, 5) ) THEN
3855  ih = ih + 1
3856  it = it + 1
3857  CALL mpi_recv_init (tauwix(i0),1,ww3_field_vec, ifrom, it, &
3858  mpi_comm_wave, irqgo2(ih), ierr )
3859 #ifdef W3_MPIT
3860  WRITE (ndst,9011) ih, ' 5/05', ifrom, it, irqgo2(ih), ierr
3861 #endif
3862  ih = ih + 1
3863  it = it + 1
3864  CALL mpi_recv_init (tauwiy(i0),1,ww3_field_vec, ifrom, it, &
3865  mpi_comm_wave, irqgo2(ih), ierr )
3866 #ifdef W3_MPIT
3867  WRITE (ndst,9011) ih, ' 5/05', ifrom, it, irqgo2(ih), ierr
3868 #endif
3869  END IF
3870  !
3871  IF ( flgrdall( 5, 6) ) THEN
3872  ih = ih + 1
3873  it = it + 1
3874  CALL mpi_recv_init (tauwnx(i0),1,ww3_field_vec, ifrom, it, &
3875  mpi_comm_wave, irqgo2(ih), ierr )
3876 #ifdef W3_MPIT
3877  WRITE (ndst,9011) ih, ' 5/06', ifrom, it, irqgo2(ih), ierr
3878 #endif
3879  ih = ih + 1
3880  it = it + 1
3881  CALL mpi_recv_init (tauwny(i0),1,ww3_field_vec, ifrom, it, &
3882  mpi_comm_wave, irqgo2(ih), ierr )
3883 #ifdef W3_MPIT
3884  WRITE (ndst,9011) ih, ' 5/06', ifrom, it, irqgo2(ih), ierr
3885 #endif
3886  END IF
3887  !
3888  IF ( flgrdall( 5, 7) ) THEN
3889  ih = ih + 1
3890  it = it + 1
3891  CALL mpi_recv_init (whitecap(i0,1),1,ww3_field_vec, ifrom, &
3892  it, mpi_comm_wave, irqgo2(ih), ierr )
3893 #ifdef W3_MPIT
3894  WRITE (ndst,9011) ih, ' 5/07', ifrom, it, irqgo2(ih), ierr
3895 #endif
3896  END IF
3897  !
3898  IF ( flgrdall( 5, 8) ) THEN
3899  ih = ih + 1
3900  it = it + 1
3901  CALL mpi_recv_init (whitecap(i0,2),1,ww3_field_vec, ifrom, &
3902  it, mpi_comm_wave, irqgo2(ih), ierr )
3903 #ifdef W3_MPIT
3904  WRITE (ndst,9011) ih, ' 5/08', ifrom, it, irqgo2(ih), ierr
3905 #endif
3906  END IF
3907  !
3908  IF ( flgrdall( 5, 9) ) THEN
3909  ih = ih + 1
3910  it = it + 1
3911  CALL mpi_recv_init (whitecap(i0,3),1,ww3_field_vec, ifrom, &
3912  it, mpi_comm_wave, irqgo2(ih), ierr )
3913 #ifdef W3_MPIT
3914  WRITE (ndst,9011) ih, ' 5/09', ifrom, it, irqgo2(ih), ierr
3915 #endif
3916  END IF
3917  !
3918  IF ( flgrdall( 5,10) ) THEN
3919  ih = ih + 1
3920  it = it + 1
3921  CALL mpi_recv_init (whitecap(i0,4),1,ww3_field_vec, ifrom, &
3922  it, mpi_comm_wave, irqgo2(ih), ierr )
3923 #ifdef W3_MPIT
3924  WRITE (ndst,9011) ih, ' 5/10', ifrom, it, irqgo2(ih), ierr
3925 #endif
3926  END IF
3927  !
3928  IF ( flgrdall( 5,11) ) THEN
3929  ih = ih + 1
3930  it = it + 1
3931  CALL mpi_recv_init (tws(i0),1,ww3_field_vec, ifrom, it, &
3932  mpi_comm_wave, irqgo2(ih), ierr )
3933 #ifdef W3_MPIT
3934  WRITE (ndst,9011) ih, ' 5/11', ifrom, it, irqgo2(ih), ierr
3935 #endif
3936  END IF
3937  !
3938  IF ( flgrdall( 6, 1) ) THEN
3939  ih = ih + 1
3940  it = it + 1
3941  CALL mpi_recv_init (sxx(i0),1,ww3_field_vec, ifrom, it, &
3942  mpi_comm_wave, irqgo2(ih), ierr )
3943 #ifdef W3_MPIT
3944  WRITE (ndst,9011) ih, ' 6/01', ifrom, it, irqgo2(ih), ierr
3945 #endif
3946  ih = ih + 1
3947  it = it + 1
3948  CALL mpi_recv_init (syy(i0),1,ww3_field_vec, ifrom, it, &
3949  mpi_comm_wave, irqgo2(ih), ierr )
3950 #ifdef W3_MPIT
3951  WRITE (ndst,9011) ih, ' 6/01', ifrom, it, irqgo2(ih), ierr
3952 #endif
3953  ih = ih + 1
3954  it = it + 1
3955  CALL mpi_recv_init (sxy(i0),1,ww3_field_vec, ifrom, it, &
3956  mpi_comm_wave, irqgo2(ih), ierr )
3957 #ifdef W3_MPIT
3958  WRITE (ndst,9011) ih, ' 6/01', ifrom, it, irqgo2(ih), ierr
3959 #endif
3960  END IF
3961  !
3962  IF ( flgrdall( 6, 2) ) THEN
3963  ih = ih + 1
3964  it = it + 1
3965  CALL mpi_recv_init (tauox(i0),1,ww3_field_vec, ifrom, it, &
3966  mpi_comm_wave, irqgo2(ih), ierr )
3967 #ifdef W3_MPIT
3968  WRITE (ndst,9011) ih, ' 6/02', ifrom, it, irqgo2(ih), ierr
3969 #endif
3970  ih = ih + 1
3971  it = it + 1
3972  CALL mpi_recv_init (tauoy(i0),1,ww3_field_vec, ifrom, it, &
3973  mpi_comm_wave, irqgo2(ih), ierr )
3974 #ifdef W3_MPIT
3975  WRITE (ndst,9011) ih, ' 6/02', ifrom, it, irqgo2(ih), ierr
3976 #endif
3977  END IF
3978  !
3979  IF ( flgrdall( 6, 3) ) THEN
3980  ih = ih + 1
3981  it = it + 1
3982  CALL mpi_recv_init (bhd(i0),1,ww3_field_vec, ifrom, it, &
3983  mpi_comm_wave, irqgo2(ih), ierr )
3984 #ifdef W3_MPIT
3985  WRITE (ndst,9011) ih, ' 6/03', ifrom, it, irqgo2(ih), ierr
3986 #endif
3987  END IF
3988  !
3989  IF ( flgrdall( 6, 4) ) THEN
3990  ih = ih + 1
3991  it = it + 1
3992  CALL mpi_recv_init (phioc(i0),1,ww3_field_vec, ifrom, it, &
3993  mpi_comm_wave, irqgo2(ih), ierr )
3994 #ifdef W3_MPIT
3995  WRITE (ndst,9011) ih, ' 6/04', ifrom, it, irqgo2(ih), ierr
3996 #endif
3997  END IF
3998  !
3999  IF ( flgrdall( 6, 5) ) THEN
4000  ih = ih + 1
4001  it = it + 1
4002  CALL mpi_recv_init (tusx(i0),1,ww3_field_vec, ifrom, it, &
4003  mpi_comm_wave, irqgo2(ih), ierr )
4004 #ifdef W3_MPIT
4005  WRITE (ndst,9011) ih, ' 6/05', ifrom, it, irqgo2(ih), ierr
4006 #endif
4007  ih = ih + 1
4008  it = it + 1
4009  CALL mpi_recv_init (tusy(i0),1,ww3_field_vec, ifrom, it, &
4010  mpi_comm_wave, irqgo2(ih), ierr )
4011 #ifdef W3_MPIT
4012  WRITE (ndst,9011) ih, ' 6/05', ifrom, it, irqgo2(ih), ierr
4013 #endif
4014  END IF
4015  !
4016  IF ( flgrdall( 6, 6) ) THEN
4017  ih = ih + 1
4018  it = it + 1
4019  CALL mpi_recv_init (ussx(i0),1,ww3_field_vec, ifrom, it, &
4020  mpi_comm_wave, irqgo2(ih), ierr )
4021 #ifdef W3_MPIT
4022  WRITE (ndst,9011) ih, ' 6/06', ifrom, it, irqgo2(ih), ierr
4023 #endif
4024  ih = ih + 1
4025  it = it + 1
4026  CALL mpi_recv_init (ussy(i0),1,ww3_field_vec, ifrom, it, &
4027  mpi_comm_wave, irqgo2(ih), ierr )
4028 #ifdef W3_MPIT
4029  WRITE (ndst,9011) ih, ' 6/06', ifrom, it, irqgo2(ih), ierr
4030 #endif
4031  END IF
4032  !
4033  IF ( flgrdall( 6, 7) ) THEN
4034  ih = ih + 1
4035  it = it + 1
4036  CALL mpi_recv_init (prms(i0),1,ww3_field_vec, ifrom, it, &
4037  mpi_comm_wave, irqgo2(ih), ierr )
4038 #ifdef W3_MPIT
4039  WRITE (ndst,9011) ih, ' 6/07', ifrom, it, irqgo2(ih), ierr
4040 #endif
4041  ih = ih + 1
4042  it = it + 1
4043  CALL mpi_recv_init (tpms(i0),1,ww3_field_vec, ifrom, it, &
4044  mpi_comm_wave, irqgo2(ih), ierr )
4045 #ifdef W3_MPIT
4046  WRITE (ndst,9011) ih, ' 6/07', ifrom, it, irqgo2(ih), ierr
4047 #endif
4048  END IF
4049  !
4050  IF ( flgrdall( 6, 8) ) THEN
4051  DO ik=1,2*nk
4052  ih = ih + 1
4053  it = it + 1
4054  CALL mpi_recv_init (us3d(i0,ik),1,ww3_field_vec, ifrom, it, &
4055  mpi_comm_wave, irqgo2(ih), ierr )
4056 #ifdef W3_MPIT
4057  WRITE (ndst,9011) ih, 'US3D ', ifrom, it, irqgo2(ih), ierr
4058 #endif
4059  END DO
4060  END IF
4061  !
4062  IF ( flgrdall( 6, 9) ) THEN
4063  DO k=p2msf(2),p2msf(3)
4064  ih = ih + 1
4065  it = it + 1
4066  CALL mpi_recv_init (p2sms(i0,k),1,ww3_field_vec, ifrom, it, &
4067  mpi_comm_wave, irqgo2(ih), ierr )
4068 #ifdef W3_MPIT
4069  WRITE (ndst,9011) ih, 'P3SMS', ifrom, it, irqgo2(ih), ierr
4070 #endif
4071  END DO
4072  END IF
4073  !
4074  IF ( flgrdall( 6,10) ) THEN
4075  ih = ih + 1
4076  it = it + 1
4077  CALL mpi_recv_init (tauice(i0,1),1,ww3_field_vec, ifrom, it, &
4078  mpi_comm_wave, irqgo2(ih), ierr )
4079 #ifdef W3_MPIT
4080  WRITE (ndst,9011) ih, ' 6/10', ifrom, it, irqgo2(ih), ierr
4081 #endif
4082  ih = ih + 1
4083  it = it + 1
4084  CALL mpi_recv_init (tauice(i0,2),1,ww3_field_vec, ifrom, it, &
4085  mpi_comm_wave, irqgo2(ih), ierr )
4086 #ifdef W3_MPIT
4087  WRITE (ndst,9011) ih, ' 6/10', ifrom, it, irqgo2(ih), ierr
4088 #endif
4089  END IF
4090  !
4091  IF ( flgrdall( 6,11) ) THEN
4092  ih = ih + 1
4093  it = it + 1
4094  CALL mpi_recv_init (phice(i0),1,ww3_field_vec, ifrom, it, &
4095  mpi_comm_wave, irqgo2(ih), ierr )
4096 #ifdef W3_MPIT
4097  WRITE (ndst,9011) ih, ' 6/11', ifrom, it, irqgo2(ih), ierr
4098 #endif
4099  END IF
4100  !
4101  IF ( flgrdall( 6, 12) ) THEN
4102  DO ik=1,2*nk
4103  ih = ih + 1
4104  it = it + 1
4105  CALL mpi_recv_init (ussp(i0,ik),1,ww3_field_vec, ifrom, it, &
4106  mpi_comm_wave, irqgo2(ih), ierr )
4107 #ifdef W3_MPIT
4108  WRITE (ndst,9011) ih, 'USSP ', ifrom, it, irqgo2(ih), ierr
4109 #endif
4110  END DO
4111  END IF
4112  !
4113  IF ( flgrdall( 6, 13) ) THEN
4114  ih = ih + 1
4115  it = it + 1
4116  CALL mpi_recv_init (tauocx(i0),1,ww3_field_vec, ifrom, it, &
4117  mpi_comm_wave, irqgo2(ih), ierr )
4118 #ifdef W3_MPIT
4119  WRITE (ndst,9011) ih, ' 6/13', ifrom, it, irqgo2(ih), ierr
4120 #endif
4121  ih = ih + 1
4122  it = it + 1
4123  CALL mpi_recv_init (tauocy(i0),1,ww3_field_vec, ifrom, it, &
4124  mpi_comm_wave, irqgo2(ih), ierr )
4125 #ifdef W3_MPIT
4126  WRITE (ndst,9011) ih, ' 6/13', ifrom, it, irqgo2(ih), ierr
4127 #endif
4128  END IF
4129  !
4130  IF ( flgrdall( 7, 1) ) THEN
4131  ih = ih + 1
4132  it = it + 1
4133  CALL mpi_recv_init (aba(i0),1,ww3_field_vec, ifrom, it, &
4134  mpi_comm_wave, irqgo2(ih), ierr )
4135 #ifdef W3_MPIT
4136  WRITE (ndst,9011) ih, ' 7/01', ifrom, it, irqgo2(ih), ierr
4137 #endif
4138  ih = ih + 1
4139  it = it + 1
4140  CALL mpi_recv_init (abd(i0),1,ww3_field_vec, ifrom, it, &
4141  mpi_comm_wave, irqgo2(ih), ierr )
4142 #ifdef W3_MPIT
4143  WRITE (ndst,9011) ih, ' 7/01', ifrom, it, irqgo2(ih), ierr
4144 #endif
4145  END IF
4146  !
4147  IF ( flgrdall( 7, 2) ) THEN
4148  ih = ih + 1
4149  it = it + 1
4150  CALL mpi_recv_init (uba(i0),1,ww3_field_vec, ifrom, it, &
4151  mpi_comm_wave, irqgo2(ih), ierr )
4152 #ifdef W3_MPIT
4153  WRITE (ndst,9011) ih, ' 7/02', ifrom, it, irqgo2(ih), ierr
4154 #endif
4155  ih = ih + 1
4156  it = it + 1
4157  CALL mpi_recv_init (ubd(i0),1,ww3_field_vec, ifrom, it, &
4158  mpi_comm_wave, irqgo2(ih), ierr )
4159 #ifdef W3_MPIT
4160  WRITE (ndst,9011) ih, ' 7/02', ifrom, it, irqgo2(ih), ierr
4161 #endif
4162  END IF
4163  !
4164  IF ( flgrdall( 7, 3) ) THEN
4165  ih = ih + 1
4166  it = it + 1
4167  CALL mpi_recv_init (bedforms(i0,1),1,ww3_field_vec, ifrom, &
4168  it, mpi_comm_wave, irqgo2(ih), ierr )
4169 #ifdef W3_MPIT
4170  WRITE (ndst,9011) ih, ' 7/03', ifrom, it, irqgo2(ih), ierr
4171 #endif
4172  ih = ih + 1
4173  it = it + 1
4174  CALL mpi_recv_init (bedforms(i0,2),1,ww3_field_vec, ifrom, &
4175  it, mpi_comm_wave, irqgo2(ih), ierr )
4176 #ifdef W3_MPIT
4177  WRITE (ndst,9011) ih, ' 7/03', ifrom, it, irqgo2(ih), ierr
4178 #endif
4179  ih = ih + 1
4180  it = it + 1
4181  CALL mpi_recv_init (bedforms(i0,3),1,ww3_field_vec, ifrom, &
4182  it, mpi_comm_wave, irqgo2(ih), ierr )
4183 #ifdef W3_MPIT
4184  WRITE (ndst,9011) ih, ' 7/03', ifrom, it, irqgo2(ih), ierr
4185 #endif
4186  END IF
4187  !
4188  IF ( flgrdall( 7, 4) ) THEN
4189  ih = ih + 1
4190  it = it + 1
4191  CALL mpi_recv_init (phibbl(i0),1,ww3_field_vec, ifrom, it, &
4192  mpi_comm_wave, irqgo2(ih), ierr )
4193 #ifdef W3_MPIT
4194  WRITE (ndst,9011) ih, ' 7/04', ifrom, it, irqgo2(ih), ierr
4195 #endif
4196  END IF
4197  !
4198  IF ( flgrdall( 7, 5) ) THEN
4199  ih = ih + 1
4200  it = it + 1
4201  CALL mpi_recv_init (taubbl(i0,1),1,ww3_field_vec, ifrom, &
4202  it, mpi_comm_wave, irqgo2(ih), ierr )
4203 #ifdef W3_MPIT
4204  WRITE (ndst,9011) ih, ' 7/05', ifrom, it, irqgo2(ih), ierr
4205 #endif
4206  ih = ih + 1
4207  it = it + 1
4208  CALL mpi_recv_init (taubbl(i0,2),1,ww3_field_vec, ifrom, &
4209  it, mpi_comm_wave, irqgo2(ih), ierr )
4210 #ifdef W3_MPIT
4211  WRITE (ndst,9011) ih, ' 7/05', ifrom, it, irqgo2(ih), ierr
4212 #endif
4213  END IF
4214  !
4215  IF ( flgrdall( 8, 1) ) THEN
4216  ih = ih + 1
4217  it = it + 1
4218  CALL mpi_recv_init (mssx(i0),1,ww3_field_vec, ifrom, it, &
4219  mpi_comm_wave, irqgo2(ih), ierr )
4220 #ifdef W3_MPIT
4221  WRITE (ndst,9011) ih, ' 8/01', ifrom, it, irqgo2(ih), ierr
4222 #endif
4223  ih = ih + 1
4224  it = it + 1
4225  CALL mpi_recv_init (mssy(i0),1,ww3_field_vec, ifrom, it, &
4226  mpi_comm_wave, irqgo2(ih), ierr )
4227 #ifdef W3_MPIT
4228  WRITE (ndst,9011) ih, ' 8/01', ifrom, it, irqgo2(ih), ierr
4229 #endif
4230  END IF
4231  !
4232  IF ( flgrdall( 8, 2) ) THEN
4233  ih = ih + 1
4234  it = it + 1
4235  CALL mpi_recv_init (mscx(i0),1,ww3_field_vec, ifrom, it, &
4236  mpi_comm_wave, irqgo2(ih), ierr )
4237 #ifdef W3_MPIT
4238  WRITE (ndst,9011) ih, ' 8/02', ifrom, it, irqgo2(ih), ierr
4239 #endif
4240  ih = ih + 1
4241  it = it + 1
4242  CALL mpi_recv_init (mscy(i0),1,ww3_field_vec, ifrom, it, &
4243  mpi_comm_wave, irqgo2(ih), ierr )
4244 #ifdef W3_MPIT
4245  WRITE (ndst,9011) ih, ' 8/02', ifrom, it, irqgo2(ih), ierr
4246 #endif
4247  END IF
4248  !
4249  IF ( flgrdall( 8, 3) ) THEN
4250  ih = ih + 1
4251  it = it + 1
4252  CALL mpi_recv_init (mssd(i0),1,ww3_field_vec, ifrom, it, &
4253  mpi_comm_wave, irqgo2(ih), ierr )
4254 #ifdef W3_MPIT
4255  WRITE (ndst,9011) ih, ' 8/03', ifrom, it, irqgo2(ih), ierr
4256 #endif
4257  END IF
4258  !
4259  IF ( flgrdall( 8, 4) ) THEN
4260  ih = ih + 1
4261  it = it + 1
4262  CALL mpi_recv_init (mscd(i0),1,ww3_field_vec, ifrom, it, &
4263  mpi_comm_wave, irqgo2(ih), ierr )
4264 #ifdef W3_MPIT
4265  WRITE (ndst,9011) ih, ' 8/04', ifrom, it, irqgo2(ih), ierr
4266 #endif
4267  END IF
4268  !
4269  IF ( flgrdall( 8, 5) ) THEN
4270  ih = ih + 1
4271  it = it + 1
4272  CALL mpi_recv_init (qp(i0),1,ww3_field_vec, ifrom, it, &
4273  mpi_comm_wave, irqgo2(ih), ierr )
4274 #ifdef W3_MPIT
4275  WRITE (ndst,9011) ih, ' 8/05', ifrom, it, irqgo2(ih), ierr
4276 #endif
4277  END IF
4278  !
4279  IF ( flgrdall( 8, 6) ) THEN
4280  ih = ih + 1
4281  it = it + 1
4282  CALL mpi_recv_init (qkk(i0),1,ww3_field_vec, ifrom, it, &
4283  mpi_comm_wave, irqgo2(ih), ierr )
4284 #ifdef W3_MPIT
4285  WRITE (ndst,9011) ih, ' 8/06', ifrom, it, irqgo2(ih), ierr
4286 #endif
4287  END IF
4288  !
4289  IF ( flgrdall( 8, 7) ) THEN
4290  ih = ih + 1
4291  it = it + 1
4292  CALL mpi_recv_init (skew(i0),1,ww3_field_vec, ifrom, it, &
4293  mpi_comm_wave, irqgo2(ih), ierr )
4294 #ifdef W3_MPIT
4295  WRITE (ndst,9011) ih, ' 8/07', ifrom, it, irqgo2(ih), ierr
4296 #endif
4297  END IF
4298  !
4299  IF ( flgrdall( 8, 8) ) THEN
4300  ih = ih + 1
4301  it = it + 1
4302  CALL mpi_recv_init (embia1(i0),1,ww3_field_vec, ifrom, it, &
4303  mpi_comm_wave, irqgo2(ih), ierr )
4304 #ifdef W3_MPIT
4305  WRITE (ndst,9011) ih, ' 8/08', ifrom, it, irqgo2(ih), ierr
4306 #endif
4307  END IF
4308  !
4309  IF ( flgrdall( 8, 9) ) THEN
4310  ih = ih + 1
4311  it = it + 1
4312  CALL mpi_recv_init (embia2(i0),1,ww3_field_vec, ifrom, it, &
4313  mpi_comm_wave, irqgo2(ih), ierr )
4314 #ifdef W3_MPIT
4315  WRITE (ndst,9011) ih, ' 8/09', ifrom, it, irqgo2(ih), ierr
4316 #endif
4317  END IF
4318  !
4319  IF ( flgrdall( 9, 1) ) THEN
4320  ih = ih + 1
4321  it = it + 1
4322  CALL mpi_recv_init (dtdyn(i0),1,ww3_field_vec, ifrom, it, &
4323  mpi_comm_wave, irqgo2(ih), ierr )
4324 #ifdef W3_MPIT
4325  WRITE (ndst,9011) ih, ' 9/01', ifrom, it, irqgo2(ih), ierr
4326 #endif
4327  END IF
4328  !
4329  IF ( flgrdall( 9, 2) ) THEN
4330  ih = ih + 1
4331  it = it + 1
4332  CALL mpi_recv_init (fcut(i0),1,ww3_field_vec, ifrom, it, &
4333  mpi_comm_wave, irqgo2(ih), ierr )
4334 #ifdef W3_MPIT
4335  WRITE (ndst,9011) ih, ' 9/02', ifrom, it, irqgo2(ih), ierr
4336 #endif
4337  END IF
4338  !
4339  IF ( flgrdall( 9, 3) ) THEN
4340  ih = ih + 1
4341  it = it + 1
4342  CALL mpi_recv_init (cflxymax(i0),1,ww3_field_vec, ifrom, it,&
4343  mpi_comm_wave, irqgo2(ih), ierr )
4344 #ifdef W3_MPIT
4345  WRITE (ndst,9011) ih, ' 9/03', ifrom, it, irqgo2(ih), ierr
4346 #endif
4347  END IF
4348  !
4349  IF ( flgrdall( 9, 4) ) THEN
4350  ih = ih + 1
4351  it = it + 1
4352  CALL mpi_recv_init (cflthmax(i0),1,ww3_field_vec, ifrom, it,&
4353  mpi_comm_wave, irqgo2(ih), ierr )
4354 #ifdef W3_MPIT
4355  WRITE (ndst,9011) ih, ' 9/04', ifrom, it, irqgo2(ih), ierr
4356 #endif
4357  END IF
4358  !
4359  IF ( flgrdall( 9, 5) ) THEN
4360  ih = ih + 1
4361  it = it + 1
4362  CALL mpi_recv_init (cflkmax(i0),1,ww3_field_vec, ifrom, it, &
4363  mpi_comm_wave, irqgo2(ih), ierr )
4364 #ifdef W3_MPIT
4365  WRITE (ndst,9011) ih, ' 9/05', ifrom, it, irqgo2(ih), ierr
4366 #endif
4367  END IF
4368  !
4369  DO i=1, noextr
4370  !WRITE(740+IAPROC,*) 'SECOND : I=', I, ' / ', NOEXTR, ' val=', FLGRDALL(10, I)
4371  IF ( flgrdall(10, i) ) THEN
4372  ih = ih + 1
4373  it = it + 1
4374  CALL mpi_recv_init (usero(i0,i),1,ww3_field_vec, ifrom, it, &
4375  mpi_comm_wave, irqgo2(ih), ierr )
4376 #ifdef W3_MPIT
4377  WRITE (string,'(A3,I2.2)') '10/', i
4378  WRITE (ndst,9011) ih, string, ifrom, it, irqgo2(ih), ierr
4379 #endif
4380  END IF
4381  END DO
4382  !
4383  END DO
4384  !
4385  nrqgo2 = ih
4386 #ifdef W3_MPIT
4387  WRITE (ndst,9012)
4388  WRITE (ndst,9014) nrqgo2, nrqmax*naproc
4389 #endif
4390  !
4391  CALL w3seta ( imod, ndse, ndst )
4392  !
4393  END IF ! IF ( IAPROC .EQ. NAPFLD ) THEN
4394  !
4395  IF ( nrqgo2 .GT. nrqmax*naproc ) THEN
4396  WRITE (ndse,1011) nrqgo2, nrqmax*naproc
4397  CALL extcde (11)
4398  END IF
4399  !
4400  END IF ! IF ((FLOUT(1) .OR. FLOUT(7)) .and. (.not. LPDLIB)) THEN
4401  !
4402  ! 2. Set-up for W3IORS ---------------------------------------------- /
4403  ! 2.a General preparations
4404  !
4405  nrqrs = 0
4406  ih = 0
4407  iroot = naprst - 1
4408  !
4409  IF ((flout(4) .OR. flout(8)) .and. (.not. lpdlib)) THEN
4410  IF (oarst) THEN
4411  ALLOCATE ( outpts(imod)%OUT4%IRQRS(34*naproc) )
4412  ELSE
4413  ALLOCATE ( outpts(imod)%OUT4%IRQRS(3*naproc) )
4414  ENDIF
4415  irqrs => outpts(imod)%OUT4%IRQRS
4416  !
4417  ! 2.b Fields at end of file (always)
4418  !
4419 #ifdef W3_MPIT
4420  WRITE (ndst,9020)
4421 #endif
4422  !
4423  IF ( iaproc.NE.naprst .AND. iaproc.LE.naproc ) THEN
4424  !
4425  ih = ih + 1
4426  it = it0 + 1
4427  CALL mpi_send_init (ust(iaproc), 1, ww3_field_vec, &
4428  iroot, it, mpi_comm_wave, irqrs(ih), ierr )
4429 #ifdef W3_MPIT
4430  WRITE (ndst,9021) ih, 'S U*', iroot, it, irqrs(ih), ierr
4431 #endif
4432  !
4433  ih = ih + 1
4434  it = it0 + 2
4435  CALL mpi_send_init (ustdir(iaproc), 1, ww3_field_vec, &
4436  iroot, it, mpi_comm_wave, irqrs(ih), ierr )
4437 #ifdef W3_MPIT
4438  WRITE (ndst,9021) ih, 'S UD', iroot, it, irqrs(ih), ierr
4439 #endif
4440  !
4441  ih = ih + 1
4442  it = it0 + 3
4443  CALL mpi_send_init (fpis(iaproc), 1, ww3_field_vec, &
4444  iroot, it, mpi_comm_wave, irqrs(ih), ierr )
4445 #ifdef W3_MPIT
4446  WRITE (ndst,9021) ih, 'S FP', iroot, it, irqrs(ih), ierr
4447 #endif
4448  !
4449  ELSE IF ( iaproc .EQ. naprst ) THEN
4450  DO i0=1, naproc
4451  ifrom = i0 - 1
4452  IF ( i0 .NE. iaproc ) THEN
4453  !
4454  ih = ih + 1
4455  it = it0 + 1
4456  CALL mpi_recv_init (ust(i0),1,ww3_field_vec, &
4457  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4458 #ifdef W3_MPIT
4459  WRITE (ndst,9021) ih, 'R U*', ifrom, it, irqrs(ih), ierr
4460 #endif
4461  !
4462  ih = ih + 1
4463  it = it0 + 2
4464  CALL mpi_recv_init (ustdir(i0),1,ww3_field_vec, &
4465  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4466 #ifdef W3_MPIT
4467  WRITE (ndst,9021) ih, 'R UD', ifrom, it, irqrs(ih), ierr
4468 #endif
4469  !
4470  ih = ih + 1
4471  it = it0 + 3
4472  CALL mpi_recv_init (fpis(i0),1,ww3_field_vec, &
4473  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4474 #ifdef W3_MPIT
4475  WRITE (ndst,9021) ih, 'R FP', ifrom, it, irqrs(ih), ierr
4476 #endif
4477  END IF
4478  END DO
4479  END IF
4480  !
4481  IF (oarst) THEN
4482  IF ( flogrr( 1, 2) ) THEN
4483  ih = ih + 1
4484  it = it0 + 4
4485  CALL mpi_send_init (cx(iaproc), 1, ww3_field_vec, &
4486  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4487 #ifdef W3_MPIT
4488  WRITE (ndst,9021) ih, 'S CX', iroot, it, irqrs(ih), ierr
4489 #endif
4490  ih = ih + 1
4491  it = it0 + 5
4492  CALL mpi_send_init (cy(iaproc), 1, ww3_field_vec, &
4493  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4494 #ifdef W3_MPIT
4495  WRITE (ndst,9021) ih, 'S CY', iroot, it, irqrs(ih), ierr
4496 #endif
4497  END IF
4498  !
4499  IF ( flogrr( 1, 12) ) THEN
4500  ih = ih + 1
4501  it = it0 + 6
4502  CALL mpi_send_init (icef(iaproc), 1, ww3_field_vec, &
4503  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4504 #ifdef W3_MPIT
4505  WRITE (ndst,9021) ih, 'S IF', iroot, it, irqrs(ih), ierr
4506 #endif
4507  END IF
4508  !
4509  IF ( flogrr( 2, 1) ) THEN
4510  ih = ih + 1
4511  it = it0 + 7
4512  CALL mpi_send_init (hs(1), nsealm, mpi_real, &
4513  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4514 #ifdef W3_MPIT
4515  WRITE (ndst,9021) ih, 'S HS', iroot, it, irqrs(ih), ierr
4516 #endif
4517  END IF
4518  !
4519  IF ( flogrr( 2, 2) ) THEN
4520  ih = ih + 1
4521  it = it0 + 8
4522  CALL mpi_send_init (wlm(1), nsealm, mpi_real, &
4523  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4524 #ifdef W3_MPIT
4525  WRITE (ndst,9021) ih, 'S WL', iroot, it, irqrs(ih), ierr
4526 #endif
4527  END IF
4528  !
4529  IF ( flogrr( 2, 4) ) THEN
4530  ih = ih + 1
4531  it = it0 + 9
4532  CALL mpi_send_init (t0m1(1), nsealm, mpi_real, &
4533  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4534 #ifdef W3_MPIT
4535  WRITE (ndst,9021) ih, 'S T0', iroot, it, irqrs(ih), ierr
4536 #endif
4537  ENDIF
4538  !
4539  IF ( flogrr( 2, 5) ) THEN
4540  ih = ih + 1
4541  it = it0 + 10
4542  CALL mpi_send_init (t01(1), nsealm, mpi_real, &
4543  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4544 #ifdef W3_MPIT
4545  WRITE (ndst,9021) ih, 'S T1', iroot, it, irqrs(ih), ierr
4546 #endif
4547  ENDIF
4548  !
4549  IF ( flogrr( 2, 6) ) THEN
4550  ih = ih + 1
4551  it = it0 + 11
4552  CALL mpi_send_init (fp0(1), nsealm, mpi_real, &
4553  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4554 #ifdef W3_MPIT
4555  WRITE (ndst,9021) ih, 'S FP', iroot, it, irqrs(ih), ierr
4556 #endif
4557  END IF
4558  !
4559  IF ( flogrr( 2, 7) ) THEN
4560  ih = ih + 1
4561  it = it0 + 12
4562  CALL mpi_send_init (thm(1), nsealm, mpi_real, &
4563  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4564 #ifdef W3_MPIT
4565  WRITE (ndst,9021) ih, 'S TH', iroot, it, irqrs(ih), ierr
4566 #endif
4567  END IF
4568  !
4569  IF ( flogrr( 2, 19) ) THEN
4570  ih = ih + 1
4571  it = it0 + 13
4572  CALL mpi_send_init (wnmean(1), nsealm, mpi_real, &
4573  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4574 #ifdef W3_MPIT
4575  WRITE (ndst,9021) ih, 'S WM', iroot, it, irqrs(ih), ierr
4576 #endif
4577  END IF
4578  !
4579  IF ( flogrr( 5, 2) ) THEN
4580  ih = ih + 1
4581  it = it0 + 14
4582  CALL mpi_send_init (charn(1), nsealm, mpi_real, &
4583  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4584 #ifdef W3_MPIT
4585  WRITE (ndst,9021) ih, 'S CH', iroot, it, irqrs(ih), ierr
4586 #endif
4587  ENDIF
4588  !
4589  IF ( flogrr( 5, 5) ) THEN
4590  ih = ih + 1
4591  it = it0 + 15
4592  CALL mpi_send_init (tauwix(1), nsealm, mpi_real, &
4593  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4594 #ifdef W3_MPIT
4595  WRITE (ndst,9021) ih, 'S WX', iroot, it, irqrs(ih), ierr
4596 #endif
4597  ih = ih + 1
4598  it = it0 + 16
4599  CALL mpi_send_init (tauwiy(1), nsealm, mpi_real, &
4600  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4601 #ifdef W3_MPIT
4602  WRITE (ndst,9021) ih, 'S WY', iroot, it, irqrs(ih), ierr
4603 #endif
4604  END IF
4605  !
4606  IF ( flogrr( 5, 11) ) THEN
4607  ih = ih + 1
4608  it = it0 + 17
4609  CALL mpi_send_init (tws(1), nsealm, mpi_real, &
4610  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4611 #ifdef W3_MPIT
4612  WRITE (ndst,9021) ih, 'S TS', iroot, it, irqrs(ih), ierr
4613 #endif
4614  END IF
4615  !
4616  IF ( flogrr( 6, 2) ) THEN
4617  ih = ih + 1
4618  it = it0 + 18
4619  CALL mpi_send_init (tauox(1), nsealm, mpi_real, &
4620  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4621 #ifdef W3_MPIT
4622  WRITE (ndst,9021) ih, 'S OX', iroot, it, irqrs(ih), ierr
4623 #endif
4624  ih = ih + 1
4625  it = it0 + 19
4626  CALL mpi_send_init (tauoy(1), nsealm, mpi_real, &
4627  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4628 #ifdef W3_MPIT
4629  WRITE (ndst,9021) ih, 'S OY', iroot, it, irqrs(ih), ierr
4630 #endif
4631  END IF
4632  !
4633  IF ( flogrr( 6, 3) ) THEN
4634  ih = ih + 1
4635  it = it0 + 20
4636  CALL mpi_send_init (bhd(1), nsealm, mpi_real, &
4637  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4638 #ifdef W3_MPIT
4639  WRITE (ndst,9021) ih, 'S BH', iroot, it, irqrs(ih), ierr
4640 #endif
4641  END IF
4642  !
4643  IF ( flogrr( 6, 4) ) THEN
4644  ih = ih + 1
4645  it = it0 + 21
4646  CALL mpi_send_init (phioc(1), nsealm, mpi_real, &
4647  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4648 #ifdef W3_MPIT
4649  WRITE (ndst,9021) ih, 'S PH', iroot, it, irqrs(ih), ierr
4650 #endif
4651  END IF
4652  !
4653  IF ( flogrr( 6, 5) ) THEN
4654  ih = ih + 1
4655  it = it0 + 22
4656  CALL mpi_send_init (tusx(1), nsealm, mpi_real, &
4657  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4658 #ifdef W3_MPIT
4659  WRITE (ndst,9021) ih, 'S UX', iroot, it, irqrs(ih), ierr
4660 #endif
4661  ih = ih + 1
4662  it = it0 + 23
4663  CALL mpi_send_init (tusy(1), nsealm, mpi_real, &
4664  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4665 #ifdef W3_MPIT
4666  WRITE (ndst,9021) ih, 'S UY', iroot, it, irqrs(ih), ierr
4667 #endif
4668  END IF
4669  !
4670  IF ( flogrr( 6, 6) ) THEN
4671  ih = ih + 1
4672  it = it0 + 24
4673  CALL mpi_send_init (ussx(1), nsealm, mpi_real, &
4674  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4675 #ifdef W3_MPIT
4676  WRITE (ndst,9021) ih, 'S SX', iroot, it, irqrs(ih), ierr
4677 #endif
4678  ih = ih + 1
4679  it = it0 + 25
4680  CALL mpi_send_init (ussy(1), nsealm, mpi_real, &
4681  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4682 #ifdef W3_MPIT
4683  WRITE (ndst,9021) ih, 'S SY', iroot, it, irqrs(ih), ierr
4684 #endif
4685  END IF
4686  !
4687  IF ( flogrr( 6,10) ) THEN
4688  ih = ih + 1
4689  it = it0 + 26
4690  CALL mpi_send_init (tauice(1,1), nsealm, mpi_real, &
4691  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4692 #ifdef W3_MPIT
4693  WRITE (ndst,9021) ih, 'S I1', iroot, it, irqrs(ih), ierr
4694 #endif
4695  ih = ih + 1
4696  it = it0 + 27
4697  CALL mpi_send_init (tauice(1,2), nsealm, mpi_real, &
4698  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4699 #ifdef W3_MPIT
4700  WRITE (ndst,9021) ih, 'S I2', iroot, it, irqrs(ih), ierr
4701 #endif
4702  END IF
4703  !
4704  IF ( flogrr( 6,13) ) THEN
4705  ih = ih + 1
4706  it = it0 + 28
4707  CALL mpi_send_init (tauocx(1), nsealm, mpi_real, &
4708  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4709 #ifdef W3_MPIT
4710  WRITE (ndst,9021) ih, 'S TX', iroot, it, irqrs(ih), ierr
4711 #endif
4712  ih = ih + 1
4713  it = it0 + 29
4714  CALL mpi_send_init (tauocy(1), nsealm, mpi_real, &
4715  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4716 #ifdef W3_MPIT
4717  WRITE (ndst,9021) ih, 'S TY', iroot, it, irqrs(ih), ierr
4718 #endif
4719  END IF
4720  !
4721  IF ( flogrr( 7, 2) ) THEN
4722  ih = ih + 1
4723  it = it0 + 30
4724  CALL mpi_send_init (uba(1), nsealm, mpi_real, &
4725  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4726 #ifdef W3_MPIT
4727  WRITE (ndst,9021) ih, 'S BA', iroot, it, irqrs(ih), ierr
4728 #endif
4729  ih = ih + 1
4730  it = it0 + 31
4731  CALL mpi_send_init (ubd(1), nsealm, mpi_real, &
4732  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4733 #ifdef W3_MPIT
4734  WRITE (ndst,9021) ih, 'S BD', iroot, it, irqrs(ih), ierr
4735 #endif
4736  END IF
4737  !
4738  IF ( flogrr( 7, 4) ) THEN
4739  ih = ih + 1
4740  it = it0 + 32
4741  CALL mpi_send_init (phibbl(1), nsealm, mpi_real, &
4742  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4743 #ifdef W3_MPIT
4744  WRITE (ndst,9021) ih, 'S PB', iroot, it, irqrs(ih), ierr
4745 #endif
4746  END IF
4747  !
4748  IF ( flogrr( 7, 5) ) THEN
4749  ih = ih + 1
4750  it = it0 + 33
4751  CALL mpi_send_init (taubbl(1,1), nsealm, mpi_real, &
4752  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4753 #ifdef W3_MPIT
4754  WRITE (ndst,9021) ih, 'S T1', iroot, it, irqrs(ih), ierr
4755 #endif
4756  ih = ih + 1
4757  it = it0 + 34
4758  CALL mpi_send_init (taubbl(1,2), nsealm, mpi_real, &
4759  iroot, it, mpi_comm_wave, irqrs(ih), ierr)
4760 #ifdef W3_MPIT
4761  WRITE (ndst,9021) ih, 'S T2', iroot, it, irqrs(ih), ierr
4762 #endif
4763  END IF
4764  !
4765  IF ( iaproc .EQ. naprst ) THEN
4766  IF (naprst .NE. napfld) CALL w3xdma ( imod, ndse, ndst, flogrr )
4767  CALL w3xeta ( imod, ndse, ndst )
4768  !
4769  DO i0=1, naproc
4770  ifrom = i0 - 1
4771  IF ( flogrr( 1, 2) ) THEN
4772  ih = ih + 1
4773  it = it0 + 4
4774  CALL mpi_recv_init (cx(i0),1,ww3_field_vec, &
4775  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4776 #ifdef W3_MPIT
4777  WRITE (ndst,9021) ih, 'R CX', ifrom, it, irqrs(ih), ierr
4778 #endif
4779  ih = it0 + 5
4780  it = it + 1
4781  CALL mpi_recv_init (cy(i0),1,ww3_field_vec, &
4782  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4783 #ifdef W3_MPIT
4784  WRITE (ndst,9021) ih, 'R CY', ifrom, it, irqrs(ih), ierr
4785 #endif
4786  END IF
4787  !
4788  IF ( flogrr( 1, 12) ) THEN
4789  ih = ih + 1
4790  it = it0 + 6
4791  CALL mpi_recv_init (icef(i0),1,ww3_field_vec, &
4792  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4793 #ifdef W3_MPIT
4794  WRITE (ndst,9021) ih, 'R IF', ifrom, it, irqrs(ih), ierr
4795 #endif
4796  END IF
4797  !
4798  IF ( flogrr( 2, 1) ) THEN
4799  ih = ih + 1
4800  it = it0 + 7
4801  CALL mpi_recv_init (hs(i0),1,ww3_field_vec, &
4802  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4803 #ifdef W3_MPIT
4804  WRITE (ndst,9021) ih, 'R HS', ifrom, it, irqrs(ih), ierr
4805 #endif
4806  END IF
4807  !
4808  IF ( flogrr( 2, 2) ) THEN
4809  ih = ih + 1
4810  it = it0 + 8
4811  CALL mpi_recv_init (wlm(i0),1,ww3_field_vec, &
4812  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4813 #ifdef W3_MPIT
4814  WRITE (ndst,9021) ih, 'R WL', ifrom, it, irqrs(ih), ierr
4815 #endif
4816  END IF
4817  !
4818  IF ( flogrr( 2, 4) ) THEN
4819  ih = ih + 1
4820  it = it0 + 9
4821  CALL mpi_recv_init (t0m1(i0),1,ww3_field_vec, &
4822  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4823 #ifdef W3_MPIT
4824  WRITE (ndst,9021) ih, 'R T0', ifrom, it, irqrs(ih), ierr
4825 #endif
4826  ENDIF
4827  !
4828  IF ( flogrr( 2, 5) ) THEN
4829  ih = ih + 1
4830  it = it0 + 10
4831  CALL mpi_recv_init (t01(i0),1,ww3_field_vec, &
4832  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4833 #ifdef W3_MPIT
4834  WRITE (ndst,9021) ih, 'R T1', ifrom, it, irqrs(ih), ierr
4835 #endif
4836  ENDIF
4837  !
4838  IF ( flogrr( 2, 6) ) THEN
4839  ih = ih + 1
4840  it = it0 + 11
4841  CALL mpi_recv_init (fp0(i0),1,ww3_field_vec, &
4842  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4843 #ifdef W3_MPIT
4844  WRITE (ndst,9021) ih, 'R FP', ifrom, it, irqrs(ih), ierr
4845 #endif
4846  END IF
4847  !
4848  IF ( flogrr( 2, 7) ) THEN
4849  ih = ih + 1
4850  it = it0 + 12
4851  CALL mpi_recv_init (thm(i0),1,ww3_field_vec, &
4852  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4853 #ifdef W3_MPIT
4854  WRITE (ndst,9021) ih, 'R TH', ifrom, it, irqrs(ih), ierr
4855 #endif
4856  END IF
4857  !
4858  IF ( flogrr( 2, 19) ) THEN
4859  ih = ih + 1
4860  it = it0 + 13
4861  CALL mpi_recv_init (wnmean(i0),1,ww3_field_vec, &
4862  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4863 #ifdef W3_MPIT
4864  WRITE (ndst,9021) ih, 'R WM', ifrom, it, irqrs(ih), ierr
4865 #endif
4866  END IF
4867  !
4868  IF ( flogrr( 5, 2) ) THEN
4869  ih = ih + 1
4870  it = it0 + 14
4871  CALL mpi_recv_init (charn(i0),1,ww3_field_vec, &
4872  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4873 #ifdef W3_MPIT
4874  WRITE (ndst,9021) ih, 'R CH', ifrom, it, irqrs(ih), ierr
4875 #endif
4876  ENDIF
4877  !
4878  IF ( flogrr( 5, 5) ) THEN
4879  ih = ih + 1
4880  it = it0 + 15
4881  CALL mpi_recv_init (tauwix(i0),1,ww3_field_vec,&
4882  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4883 #ifdef W3_MPIT
4884  WRITE (ndst,9021) ih, 'R WX', ifrom, it, irqrs(ih), ierr
4885 #endif
4886  ih = ih + 1
4887  it = it0 + 16
4888  CALL mpi_recv_init (tauwiy(i0),1,ww3_field_vec,&
4889  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4890 #ifdef W3_MPIT
4891  WRITE (ndst,9021) ih, 'R WY', ifrom, it, irqrs(ih), ierr
4892 #endif
4893  END IF
4894  !
4895  IF ( flogrr( 5,11) ) THEN
4896  ih = ih + 1
4897  it = it0 + 17
4898  CALL mpi_recv_init (tws(i0),1,ww3_field_vec, &
4899  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4900 #ifdef W3_MPIT
4901  WRITE (ndst,9021) ih, 'R TS', ifrom, it, irqrs(ih), ierr
4902 #endif
4903  END IF
4904  !
4905  IF ( flogrr( 6, 2) ) THEN
4906  ih = ih + 1
4907  it = it0 + 18
4908  CALL mpi_recv_init (tauox(i0),1,ww3_field_vec, &
4909  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4910 #ifdef W3_MPIT
4911  WRITE (ndst,9021) ih, 'R OX', ifrom, it, irqrs(ih), ierr
4912 #endif
4913  ih = ih + 1
4914  it = it0 + 19
4915  CALL mpi_recv_init (tauoy(i0),1,ww3_field_vec, &
4916  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4917 #ifdef W3_MPIT
4918  WRITE (ndst,9021) ih, 'R OY', ifrom, it, irqrs(ih), ierr
4919 #endif
4920  END IF
4921  !
4922  IF ( flogrr( 6, 3) ) THEN
4923  ih = ih + 1
4924  it = it0 + 20
4925  CALL mpi_recv_init (bhd(i0),1,ww3_field_vec, &
4926  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4927 #ifdef W3_MPIT
4928  WRITE (ndst,9021) ih, 'R BH', ifrom, it, irqrs(ih), ierr
4929 #endif
4930  END IF
4931  !
4932  IF ( flogrr( 6, 4) ) THEN
4933  ih = ih + 1
4934  it = it0 + 21
4935  CALL mpi_recv_init (phioc(i0),1,ww3_field_vec, &
4936  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4937 #ifdef W3_MPIT
4938  WRITE (ndst,9021) ih, 'R PH', ifrom, it, irqrs(ih), ierr
4939 #endif
4940  END IF
4941  !
4942  IF ( flogrr( 6, 5) ) THEN
4943  ih = ih + 1
4944  it = it0 + 22
4945  CALL mpi_recv_init (tusx(i0),1,ww3_field_vec, &
4946  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4947 #ifdef W3_MPIT
4948  WRITE (ndst,9021) ih, 'R UX', ifrom, it, irqrs(ih), ierr
4949 #endif
4950  ih = ih + 1
4951  it = it0 + 23
4952  CALL mpi_recv_init (tusy(i0),1,ww3_field_vec, &
4953  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4954 #ifdef W3_MPIT
4955  WRITE (ndst,9021) ih, 'R UY', ifrom, it, irqrs(ih), ierr
4956 #endif
4957  END IF
4958  !
4959  IF ( flogrr( 6, 6) ) THEN
4960  ih = ih + 1
4961  it = it0 + 24
4962  CALL mpi_recv_init (ussx(i0),1,ww3_field_vec, &
4963  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4964 #ifdef W3_MPIT
4965  WRITE (ndst,9021) ih, 'R SX', ifrom, it, irqrs(ih), ierr
4966 #endif
4967  ih = ih + 1
4968  it = it0 + 25
4969  CALL mpi_recv_init (ussy(i0),1,ww3_field_vec, &
4970  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4971 #ifdef W3_MPIT
4972  WRITE (ndst,9021) ih, 'R SY', ifrom, it, irqrs(ih), ierr
4973 #endif
4974  END IF
4975  !
4976  IF ( flogrr( 6,10) ) THEN
4977  ih = ih + 1
4978  it = it0 + 26
4979  CALL mpi_recv_init (tauice(i0,1),1,ww3_field_vec,&
4980  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4981 #ifdef W3_MPIT
4982  WRITE (ndst,9021) ih, 'R I1', ifrom, it, irqrs(ih), ierr
4983 #endif
4984  ih = ih + 1
4985  it = it0 + 27
4986  CALL mpi_recv_init (tauice(i0,2),1,ww3_field_vec,&
4987  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4988 #ifdef W3_MPIT
4989  WRITE (ndst,9021) ih, 'R I2', ifrom, it, irqrs(ih), ierr
4990 #endif
4991  END IF
4992  !
4993  IF ( flogrr( 6,13) ) THEN
4994  ih = ih + 1
4995  it = it0 + 28
4996  CALL mpi_recv_init (tauocx(i0),1,ww3_field_vec,&
4997  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
4998 #ifdef W3_MPIT
4999  WRITE (ndst,9021) ih, 'R SX', ifrom, it, irqrs(ih), ierr
5000 #endif
5001  ih = ih + 1
5002  it = it0 + 29
5003  CALL mpi_recv_init (tauocy(i0),1,ww3_field_vec,&
5004  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
5005 #ifdef W3_MPIT
5006  WRITE (ndst,9021) ih, 'R SY', ifrom, it, irqrs(ih), ierr
5007 #endif
5008  END IF
5009  !
5010  IF ( flogrr( 7, 2) ) THEN
5011  ih = ih + 1
5012  it = it0 + 30
5013  CALL mpi_recv_init (uba(i0),1,ww3_field_vec, &
5014  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
5015 #ifdef W3_MPIT
5016  WRITE (ndst,9021) ih, 'R BA', ifrom, it, irqrs(ih), ierr
5017 #endif
5018  ih = ih + 1
5019  it = it0 + 31
5020  CALL mpi_recv_init (ubd(i0),1,ww3_field_vec, &
5021  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
5022 #ifdef W3_MPIT
5023  WRITE (ndst,9021) ih, 'R BD', ifrom, it, irqrs(ih), ierr
5024 #endif
5025  END IF
5026  !
5027  IF ( flogrr( 7, 4) ) THEN
5028  ih = ih + 1
5029  it = it0 + 32
5030  CALL mpi_recv_init (phibbl(i0),1,ww3_field_vec,&
5031  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
5032 #ifdef W3_MPIT
5033  WRITE (ndst,9021) ih, 'R PB', ifrom, it, irqrs(ih), ierr
5034 #endif
5035  END IF
5036  !
5037  IF ( flogrr( 7, 5) ) THEN
5038  ih = ih + 1
5039  it = it0 + 33
5040  CALL mpi_recv_init (taubbl(i0,1),1,ww3_field_vec,&
5041  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
5042 #ifdef W3_MPIT
5043  WRITE (ndst,9021) ih, 'R T1', ifrom, it, irqrs(ih), ierr
5044 #endif
5045  ih = ih + 1
5046  it = it0 + 34
5047  CALL mpi_recv_init (taubbl(i0,2),1,ww3_field_vec,&
5048  ifrom, it, mpi_comm_wave, irqrs(ih), ierr )
5049 #ifdef W3_MPIT
5050  WRITE (ndst,9021) ih, 'R T2', ifrom, it, irqrs(ih), ierr
5051 #endif
5052  END IF
5053  END DO
5054  !
5055  CALL w3seta ( imod, ndse, ndst )
5056  END IF ! IF ( IAPROC .EQ. NAPRST ) THEN
5057  END IF ! IF (OARST) THEN
5058  !
5059  nrqrs = ih
5060  IF (oarst) THEN
5061  it0 = it0 + 34
5062  ELSE
5063  it0 = it0 + 3
5064  ENDIF
5065  !
5066 #ifdef W3_MPIT
5067  WRITE (ndst,9022)
5068  WRITE (ndst,9023) nrqrs
5069 #endif
5070  !
5071  ! 2.c Data server mode
5072  !
5073  IF ( iostyp .GT. 0 ) THEN
5074  !
5075  nblkrs = 10
5076  rsblks = max( 5 , nsealm/nblkrs )
5077  IF ( nblkrs*rsblks .LT. nsealm ) rsblks = rsblks + 1
5078  nblkrs = 1 + (nsealm-1)/rsblks
5079  !
5080 #ifdef W3_MPIT
5081  WRITE (ndst,9025) rsblks, nblkrs
5082 #endif
5083  ih = 0
5084  !
5085  IF ( iaproc .NE. naprst ) THEN
5086  !
5087  ALLOCATE ( outpts(imod)%OUT4%IRQRSS(nblkrs) )
5088  irqrss => outpts(imod)%OUT4%IRQRSS
5089  !
5090  DO ib=1, nblkrs
5091  ih = ih + 1
5092  it = it0 + 3 + ib
5093  jsea0 = 1 + (ib-1)*rsblks
5094  jsean = min( nsealm , ib*rsblks )
5095  nseab = 1 + jsean - jsea0
5096  CALL mpi_send_init (va(1,jsea0), nspec*nseab, mpi_real, iroot, it, &
5097  mpi_comm_wave, irqrss(ih), ierr )
5098 #ifdef W3_MPIT
5099  WRITE (ndst,9026) ih, 'S', ib, iroot, it, irqrss(ih), ierr, nseab
5100 #endif
5101  END DO
5102  !
5103  ELSE
5104  !
5105  ALLOCATE ( outpts(imod)%OUT4%IRQRSS(naproc*nblkrs) , &
5106  outpts(imod)%OUT4%VAAUX(nspec,2*rsblks,naproc) )
5107  !
5108  irqrss => outpts(imod)%OUT4%IRQRSS
5109  vaaux => outpts(imod)%OUT4%VAAUX
5110  DO ib=1, nblkrs
5111  it = it0 + 3 + ib
5112  jsea0 = 1 + (ib-1)*rsblks
5113  jsean = min( nsealm , ib*rsblks )
5114  nseab = 1 + jsean - jsea0
5115  DO i0=1, naproc
5116  IF ( i0 .NE. naprst ) THEN
5117  ih = ih + 1
5118  ifrom = i0 - 1
5119  iboff = mod(ib-1,2)*rsblks
5120  CALL mpi_recv_init (vaaux(1,1+iboff,i0), nspec*nseab, mpi_real, &
5121  ifrom, it, mpi_comm_wave, irqrss(ih), ierr )
5122 #ifdef W3_MPIT
5123  WRITE (ndst,9026) ih, 'R', ib, ifrom, it, irqrss(ih), ierr, nseab
5124 #endif
5125  END IF
5126  END DO
5127  END DO
5128  !
5129  END IF
5130  !
5131 #ifdef W3_MPIT
5132  WRITE (ndst,9027)
5133  WRITE (ndst,9028) ih
5134 #endif
5135  it0 = it0 + nblkrs
5136  !
5137  END IF
5138  !
5139  END IF ! IF ((FLOUT(4) .OR. FLOUT(8)) .and. (.not. LPDLIB)) THEN
5140  !
5141  ! 3. Set-up for W3IOBC ( SENDs ) ------------------------------------ /
5142  !
5143  nrqbp = 0
5144  nrqbp2 = 0
5145  ih = 0
5146  it = it0
5147  iroot = napbpt - 1
5148  !
5149  IF ( flout(5) ) THEN
5150  ALLOCATE ( outpts(imod)%OUT5%IRQBP1(nbo2(nfbpo)), &
5151  outpts(imod)%OUT5%IRQBP2(nbo2(nfbpo)) )
5152  irqbp1 => outpts(imod)%OUT5%IRQBP1
5153  irqbp2 => outpts(imod)%OUT5%IRQBP2
5154  !
5155  ! 3.a Loops over files and points
5156  !
5157 #ifdef W3_MPIT
5158  WRITE (ndst,9030) 'MPI_SEND_INIT'
5159 #endif
5160  !
5161  DO j=1, nfbpo
5162  DO i=nbo2(j-1)+1, nbo2(j)
5163  !
5164  it = it + 1
5165  !
5166  ! 3.b Residence processor of point
5167  !
5168  isea = isbpo(i)
5169  CALL init_get_jsea_isproc(isea, jsea, isproc)
5170  !
5171  ! 3.c If stored locally, send data
5172  !
5173  IF ( iaproc .EQ. isproc ) THEN
5174  ih = ih + 1
5175  CALL mpi_send_init (va(1,jsea),nspec,mpi_real, iroot, it, mpi_comm_wave, &
5176  irqbp1(ih), ierr)
5177 #ifdef W3_MPIT
5178  WRITE (ndst,9031) ih, i, j, iroot, it, irqbp1(ih), ierr
5179 #endif
5180  END IF
5181  !
5182  END DO
5183  END DO
5184  !
5185  ! ... End of loops 4.a
5186  !
5187  nrqbp = ih
5188  !
5189 #ifdef W3_MPIT
5190  WRITE (ndst,9032)
5191  WRITE (ndst,9033) nrqbp
5192 #endif
5193  !
5194  ! 3.d Set-up for W3IOBC ( RECVs ) ------------------------------------ /
5195  !
5196  IF ( iaproc .EQ. napbpt ) THEN
5197  !
5198  ih = 0
5199  it = it0
5200  !
5201  ! 3.e Loops over files and points
5202  !
5203 #ifdef W3_MPIT
5204  WRITE (ndst,9030) 'MPI_RECV_INIT'
5205 #endif
5206  !
5207  DO j=1, nfbpo
5208  DO i=nbo2(j-1)+1, nbo2(j)
5209  !
5210  ! 3.f Residence processor of point
5211  !
5212  isea = isbpo(i)
5213  CALL init_get_jsea_isproc(isea, jsea, isproc)
5214  !
5215  ! 3.g Receive in correct array
5216  !
5217  ih = ih + 1
5218  it = it + 1
5219  itarg = isproc - 1
5220  CALL mpi_recv_init (abpos(1,ih),nspec,mpi_real, itarg, it, mpi_comm_wave, &
5221  irqbp2(ih), ierr)
5222 #ifdef W3_MPIT
5223  WRITE (ndst,9031) ih, i, j, itarg, it, irqbp2(ih), ierr
5224 #endif
5225  !
5226  END DO
5227  END DO
5228  !
5229  nrqbp2 = ih
5230  !
5231  ! ... End of loops 4.e
5232  !
5233 #ifdef W3_MPIT
5234  WRITE (ndst,9032)
5235  WRITE (ndst,9033) nrqbp2
5236 #endif
5237  !
5238  END IF
5239  !
5240  it0 = it0 + nbo2(nfbpo)
5241  !
5242  END IF
5243  !
5244 #ifdef W3_MPIT
5245  WRITE (ndst,*)
5246 #endif
5247  !
5248  ! 4. Set-up for W3IOTR ---------------------------------------------- /
5249  !
5250  ih = 0
5251  iroot = naptrk - 1
5252  !
5253  IF ( flout(3) ) THEN
5254  !
5255  ! 4.a U*
5256  !
5257 #ifdef W3_MPIT
5258  WRITE (ndst,9040)
5259 #endif
5260  !
5261  IF ( iaproc .NE. naptrk ) THEN
5262  ALLOCATE ( outpts(imod)%OUT3%IRQTR(2) )
5263  irqtr => outpts(imod)%OUT3%IRQTR
5264  ih = ih + 1
5265  it = it0 + 1
5266  CALL mpi_send_init (ust(iaproc),1,ww3_field_vec, iroot, it, mpi_comm_wave, &
5267  irqtr(ih), ierr )
5268 #ifdef W3_MPIT
5269  WRITE (ndst,9041) ih, 'S U*', iroot, it, irqtr(ih), ierr
5270 #endif
5271  ih = ih + 1
5272  it = it0 + 2
5273  CALL mpi_send_init (ustdir(iaproc),1,ww3_field_vec, iroot, it, mpi_comm_wave, &
5274  irqtr(ih), ierr )
5275 #ifdef W3_MPIT
5276  WRITE (ndst,9041) ih, 'S U*', iroot, it, irqtr(ih), ierr
5277 #endif
5278  ELSE
5279  ALLOCATE ( outpts(imod)%OUT3%IRQTR(2*naproc) )
5280  irqtr => outpts(imod)%OUT3%IRQTR
5281  DO i0=1, naproc
5282  ifrom = i0 - 1
5283  IF ( i0 .NE. iaproc ) THEN
5284  ih = ih + 1
5285  it = it0 + 1
5286  CALL mpi_recv_init(ust(i0),1,ww3_field_vec, ifrom, it, mpi_comm_wave, &
5287  irqtr(ih), ierr)
5288 #ifdef W3_MPIT
5289  WRITE (ndst,9041) ih, 'R U*', ifrom, it, irqtr(ih), ierr
5290 #endif
5291  ih = ih + 1
5292  it = it0 + 2
5293  CALL mpi_recv_init(ustdir(i0),1,ww3_field_vec, ifrom, it, mpi_comm_wave, &
5294  irqtr(ih), ierr)
5295 #ifdef W3_MPIT
5296  WRITE (ndst,9041) ih, 'R U*', ifrom, it, irqtr(ih), ierr
5297 #endif
5298  END IF
5299  END DO
5300  END IF
5301  !
5302  nrqtr = ih
5303  it0 = it0 + 2
5304  !
5305 #ifdef W3_MPIT
5306  WRITE (ndst,9042)
5307  WRITE (ndst,9043) nrqtr
5308 #endif
5309  !
5310  END IF
5311  !
5312  ! 5. Set-up remaining counters -------------------------------------- /
5313  !
5314  it0prt = it0
5315  it0pnt = it0prt + 2*naproc
5316  it0trk = it0pnt + 5000
5317 #endif
5318  !
5319  RETURN
5320  !
5321  ! Formats :
5322  !
5323 #ifdef W3_MPI
5324 1010 FORMAT (/' *** ERROR W3MPIO : ARRAY IRQGO TOO SMALL *** '/)
5325 1011 FORMAT (/' *** ERROR W3MPIO : ARRAY IRQGO2 TOO SMALL *** '/)
5326 #endif
5327  !
5328 #ifdef W3_MPIT
5329 9010 FORMAT (/' TEST W3MPIO: COMMUNICATION CALLS FOR W3IOGO ',a/ &
5330  ' +------+-------+------+------+--------------+'/ &
5331  ' | IH | ID | TARG | TAG | handle err |'/ &
5332  ' +------+-------+------+------+--------------+')
5333 9011 FORMAT ( ' |',i5,' | ',a5,' |',2(i5,' |'),i9,i4,' |')
5334 9012 FORMAT ( ' +------+-------+------+------+--------------+')
5335 9013 FORMAT ( ' TEST W3MPIO: NRQGO :',2i10)
5336 9014 FORMAT ( ' TEST W3MPIO: NRQGO2:',2i10)
5337 9020 FORMAT (/' TEST W3MPIO: COMM. CALLS FOR W3IORS (F)'/ &
5338  ' +------+------+------+------+--------------+'/ &
5339  ' | IH | ID | TARG | TAG | handle err |'/ &
5340  ' +------+------+------+------+--------------+')
5341 9021 FORMAT ( ' |',i5,' | ',a4,' |',2(i5,' |'),i9,i4,' |')
5342 9022 FORMAT ( ' +------+------+------+------+--------------+')
5343 9023 FORMAT ( ' TEST W3MPIO: NRQRS :',i10)
5344 9025 FORMAT (/' TEST W3MPIO: COMM. CALLS FOR W3IORS (S)'/ &
5345  ' BLOCK SIZE / BLOCKS : ',2i6/ &
5346  ' +------+------+------+------+--------------+---------+'/ &
5347  ' | IH | ID | TARG | TAG | handle err | spectra |'/ &
5348  ' +------+------+------+------+--------------+---------+')
5349 9026 FORMAT ( &
5350  ' |',i5,' | ',a1,i3,' |',2(i5,' |'),i9,i4,' |',i8,' |')
5351 9027 FORMAT ( &
5352  ' +------+------+------+------+--------------+---------+')
5353 9028 FORMAT ( ' TEST W3MPIO: IHMAX :',i10)
5354 9030 FORMAT (/' TEST W3MPIO: ',a,' CALLS FOR W3IOBC'/ &
5355  ' +------+------+---+------+------+--------------+'/ &
5356  ' | IH | IPT | F | TARG | TAG | handle err |'/ &
5357  ' +------+------+---+------+------+--------------+')
5358 9031 FORMAT ( ' |',2(i5,' |'),i2,' |',2(i5,' |'),i9,i4,' |')
5359 9032 FORMAT ( &
5360  ' +------+------+---+------+------+--------------+')
5361 9033 FORMAT ( ' TEST W3MPIO: NRQBC :',i10)
5362 9034 FORMAT ( ' TEST W3MPIO: TOTAL :',i10)
5363 9040 FORMAT (/' TEST W3MPIO: COMMUNICATION CALLS FOR W3IOTR'/ &
5364  ' +------+------+------+------+--------------+'/ &
5365  ' | IH | ID | TARG | TAG | handle err |'/ &
5366  ' +------+------+------+------+--------------+')
5367 9041 FORMAT ( ' |',i5,' | ',a4,' |',2(i5,' |'),i9,i4,' |')
5368 9042 FORMAT ( &
5369  ' +------+------+------+------+--------------+')
5370 9043 FORMAT ( ' TEST W3MPIO: NRQTR :',i10)
5371 #endif
5372  !/
5373  !/ End of W3MPIO ----------------------------------------------------- /
5374  !/
5375  END SUBROUTINE w3mpio
5376  !/ ------------------------------------------------------------------- /
5387  SUBROUTINE w3mpip ( IMOD )
5388  !/
5389  !/ +-----------------------------------+
5390  !/ | WAVEWATCH III NOAA/NCEP |
5391  !/ | H. L. Tolman |
5392  !/ | FORTRAN 90 |
5393  !/ | Last update : 30-Oct-2009 |
5394  !/ +-----------------------------------+
5395  !/
5396  !/ 02-Aug-2006 : Origination. ( version 3.10 )
5397  !/ 17-May-2007 : Adding NTPROC/NAPROC separation. ( version 3.11 )
5398  !/ 30-Oct-2009 : Implement curvilinear grid type. ( version 3.14 )
5399  !/ (W. E. Rogers & T. J. Campbell, NRL)
5400  !/
5401  ! 1. Purpose :
5402  !
5403  ! Prepare MPI persistent communication needed for WAVEWATCH I/O
5404  ! routines.
5405  !
5406  ! 2. Method :
5407  !
5408  ! Create handles as needed.
5409  !
5410  ! 3. Parameters :
5411  !
5412  ! Parameter list
5413  ! ----------------------------------------------------------------
5414  ! IMOD Int. I Model number.
5415  ! ----------------------------------------------------------------
5416  !
5417  ! 4. Subroutines used :
5418  !
5419  ! Name Type Module Description
5420  ! ----------------------------------------------------------------
5421  ! STRACE Subr. W3SERVMD Subroutine tracing.
5422  !
5423  ! MPI_SEND_INIT, MPI_RECV_INIT
5424  ! Subr. mpif.h MPI persistent communication calls.
5425  ! ----------------------------------------------------------------
5426  !
5427  ! 5. Called by :
5428  !
5429  ! Name Type Module Description
5430  ! ----------------------------------------------------------------
5431  ! W3INIT Subr. W3INITMD Wave model initialization routine.
5432  ! ----------------------------------------------------------------
5433  !
5434  ! 6. Error messages :
5435  !
5436  ! 7. Remarks :
5437  !
5438  ! 8. Structure :
5439  !
5440  ! See source code.
5441  !
5442  ! 9. Switches :
5443  !
5444  ! !/MPI MPI communication calls.
5445  !
5446  ! !/S Enable subroutine tracing.
5447  ! !/MPIT Enable test output.
5448  !
5449  ! 10. Source code :
5450  !
5451  !/ ------------------------------------------------------------------- /
5452 #ifdef W3_S
5453  USE w3servmd, ONLY: strace
5454 #endif
5455 #ifdef W3_MPI
5456  USE w3servmd, ONLY: extcde
5457  !/
5458  USE w3gdatmd, ONLY: nx, ny, nspec, mapfs
5459  USE w3wdatmd, ONLY: va
5460  USE w3adatmd, ONLY: mpi_comm_wave, sppnt
5461  USE w3odatmd, ONLY: ndst, ndse, iaproc, naproc, nappnt, flout
5462  USE w3odatmd, ONLY: outpts, nrqpo, nrqpo2, irqpo1, irqpo2, &
5464  USE w3parall, ONLY: init_get_jsea_isproc
5465 #endif
5466  !/
5467 #ifdef W3_MPI
5468  include "mpif.h"
5469 #endif
5470  !/
5471  !/ ------------------------------------------------------------------- /
5472  !/ Parameter list
5473  !/
5474  INTEGER, INTENT(IN) :: IMOD
5475  !/
5476  !/ ------------------------------------------------------------------- /
5477  !/ Local parameters
5478  !/
5479 #ifdef W3_MPI
5480  INTEGER :: IH, IROOT, I, J, IT, IT0, JSEA, &
5481  IERR, ITARG, IX(4), IY(4), &
5482  K, IS(4), IP(4)
5483 #endif
5484  INTEGER :: itout
5485 #ifdef W3_S
5486  INTEGER, SAVE :: IENT
5487 #endif
5488  !/
5489  !/ ------------------------------------------------------------------- /
5490  !/
5491 #ifdef W3_S
5492  CALL strace (ient, 'W3MPIP')
5493 #endif
5494  !
5495 #ifdef W3_MPI
5496  IF ( o2irqi ) THEN
5497  WRITE (ndse,1001)
5498  CALL extcde (1)
5499  END IF
5500  !
5501  ! 1. Set-up for W3IOPE/O ( SENDs ) ---------------------------------- /
5502  !
5503  nrqpo = 0
5504  nrqpo2 = 0
5505  ih = 0
5506  it0 = it0pnt
5507  iroot = nappnt - 1
5508  !
5509  ALLOCATE ( outpts(imod)%OUT2%IRQPO1(4*nopts), &
5510  outpts(imod)%OUT2%IRQPO2(4*nopts) )
5511  irqpo1 => outpts(imod)%OUT2%IRQPO1
5512  irqpo2 => outpts(imod)%OUT2%IRQPO2
5513  o2irqi = .true.
5514 #endif
5515  !
5516  ! 1.a Loop over output locations
5517  !
5518 #ifdef W3_MPIT
5519  WRITE (ndst,9010) 'MPI_SEND_INIT'
5520 #endif
5521  !
5522 #ifdef W3_MPI
5523  DO i=1, nopts
5524  DO k=1,4
5525  ix(k)=iptint(1,k,i)
5526  iy(k)=iptint(2,k,i)
5527  END DO
5528  ! 1.b Loop over corner points
5529  !
5530  DO j=1, 4
5531  !
5532  it = it0 + (i-1)*4 + j
5533  is(j) = mapfs(iy(j),ix(j))
5534  IF ( is(j) .EQ. 0 ) THEN
5535  jsea = 0
5536  ip(j) = nappnt
5537  ELSE
5538  CALL init_get_jsea_isproc(is(j), jsea, ip(j))
5539  END IF
5540 #endif
5541  !
5542  ! 1.c Send if point is stored here
5543  !
5544 #ifdef W3_MPI
5545  IF ( ip(j) .EQ. iaproc ) THEN
5546  ih = ih + 1
5547  CALL mpi_send_init ( va(1,jsea), nspec, mpi_real, iroot, it, mpi_comm_wave, &
5548  irqpo1(ih), ierr )
5549 #endif
5550 #ifdef W3_MPIT
5551  WRITE (ndst,9011) ih,i,j, iroot,it, irqpo1(ih), ierr
5552 #endif
5553 #ifdef W3_MPI
5554  END IF
5555  !
5556  ! ... End of loop 1.b
5557  !
5558  END DO
5559  !
5560  ! ... End of loop 1.a
5561  !
5562  END DO
5563  !
5564  nrqpo = ih
5565 #endif
5566  !
5567 #ifdef W3_MPIT
5568  WRITE (ndst,9012)
5569  WRITE (ndst,9013) nrqpo
5570 #endif
5571  !
5572  ! 1.d Set-up for W3IOPE/O ( RECVs ) ---------------------------------- /
5573  !
5574 #ifdef W3_MPI
5575  IF ( iaproc .EQ. nappnt ) THEN
5576  !
5577  ih = 0
5578 #endif
5579  !
5580  ! 2.e Loop over output locations
5581  !
5582 #ifdef W3_MPIT
5583  WRITE (ndst,9010) 'MPI_RECV_INIT'
5584 #endif
5585  !
5586 #ifdef W3_MPI
5587  DO i=1, nopts
5588  DO k=1,4
5589  ix(k)=iptint(1,k,i)
5590  iy(k)=iptint(2,k,i)
5591  END DO
5592  !
5593  DO j=1, 4
5594  !
5595  it = it0 + (i-1)*4 + j
5596  is(j) = mapfs(iy(j),ix(j))
5597  IF ( is(j) .EQ. 0 ) THEN
5598  jsea = 0
5599  ip(j) = nappnt
5600  ELSE
5601  CALL init_get_jsea_isproc(is(j), jsea, ip(j))
5602  END IF
5603 #endif
5604  !
5605  ! 1.g Receive in correct array
5606  !
5607 #ifdef W3_MPI
5608  ih = ih + 1
5609  itarg = ip(j) - 1
5610  CALL mpi_recv_init ( sppnt(1,1,j), nspec, mpi_real, itarg, it, mpi_comm_wave, &
5611  irqpo2(ih), ierr )
5612 #endif
5613 #ifdef W3_MPIT
5614  WRITE (ndst,9011) ih,i,j, itarg,it, irqpo2(ih), ierr
5615 #endif
5616  !
5617  ! ... End of loop 1.f
5618  !
5619 #ifdef W3_MPI
5620  END DO
5621  !
5622  ! ... End of loop 1.e
5623  !
5624  END DO
5625  !
5626  nrqpo2 = nopts*4
5627 #endif
5628  !
5629 #ifdef W3_MPIT
5630  WRITE (ndst,9012)
5631  WRITE (ndst,9014) nrqpo2
5632 #endif
5633  !
5634 #ifdef W3_MPI
5635  END IF
5636 #endif
5637  !
5638  !
5639 #ifdef W3_MPI
5640  it0 = it0 + 8*nopts
5641 #endif
5642  !
5643  ! 1.h Base tag number for track output
5644  !
5645 #ifdef W3_MPI
5646  it0trk = it0
5647 #endif
5648  !
5649  RETURN
5650  !
5651  ! Formats :
5652  !
5653 #ifdef W3_MPI
5654 1001 FORMAT (/' *** ERROR W3MPIP : ARRAYS ALREADY ALLOCATED *** '/)
5655 #endif
5656  !
5657 #ifdef W3_MPIT
5658 9010 FORMAT (/' TEST W3MPIP: ',a,' CALLS FOR W3IOPO'/ &
5659  ' +------+------+---+------+------+--------------+'/ &
5660  ' | IH | IPT | J | TARG | TAG | handle err |'/ &
5661  ' +------+------+---+------+------+--------------+')
5662 9011 FORMAT ( ' |',2(i5,' |'),i2,' |',2(i5,' |'),i9,i4,' |')
5663 9012 FORMAT ( &
5664  ' +------+------+---+------+------+--------------+')
5665 9013 FORMAT ( ' TEST W3MPIP: NRQPO :',i10)
5666 9014 FORMAT ( ' TEST W3MPIP: TOTAL :',i10)
5667 #endif
5668  !/
5669  !/ End of W3MPIP ----------------------------------------------------- /
5670  !/
5671  END SUBROUTINE w3mpip
5672  !/
5673  !/ End of module W3INITMD -------------------------------------------- /
5674  !/
5675 END MODULE w3initmd
w3adatmd::pt2
real, dimension(:,:), pointer pt2
Definition: w3adatmd.F90:597
w3adatmd::psw
real, dimension(:,:), pointer psw
Definition: w3adatmd.F90:597
w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3odatmd::nrqbp2
integer, pointer nrqbp2
Definition: w3odatmd.F90:533
w3adatmd::hcmaxe
real, dimension(:), pointer hcmaxe
Definition: w3adatmd.F90:587
w3odatmd::iostyp
integer iostyp
Definition: w3odatmd.F90:321
w3gdatmd::nseal
integer, pointer nseal
Definition: w3gdatmd.F90:1097
w3idatmd::flmdn
logical, pointer flmdn
Definition: w3idatmd.F90:263
w3odatmd::flbpo
logical, pointer flbpo
Definition: w3odatmd.F90:546
w3timemd::dsec21
real function dsec21(TIME1, TIME2)
Definition: w3timemd.F90:333
w3adatmd::phice
real, dimension(:), pointer phice
Definition: w3adatmd.F90:607
include
cmake src_list cmake include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_switches.cmake) check_switches("$
Definition: CMakeLists.txt:15
w3adatmd::th2m
real, dimension(:,:), pointer th2m
Definition: w3adatmd.F90:594
w3gdatmd::do_change_wlv
logical, pointer do_change_wlv
Definition: w3gdatmd.F90:1407
w3odatmd::nrqpo
integer, pointer nrqpo
Definition: w3odatmd.F90:486
w3odatmd::iptint
integer, dimension(:,:,:), pointer iptint
Definition: w3odatmd.F90:488
w3adatmd::charn
real, dimension(:), pointer charn
Definition: w3adatmd.F90:603
w3adatmd::dtdyn
real, dimension(:), pointer dtdyn
Definition: w3adatmd.F90:620
w3wdatmd::fpis
real, dimension(:), pointer fpis
Definition: w3wdatmd.F90:183
w3adatmd::nsealm
integer, pointer nsealm
Definition: w3adatmd.F90:686
w3triamd
Reads triangle and unstructured grid information.
Definition: w3triamd.F90:21
w3odatmd::nrqgo2
integer, pointer nrqgo2
Definition: w3odatmd.F90:475
w3odatmd::upproc
logical upproc
Definition: w3odatmd.F90:333
w3adatmd::as
real, dimension(:), pointer as
Definition: w3adatmd.F90:584
w3odatmd::tosnl5
integer, dimension(:), pointer tosnl5
Definition: w3odatmd.F90:462
w3gdatmd::ygrd
double precision, dimension(:,:), pointer ygrd
Definition: w3gdatmd.F90:1205
w3odatmd::notype
integer notype
Definition: w3odatmd.F90:327
w3gdatmd::fspsi
logical, pointer fspsi
Definition: w3gdatmd.F90:1405
w3uostmd
Parmeterization of the unresolved obstacles.
Definition: w3uostmd.F90:22
w3adatmd
Define data structures to set up wave model auxiliary data for several models simultaneously.
Definition: w3adatmd.F90:26
w3adatmd::hcmaxd
real, dimension(:), pointer hcmaxd
Definition: w3adatmd.F90:587
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3adatmd::sth1m
real, dimension(:,:), pointer sth1m
Definition: w3adatmd.F90:594
yowrankmodule::rank
type(t_rank), dimension(:), allocatable, public rank
Provides access to some information of all threads e.g.
Definition: yowrankModule.F90:68
w3adatmd::ussy
real, dimension(:), pointer ussy
Definition: w3adatmd.F90:607
w3gdatmd::trnx
real, dimension(:,:), pointer trnx
Definition: w3gdatmd.F90:1200
w3adatmd::nrqsg2
integer, pointer nrqsg2
Definition: w3adatmd.F90:676
w3gdatmd::zb
real, dimension(:), pointer zb
Definition: w3gdatmd.F90:1195
w3adatmd::pep
real, dimension(:,:), pointer pep
Definition: w3adatmd.F90:597
w3adatmd::mscd
real, dimension(:), pointer mscd
Definition: w3adatmd.F90:617
w3adatmd::abd
real, dimension(:), pointer abd
Definition: w3adatmd.F90:614
w3gdatmd::ungtype
integer, parameter ungtype
Definition: w3gdatmd.F90:626
w3odatmd::o2irqi
logical, pointer o2irqi
Definition: w3odatmd.F90:505
w3gdatmd::dmin
real, pointer dmin
Definition: w3gdatmd.F90:1183
w3wavset
Implicit solution of wave setup problem following Dingemans for structured and unstructured grids.
Definition: w3wavset.F90:18
w3gdatmd::p2msf
integer, dimension(:), pointer p2msf
Definition: w3gdatmd.F90:1098
w3wdatmd
Define data structures to set up wave model dynamic data for several models simultaneously.
Definition: w3wdatmd.F90:18
w3triamd::nvectri
subroutine nvectri
Calculate cell tools: inward normal, angles and length of edges.
Definition: w3triamd.F90:1004
w3adatmd::stmaxe
real, dimension(:), pointer stmaxe
Definition: w3adatmd.F90:587
w3parall::isea_to_jsea
integer, dimension(:), allocatable isea_to_jsea
Definition: w3parall.F90:83
w3adatmd::tauice
real, dimension(:,:), pointer tauice
Definition: w3adatmd.F90:607
w3dispmd::wavnu3
pure subroutine wavnu3(SI, H, K, CG)
Definition: w3dispmd.F90:347
w3adatmd::t02
real, dimension(:), pointer t02
Definition: w3adatmd.F90:587
w3adatmd::us3d
real, dimension(:,:), pointer us3d
Definition: w3adatmd.F90:612
w3adatmd::wadats
type(wadat), dimension(:), allocatable, target wadats
Definition: w3adatmd.F90:571
w3adatmd::cflxymax
real, dimension(:), pointer cflxymax
Definition: w3adatmd.F90:620
w3parall::set_up_nseal_nsealm
subroutine set_up_nseal_nsealm(NSEALout, NSEALMout)
Setup NSEAL, NSEALM in context of PDLIB.
Definition: w3parall.F90:1040
w3odatmd::iy0
integer, pointer iy0
Definition: w3odatmd.F90:551
w3adatmd::cg
real, dimension(:,:), pointer cg
Definition: w3adatmd.F90:575
w3adatmd::tws
real, dimension(:), pointer tws
Definition: w3adatmd.F90:603
w3odatmd::nopts
integer, pointer nopts
Definition: w3odatmd.F90:484
w3odatmd::irqpo2
integer, dimension(:), pointer irqpo2
Definition: w3odatmd.F90:490
w3adatmd::tusx
real, dimension(:), pointer tusx
Definition: w3adatmd.F90:607
w3idatmd::flmth
logical, pointer flmth
Definition: w3idatmd.F90:263
w3adatmd::fcut
real, dimension(:), pointer fcut
Definition: w3adatmd.F90:620
w3odatmd::flogd
logical, dimension(:), pointer flogd
Definition: w3odatmd.F90:478
w3adatmd::nsploc
integer, pointer nsploc
Definition: w3adatmd.F90:676
w3odatmd::flogr2
logical, dimension(:,:), pointer flogr2
Definition: w3odatmd.F90:478
w3adatmd::bispl
integer, dimension(:), pointer bispl
Definition: w3adatmd.F90:680
w3gdatmd::fsn
logical, pointer fsn
Definition: w3gdatmd.F90:1405
w3adatmd::tusy
real, dimension(:), pointer tusy
Definition: w3adatmd.F90:607
w3adatmd::ptp
real, dimension(:,:), pointer ptp
Definition: w3adatmd.F90:597
w3adatmd::dw
real, dimension(:), pointer dw
Definition: w3adatmd.F90:584
w3iorsmd::w3iors
subroutine w3iors(INXOUT, NDSR, DUMFPI, IMOD, FLRSTRT)
Reads/writes restart files.
Definition: w3iorsmd.F90:113
constants::tstout
logical, parameter tstout
TSTOUT Flag for generation of test files.
Definition: constants.F90:56
w3adatmd::u10d
real, dimension(:), pointer u10d
Definition: w3adatmd.F90:584
w3odatmd::ntproc
integer, pointer ntproc
Definition: w3odatmd.F90:457
w3odatmd::dtout
real, dimension(:), pointer dtout
Definition: w3odatmd.F90:467
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3wdatmd::icef
real, dimension(:), pointer icef
Definition: w3wdatmd.F90:183
w3gdatmd::xgrd
double precision, dimension(:,:), pointer xgrd
Definition: w3gdatmd.F90:1205
w3initmd::w3mpii
subroutine w3mpii(IMOD)
Perform initializations for MPI version of model.
Definition: w3initmd.F90:1691
w3adatmd::th1m
real, dimension(:,:), pointer th1m
Definition: w3adatmd.F90:594
w3adatmd::t01
real, dimension(:), pointer t01
Definition: w3adatmd.F90:587
w3adatmd::cge
real, dimension(:), pointer cge
Definition: w3adatmd.F90:603
w3wdatmd::wlv
real, dimension(:), pointer wlv
Definition: w3wdatmd.F90:183
w3gdatmd::flck
logical, pointer flck
Definition: w3gdatmd.F90:1217
w3gdatmd::fsrefraction
logical, pointer fsrefraction
Definition: w3gdatmd.F90:1406
w3odatmd::iaproc
integer, pointer iaproc
Definition: w3odatmd.F90:457
w3odatmd::ngrpp
integer, parameter ngrpp
Definition: w3odatmd.F90:324
pdlib_w3profsmd::test_mpi_status
subroutine test_mpi_status(string)
Definition: w3profsmd_pdlib.F90:1867
w3adatmd::pdir
real, dimension(:,:), pointer pdir
Definition: w3adatmd.F90:597
w3wdatmd::time
integer, dimension(:), pointer time
Definition: w3wdatmd.F90:172
w3adatmd::thp0
real, dimension(:), pointer thp0
Definition: w3adatmd.F90:587
w3adatmd::tauocy
real, dimension(:), pointer tauocy
Definition: w3adatmd.F90:607
w3odatmd::irqpo1
integer, dimension(:), pointer irqpo1
Definition: w3odatmd.F90:490
w3odatmd::flform
logical, pointer flform
Definition: w3odatmd.F90:554
w3idatmd::flic4
logical, pointer flic4
Definition: w3idatmd.F90:264
w3adatmd::phs
real, dimension(:,:), pointer phs
Definition: w3adatmd.F90:597
w3adatmd::hs
real, dimension(:), pointer hs
Definition: w3adatmd.F90:587
w3odatmd::unipts
logical unipts
Definition: w3odatmd.F90:333
w3triamd::coordmax
subroutine coordmax
Calculate first point and last point coordinates, and minimum and maximum edge length.
Definition: w3triamd.F90:1249
w3gdatmd::gname
character(len=30), pointer gname
Definition: w3gdatmd.F90:1223
w3gdatmd::ny
integer, pointer ny
Definition: w3gdatmd.F90:1097
w3adatmd::uba
real, dimension(:), pointer uba
Definition: w3adatmd.F90:614
w3adatmd::iappro
integer, dimension(:), pointer iappro
Definition: w3adatmd.F90:674
w3odatmd::fnmpre
character(len=80) fnmpre
Definition: w3odatmd.F90:330
yownodepool::npa
integer, public npa
number of ghost + resident nodes this partition holds
Definition: yownodepool.F90:99
w3adatmd::pqp
real, dimension(:,:), pointer pqp
Definition: w3adatmd.F90:597
w3odatmd::isbpo
integer, dimension(:), pointer isbpo
Definition: w3odatmd.F90:535
w3odatmd::flbpi
logical, pointer flbpi
Definition: w3odatmd.F90:546
w3wdatmd::va
real, dimension(:,:), pointer va
Definition: w3wdatmd.F90:183
w3odatmd::iyn
integer, pointer iyn
Definition: w3odatmd.F90:551
w3idatmd::flcur
logical, pointer flcur
Definition: w3idatmd.F90:261
w3odatmd::napbpt
integer, pointer napbpt
Definition: w3odatmd.F90:457
w3adatmd::tauwix
real, dimension(:), pointer tauwix
Definition: w3adatmd.F90:603
w3adatmd::w3dima
subroutine w3dima(IMOD, NDSE, NDST, D_ONLY)
Initialize an individual data grid at the proper dimensions.
Definition: w3adatmd.F90:846
w3wdatmd::trho
integer, dimension(:), pointer trho
Definition: w3wdatmd.F90:172
w3adatmd::pthp0
real, dimension(:,:), pointer pthp0
Definition: w3adatmd.F90:597
w3initmd::w3mpio
subroutine w3mpio(IMOD)
Prepare MPI persistent communication needed for WAVEWATCH I/O routines.
Definition: w3initmd.F90:2032
w3wdatmd::tlev
integer, dimension(:), pointer tlev
Definition: w3wdatmd.F90:172
w3idatmd::flic5
logical, pointer flic5
Definition: w3idatmd.F90:264
w3gdatmd::w3setg
subroutine w3setg(IMOD, NDSE, NDST)
Definition: w3gdatmd.F90:2152
w3adatmd::w3xeta
subroutine w3xeta(IMOD, NDSE, NDST)
Reduced version of W3SETA to point to expended output arrays.
Definition: w3adatmd.F90:3118
w3adatmd::tauwiy
real, dimension(:), pointer tauwiy
Definition: w3adatmd.F90:603
w3adatmd::taubbl
real, dimension(:,:), pointer taubbl
Definition: w3adatmd.F90:614
w3servmd::wwtime
subroutine wwtime(STRNG)
Definition: w3servmd.F90:664
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3iorsmd::oarst
logical oarst
Definition: w3iorsmd.F90:68
w3adatmd::ef
real, dimension(:,:), pointer ef
Definition: w3adatmd.F90:594
w3odatmd::iys
integer, pointer iys
Definition: w3odatmd.F90:551
w3iopomd::w3iopp
subroutine w3iopp(NPT, XPT, YPT, PNAMES, IMOD)
Preprocessing of point output.
Definition: w3iopomd.F90:230
w3adatmd::w3seta
subroutine w3seta(IMOD, NDSE, NDST)
Select one of the WAVEWATCH III grids / models.
Definition: w3adatmd.F90:2645
w3adatmd::tauwny
real, dimension(:), pointer tauwny
Definition: w3adatmd.F90:603
w3odatmd::ptloc
real, dimension(:,:), pointer ptloc
Definition: w3odatmd.F90:492
w3odatmd::abpos
real, dimension(:,:), pointer abpos
Definition: w3odatmd.F90:541
w3initmd::w3mpip
subroutine w3mpip(IMOD)
Prepare MPI persistent communication needed for WAVEWATCH I/O routines.
Definition: w3initmd.F90:5388
w3gdatmd::rstype
integer, pointer rstype
Definition: w3gdatmd.F90:1095
w3gdatmd::mapfs
integer, dimension(:,:), pointer mapfs
Definition: w3gdatmd.F90:1163
w3odatmd::tonext
integer, dimension(:,:), pointer tonext
Definition: w3odatmd.F90:464
w3idatmd::fllev
logical, pointer fllev
Definition: w3idatmd.F90:261
w3odatmd::naperr
integer, pointer naperr
Definition: w3odatmd.F90:457
w3adatmd::phiaw
real, dimension(:), pointer phiaw
Definition: w3adatmd.F90:603
w3adatmd::pws
real, dimension(:,:), pointer pws
Definition: w3adatmd.F90:597
w3adatmd::plp
real, dimension(:,:), pointer plp
Definition: w3adatmd.F90:597
w3odatmd::nblkrs
integer, pointer nblkrs
Definition: w3odatmd.F90:523
w3initmd::w3init
subroutine w3init(IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, FLG2, NPT, XPT, YPT, PNAMES, IPRT, PRTFRM, MPI_COMM, FLAGSTIDEIN)
Initialize WAVEWATCH III.
Definition: w3initmd.F90:164
w3adatmd::phibbl
real, dimension(:), pointer phibbl
Definition: w3adatmd.F90:614
pdlib_w3profsmd::deallocate_pdlib_global
subroutine deallocate_pdlib_global(IMOD)
Definition: w3profsmd_pdlib.F90:7278
w3adatmd::mpibuf
integer, parameter mpibuf
Definition: w3adatmd.F90:376
w3odatmd::w3dmo5
subroutine w3dmo5(IMOD, NDSE, NDST, IBLOCK)
Definition: w3odatmd.F90:1321
w3gdatmd::b_jgs_block_gauss_seidel
logical, pointer b_jgs_block_gauss_seidel
Definition: w3gdatmd.F90:1415
yownodepool
Has data that belong to nodes.
Definition: yownodepool.F90:39
constants::lpdlib
logical lpdlib
LPDLIB Logical for using the PDLIB library.
Definition: constants.F90:101
w3odatmd::flogrr
logical, dimension(:,:), pointer flogrr
Definition: w3odatmd.F90:478
w3adatmd::cflthmax
real, dimension(:), pointer cflthmax
Definition: w3adatmd.F90:620
w3gdatmd::nsea
integer, pointer nsea
Definition: w3gdatmd.F90:1097
w3adatmd::skew
real, dimension(:), pointer skew
Definition: w3adatmd.F90:617
w3adatmd::psi
real, dimension(:,:), pointer psi
Definition: w3adatmd.F90:597
w3adatmd::sth2m
real, dimension(:,:), pointer sth2m
Definition: w3adatmd.F90:594
w3adatmd::tpms
real, dimension(:), pointer tpms
Definition: w3adatmd.F90:607
w3servmd
Definition: w3servmd.F90:3
w3adatmd::embia1
real, dimension(:), pointer embia1
Definition: w3adatmd.F90:617
w3odatmd::flogrd
logical, dimension(:,:), pointer flogrd
Definition: w3odatmd.F90:478
w3odatmd::naplog
integer, pointer naplog
Definition: w3odatmd.F90:457
w3adatmd::ths
real, dimension(:), pointer ths
Definition: w3adatmd.F90:587
pdlib_w3profsmd::pdlib_iobp_init
subroutine pdlib_iobp_init(IMOD)
Definition: w3profsmd_pdlib.F90:518
w3adatmd::bedforms
real, dimension(:,:), pointer bedforms
Definition: w3adatmd.F90:614
w3odatmd::nrqpo2
integer, pointer nrqpo2
Definition: w3odatmd.F90:486
w3odatmd::nbo2
integer, dimension(:), pointer nbo2
Definition: w3odatmd.F90:531
w3timemd::tick21
subroutine tick21(TIME, DTIME)
Definition: w3timemd.F90:84
w3adatmd::ud
real, dimension(:), pointer ud
Definition: w3adatmd.F90:584
w3adatmd::hmaxd
real, dimension(:), pointer hmaxd
Definition: w3adatmd.F90:587
yowrankmodule
Provides access to some information of all threads e.g.
Definition: yowrankModule.F90:44
pdlib_w3profsmd::block_solver_explicit_init
subroutine block_solver_explicit_init()
Definition: w3profsmd_pdlib.F90:6610
w3adatmd::pwst
real, dimension(:), pointer pwst
Definition: w3adatmd.F90:597
w3triamd::spatial_grid
subroutine spatial_grid
Calculates triangle areas and reorders the triangles to have them oriented counterclockwise.
Definition: w3triamd.F90:891
w3wdatmd::w3setw
subroutine w3setw(IMOD, NDSE, NDST)
Select one of the WAVEWATCH III grids / models.
Definition: w3wdatmd.F90:660
w3adatmd::qkk
real, dimension(:), pointer qkk
Definition: w3adatmd.F90:617
w3odatmd::noge
integer, dimension(nogrp) noge
Definition: w3odatmd.F90:326
w3adatmd::irqsg1
integer, dimension(:,:), pointer irqsg1
Definition: w3adatmd.F90:681
w3gdatmd::fsfct
logical, pointer fsfct
Definition: w3gdatmd.F90:1405
w3odatmd::irqbp1
integer, dimension(:), pointer irqbp1
Definition: w3odatmd.F90:538
w3odatmd::w3seto
subroutine w3seto(IMOD, NDSERR, NDSTST)
Definition: w3odatmd.F90:1523
pdlib_w3profsmd::print_wn_statistic
subroutine print_wn_statistic(string)
Definition: w3profsmd_pdlib.F90:2869
w3adatmd::sxy
real, dimension(:), pointer sxy
Definition: w3adatmd.F90:607
w3timemd::stme21
subroutine stme21(TIME, DTME21)
Definition: w3timemd.F90:682
w3servmd::print_memcheck
subroutine print_memcheck(iun, msg)
Write memory statistics if requested.
Definition: w3servmd.F90:2033
w3adatmd::gstore
real, dimension(:,:), pointer gstore
Definition: w3adatmd.F90:682
w3adatmd::tauwnx
real, dimension(:), pointer tauwnx
Definition: w3adatmd.F90:603
w3idatmd::flic2
logical, pointer flic2
Definition: w3idatmd.F90:264
w3gdatmd::flcth
logical, pointer flcth
Definition: w3gdatmd.F90:1217
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
pdlib_w3profsmd::block_solver_init
subroutine block_solver_init(IMOD)
Definition: w3profsmd_pdlib.F90:6675
w3odatmd::vaaux
real, dimension(:,:,:), pointer vaaux
Definition: w3odatmd.F90:525
w3idatmd::flic3
logical, pointer flic3
Definition: w3idatmd.F90:264
w3odatmd::it0prt
integer, pointer it0prt
Definition: w3odatmd.F90:512
w3odatmd
Definition: w3odatmd.F90:3
w3odatmd::rsblks
integer, pointer rsblks
Definition: w3odatmd.F90:523
w3adatmd::wbt
real, dimension(:), pointer wbt
Definition: w3adatmd.F90:587
w3odatmd::irqgo2
integer, dimension(:), pointer irqgo2
Definition: w3odatmd.F90:476
w3adatmd::bhd
real, dimension(:), pointer bhd
Definition: w3adatmd.F90:607
w3odatmd::nds
integer, dimension(:), pointer nds
Definition: w3odatmd.F90:464
w3adatmd::cy
real, dimension(:), pointer cy
Definition: w3adatmd.F90:584
w3adatmd::pnr
real, dimension(:), pointer pnr
Definition: w3adatmd.F90:597
w3odatmd::screen
integer, pointer screen
Definition: w3odatmd.F90:456
w3odatmd::tolast
integer, dimension(:,:), pointer tolast
Definition: w3odatmd.F90:464
w3adatmd::hmaxe
real, dimension(:), pointer hmaxe
Definition: w3adatmd.F90:587
w3adatmd::pt1
real, dimension(:,:), pointer pt1
Definition: w3adatmd.F90:597
w3adatmd::wlm
real, dimension(:), pointer wlm
Definition: w3adatmd.F90:587
w3odatmd::nfbpo
integer, pointer nfbpo
Definition: w3odatmd.F90:530
w3gdatmd::mapsf
integer, dimension(:,:), pointer mapsf
Definition: w3gdatmd.F90:1163
w3odatmd::naproc
integer, pointer naproc
Definition: w3odatmd.F90:457
w3parall::print_my_time
subroutine print_my_time(string)
Print timings.
Definition: w3parall.F90:200
w3triamd::area_si
subroutine area_si(IMOD)
Define optimized connection arrays (points and triangles) for spatial propagation schemes.
Definition: w3triamd.F90:1337
w3iogrmd::w3iogr
subroutine w3iogr(INXOUT, NDSM, IMOD, FEXT ifdef W3_ASCII
Reading and writing of the model definition file.
Definition: w3iogrmd.F90:117
w3gdatmd::fsnimp
logical, pointer fsnimp
Definition: w3gdatmd.F90:1405
w3gdatmd::us3df
integer, dimension(:), pointer us3df
Definition: w3gdatmd.F90:1098
w3adatmd::wnmean
real, dimension(:), pointer wnmean
Definition: w3adatmd.F90:587
w3odatmd::irqtr
integer, dimension(:), pointer irqtr
Definition: w3odatmd.F90:513
w3adatmd::cflkmax
real, dimension(:), pointer cflkmax
Definition: w3adatmd.F90:620
w3odatmd::irqbp2
integer, dimension(:), pointer irqbp2
Definition: w3odatmd.F90:538
yowdatapool::istatus
integer, dimension(mpi_status_size) istatus
MPI Real Type Shpuld be MPI_REAL8.
Definition: yowdatapool.F90:74
w3adatmd::sstore
real, dimension(:,:), pointer sstore
Definition: w3adatmd.F90:682
yowdatapool
Has fancy data.
Definition: yowdatapool.F90:39
w3idatmd::w3seti
subroutine w3seti(IMOD, NDSE, NDST)
Select one of the WAVEWATCH III grids / models.
Definition: w3idatmd.F90:819
w3adatmd::phioc
real, dimension(:), pointer phioc
Definition: w3adatmd.F90:607
w3wavset::preparation_fd_scheme
subroutine preparation_fd_scheme(IMOD)
Wave setup for FD grids.
Definition: w3wavset.F90:1778
file
file(STRINGS ${CMAKE_BINARY_DIR}/switch switch_strings) separate_arguments(switches UNIX_COMMAND $
Definition: CMakeLists.txt:3
w3iogrmd
Reading/writing of model definition file.
Definition: w3iogrmd.F90:20
w3odatmd::nrqrs
integer, pointer nrqrs
Definition: w3odatmd.F90:523
w3odatmd::ptnme
character(len=40), dimension(:), pointer ptnme
Definition: w3odatmd.F90:501
w3adatmd::wn
real, dimension(:,:), pointer wn
Definition: w3adatmd.F90:575
w3wdatmd::w3dimw
subroutine w3dimw(IMOD, NDSE, NDST, F_ONLY)
Initialize an individual data grid at the proper dimensions.
Definition: w3wdatmd.F90:343
w3adatmd::u10
real, dimension(:), pointer u10
Definition: w3adatmd.F90:584
w3idatmd::flmvs
logical, pointer flmvs
Definition: w3idatmd.F90:263
w3gdatmd::iclose
integer, pointer iclose
Definition: w3gdatmd.F90:1096
w3gdatmd::fstotalexp
logical, pointer fstotalexp
Definition: w3gdatmd.F90:1405
w3odatmd::napprt
integer, pointer napprt
Definition: w3odatmd.F90:457
w3odatmd::ixs
integer, pointer ixs
Definition: w3odatmd.F90:551
w3odatmd::irqrs
integer, dimension(:), pointer irqrs
Definition: w3odatmd.F90:524
w3odatmd::flog2
logical, dimension(:), pointer flog2
Definition: w3odatmd.F90:478
w3adatmd::fliwnd
logical, pointer fliwnd
Definition: w3adatmd.F90:688
w3odatmd::naptrk
integer, pointer naptrk
Definition: w3odatmd.F90:457
pdlib_w3profsmd::pdlib_mapsta_init
subroutine pdlib_mapsta_init(IMOD)
Definition: w3profsmd_pdlib.F90:403
w3adatmd::ww3_spec_vec
integer, pointer ww3_spec_vec
Definition: w3adatmd.F90:676
w3adatmd::qp
real, dimension(:), pointer qp
Definition: w3adatmd.F90:587
w3odatmd::flout
logical, dimension(:), pointer flout
Definition: w3odatmd.F90:468
constants::tpi
real, parameter tpi
TPI 2*Pi.
Definition: constants.F90:72
w3iogomd
Gridded output of mean wave parameters.
Definition: w3iogomd.F90:15
w3idatmd::flwind
logical, pointer flwind
Definition: w3idatmd.F90:261
w3adatmd::stmaxd
real, dimension(:), pointer stmaxd
Definition: w3adatmd.F90:587
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3gdatmd::gtype
integer, pointer gtype
Definition: w3gdatmd.F90:1094
w3wdatmd::zeta_setup
real, dimension(:), pointer zeta_setup
Definition: w3wdatmd.F90:187
w3idatmd
Define data structures to set up wave model input data for several models simultaneously.
Definition: w3idatmd.F90:16
w3odatmd::ndso
integer, pointer ndso
Definition: w3odatmd.F90:456
w3arrymd
Definition: w3arrymd.F90:3
w3adatmd::whitecap
real, dimension(:,:), pointer whitecap
Definition: w3adatmd.F90:603
w3odatmd::nappnt
integer, pointer nappnt
Definition: w3odatmd.F90:457
w3odatmd::napout
integer, pointer napout
Definition: w3odatmd.F90:457
pdlib_w3profsmd::set_iobpa_pdlib
subroutine set_iobpa_pdlib
Definition: w3profsmd_pdlib.F90:6903
w3servmd::wwdate
subroutine wwdate(STRNG)
Definition: w3servmd.F90:595
w3adatmd::sppnt
real, dimension(:,:,:), pointer sppnt
Definition: w3adatmd.F90:684
w3initmd::critos
real, parameter critos
Definition: w3initmd.F90:128
w3uostmd::uost_setgrid
subroutine, public uost_setgrid(IGRID)
Sets the current grid in the sourceterm object.
Definition: w3uostmd.F90:232
w3adatmd::tauox
real, dimension(:), pointer tauox
Definition: w3adatmd.F90:607
w3odatmd::ixn
integer, pointer ixn
Definition: w3odatmd.F90:551
w3odatmd::ix0
integer, pointer ix0
Definition: w3odatmd.F90:551
w3iogomd::w3flgrdupdt
subroutine w3flgrdupdt(NDSO, NDSEN, FLGRD, FLGR2, FLGD, FLG2)
Updates the flags for output parameters based on the mod_def file this is to prevent the allocation o...
Definition: w3iogomd.F90:178
w3odatmd::noextr
integer, parameter noextr
Definition: w3odatmd.F90:328
w3adatmd::p2sms
real, dimension(:,:), pointer p2sms
Definition: w3adatmd.F90:612
w3odatmd::idout
character(len=20), dimension(nogrp, ngrpp) idout
Definition: w3odatmd.F90:329
w3adatmd::prms
real, dimension(:), pointer prms
Definition: w3adatmd.F90:607
w3odatmd::napfld
integer, pointer napfld
Definition: w3odatmd.F90:457
w3adatmd::usero
real, dimension(:,:), pointer usero
Definition: w3adatmd.F90:623
w3parall::init_get_jsea_isproc
subroutine init_get_jsea_isproc(ISEA, JSEA, ISPROC)
Set JSEA for all schemes.
Definition: w3parall.F90:1163
w3odatmd::it0trk
integer, pointer it0trk
Definition: w3odatmd.F90:512
w3odatmd::tofrst
integer, dimension(:), pointer tofrst
Definition: w3odatmd.F90:464
w3adatmd::mssy
real, dimension(:), pointer mssy
Definition: w3adatmd.F90:617
w3idatmd::fltaua
logical, pointer fltaua
Definition: w3idatmd.F90:261
w3odatmd::ndst
integer, pointer ndst
Definition: w3odatmd.F90:456
w3wdatmd::ust
real, dimension(:), pointer ust
Definition: w3wdatmd.F90:183
w3adatmd::mpi_comm_wave
integer, pointer mpi_comm_wave
Definition: w3adatmd.F90:676
constants
Define some much-used constants for global use (all defined as PARAMETER).
Definition: constants.F90:20
w3adatmd::ua
real, dimension(:), pointer ua
Definition: w3adatmd.F90:584
w3adatmd::tauoy
real, dimension(:), pointer tauoy
Definition: w3adatmd.F90:607
w3odatmd::nogrp
integer, parameter nogrp
Definition: w3odatmd.F90:323
w3gdatmd::b_jgs_use_jacobi
logical, pointer b_jgs_use_jacobi
Definition: w3gdatmd.F90:1414
w3adatmd::fp0
real, dimension(:), pointer fp0
Definition: w3adatmd.F90:587
w3initmd::switches
character(len=512), parameter switches
Definition: w3initmd.F90:130
w3gdatmd
Definition: w3gdatmd.F90:16
w3adatmd::flcold
logical, pointer flcold
Definition: w3adatmd.F90:688
w3adatmd::hsig
real, dimension(:), pointer hsig
Definition: w3adatmd.F90:587
w3idatmd::flrhoa
logical, pointer flrhoa
Definition: w3idatmd.F90:261
w3parall::synchronize_ipgl_etc_array
subroutine synchronize_ipgl_etc_array(IMOD, IsMulti)
Sync global local arrays.
Definition: w3parall.F90:916
w3adatmd::ussx
real, dimension(:), pointer ussx
Definition: w3adatmd.F90:607
w3dispmd::wavnu1
subroutine wavnu1(SI, H, K, CG)
Definition: w3dispmd.F90:85
w3adatmd::embia2
real, dimension(:), pointer embia2
Definition: w3adatmd.F90:617
w3adatmd::mssx
real, dimension(:), pointer mssx
Definition: w3adatmd.F90:617
w3servmd::extcde
subroutine extcde(IEXIT, UNIT, MSG, FILE, LINE, COMM)
Definition: w3servmd.F90:736
w3odatmd::outpts
type(output), dimension(:), allocatable, target outpts
Definition: w3odatmd.F90:452
w3adatmd::mscy
real, dimension(:), pointer mscy
Definition: w3adatmd.F90:617
w3adatmd::w3xdma
subroutine w3xdma(IMOD, NDSE, NDST, OUTFLAGS)
Version of W3DIMX for extended ouput arrays only.
Definition: w3adatmd.F90:1523
w3odatmd::irqrss
integer, dimension(:), pointer irqrss
Definition: w3odatmd.F90:524
w3adatmd::ibfloc
integer, pointer ibfloc
Definition: w3adatmd.F90:676
w3adatmd::bstat
integer, dimension(:), pointer bstat
Definition: w3adatmd.F90:680
w3idatmd::flice
logical, pointer flice
Definition: w3idatmd.F90:261
w3adatmd::nrqsg1
integer, pointer nrqsg1
Definition: w3adatmd.F90:676
w3servmd::itrace
subroutine itrace(NDS, NMAX)
Definition: w3servmd.F90:91
w3wdatmd::ustdir
real, dimension(:), pointer ustdir
Definition: w3wdatmd.F90:183
w3adatmd::ww3_field_vec
integer, pointer ww3_field_vec
Definition: w3adatmd.F90:676
pdlib_w3profsmd::all_va_integral_print
subroutine all_va_integral_print(IMOD, string, choice)
Definition: w3profsmd_pdlib.F90:2292
w3adatmd::ptm1
real, dimension(:,:), pointer ptm1
Definition: w3adatmd.F90:597
w3odatmd::noswll
integer, pointer noswll
Definition: w3odatmd.F90:460
w3adatmd::irqsg2
integer, dimension(:,:), pointer irqsg2
Definition: w3adatmd.F90:681
pdlib_w3profsmd::pdlib_init
subroutine pdlib_init(IMOD)
Definition: w3profsmd_pdlib.F90:144
w3adatmd::thm
real, dimension(:), pointer thm
Definition: w3adatmd.F90:587
w3adatmd::mscx
real, dimension(:), pointer mscx
Definition: w3adatmd.F90:617
w3adatmd::ppe
real, dimension(:,:), pointer ppe
Definition: w3adatmd.F90:597
w3adatmd::isploc
integer, pointer isploc
Definition: w3adatmd.F90:676
w3odatmd::ptifac
real, dimension(:,:), pointer ptifac
Definition: w3odatmd.F90:492
w3adatmd::cx
real, dimension(:), pointer cx
Definition: w3adatmd.F90:584
w3gdatmd::nx
integer, pointer nx
Definition: w3gdatmd.F90:1097
w3adatmd::pgw
real, dimension(:,:), pointer pgw
Definition: w3adatmd.F90:597
w3gdatmd::fsfreqshift
logical, pointer fsfreqshift
Definition: w3gdatmd.F90:1406
w3timemd
Definition: w3timemd.F90:3
constants::undef
real undef
UNDEF Value for undefined variable in output.
Definition: constants.F90:84
w3adatmd::ussp
real, dimension(:,:), pointer ussp
Definition: w3adatmd.F90:612
w3odatmd::nrqbp
integer, pointer nrqbp
Definition: w3odatmd.F90:533
w3parall
Parallel routines for implicit solver.
Definition: w3parall.F90:22
w3dispmd
Definition: w3dispmd.F90:3
w3odatmd::irqgo
integer, dimension(:), pointer irqgo
Definition: w3odatmd.F90:476
w3gdatmd::usspf
integer, dimension(:), pointer usspf
Definition: w3gdatmd.F90:1098
w3gdatmd::dtcfl
real, pointer dtcfl
Definition: w3gdatmd.F90:1183
w3idatmd::w3dimi
subroutine w3dimi(IMOD, NDSE, NDST, FLAGSTIDEIN)
Initialize an individual data grid at the proper dimensions.
Definition: w3idatmd.F90:435
w3odatmd::it0pnt
integer, pointer it0pnt
Definition: w3odatmd.F90:512
w3adatmd::mssd
real, dimension(:), pointer mssd
Definition: w3adatmd.F90:617
w3odatmd::nrqgo
integer, pointer nrqgo
Definition: w3odatmd.F90:475
w3gdatmd::fstotalimp
logical, pointer fstotalimp
Definition: w3gdatmd.F90:1405
w3odatmd::naprst
integer, pointer naprst
Definition: w3odatmd.F90:457
w3gdatmd::e3df
integer, dimension(:,:), pointer e3df
Definition: w3gdatmd.F90:1098
w3adatmd::t0m1
real, dimension(:), pointer t0m1
Definition: w3adatmd.F90:587
w3arrymd::prtblk
subroutine prtblk(NDS, NX, NY, MX, F, MAP, MAP0, FSC, IX1, IX2, IX3, IY1, IY2, IY3, PRVAR, PRUNIT)
Definition: w3arrymd.F90:1112
w3gdatmd::mapsta
integer, dimension(:,:), pointer mapsta
Definition: w3gdatmd.F90:1163
w3iorsmd
Read/write restart files.
Definition: w3iorsmd.F90:14
w3wdatmd::tice
integer, dimension(:), pointer tice
Definition: w3wdatmd.F90:172
w3initmd
Contains module W3INITMD.
Definition: w3initmd.F90:14
w3gdatmd::trny
real, dimension(:,:), pointer trny
Definition: w3gdatmd.F90:1200
w3initmd::wwver
character(len=10), parameter wwver
Definition: w3initmd.F90:129
w3iopomd
Process point output.
Definition: w3iopomd.F90:19
w3adatmd::tauocx
real, dimension(:), pointer tauocx
Definition: w3adatmd.F90:607
w3gdatmd::mapst2
integer, dimension(:,:), pointer mapst2
Definition: w3gdatmd.F90:1163
pdlib_w3profsmd
Definition: w3profsmd_pdlib.F90:4
w3parall::init_get_isea
subroutine init_get_isea(ISEA, JSEA)
Set ISEA for all schemes.
Definition: w3parall.F90:1398
w3adatmd::aba
real, dimension(:), pointer aba
Definition: w3adatmd.F90:614
w3adatmd::syy
real, dimension(:), pointer syy
Definition: w3adatmd.F90:607
w3adatmd::ubd
real, dimension(:), pointer ubd
Definition: w3adatmd.F90:614
w3adatmd::sxx
real, dimension(:), pointer sxx
Definition: w3adatmd.F90:607
pdlib_w3profsmd::set_iobdp_pdlib
subroutine set_iobdp_pdlib
Definition: w3profsmd_pdlib.F90:6814
w3idatmd::flic1
logical, pointer flic1
Definition: w3idatmd.F90:264
w3gdatmd::dtmax
real, pointer dtmax
Definition: w3gdatmd.F90:1183
w3odatmd::nrqtr
integer, pointer nrqtr
Definition: w3odatmd.F90:512
w3gdatmd::flagll
logical, pointer flagll
Definition: w3gdatmd.F90:1219
w3wdatmd::asf
real, dimension(:), pointer asf
Definition: w3wdatmd.F90:183
w3adatmd::mpi_comm_wcmp
integer, pointer mpi_comm_wcmp
Definition: w3adatmd.F90:676