WAVEWATCH III  beta 0.0.1
wmiopomd.F90
Go to the documentation of this file.
1 
6 
7 #include "w3macros.h"
8 !/ ------------------------------------------------------------------- /
15 MODULE wmiopomd
16  !/
17  !/ +-----------------------------------+
18  !/ | WAVEWATCH III NOAA/NCEP |
19  !/ | H. L. Tolman |
20  !/ | FORTRAN 90 |
21  !/ | Last update : 06-Jun-2012 |
22  !/ +-----------------------------------+
23  !/
24  !/ 09-Aug-2006 : Origination. ( version 3.10 )
25  !/ 01-May-2007 : Addd diagnostic output O7a/b. ( version 3.11 )
26  !/ 21-Jun-2007 : Dedicated output processes. ( version 3.11 )
27  !/ 29-May-2009 : Preparing distribution version. ( version 3.14 )
28  !/ 30-Oct-2009 : Implement run-time grid selection. ( version 3.14 )
29  !/ (W. E. Rogers & T. J. Campbell, NRL)
30  !/ 06-Dec-2010 : Change from GLOBAL (logical) to ICLOSE (integer) to
31  !/ specify index closure for a grid. ( version 3.14 )
32  !/ (T. J. Campbell, NRL)
33  !/ 06-Mar-2012 : Using MPI_COMM_NULL in checks. ( version 4.07 )
34  !/ 06-Jun-2012 : Porting bugfixes from 3.14 to 4.07 ( version 4.07 )
35  !/
36  !/ Copyright 2009-2012 National Weather Service (NWS),
37  !/ National Oceanic and Atmospheric Administration. All rights
38  !/ reserved. WAVEWATCH III is a trademark of the NWS.
39  !/ No unauthorized use without permission.
40  !/
41  ! 1. Purpose :
42  !
43  ! Module for generating a single point output file for a multi-
44  ! grid model implementation.
45  !
46  ! 2. Variables and types :
47  !
48  ! 3. Subroutines and functions :
49  !
50  ! Name Type Scope Description
51  ! ----------------------------------------------------------------
52  ! WMIOPP Subr Public Initialization routine.
53  ! WMIOPO Subr Public Gather and write routine.
54  ! ----------------------------------------------------------------
55  !
56  ! 4. Subroutines and functions used :
57  !
58  ! Name Type Module Description
59  ! ----------------------------------------------------------------
60  ! W3SETG Subr W3GDATMD Point to model grid.
61  ! W3SETW Subr W3WDATMD Point to model grid.
62  ! W3SETA Subr W3ADATMD Point to model grid.
63  ! W3SETO Subr W3ODATMD Point to model grid.
64  ! W3DMO2 Subr Id. Dimention model grids output 2.
65  ! WMSETM Subr WMMDATMD Point to model grid.
66  ! W3MPIP Subr W3INITMD Model intiailization.
67  ! W3IOPP Sunr W3IOPOMD Prepare point output for single model.
68  ! W3IOPO Sunr Id. Point output for single model.
69  ! W3CSPC Subr. W3CSPCMD Spectral grid conversion.
70  ! STRACE Subr W3SERVMD Subroutine tracing.
71  ! EXTCDE Subr Id. Program abort.
72  ! MPI_SEND, MPI_RECV
73  ! Subr. mpif.h Standard MPI library routines.
74  ! ----------------------------------------------------------------
75  !
76  ! 5. Remarks :
77  !
78  ! 6. Switches :
79  !
80  ! !/SHRD Distributed memory model.
81  ! !/MPI
82  !
83  ! !O7a Disgnostic output to NMPSCR.
84  ! !O7b
85  !
86  ! !/S Enable subroutine tracing.
87  ! !/T Enable test output
88  ! !/MPIT
89  !
90  ! 7. Source code :
91  !
92  !/ ------------------------------------------------------------------- /
93  PUBLIC
94  !/
95 CONTAINS
96  !/ ------------------------------------------------------------------- /
109  SUBROUTINE wmiopp ( NPT, XPT, YPT, PNAMES )
110  !/
111  !/ +-----------------------------------+
112  !/ | WAVEWATCH III NOAA/NCEP |
113  !/ | H. L. Tolman |
114  !/ | FORTRAN 90 |
115  !/ | Last update : 01-Sep-2012 !
116  !/ +-----------------------------------+
117  !/
118  !/ 09-Aug-2006 : Origination. ( version 3.10 )
119  !/ 01-May-2007 : Addd diagnostic output O7a,b ( version 3.11 )
120  !/ 30-Oct-2009 : Implement run-time grid selection. ( version 3.14 )
121  !/ (W. E. Rogers & T. J. Campbell, NRL)
122  !/ 06-Dec-2010 : Change from GLOBAL (logical) to ICLOSE (integer) to
123  !/ specify index closure for a grid. ( version 3.14 )
124  !/ (T. J. Campbell, NRL)
125  !/ 16-Mar-2012 : Using MPI_COMM_NULL in checks. ( version 4.07 )
126  !/ 06-Jun-2012 : Porting bugfixes from 3.14 to 4.07 ( version 4.07 )
127  !/ 01-Sep-2012 : Added tests for unstructured grid ( version 4.07 )
128  !/ (M. Dutour Sikiric, IRB & Aron Roland, Z&P)
129  !/
130  ! 1. Purpose :
131  !
132  ! Initialization for unified point output.
133  !
134  ! 2. Method :
135  !
136  ! Find highest resolution grid for each point.
137  !
138  ! 3. Parameters :
139  !
140  ! Parameter list
141  ! ----------------------------------------------------------------
142  ! NPT Int. I Number of output points in input.
143  ! XPT R.A. I X (longitude) coordinates of output points.
144  ! YPT R.A. I Id. Y.
145  ! PNAMES C*40 I Names of output points.
146  ! ----------------------------------------------------------------
147  ! Note: all are optional, and should be given on the first call
148  ! only, will be taken from storage after that.
149  ! NPT needs to be ginve always, but can be dummy after
150  ! first call.
151  !
152  ! 4. Subroutines used :
153  !
154  ! Name Type Module Description
155  ! ----------------------------------------------------------------
156  ! W3SETG Subr W3GDATMD Point to model grid.
157  ! W3SETW Subr W3WDATMD Point to model grid.
158  ! W3SETA Subr W3ADATMD Point to model grid.
159  ! W3SETO Subr W3ODATMD Point to model grid.
160  ! W3DMO2 Subr Id. Dimension model grids output 2.
161  ! WMSETM Subr WMMDATMD Point to model grid.
162  ! W3MPIP Subr W3INITMD Model intiailization.
163  ! W3IOPP Sunr W3IOPOMD Point output for single model.
164  ! STRACE Subr W3SERVMD Subroutine tracing.
165  ! EXTCDE Subr Id. Program abort.
166  ! ----------------------------------------------------------------
167  !
168  ! 5. Called by :
169  !
170  ! Name Type Module Description
171  ! ----------------------------------------------------------------
172  ! WMINIT Subr. WMINITMD Wave model initialization routine.
173  ! ----------------------------------------------------------------
174  !
175  ! 6. Error messages :
176  !
177  ! 7. Remarks :
178  !
179  ! - The algorithm used to decide if the pont is in the grid needs
180  ! to be strictly consistent with W3IOPP.
181  ! - MPI communication is set up separately from W3MPIO to assure
182  ! that data are gathered in a single processor even if this
183  ! procesor is not part of the communicator of the individual
184  ! model.
185  ! - In section 2.b the soring of the grids by rand is utilized.
186  !
187  ! 8. Structure :
188  !
189  ! See source code.
190  !
191  ! 9. Switches :
192  !
193  ! !/SHRD Distributed memory model.
194  ! !/MPI
195  !
196  ! !O7a Disgnostic output to NMPSCR.
197  ! !O7b
198  !
199  ! !/S Enable subroutine tracing.
200  ! !/T Enable test output
201  !
202  ! 10. Source code :
203  !
204  !/ ------------------------------------------------------------------- /
205  !
206  USE w3gsrumd
207  USE w3gdatmd, ONLY: w3setg
208  USE w3adatmd, ONLY: w3seta
209  USE w3wdatmd, ONLY: w3setw
210  USE w3odatmd, ONLY: w3seto, w3dmo2
211  USE wmmdatmd, ONLY: wmsetm
212 #ifdef W3_MPI
213  USE w3initmd, ONLY: w3mpip
214 #endif
215  USE w3iopomd, ONLY: w3iopp
216  USE w3servmd, ONLY: extcde
217 #ifdef W3_S
218  USE w3servmd, ONLY: strace
219 #endif
220  !
221  USE w3gdatmd, ONLY: nx, ny, x0, y0, sx, mapsta, grids, &
223  clgtype, gsu
224  USE w3gdatmd, ONLY: trigp, maxx, maxy, dxymax ! unstructured grids
225  USE w3odatmd, ONLY: o2init, nopts, ptloc, ptnme, grdid, outpts
226 #ifdef W3_MPI
227  USE w3odatmd, ONLY: o2irqi
228 #endif
229  USE wmmdatmd, ONLY: mdse, mdst, nrgrd, mdatas, improc, nmpscr, &
230  nmperr, mdss
231  USE w3triamd
232 #ifdef W3_MPI
234 #endif
235  !
236  IMPLICIT NONE
237  !
238 #ifdef W3_MPI
239  include "mpif.h"
240 #endif
241  !/
242  !/ ------------------------------------------------------------------- /
243  !/ Parameter list
244  !/
245  INTEGER, INTENT(IN) :: NPT
246  REAL, INTENT(IN), OPTIONAL :: XPT(NPT), YPT(NPT)
247  CHARACTER(LEN=40),INTENT(IN), OPTIONAL :: PNAMES(NPT)
248  !/
249  !/ ------------------------------------------------------------------- /
250  !/ Local parameters
251  !/
252  INTEGER :: IPT, J, II
253  INTEGER :: IX(4), IY(4) ! created by w3grmp
254  REAL :: RD(4) ! created by w3grmp
255  INTEGER :: itout, I1, I2, I3 ! unstructured grids
256 #ifdef W3_S
257  INTEGER, SAVE :: IENT = 0
258 #endif
259  INTEGER :: IERR_MPI
260  REAL :: RX, RY, RDX, RDY
261  REAL, PARAMETER :: ACC = 0.05
262  REAL, ALLOCATABLE :: XP(:), YP(:)
263  REAL :: FACTOR
264  LOGICAL, ALLOCATABLE :: INGRID(:,:)
265  LOGICAL, SAVE :: SETUP = .false., flgo7a = .false.
266  CHARACTER(LEN=40), ALLOCATABLE :: PN(:)
267  !/
268 #ifdef W3_S
269  CALL strace (ient, 'WMIOPP')
270 #endif
271  !
272  ! -------------------------------------------------------------------- /
273  ! 0. Initializations
274  !
275  CALL w3seto ( 0, mdse, mdst )
276  !
277 #ifdef W3_T
278  WRITE (mdst,9000) o2init, npt, PRESENT(xpt), &
279  PRESENT(ypt), PRESENT(pnames)
280 #endif
281 #ifdef W3_O7a
282  flgo7a = .true.
283 #endif
284  !
285  ! -------------------------------------------------------------------- /
286  ! 1. Initialize if necessary and possible
287  !
288  IF ( .NOT. o2init ) THEN
289  !
290 #ifdef W3_T
291  WRITE (mdst,9010)
292 #endif
293  !
294  IF ( .NOT.PRESENT(xpt) .OR. .NOT.PRESENT(ypt) .OR. &
295  .NOT.PRESENT(pnames) ) THEN
296  WRITE (mdse,1000)
297  CALL extcde (1)
298  END IF
299  !
300  CALL w3dmo2 ( 0, mdse, mdst, npt )
301  !
302  nopts = npt
303  ptloc(1,:) = xpt
304  ptloc(2,:) = ypt
305  ptnme = pnames
306  grdid = 'none'
307  !
308  END IF
309  !
310  ! -------------------------------------------------------------------- /
311  ! 2. Locate points in grids
312  ! 2.a Check all points for all grids
313  !
314 #ifdef W3_T
315  WRITE (mdst,9020)
316 #endif
317  !
318  IF ( flagll ) THEN
319  factor = 1.
320  ELSE
321  factor = 1.e-3
322  END IF
323  !
324  ALLOCATE ( ingrid(nrgrd,nopts), xp(nopts), yp(nopts) )
325  !
326  ingrid = .false.
327  xp = ptloc(1,:)
328  yp = ptloc(2,:)
329  !
330  DO j=1, nrgrd
331  !
332  CALL w3setg ( j, mdse, mdst )
333  !
334  ! Loop over output points
335  !
336  ! notes.....Here, we have pulled coding for UNGTYPE and CLGTYPE from w3iopomd.ftn
337  ! ..........in w3iopomd.ftn, it is "DO IPT=1, NPT" but otherwise very similar
338  DO ipt=1, nopts
339  !
340  ! Check if point within grid
341  !
342  IF (gtype .NE. ungtype) THEN
343  ingrid(j,ipt) = w3grmp( gsu, xpt(ipt), ypt(ipt), ix, iy, rd )
344  IF ( .NOT.ingrid(j,ipt) ) THEN
345  cycle
346  END IF
347  ELSE
348  CALL is_in_ungrid(j, dble(xpt(ipt)), dble(ypt(ipt)), itout, ix, iy, rd )
349  IF (itout.eq.0) THEN
350  ingrid(j,ipt)=.false.
351  END IF
352  END IF
353  !
354  ! Check if point not on land
355  !
356  IF ( mapsta(iy(1),ix(1)) .EQ. 0 .AND. &
357  mapsta(iy(2),ix(2)) .EQ. 0 .AND. &
358  mapsta(iy(3),ix(3)) .EQ. 0 .AND. &
359  mapsta(iy(4),ix(4)) .EQ. 0 ) THEN
360  ingrid(j,ipt) = .false.
361  cycle
362  END IF
363 
364  !.........If we've gotten to this point, then we are satisfied that
365  !................the point is in this grid.
366 
367  END DO ! DO IPT=1, NOPTS
368  !
369  END DO ! DO J=1, NRGRD
370  !
371  DEALLOCATE ( xp, yp )
372  !
373  ! 2.b Select a grid for each point
374  ! start from last, which is supposedly higher resolution
375  !
376  mdatas(:)%NRUPTS = 0
377  !
378  DO ipt=1, nopts
379  grdid(ipt) = '...none...'
380  DO j= nrgrd, 1, -1
381  IF ( ingrid(j,ipt) ) THEN
382  grdid(ipt) = grids(j)%FILEXT
383  mdatas(j)%NRUPTS = mdatas(j)%NRUPTS + 1
384  EXIT
385  END IF
386  END DO
387  END DO
388  !
389  ! 2.c Diagnostic output
390  !
391 #ifdef W3_O7b
392  IF ( improc .EQ. nmpscr ) THEN
393  WRITE (mdss,920)
394  DO ipt=1, nopts
395  DO j=1, nrgrd
396  IF ( grids(j)%FILEXT .EQ. grdid(ipt) ) EXIT
397  END DO
398  IF ( j .GT. nrgrd ) THEN
399  WRITE (mdss,921) ptnme(ipt), ptloc(:,ipt)*factor
400  ELSE
401  WRITE (mdss,922) ptnme(ipt), ptloc(:,ipt)*factor, &
402  grids(j)%FILEXT
403  END IF
404  END DO
405  WRITE (mdss,929)
406  END IF
407 #endif
408  !
409  ! 2.d Test output
410  !
411 #ifdef W3_T
412  DO ipt=1, nopts
413  WRITE (mdst,9021) ipt, ptnme(ipt), grdid(ipt)
414  END DO
415 #endif
416  !
417 #ifdef W3_T
418  ipt = nopts
419  WRITE (mdst,9022)
420  DO j=1, nrgrd
421  WRITE (mdst,9023) j, mdatas(j)%NRUPTS, grids(j)%FILEXT
422  ipt = ipt - mdatas(j)%NRUPTS
423  END DO
424  WRITE (mdst,9024) ipt
425 #endif
426  !
427  DEALLOCATE ( ingrid )
428  !
429  ! -------------------------------------------------------------------- /
430  ! 3. Initialize individual grids
431  ! 3.a Loop over grids
432  !
433  DO j=1, nrgrd
434  !
435 #ifdef W3_T
436  WRITE (mdst,9030) j
437 #endif
438  !
439  ! 3.b (De)allocate map arrays
440  !
441  ipt = max( 1 , mdatas(j)%NRUPTS )
442  IF ( setup ) DEALLOCATE ( mdatas(j)%UPTMAP )
443  ALLOCATE ( mdatas(j)%UPTMAP(ipt) )
444  !
445  IF ( mdatas(j)%NRUPTS .EQ. 0 ) cycle
446  !
447  ALLOCATE ( xp(ipt), yp(ipt), pn(ipt) )
448  !
449  ! 3.c Set up mapping and point arrays
450  !
451  ipt = 0
452  DO ii=1, nopts
453  IF ( grdid(ii) .NE. grids(j)%FILEXT ) cycle
454  ipt = ipt + 1
455  mdatas(j)%UPTMAP(ipt) = ii
456  xp(ipt) = ptloc(1,ii)
457  yp(ipt) = ptloc(2,ii)
458  pn(ipt) = ptnme(ii)
459  END DO
460  !
461 #ifdef W3_T
462  DO ipt=1, mdatas(j)%NRUPTS
463  WRITE (mdst,9031) ipt, mdatas(j)%UPTMAP(ipt),xp(ipt),yp(ipt),pn(ipt)
464  END DO
465 #endif
466  !
467 #ifdef W3_MPI
468  IF ( flgo7a ) CALL mpi_barrier ( mpi_comm_mwave, ierr_mpi )
469 #endif
470 #ifdef W3_O7a
471  IF ( improc.EQ.nmpscr ) WRITE (mdss,930) &
472  j, grids(j)%FILEXT, ipt
473 #endif
474  !
475  ! 3.d Preprocessing for output
476  !
477 #ifdef W3_T
478  WRITE (mdst,9032)
479 #endif
480  !
481  ! 3.d.1 Shared memory version
482  !
483 #ifdef W3_SHRD
484  CALL w3seto ( j, mdse, mdst )
485  CALL w3setg ( j, mdse, mdst )
486 #endif
487  !
488 #ifdef W3_SHRD
489  IF ( o2init ) THEN
490  DEALLOCATE ( outpts(j)%OUT2%IPTINT, &
491  outpts(j)%OUT2%IL , outpts(j)%OUT2%IW , &
492  outpts(j)%OUT2%II , outpts(j)%OUT2%PTIFAC, &
493  outpts(j)%OUT2%PTNME, outpts(j)%OUT2%GRDID , &
494  outpts(j)%OUT2%DPO , outpts(j)%OUT2%WAO , &
495  outpts(j)%OUT2%WDO , outpts(j)%OUT2%ASO , &
496  outpts(j)%OUT2%CAO , outpts(j)%OUT2%CDO , &
497  outpts(j)%OUT2%SPCO , outpts(j)%OUT2%PTLOC )
498  o2init = .false.
499  END IF
500 #endif
501  !
502 #ifdef W3_SHRD
503  CALL w3iopp ( mdatas(j)%NRUPTS, xp, yp, pn, j )
504 #endif
505  !
506  ! 3.d.2 Distributed memory version
507  !
508 #ifdef W3_MPI
509  CALL wmsetm ( j, mdse, mdst )
510 #endif
511  !
512 #ifdef W3_MPI
513  IF ( mpi_comm_grd .NE. mpi_comm_null ) THEN
514 #endif
515  !
516 #ifdef W3_MPI
517  CALL w3seto ( j, mdse, mdst )
518  CALL w3setg ( j, mdse, mdst )
519  CALL w3seta ( j, mdse, mdst )
520  CALL w3setw ( j, mdse, mdst )
521 #endif
522  !
523 #ifdef W3_MPI
524  IF ( o2init ) THEN
525  DEALLOCATE ( outpts(j)%OUT2%IPTINT, &
526  outpts(j)%OUT2%IL , outpts(j)%OUT2%IW , &
527  outpts(j)%OUT2%II , outpts(j)%OUT2%PTIFAC, &
528  outpts(j)%OUT2%PTNME, outpts(j)%OUT2%GRDID , &
529  outpts(j)%OUT2%DPO , outpts(j)%OUT2%WAO , &
530  outpts(j)%OUT2%WDO , outpts(j)%OUT2%ASO , &
531  outpts(j)%OUT2%CAO , outpts(j)%OUT2%CDO , &
532  outpts(j)%OUT2%SPCO , outpts(j)%OUT2%PTLOC )
533  o2init = .false.
534  END IF
535 #endif
536  !
537 #ifdef W3_MPI
538  CALL w3iopp ( mdatas(j)%NRUPTS, xp, yp, pn, j )
539 #endif
540  !
541 #ifdef W3_MPI
542  IF ( o2irqi ) THEN
543  DEALLOCATE (outpts(j)%OUT2%IRQPO1, &
544  outpts(j)%OUT2%IRQPO2 )
545  o2irqi = .false.
546  END IF
547 #endif
548  !
549 #ifdef W3_MPI
550  CALL w3mpip ( j )
551 #endif
552  !
553 #ifdef W3_MPI
554  END IF
555 #endif
556  !
557  ! This barrier is needed to straighten out output.
558  !
559 #ifdef W3_O7a
560  IF ( improc.EQ.nmpscr ) WRITE (mdss,939)
561 #endif
562  !
563  ! 3.e Reset pointers and clean up
564  !
565  CALL w3seto ( 0, mdse, mdst )
566  DEALLOCATE ( xp, yp, pn )
567  !
568  END DO
569  !
570 #ifdef W3_MPI
571  IF ( flgo7a ) CALL mpi_barrier ( mpi_comm_mwave, ierr_mpi )
572 #endif
573  !
574  ! -------------------------------------------------------------------- /
575  ! 4. Finalize
576  !
577  setup = .true.
578  !
579  RETURN
580  !
581  ! Formats
582  !
583 #ifdef W3_O7b
584 920 FORMAT (/' Diagnostic test output for output points :'/ &
585  ' -------------------------------------------------')
586 921 FORMAT ( ' ',a,' (',2f8.2,') NO GRID FOUND')
587 922 FORMAT ( ' ',a,' (',2f8.2,') grid ',a)
588 929 FORMAT ( ' ')
589 #endif
590  !
591 #ifdef W3_O7a
592 930 FORMAT (/' Grid ',i3,' [',a,']',i4,' points :'/ &
593  ' -------------------------------------------------')
594 939 FORMAT ( ' ')
595 #endif
596  !
597 1000 FORMAT (/' *** ERROR WMIOPP : INITALIZATION DATA NOT', &
598  ' AVAILABLE *** '/)
599  !
600 #ifdef W3_T
601 9000 FORMAT ( ' TEST WMIOPP : O2INIT :',l2/ &
602  ' PAR LIST :',i4,3l2)
603 #endif
604  !
605 #ifdef W3_T
606 9010 FORMAT ( ' TEST WMIOPP : INITIALIZING DATA GRID 0')
607 #endif
608  !
609 #ifdef W3_T
610 9020 FORMAT ( ' TEST WMIOPP : FINDING POINTS IN GRID')
611 9021 FORMAT ( ' ',i4,2x,a,2x,a)
612 9022 FORMAT ( ' TEST WMIOPP : OUTPUT POINTS PER GRID')
613 9023 FORMAT ( ' GRID',i3,' HAS',i4,' OUTPUT ', &
614  'POINTS, NAME = ',a)
615 9024 FORMAT ( ' UNALLOCATED POINTS :',i4)
616 #endif
617  !
618 #ifdef W3_T
619 9030 FORMAT ( ' TEST WMIOPP : PREPPING GRID',i3)
620 9031 FORMAT ( ' ',2i5,2e12.3,2x,a)
621 9032 FORMAT ( ' TEST WMIOPP : RUNNING W3IOPP / W3MPIP')
622 #endif
623  !/
624  !/ End of WMIOPP ----------------------------------------------------- /
625  !/
626  END SUBROUTINE wmiopp
627  !/ ------------------------------------------------------------------- /
639  SUBROUTINE wmiopo ( TOUT )
640  !/
641  !/ +-----------------------------------+
642  !/ | WAVEWATCH III NOAA/NCEP |
643  !/ | H. L. Tolman |
644  !/ | FORTRAN 90 |
645  !/ | Last update : 16-Mar-2012 !
646  !/ +-----------------------------------+
647  !/
648  !/ 09-Aug-2006 : Origination. ( version 3.10 )
649  !/ 21-Jun-2007 : Dedicated output processes. ( version 3.11 )
650  !/ 16-Mar-2012 : Using MPI_COMM_NULL in checks. ( version 3.14 )
651  !/
652  ! 1. Purpose :
653  !
654  ! Gather and write unified point output.
655  !
656  ! 2. Method :
657  !
658  ! Per-grid point output is already gathered. All data are gathered
659  ! in the porper storage, and writen using the standard W3IOPO
660  ! routint from grid number 0.
661  !
662  ! 3. Parameters :
663  !
664  ! Parameter list
665  ! ----------------------------------------------------------------
666  ! TOUT I.A. I Time for output file.
667  ! ----------------------------------------------------------------
668  !
669  ! 4. Subroutines used :
670  !
671  ! Name Type Module Description
672  ! ----------------------------------------------------------------
673  ! W3SETG Subr. W3GDATMD Point to model grid.
674  ! W3SETW Subr. W3WDATMD Point to model grid.
675  ! W3SETO Subr. W3ODATMD Point to model grid.
676  ! WMSETM Subr. WMMDATMD Point to model grid.
677  ! W3CSPC Subr. W3CSPCMD Spectral grid conversion.
678  ! W3IOPO Subr. W3IOPOMD Point output for single model.
679  ! STRACE Subr. W3SERVMD Subroutine tracing.
680  ! MPI_SEND, MPI_RECV
681  ! Subr. mpif.h Standard MPI library routines.
682  ! ----------------------------------------------------------------
683  !
684  ! 5. Called by :
685  !
686  ! Name Type Module Description
687  ! ----------------------------------------------------------------
688  ! WMWAVE Prog. WMWAVEMD Multi-grid wave model routine.
689  ! ----------------------------------------------------------------
690  !
691  ! 6. Error messages :
692  !
693  ! 7. Remarks :
694  !
695  ! 8. Structure :
696  !
697  ! See source code.
698  !
699  ! 9. Switches :
700  !
701  ! !/MPI Distributed memory model.
702  !
703  ! !/S Enable subroutine tracing.
704  ! !/T Enable test output
705  ! !/MPIT
706  !
707  ! 10. Source code :
708  !
709  !/ ------------------------------------------------------------------- /
710  ! USE CONSTANTS
711  !
712  USE w3gdatmd, ONLY: w3setg
713  USE w3wdatmd, ONLY: w3setw
714  USE w3odatmd, ONLY: w3seto
715  USE wmmdatmd, ONLY: wmsetm
716  USE w3cspcmd, ONLY: w3cspc
717  USE w3iopomd
718  USE w3gdatmd, ONLY: nk, nth, nspec, xfr, fr1, th, sgrds
719  USE w3wdatmd, ONLY: time
720  USE w3odatmd, ONLY: iaproc, naproc, nappnt, nopts, spco, dpo, &
721  wao, wdo, aso, cao, cdo, outpts, &
722  iceo,iceho,icefo
723  USE wmmdatmd, ONLY: mdst, mdse, improc, nmproc, nmpupt, nrgrd, &
725 #ifdef W3_ASCII
726  USE wmmdatmd, ONLY: mdsupa
727 #endif
728 #ifdef W3_MPI
730  mtag0
731 #endif
732 #ifdef W3_S
733  USE w3servmd, ONLY: strace
734 #endif
735  !
736  IMPLICIT NONE
737  !
738 #ifdef W3_MPI
739  include "mpif.h"
740 #endif
741  !/
742  !/ ------------------------------------------------------------------- /
743  !/ Parameter list
744  !/
745  INTEGER, INTENT(IN) :: TOUT(2)
746  !/
747  !/ ------------------------------------------------------------------- /
748  !/ Local parameters
749  !/
750  INTEGER :: J, I, II, IT0, IT, ITARG, IFROM
751 #ifdef W3_SHRD
752  INTEGER :: MPI_COMM_GRD = 1, croot = 1
753  INTEGER, PARAMETER :: MPI_COMM_NULL = -1
754 #endif
755 #ifdef W3_MPI
756  INTEGER :: IERR_MPI, NMPPNT
757  INTEGER, ALLOCATABLE :: STATUS(:,:)
758 #endif
759 #ifdef W3_S
760  INTEGER, SAVE :: IENT = 0
761 #endif
762  REAL, POINTER :: SPEC(:,:)
763 #ifdef W3_MPI
764  REAL, POINTER :: SPCR(:,:), DPR(:), WAR(:), &
765  WDR(:), ASR(:), CAR(:), CDR(:)
766  REAL, POINTER :: ICRO(:), ICRFO(:), ICRHO(:)
767 #endif
768  !/
769 #ifdef W3_S
770  CALL strace (ient, 'WMIOPO')
771 #endif
772  !
773  ! -------------------------------------------------------------------- /
774  ! 0. Initializations
775  !
776 #ifdef W3_T
777  WRITE (mdst,9000) nmpupt, improc
778 #endif
779  !
780  IF ( improc .EQ. nmpupt ) THEN
781  outpts(0)%OUT2%SPCO = 0.
782  outpts(0)%OUT2%DPO = 1.
783  outpts(0)%OUT2%WAO = 0.
784  outpts(0)%OUT2%WDO = 0.
785  outpts(0)%OUT2%ASO = 0.
786  outpts(0)%OUT2%CAO = 0.
787  outpts(0)%OUT2%CDO = 0.
788  outpts(0)%OUT2%ICEO = 0.
789  outpts(0)%OUT2%ICEFO = 0.
790  outpts(0)%OUT2%ICEHO = 0.
791  END IF
792  !
793  ! -------------------------------------------------------------------- /
794  ! 1. Loop over grids for processing local data
795  !
796  DO j=1, nrgrd
797  !
798  ! 1.a Set up loop
799  !
800  CALL w3seto ( j, mdse, mdst )
801  CALL w3setg ( j, mdse, mdst )
802  CALL wmsetm ( j, mdse, mdst )
803  !
804 #ifdef W3_T
805  WRITE (mdst,9010) j, nopts, iaproc, nappnt
806 #endif
807  !
808  ! 1.b Determine if action
809  !
810  IF ( mpi_comm_grd .EQ. mpi_comm_null ) THEN
811 #ifdef W3_T
812  WRITE (mdst,9011)
813 #endif
814  cycle
815  END IF
816  !
817  IF ( nopts .EQ. 0 ) THEN
818 #ifdef W3_T
819  WRITE (mdst,9012)
820 #endif
821  cycle
822  END IF
823  !
824  IF ( iaproc .NE. nappnt ) THEN
825 #ifdef W3_T
826  WRITE (mdst,9014)
827 #endif
828  cycle
829  END IF
830  !
831  ! 1.c Data here, and to remain on present processor.
832  !
833  IF ( improc .EQ. nmpupt ) THEN
834 #ifdef W3_T
835  WRITE (mdst,9015)
836 #endif
837  !
838  ! 1.c.1 Spectral conversion if needed
839  !
840  IF ( respec(0,j) ) THEN
841 #ifdef W3_T
842  WRITE (mdst,9016) 'YES'
843 #endif
844  ALLOCATE ( spec(sgrds(0)%NSPEC,nopts) )
845  CALL w3cspc ( spco, nk, nth, xfr, fr1, th(1), spec, &
846  sgrds(0)%NK, sgrds(0)%NTH, sgrds(0)%XFR, &
847  sgrds(0)%FR1, sgrds(0)%TH(1), nopts, mdst, mdse, &
848  sgrds(0)%FACHFE )
849  !
850  ! 1.c.2 Spectral conversion not needed
851  !
852  ELSE
853 #ifdef W3_T
854  WRITE (mdst,9016) 'NO'
855 #endif
856  spec => spco
857  END IF
858  !
859  ! 1.d Store data at grid 0
860  !
861 #ifdef W3_T
862  WRITE (mdst,9017) j
863 #endif
864  !
865  DO i=1, nopts
866  ii = uptmap(i)
867  outpts(0)%OUT2%SPCO(:,ii) = spec(:,i)
868  outpts(0)%OUT2%DPO(ii) = dpo(i)
869  outpts(0)%OUT2%WAO(ii) = wao(i)
870  outpts(0)%OUT2%WDO(ii) = wdo(i)
871  outpts(0)%OUT2%ASO(ii) = aso(i)
872  outpts(0)%OUT2%CAO(ii) = cao(i)
873  outpts(0)%OUT2%CDO(ii) = cdo(i)
874  outpts(0)%OUT2%ICEO(ii) = iceo(i)
875  outpts(0)%OUT2%ICEFO(ii) = icefo(i)
876  outpts(0)%OUT2%ICEHO(ii) = iceho(i)
877  END DO
878  !
879  IF ( respec(0,j) ) DEALLOCATE ( spec )
880  !
881  ! 1.e Data here, and to be sent to other processor.
882  !
883 #ifdef W3_MPI
884  ELSE
885 #endif
886  !
887 #ifdef W3_MPIT
888  WRITE (mdst,9018) j, improc, nmpupt
889 #endif
890  !
891 #ifdef W3_MPI
892  it0 = mtag0 - 7*nrgrd - 1
893  it = it0 + (j-1)*7
894  itarg = nmpupt - 1
895 #endif
896  !
897 #ifdef W3_MPI
898  it = it + 1
899  CALL mpi_send ( spco(1,1), nspec*nopts, mpi_real, &
900  itarg, it, mpi_comm_mwave, ierr_mpi )
901 #endif
902 #ifdef W3_MPIT
903  WRITE (mdst,9019) it-it0, 'SPECTRA'
904 #endif
905 #ifdef W3_MPI
906  it = it + 1
907  CALL mpi_send ( dpo(1), nopts, mpi_real, itarg, it, &
908  mpi_comm_mwave, ierr_mpi )
909 #endif
910 #ifdef W3_MPIT
911  WRITE (mdst,9019) it-it0, 'WATER DEPTHS'
912 #endif
913 #ifdef W3_MPI
914  it = it + 1
915  CALL mpi_send ( wao(1), nopts, mpi_real, itarg, it, &
916  mpi_comm_mwave, ierr_mpi )
917 #endif
918 #ifdef W3_MPIT
919  WRITE (mdst,9019) it-it0, 'WIND SPEED'
920 #endif
921 #ifdef W3_MPI
922  it = it + 1
923  CALL mpi_send ( wdo(1), nopts, mpi_real, itarg, it, &
924  mpi_comm_mwave, ierr_mpi )
925 #endif
926 #ifdef W3_MPIT
927  WRITE (mdst,9019) it-it0, 'WIND DIRECTION'
928 #endif
929 #ifdef W3_MPI
930  it = it + 1
931  CALL mpi_send ( aso(1), nopts, mpi_real, itarg, it, &
932  mpi_comm_mwave, ierr_mpi )
933 #endif
934 #ifdef W3_MPIT
935  WRITE (mdst,9019) it-it0, 'AIR_SEA TEMP DIFF'
936 #endif
937 #ifdef W3_MPI
938  it = it + 1
939  CALL mpi_send ( cao(1), nopts, mpi_real, itarg, it, &
940  mpi_comm_mwave, ierr_mpi )
941 #endif
942 #ifdef W3_MPIT
943  WRITE (mdst,9019) it-it0, 'CURRENT VELOCITY'
944 #endif
945 #ifdef W3_MPI
946  it = it + 1
947  CALL mpi_send ( cdo(1), nopts, mpi_real, itarg, it, &
948  mpi_comm_mwave, ierr_mpi )
949 #endif
950 #ifdef W3_MPIT
951  WRITE (mdst,9019) it-it0, 'CURRENT DIRECTION'
952 #endif
953  !JDM: The below should be added for points using partitioned processors
954  ! for multigrid, however I am unsure if the IT0 (7 to 10?) should be changed so
955  ! this is being left here commented out for now.
956  ! There is a corresponding section to this below
957  !!/MPI IT = IT + 1
958  !!/MPI CALL MPI_SEND ( ICEO(1), NOPTS, MPI_REAL, ITARG, IT, &
959  !!/MPI MPI_COMM_MWAVE, IERR_MPI )
960  !!/MPIT WRITE (MDST,9019) IT-IT0, 'ICEO'
961  !!/MPI IT = IT + 1
962  !!/MPI CALL MPI_SEND ( ICEFO(1), NOPTS, MPI_REAL, ITARG, IT, &
963  !!/MPI MPI_COMM_MWAVE, IERR_MPI )
964  !!/MPIT WRITE (MDST,9019) IT-IT0, 'ICEFO'
965  !!/MPI IT = IT + 1
966  !!/MPI CALL MPI_SEND ( ICEHO(1), NOPTS, MPI_REAL, ITARG, IT, &
967  !!/MPI MPI_COMM_MWAVE, IERR_MPI )
968  !!/MPIT WRITE (MDST,9019) IT-IT0, 'ICEHO'
969  !
970  END IF
971  !
972  END DO
973  !
974  ! -------------------------------------------------------------------- /
975  ! 2. Check if this is output processor, otherwise exit
976  !
977  IF ( improc .NE. nmpupt ) THEN
978 #ifdef W3_T
979  WRITE (mdst,9020)
980 #endif
981  RETURN
982  END IF
983  !
984  ! -------------------------------------------------------------------- /
985  ! 3. Loop over grids for processing remote data
986  !
987 #ifdef W3_MPIT
988  WRITE (mdst,9030)
989 #endif
990  !
991  ! 3.a Loop setup
992  !
993 #ifdef W3_MPI
994  DO j=1, nrgrd
995 #endif
996  !
997 #ifdef W3_MPI
998  CALL w3seto ( j, mdse, mdst )
999  CALL w3setg ( j, mdse, mdst )
1000  CALL wmsetm ( j, mdse, mdst )
1001 #endif
1002  !
1003 #ifdef W3_MPI
1004  DO nmppnt= nmproc, 1, -1
1005  IF ( allprc(nmppnt,j) .EQ. nappnt ) EXIT
1006  END DO
1007 #endif
1008  !
1009 #ifdef W3_MPIT
1010  WRITE (mdst,9031) j, nopts, nmppnt
1011 #endif
1012 #ifdef W3_MPI
1013  IF ( nmppnt.EQ.nmpupt .OR. nopts.EQ.0 ) THEN
1014 #endif
1015 #ifdef W3_MPIT
1016  WRITE (mdst,9032)
1017 #endif
1018 #ifdef W3_MPI
1019  cycle
1020  END IF
1021 #endif
1022  !
1023  ! 3.b Receive data
1024  !
1025 #ifdef W3_MPI
1026  it0 = mtag0 - 7*nrgrd - 1
1027  it = it0 + (j-1)*7
1028  ifrom = nmppnt - 1
1029  ALLOCATE ( spcr(nspec,nopts), status(mpi_status_size,1), &
1030  dpr(nopts), war(nopts), wdr(nopts), asr(nopts),&
1031  car(nopts), cdr(nopts), icro(nopts), &
1032  icrfo(nopts), icrho(nopts) )
1033 #endif
1034  !
1035 #ifdef W3_MPI
1036  it = it + 1
1037  CALL mpi_recv ( spcr(1,1), nspec*nopts, mpi_real, ifrom, &
1038  it, mpi_comm_mwave, status, ierr_mpi )
1039 #endif
1040 #ifdef W3_MPIT
1041  WRITE (mdst,9019) it-it0, 'SPECTRA'
1042 #endif
1043 #ifdef W3_MPI
1044  it = it + 1
1045  CALL mpi_recv ( dpr(1), nspec*nopts, mpi_real, ifrom, &
1046  it, mpi_comm_mwave, status, ierr_mpi )
1047 #endif
1048 #ifdef W3_MPIT
1049  WRITE (mdst,9019) it-it0, 'WATER DEPTHS'
1050 #endif
1051 #ifdef W3_MPI
1052  it = it + 1
1053  CALL mpi_recv ( war(1), nspec*nopts, mpi_real, ifrom, &
1054  it, mpi_comm_mwave, status, ierr_mpi )
1055 #endif
1056 #ifdef W3_MPIT
1057  WRITE (mdst,9019) it-it0, 'WIND SPEED'
1058 #endif
1059 #ifdef W3_MPI
1060  it = it + 1
1061  CALL mpi_recv ( wdr(1), nspec*nopts, mpi_real, ifrom, &
1062  it, mpi_comm_mwave, status, ierr_mpi )
1063 #endif
1064 #ifdef W3_MPIT
1065  WRITE (mdst,9019) it-it0, 'WIND DIRECTION'
1066 #endif
1067 #ifdef W3_MPI
1068  it = it + 1
1069  CALL mpi_recv ( asr(1), nspec*nopts, mpi_real, ifrom, &
1070  it, mpi_comm_mwave, status, ierr_mpi )
1071 #endif
1072 #ifdef W3_MPIT
1073  WRITE (mdst,9019) it-it0, 'AIR_SEA TEMP DIFF'
1074 #endif
1075 #ifdef W3_MPI
1076  it = it + 1
1077  CALL mpi_recv ( car(1), nspec*nopts, mpi_real, ifrom, &
1078  it, mpi_comm_mwave, status, ierr_mpi )
1079 #endif
1080 #ifdef W3_MPIT
1081  WRITE (mdst,9019) it-it0, 'CURRENT VELOCITY'
1082 #endif
1083 #ifdef W3_MPI
1084  it = it + 1
1085  CALL mpi_recv ( cdr(1), nspec*nopts, mpi_real, ifrom, &
1086  it, mpi_comm_mwave, status, ierr_mpi )
1087 #endif
1088 #ifdef W3_MPIT
1089  WRITE (mdst,9019) it-it0, 'CURRENT DIRECTION'
1090 #endif
1091  !JDM: The below should be added for points using partitioned processors
1092  ! for multigrid, however I am unsure if the IT0 (7 to 10?) should be changed so
1093  ! this is being left here commented out for now.
1094  ! There is a corresponding section to this above
1095  !!/MPI IT = IT + 1
1096  !!/MPI CALL MPI_RECV ( ICRO(1), NSPEC*NOPTS, MPI_REAL, IFROM, &
1097  !!/MPI IT, MPI_COMM_MWAVE, STATUS, IERR_MPI )
1098  !!/MPIT WRITE (MDST,9019) IT-IT0, 'ICEO'
1099  !!/MPI IT = IT + 1
1100  !!/MPI CALL MPI_RECV (ICRFO(1), NSPEC*NOPTS, MPI_REAL, IFROM, &
1101  !!/MPI IT, MPI_COMM_MWAVE, STATUS, IERR_MPI )
1102  !!/MPIT WRITE (MDST,9019) IT-IT0, 'ICEFO'
1103  !!/MPI IT = IT + 1
1104  !!/MPI CALL MPI_SEND (ICRHO(1), NSPEC*NOPTS, MPI_REAL, IFROM, &
1105  !!/MPI IT, MPI_COMM_MWAVE, STATUS, IERR_MPI )
1106  !!/MPIT WRITE (MDST,9019) IT-IT0, 'ICEHO'
1107  !
1108  ! 3.c Convert if necessary
1109  !
1110 #ifdef W3_MPI
1111  IF ( respec(0,j) ) THEN
1112 #endif
1113 #ifdef W3_MPIT
1114  WRITE (mdst,9016) 'YES'
1115 #endif
1116 #ifdef W3_MPI
1117  ALLOCATE ( spec(sgrds(0)%NSPEC,nopts) )
1118  CALL w3cspc ( spcr, nk, nth, xfr, fr1, th(1), spec, &
1119  sgrds(0)%NK, sgrds(0)%NTH, sgrds(0)%XFR, &
1120  sgrds(0)%FR1, sgrds(0)%TH(1), nopts, mdst, mdse, &
1121  sgrds(0)%FACHFE )
1122  ELSE
1123 #endif
1124 #ifdef W3_MPIT
1125  WRITE (mdst,9016) 'NO'
1126 #endif
1127 #ifdef W3_MPI
1128  spec => spcr
1129  END IF
1130 #endif
1131  !
1132  ! 3.d Store data at grid 0
1133  !
1134 #ifdef W3_MPIT
1135  WRITE (mdst,9117) j
1136 #endif
1137  !
1138 #ifdef W3_MPI
1139  DO i=1, nopts
1140  ii = uptmap(i)
1141  outpts(0)%OUT2%SPCO(:,ii) = spec(:,i)
1142  outpts(0)%OUT2%DPO(ii) = dpr(i)
1143  outpts(0)%OUT2%WAO(ii) = war(i)
1144  outpts(0)%OUT2%WDO(ii) = wdr(i)
1145  outpts(0)%OUT2%ASO(ii) = asr(i)
1146  outpts(0)%OUT2%CAO(ii) = car(i)
1147  outpts(0)%OUT2%CDO(ii) = cdr(i)
1148  outpts(0)%OUT2%ICEO(ii) = iceo(i)
1149  outpts(0)%OUT2%ICEFO(ii) = icefo(i)
1150  outpts(0)%OUT2%ICEHO(ii) = iceho(i)
1151  END DO
1152 #endif
1153  !
1154 #ifdef W3_MPI
1155  IF ( respec(0,j) ) DEALLOCATE ( spec )
1156  DEALLOCATE ( spcr, dpr, war, wdr, asr, car, cdr, status )
1157 #endif
1158  ! !JDM add deallocates here and check the itag stuff.. really not
1159  ! sure aabout that
1160 #ifdef W3_MPI
1161  DEALLOCATE (icro, icrfo, icrho)
1162  END DO
1163 #endif
1164  !
1165  ! -------------------------------------------------------------------- /
1166  ! 4. Output data
1167  !
1168 #ifdef W3_T
1169  WRITE (mdst,9040)
1170 #endif
1171  !
1172  CALL w3seto ( 0, mdse, mdst )
1173  CALL w3setg ( 0, mdse, mdst )
1174  CALL w3setw ( 0, mdse, mdst )
1175  !
1176  time = tout
1177  !
1178 #ifdef W3_BIN2NC
1179  CALL w3iopon ( 'WRITE', mdsup, ii, 0)
1180 #else
1181  CALL w3iopo ( 'WRITE', mdsup, ii, 0 &
1182 #ifdef W3_ASCII
1183  ,mdsupa &
1184 #endif
1185  )
1186 #endif
1187  !
1188  RETURN
1189  !
1190  ! Formats
1191  !
1192 #ifdef W3_T
1193 9000 FORMAT ( ' TEST WMIOPO : OUTPUT/ACTUAL PROCESS : ',2i6)
1194 9010 FORMAT ( ' TEST WMIOPO : PROCESSING GRID : ',i6/ &
1195  ' OUTPUT POINTS : ',i6/ &
1196  ' ACTUAL/OUTPUT PROCESS : ',2i6)
1197 9011 FORMAT ( ' CYCLE : GRID NOT ON PROCESS')
1198 9012 FORMAT ( ' CYCLE : GRID WITHOUT OUTPUT POINTS')
1199 9014 FORMAT ( ' CYCLE : DATA NOT ON PRESENT PROCESS')
1200 9015 FORMAT ( ' TEST WMIOPO : PROCESSING DATA LOCALLY')
1201 9016 FORMAT ( ' TEST WMIOPO : NEED FOR SPECTRAL CONVERSION : ',a)
1202 9017 FORMAT ( ' TEST WMIOPO : STORING DATA FROM GRID',i4, &
1203  ' IN GRID 0')
1204 #endif
1205 #ifdef W3_MPIT
1206 9117 FORMAT ( ' TEST WMIOPO : STORING DATA FROM GRID',i4, &
1207  ' IN GRID 0')
1208 9018 FORMAT ( ' TEST WMIOPO : GRID',i4,' SEND FROM',i4,' TO',i4)
1209 9019 FORMAT ( ' IT = ',i4,' PAR = ',a)
1210 #endif
1211  !
1212 #ifdef W3_T
1213 9020 FORMAT ( ' TEST WMIOPO : DONE AT THIS PROCESSOR')
1214 #endif
1215  !
1216 #ifdef W3_MPIT
1217 9030 FORMAT ( ' TEST WMIOPO : LOOP OVER GRIDS FOR REMOTE DATA')
1218 9031 FORMAT ( ' TEST WMIOPO : GRID',i4,',',i4,' POINTS FROM',i4)
1219 9032 FORMAT ( ' NOTHING TO RECEIVE')
1220 #endif
1221  !
1222 9040 FORMAT ( ' TEST WMIOPO : PERFORM OUTPUT')
1223  !/
1224  !/ End of WMIOPO ----------------------------------------------------- /
1225  !/
1226  END SUBROUTINE wmiopo
1227  !/
1228  !/ End of module WMIOPOMD -------------------------------------------- /
1229  !/
1230 END MODULE wmiopomd
w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::trigp
integer, dimension(:,:), pointer trigp
Definition: w3gdatmd.F90:1111
wmmdatmd::respec
logical, dimension(:,:), allocatable respec
RESPEC.
Definition: wmmdatmd.F90:381
include
cmake src_list cmake include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_switches.cmake) check_switches("$
Definition: CMakeLists.txt:15
wmmdatmd::mdse
integer mdse
MDSE.
Definition: wmmdatmd.F90:316
wmiopomd
Module for generating a single point output file for a multi- grid model implementation.
Definition: wmiopomd.F90:15
w3triamd
Reads triangle and unstructured grid information.
Definition: w3triamd.F90:21
w3gdatmd::gsu
type(t_gsu), pointer gsu
Definition: w3gdatmd.F90:1226
w3adatmd
Define data structures to set up wave model auxiliary data for several models simultaneously.
Definition: w3adatmd.F90:26
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3triamd::is_in_ungrid
subroutine is_in_ungrid(IMOD, XTIN, YTIN, ITOUT, IS, JS, RW)
Determine whether a point is inside or outside an unstructured grid, and returns index of triangle an...
Definition: w3triamd.F90:1605
w3gdatmd::sgrds
type(sgrd), dimension(:), allocatable, target sgrds
Definition: w3gdatmd.F90:1089
wmmdatmd::mdsupa
integer mdsupa
MDSUPA.
Definition: wmmdatmd.F90:319
w3gdatmd::ungtype
integer, parameter ungtype
Definition: w3gdatmd.F90:626
w3odatmd::o2irqi
logical, pointer o2irqi
Definition: w3odatmd.F90:505
w3wdatmd
Define data structures to set up wave model dynamic data for several models simultaneously.
Definition: w3wdatmd.F90:18
wmmdatmd::nmpscr
integer nmpscr
NMPSCR.
Definition: wmmdatmd.F90:324
w3gdatmd::maxx
real, pointer maxx
Definition: w3gdatmd.F90:1133
w3odatmd::nopts
integer, pointer nopts
Definition: w3odatmd.F90:484
w3gsrumd
Definition: w3gsrumd.F90:17
w3odatmd::iaproc
integer, pointer iaproc
Definition: w3odatmd.F90:457
w3odatmd::w3dmo2
subroutine w3dmo2(IMOD, NDSE, NDST, NPT)
Definition: w3odatmd.F90:952
w3odatmd::grdid
character(len=13), dimension(:), pointer grdid
Definition: w3odatmd.F90:502
wmmdatmd::mdss
integer mdss
MDSS.
Definition: wmmdatmd.F90:314
w3wdatmd::time
integer, dimension(:), pointer time
Definition: w3wdatmd.F90:172
w3gdatmd::grids
type(grid), dimension(:), allocatable, target grids
Definition: w3gdatmd.F90:1088
wmmdatmd::uptmap
integer, dimension(:), pointer uptmap
UPTMAP.
Definition: wmmdatmd.F90:541
w3gdatmd::ny
integer, pointer ny
Definition: w3gdatmd.F90:1097
wmmdatmd::mpi_comm_grd
integer, pointer mpi_comm_grd
MPI_COMM_GRD.
Definition: wmmdatmd.F90:543
w3cspcmd
Convert spectra to new discrete spectral grid.
Definition: w3cspcmd.F90:21
w3odatmd::dpo
real, dimension(:), pointer dpo
Definition: w3odatmd.F90:492
wmmdatmd::improc
integer improc
IMPROC.
Definition: wmmdatmd.F90:322
w3odatmd::wdo
real, dimension(:), pointer wdo
Definition: w3odatmd.F90:492
w3odatmd::o2init
logical, pointer o2init
Definition: w3odatmd.F90:503
w3gdatmd::th
real, dimension(:), pointer th
Definition: w3gdatmd.F90:1234
w3gdatmd::iclose_none
integer, parameter iclose_none
Definition: w3gdatmd.F90:629
w3gdatmd::w3setg
subroutine w3setg(IMOD, NDSE, NDST)
Definition: w3gdatmd.F90:2152
wmiopomd::wmiopp
subroutine wmiopp(NPT, XPT, YPT, PNAMES)
Initialization for unified point output.
Definition: wmiopomd.F90:110
wmmdatmd::nmproc
integer nmproc
NMPROC.
Definition: wmmdatmd.F90:321
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
w3odatmd::ptloc
real, dimension(:,:), pointer ptloc
Definition: w3odatmd.F90:492
w3initmd::w3mpip
subroutine w3mpip(IMOD)
Prepare MPI persistent communication needed for WAVEWATCH I/O routines.
Definition: w3initmd.F90:5388
wmmdatmd::mdatas
type(mdata), dimension(:), allocatable, target mdatas
MDATAS.
Definition: wmmdatmd.F90:528
w3gdatmd::x0
real, pointer x0
Definition: w3gdatmd.F90:1183
w3gdatmd::clgtype
integer, parameter clgtype
Definition: w3gdatmd.F90:625
w3servmd
Definition: w3servmd.F90:3
wmmdatmd::nrgrd
integer nrgrd
NRGRD.
Definition: wmmdatmd.F90:330
w3wdatmd::w3setw
subroutine w3setw(IMOD, NDSE, NDST)
Select one of the WAVEWATCH III grids / models.
Definition: w3wdatmd.F90:660
w3odatmd::wao
real, dimension(:), pointer wao
Definition: w3odatmd.F90:492
w3odatmd::w3seto
subroutine w3seto(IMOD, NDSERR, NDSTST)
Definition: w3odatmd.F90:1523
wmmdatmd::nmpupt
integer nmpupt
NMPUPT.
Definition: wmmdatmd.F90:327
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
w3odatmd
Definition: w3odatmd.F90:3
w3cspcmd::w3cspc
subroutine w3cspc(SP1, NFR1, NTH1, XF1, FR1, TH1, SP2, NFR2, NTH2, XF2, FR2, TH2, NSP, NDST, NDSE, FTL)
Convert a set of spectra to a new spectral grid.
Definition: w3cspcmd.F90:146
w3odatmd::naproc
integer, pointer naproc
Definition: w3odatmd.F90:457
wmmdatmd::allprc
integer, dimension(:,:), allocatable allprc
ALLPRC.
Definition: wmmdatmd.F90:360
wmmdatmd::nmperr
integer nmperr
NMPERR.
Definition: wmmdatmd.F90:326
wmiopomd::wmiopo
subroutine wmiopo(TOUT)
Gather and write unified point output.
Definition: wmiopomd.F90:640
w3iopomd::w3iopon
subroutine w3iopon(INXOUT, NDSOP, IOTST, IMOD)
Read or write the netCDF point output file, depending on the value of the first parameter.
Definition: w3iopomd.F90:1747
wmmdatmd::mdst
integer mdst
MDST.
Definition: wmmdatmd.F90:315
w3odatmd::ptnme
character(len=40), dimension(:), pointer ptnme
Definition: w3odatmd.F90:501
wmmdatmd::mtag0
integer, parameter mtag0
MTAG0.
Definition: wmmdatmd.F90:346
w3gdatmd::iclose
integer, pointer iclose
Definition: w3gdatmd.F90:1096
w3gdatmd::fr1
real, pointer fr1
Definition: w3gdatmd.F90:1232
w3gdatmd::maxy
real, pointer maxy
Definition: w3gdatmd.F90:1133
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
wmmdatmd::wmsetm
subroutine wmsetm(IMOD, NDSE, NDST)
Select one of the WAVEWATCH III grids / models.
Definition: wmmdatmd.F90:1169
w3gdatmd::gtype
integer, pointer gtype
Definition: w3gdatmd.F90:1094
w3gdatmd::xfr
real, pointer xfr
Definition: w3gdatmd.F90:1232
w3odatmd::nappnt
integer, pointer nappnt
Definition: w3odatmd.F90:457
w3gdatmd::y0
real, pointer y0
Definition: w3gdatmd.F90:1183
w3gdatmd::dxymax
real, pointer dxymax
Definition: w3gdatmd.F90:1133
w3gdatmd::sx
real, pointer sx
Definition: w3gdatmd.F90:1183
w3gdatmd
Definition: w3gdatmd.F90:16
wmmdatmd
Define data structures to set up wave model dynamic data for several models simultaneously.
Definition: wmmdatmd.F90:16
w3odatmd::outpts
type(output), dimension(:), allocatable, target outpts
Definition: w3odatmd.F90:452
w3gdatmd::nx
integer, pointer nx
Definition: w3gdatmd.F90:1097
w3odatmd::aso
real, dimension(:), pointer aso
Definition: w3odatmd.F90:492
w3iopomd::w3iopo
subroutine w3iopo(INXOUT, NDSOP, IOTST, IMOD ifdef W3_ASCII
Read or write point output.
Definition: w3iopomd.F90:1907
w3gdatmd::mapsta
integer, dimension(:,:), pointer mapsta
Definition: w3gdatmd.F90:1163
w3initmd
Contains module W3INITMD.
Definition: w3initmd.F90:14
w3iopomd
Process point output.
Definition: w3iopomd.F90:19
wmmdatmd::mpi_comm_mwave
integer mpi_comm_mwave
MPI_COMM_MWAVE.
Definition: wmmdatmd.F90:344
w3gdatmd::flagll
logical, pointer flagll
Definition: w3gdatmd.F90:1219
wmmdatmd::mdsup
integer mdsup
MDSUP.
Definition: wmmdatmd.F90:317