My Project
swmod2.f90
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 ! ALLOCATABLE DATA RELATED MODULES, file 2 of 3
13 !
14 ! Contents of this file
15 !
16 ! M_WCAP information for whitecapping
17 ! OUTP_DATA information for output data
18 ! M_SNL4 information for quadruplets
19 ! M_BNDSPEC information for boundary conditions
20 ! M_OBSTA information for obstacles
21 ! M_GENARR contains a number of general arrays
22 ! M_PARALL information for parallelisation with MPI
23 ! M_DIFFR information for diffraction
24 !
25  MODULE m_wcap
26 !
27 !
28 ! --|-----------------------------------------------------------|--
29 ! | Delft University of Technology |
30 ! | Faculty of Civil Engineering |
31 ! | Environmental Fluid Mechanics Section |
32 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
33 ! | |
34 ! | Programmers: R.C. Ris, N. Booij, |
35 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
36 ! | M. Zijlema, E.E. Kriezi, |
37 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
38 ! --|-----------------------------------------------------------|--
39 !
40 !
41 ! SWAN (Simulating WAves Nearshore); a third generation wave model
42 ! Copyright (C) 2004-2005 Delft University of Technology
43 !
44 ! This program is free software; you can redistribute it and/or
45 ! modify it under the terms of the GNU General Public License as
46 ! published by the Free Software Foundation; either version 2 of
47 ! the License, or (at your option) any later version.
48 !
49 ! This program is distributed in the hope that it will be useful,
50 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
51 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 ! GNU General Public License for more details.
53 !
54 ! A copy of the GNU General Public License is available at
55 ! http://www.gnu.org/copyleft/gpl.html#SEC3
56 ! or by writing to the Free Software Foundation, Inc.,
57 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
58 !
59 !
60 ! 0. Authors
61 !
62 ! 40.02: IJsbrand Haagsma
63 !
64 ! 1. Updates
65 !
66 ! Sep. 00: New Module
67 !
68 ! 2. Purpose
69 !
70 ! Create global variables used in whitecapping and integral parameter
71 ! subroutines
72 !
73 ! 3. Method
74 !
75 ! MODULE construct
76 !
77 ! 4. Modules used
78 !
79 ! ---
80 !
81  IMPLICIT NONE
82 !
83 ! 5. Argument variables
84 !
85 ! ---
86 !
87 ! 6. Parameter variables
88 !
89 ! ---
90 !
91 ! 7. Local variables
92 !
93 ! ACTOT : Total action density per gridpoint
94 ! EDRKTOT: Zeroth moment of energy / SQRT(wavenumber)
95 ! EKTOT : Zeroth moment of energy * wavenumber
96 ! ETOT1 : First moment of the energy density
97 ! ETOT2 : Second moment of the energy density
98 ! ETOT4 : Fourth moment of the energy density
99 ! KM_WAM : Mean average wavenumber according to the WAM-formulation
100 ! KM01 : Mean average wavenumber according to first order moment
101 ! SIGM_10: Mean frequency according to zeroth order moment
102 ! SIGM01 : Mean frequency according to first order moment
103 !
104  REAL, SAVE :: actot
105  REAL, SAVE :: edrktot
106  REAL, SAVE :: ektot
107  REAL, SAVE :: etot1
108  REAL, SAVE :: etot2
109  REAL, SAVE :: etot4
110  REAL, SAVE :: km_wam
111  REAL, SAVE :: km01
112  REAL, SAVE :: sigm_10
113  REAL, SAVE :: sigm01
114 !$OMP THREADPRIVATE(ACTOT, EDRKTOT, EKTOT, ETOT1, ETOT2, ETOT4,
115 !$OMP& KM_WAM, KM01, SIGM_10, SIGM01)
116 !
117 ! SIGPOW : contains powers of relative frequencies
118 ! second dimension indicates power of sigma
119 !
120  REAL, SAVE, ALLOCATABLE :: sigpow(:,:)
121 !
122 ! 8. Subroutines and functions used
123 !
124 ! ---
125 !
126 ! 9. Subroutines and functions calling
127 !
128 ! SSFILL :
129 ! SINTGRL: Calculating integral paramters
130 ! WCAP : Calculating whitecapping source term
131 !
132 ! 10. Error messages
133 !
134 ! ---
135 !
136 ! 11. Remarks
137 !
138 ! ---
139 !
140 ! 12. Structure
141 !
142 ! ---
143 !
144 ! 13. Source text
145 !
146  END MODULE m_wcap
147 
148  MODULE outp_data
149 !
150 !
151 ! --|-----------------------------------------------------------|--
152 ! | Delft University of Technology |
153 ! | Faculty of Civil Engineering |
154 ! | Environmental Fluid Mechanics Section |
155 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
156 ! | |
157 ! | Programmers: R.C. Ris, N. Booij, |
158 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
159 ! | M. Zijlema, E.E. Kriezi, |
160 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
161 ! --|-----------------------------------------------------------|--
162 !
163 !
164 ! SWAN (Simulating WAves Nearshore); a third generation wave model
165 ! Copyright (C) 2004-2005 Delft University of Technology
166 !
167 ! This program is free software; you can redistribute it and/or
168 ! modify it under the terms of the GNU General Public License as
169 ! published by the Free Software Foundation; either version 2 of
170 ! the License, or (at your option) any later version.
171 !
172 ! This program is distributed in the hope that it will be useful,
173 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
174 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
175 ! GNU General Public License for more details.
176 !
177 ! A copy of the GNU General Public License is available at
178 ! http://www.gnu.org/copyleft/gpl.html#SEC3
179 ! or by writing to the Free Software Foundation, Inc.,
180 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
181 !
182 !
183 ! 0. Authors
184 !
185 ! 40.13: Nico Booij
186 ! 40.31: Marcel Zijlema
187 !
188 ! 1. Updates
189 !
190 ! 40.13, July 01: New Module
191 ! 40.13, Oct. 01: Longer filenames for output requests
192 ! 40.31, Dec. 03: derive types OPSDAT, ORQDAT added
193 !
194 ! 2. Purpose
195 !
196 ! Contains data needed during generation of output
197 !
198 ! 3. Method
199 !
200 ! MODULE construct
201 !
202 ! 4. Modules used
203 !
204  USE ocpcomm2
205 !
206  IMPLICIT NONE
207 !
208 ! 5. Argument variables
209 !
210 ! ---
211 !
212 ! 6. Parameter variables
213 !
214 ! ---
215 !
216 ! 7. Local variables
217 
218  INTEGER, PARAMETER :: max_outp_req = 250 ! max. number of output requests
219 
220  CHARACTER (LEN=1) :: out_comment = '%' ! comment sign for heading lines
221 
222  ! formats for output:
223  CHARACTER (LEN=40) :: flt_block = '(6E12.4)' ! floating point block
224  CHARACTER (LEN=40) :: flt_table = '(E11.4)' ! floating point table
225  CHARACTER (LEN=40) :: fix_spec = '(200(1X,I4))' ! spectral output
226 
227 ! format for block output per process in case of collecting data
228  CHARACTER (LEN=40) :: flt_blkp = '(6E17.9)'
229 
230  INTEGER :: fld_table = 12 ! field length for fixed-point table
231  INTEGER :: dec_block = 4 ! number of decimals for fixed-point block
232  INTEGER :: dec_spec = 4 ! number of decimals for spectral output
233 
234 ! longer filenames for output requests
235  CHARACTER (LEN=LENFNM) :: outp_files(1:max_outp_req)
236  ! filenames for output; index is output request sequence number
237 
238  INTEGER, SAVE :: nreoq = 0 ! actual number of requests saved
239 
240  TYPE opsdat
241  CHARACTER (LEN=1) :: pstype ! type (F, C, P, ...)
242  CHARACTER (LEN=8) :: psname ! name of point set
243  INTEGER :: opi(2) ! integer coefficients
244  REAL :: opr(5) ! real coefficients
245  INTEGER :: mip ! number of points
246  REAL, POINTER :: xp(:), yp(:), xq(:), yq(:) ! point coordinates
247  TYPE(opsdat), POINTER :: nextops
248  END TYPE opsdat
249 
250  TYPE(opsdat), SAVE, TARGET :: fops
251  TYPE(opsdat), SAVE, POINTER :: cops
252  LOGICAL, SAVE :: lops = .false.
253 
254  TYPE orqdat
255  CHARACTER (LEN=4) :: rqtype ! type (BLK, TAB, SPC ...)
256  CHARACTER (LEN=8) :: psname ! name of point set
257  INTEGER :: oqi(4) ! integer coefficients
258  REAL :: oqr(2) ! real coefficients
259  INTEGER, POINTER :: ivtyp(:) ! type of output variable
260  REAL, POINTER :: fac(:) ! multiplication factor of block output
261  TYPE(orqdat), POINTER :: nextorq
262  END TYPE orqdat
263 
264  TYPE(orqdat), SAVE, TARGET :: forq
265 !
266 ! 8. Subroutines and functions used
267 !
268 ! ---
269 !
270 ! 9. Subroutines and functions calling
271 !
272 ! SWREAD : reads data (command OUTPut OPTions)
273 ! SWBLOK : produces block output
274 ! SWTABP : produces table output
275 !
276 ! 10. Error messages
277 !
278 ! ---
279 !
280 ! 11. Remarks
281 !
282 ! ---
283 !
284 ! 12. Structure
285 !
286 ! ---
287 !
288 ! 13. Source text
289 !
290  END MODULE outp_data
291 
292  MODULE m_snl4
293 !
294 !
295 ! --|-----------------------------------------------------------|--
296 ! | Delft University of Technology |
297 ! | Faculty of Civil Engineering |
298 ! | Environmental Fluid Mechanics Section |
299 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
300 ! | |
301 ! | Programmers: R.C. Ris, N. Booij, |
302 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
303 ! | M. Zijlema, E.E. Kriezi, |
304 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
305 ! --|-----------------------------------------------------------|--
306 !
307 !
308 ! SWAN (Simulating WAves Nearshore); a third generation wave model
309 ! Copyright (C) 2004-2005 Delft University of Technology
310 !
311 ! This program is free software; you can redistribute it and/or
312 ! modify it under the terms of the GNU General Public License as
313 ! published by the Free Software Foundation; either version 2 of
314 ! the License, or (at your option) any later version.
315 !
316 ! This program is distributed in the hope that it will be useful,
317 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
318 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
319 ! GNU General Public License for more details.
320 !
321 ! A copy of the GNU General Public License is available at
322 ! http://www.gnu.org/copyleft/gpl.html#SEC3
323 ! or by writing to the Free Software Foundation, Inc.,
324 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
325 !
326 !
327 ! 0. Authors
328 !
329 ! 40.17: IJsbrand Haagsma
330 ! 40.41: Marcel Zijlema
331 !
332 ! 1. Updates
333 !
334 ! Feb. 01: New Module
335 ! Aug. 04: added linked list for RIAM
336 !
337 ! 2. Purpose
338 !
339 ! Create global variables used in quadruplet subroutines
340 !
341 ! 3. Method
342 !
343 ! MODULE construct
344 !
345 ! 4. Modules used
346 !
347 ! ---
348 !
349  IMPLICIT NONE
350 !
351 ! 5. Argument variables
352 !
353 ! ---
354 !
355 ! 6. Parameter variables
356 !
357 ! ---
358 !
359 ! 7. Local variables
360 
361 ! MDIA : Number of quadruplets in the MDIA formulation
362 
363  INTEGER, PUBLIC, SAVE :: mdia = 1
364 
365 ! AF11 : Contains the scaling frequency for the DIA.
366 ! CNL4_1: Contains the values for C1 in the MDIA formulation.
367 ! CNL4_2: Contains the values for C2 in the MDIA formulation.
368 ! LAMBDA: Contains the values for lambda in the MDIA formulation.
369 
370  REAL, PUBLIC, SAVE, ALLOCATABLE :: af11(:)
371  REAL, PUBLIC, SAVE, ALLOCATABLE :: cnl4_1(:)
372  REAL, PUBLIC, SAVE, ALLOCATABLE :: cnl4_2(:)
373  REAL, PUBLIC, SAVE, ALLOCATABLE :: lambda(:)
374 
375  TYPE riamdat
376  INTEGER :: ii(3), jj(3)
377  REAL :: sss, di(3), dj(3)
378  TYPE(riamdat), POINTER :: nextriam
379  END TYPE riamdat
380 
381  TYPE(riamdat), SAVE, TARGET :: friam
382  TYPE(riamdat), SAVE, POINTER :: curriam
383 
384 ! 8. Subroutines and functions used
385 !
386 ! ---
387 !
388 ! 9. Subroutines and functions calling
389 !
390 ! ---
391 !
392 ! 10. Error messages
393 !
394 ! ---
395 !
396 ! 11. Remarks
397 !
398 ! ---
399 !
400 ! 12. Structure
401 !
402 ! ---
403 !
404 ! 13. Source text
405 !
406  END MODULE m_snl4
407 
408  MODULE m_bndspec
409 !
410 !
411 ! --|-----------------------------------------------------------|--
412 ! | Delft University of Technology |
413 ! | Faculty of Civil Engineering and Geosciences |
414 ! | Environmental Fluid Mechanics Section |
415 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
416 ! | |
417 ! | Programmer: M. Zijlema |
418 ! --|-----------------------------------------------------------|--
419 !
420 !
421 ! SWAN (Simulating WAves Nearshore); a third generation wave model
422 ! Copyright (C) 2004-2005 Delft University of Technology
423 !
424 ! This program is free software; you can redistribute it and/or
425 ! modify it under the terms of the GNU General Public License as
426 ! published by the Free Software Foundation; either version 2 of
427 ! the License, or (at your option) any later version.
428 !
429 ! This program is distributed in the hope that it will be useful,
430 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
431 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
432 ! GNU General Public License for more details.
433 !
434 ! A copy of the GNU General Public License is available at
435 ! http://www.gnu.org/copyleft/gpl.html#SEC3
436 ! or by writing to the Free Software Foundation, Inc.,
437 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
438 !
439 !
440 ! 0. Authors
441 !
442 ! 40.31: Marcel Zijlema
443 !
444 ! 1. Updates
445 !
446 ! Nov. 03: New Module
447 !
448 ! 2. Purpose
449 !
450 ! Contains data with respect to specification
451 ! of boundary conditions
452 !
453 ! 3. Method
454 !
455 ! ---
456 !
457 ! 4. Modules used
458 !
459 ! ---
460 !
461  IMPLICIT NONE
462 !
463 ! 5. Argument variables
464 !
465 ! ---
466 !
467 ! 6. Parameter variables
468 !
469 ! ---
470 !
471 ! 7. Local variables
472 !
473 ! BFILED : data concerning boundary condition files
474 ! BGP : array containing data w.r.t. boundary grid points
475 ! BSPLOC : place in array BSPECS where to store interpolated spectra
476 ! BSPDIR : spectral directions of input spectrum
477 ! BSPFRQ : spectral frequencies of input spectrum
478 ! CUBGP : current item in list of boundary grid points
479 ! DSHAPE : indicates option for computation of directional distribution
480 ! in the spectrum (boundary spectra etc.)
481 ! =1: directional spread in degrees is given
482 ! =2: power of COS is given
483 ! FBNDFIL : first boundary condition file in list of files
484 ! FBGP : first item in list of boundary grid points
485 ! FBS : first item in list of boundary spectrum parameters
486 ! FSHAPE : indicates option for computation of frequency distribution
487 ! in the spectrum (boundary spectra etc.)
488 ! =1: Pierson-Moskowitz
489 ! =2: Jonswap
490 ! =3: bin
491 ! =4: Gaussian
492 ! NBS : index of BSPECS
493 ! NEXTBGP : pointer to next item in list of boundary grid points
494 ! NEXTBS : pointer to next item in list of boundary spectrum parameters
495 ! NEXTBSPC: pointer to next boundary condition file in list
496 ! SPPARM : integral parameters used for computation of
497 ! incident spectrum. Meaning:
498 ! 1: significant wave height
499 ! 2: wave period (peak or mean)
500 ! 3: average wave direction
501 ! 4: directional distribution coefficient
502 
503  TYPE bspcdat
504  INTEGER :: bfiled(20)
505  INTEGER, POINTER :: bsploc(:)
506  REAL, POINTER :: bspdir(:), bspfrq(:)
507  TYPE(bspcdat), POINTER :: nextbspc
508  END TYPE bspcdat
509 
510  TYPE(bspcdat), SAVE, TARGET :: fbndfil
511 
512  TYPE bsdat
513  INTEGER :: nbs
514  INTEGER :: fshape, dshape
515  REAL :: spparm(4)
516  TYPE(bsdat), POINTER :: nextbs
517  END TYPE bsdat
518 
519  TYPE(bsdat), SAVE, TARGET :: fbs
520 
521  TYPE bgpdat
522  INTEGER :: bgp(6)
523  TYPE(bgpdat), POINTER :: nextbgp
524  END TYPE bgpdat
525 
526  TYPE(bgpdat), SAVE, TARGET :: fbgp
527  TYPE(bgpdat), SAVE, POINTER :: cubgp
528 
529 ! 8. Subroutines and functions used
530 !
531 ! ---
532 !
533 ! 9. Subroutines and functions calling
534 !
535 ! ---
536 !
537 ! 10. Error messages
538 !
539 ! ---
540 !
541 ! 11. Remarks
542 !
543 ! ---
544 !
545 ! 12. Structure
546 !
547 ! ---
548 !
549 ! 13. Source text
550 !
551  END MODULE m_bndspec
552 
553  MODULE m_obsta
554 !
555 !
556 ! --|-----------------------------------------------------------|--
557 ! | Delft University of Technology |
558 ! | Faculty of Civil Engineering and Geosciences |
559 ! | Environmental Fluid Mechanics Section |
560 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
561 ! | |
562 ! | Programmer: M. Zijlema |
563 ! --|-----------------------------------------------------------|--
564 !
565 !
566 ! SWAN (Simulating WAves Nearshore); a third generation wave model
567 ! Copyright (C) 2004-2005 Delft University of Technology
568 !
569 ! This program is free software; you can redistribute it and/or
570 ! modify it under the terms of the GNU General Public License as
571 ! published by the Free Software Foundation; either version 2 of
572 ! the License, or (at your option) any later version.
573 !
574 ! This program is distributed in the hope that it will be useful,
575 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
576 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
577 ! GNU General Public License for more details.
578 !
579 ! A copy of the GNU General Public License is available at
580 ! http://www.gnu.org/copyleft/gpl.html#SEC3
581 ! or by writing to the Free Software Foundation, Inc.,
582 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
583 !
584 !
585 ! 0. Authors
586 !
587 ! 40.31: Marcel Zijlema
588 !
589 ! 1. Updates
590 !
591 ! Nov. 03: New Module
592 !
593 ! 2. Purpose
594 !
595 ! Contains data with respect to obstacles
596 !
597 ! 3. Method
598 !
599 ! ---
600 !
601 ! 4. Modules used
602 !
603 ! ---
604 !
605  IMPLICIT NONE
606 !
607 ! 5. Argument variables
608 !
609 ! ---
610 !
611 ! 6. Parameter variables
612 !
613 ! ---
614 !
615 ! 7. Local variables
616 !
617 ! FOBSTAC : first obstacle in list of obstacles
618 ! NCRPTS : number of corner points in obstacle
619 ! NEXTOBST: pointer to next obstacle in list
620 ! RFCOEF : reflection coefficients
621 ! RFTYP1 : reflection type: standard (REFL)
622 ! RFTYP2 : reflection type: diffusive/specular (RDIFF/RSPEC)
623 ! RFTYP3 : reflection type: frequency-dependent (RFD)
624 ! TRCOEF : transmission coefficients
625 ! TRTYPE : transmission type
626 ! XCRP : x-coordinate of corner point
627 ! YCRP : y-coordinate of corner point
628 
629  TYPE obstdat
630  INTEGER :: trtype
631  REAL :: trcoef(3)
632  INTEGER :: rftyp1, rftyp2, rftyp3
633  REAL :: rfcoef(8)
634  INTEGER :: ncrpts
635  REAL, POINTER :: xcrp(:), ycrp(:)
636  TYPE(obstdat), POINTER :: nextobst
637  END TYPE obstdat
638 
639  TYPE(obstdat), SAVE, TARGET :: fobstac
640 
641 ! 8. Subroutines and functions used
642 !
643 ! ---
644 !
645 ! 9. Subroutines and functions calling
646 !
647 ! ---
648 !
649 ! 10. Error messages
650 !
651 ! ---
652 !
653 ! 11. Remarks
654 !
655 ! ---
656 !
657 ! 12. Structure
658 !
659 ! ---
660 !
661 ! 13. Source text
662 !
663  END MODULE m_obsta
664 
665  MODULE m_genarr
666 !
667 !
668 ! --|-----------------------------------------------------------|--
669 ! | Delft University of Technology |
670 ! | Faculty of Civil Engineering and Geosciences |
671 ! | Environmental Fluid Mechanics Section |
672 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
673 ! | |
674 ! | Programmer: M. Zijlema |
675 ! --|-----------------------------------------------------------|--
676 !
677 !
678 ! SWAN (Simulating WAves Nearshore); a third generation wave model
679 ! Copyright (C) 2004-2005 Delft University of Technology
680 !
681 ! This program is free software; you can redistribute it and/or
682 ! modify it under the terms of the GNU General Public License as
683 ! published by the Free Software Foundation; either version 2 of
684 ! the License, or (at your option) any later version.
685 !
686 ! This program is distributed in the hope that it will be useful,
687 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
688 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
689 ! GNU General Public License for more details.
690 !
691 ! A copy of the GNU General Public License is available at
692 ! http://www.gnu.org/copyleft/gpl.html#SEC3
693 ! or by writing to the Free Software Foundation, Inc.,
694 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
695 !
696 !
697 ! 0. Authors
698 !
699 ! 40.31: Marcel Zijlema
700 !
701 ! 1. Updates
702 !
703 ! Oct. 03: New Module
704 !
705 ! 2. Purpose
706 !
707 ! Create several allocatable arrays for SWAN computation
708 !
709 ! 3. Method
710 !
711 ! The following arrays will be created:
712 !
713 ! KGRPNT, KGRBND
714 ! XYTST
715 ! AC2
716 ! XCGRID, YCGRID
717 ! SPCSIG, SPCDIR
718 ! DEPTH , FRIC
719 ! UXB , UYB
720 ! WXI , WYI
721 ! WLEVL , ASTDF
722 !
723 ! 4. Modules used
724 !
725 ! ---
726 !
727  IMPLICIT NONE
728 !
729 ! 5. Argument variables
730 !
731 ! ---
732 !
733 ! 6. Parameter variables
734 !
735 ! ---
736 !
737 ! 7. Local variables
738 !
739 ! AC2 : Contains action density at present time step
740 ! ASTDF : input field of air-sea temperature difference
741 ! DEPTH : input field of depth
742 ! FRIC : input field of friction
743 ! KGRBND: array containing all boundary points
744 ! (+ 2 extra zeros as area separator for all separated areas)
745 ! KGRPNT: array containing indirect addresses for grid points
746 ! SPCDIR: (*,1); spectral directions (radians)
747 ! (*,2); cosine of spectral directions
748 ! (*,3); sine of spectral directions
749 ! (*,4); cosine^2 of spectral directions
750 ! (*,5); cosine*sine of spectral directions
751 ! (*,6); sine^2 of spectral directions
752 ! SPCSIG: Relative frequencies in computational domain in sigma-space
753 ! UXB : input field of contravariant U-velocity
754 ! UYB : input field of contravariant V-velocity
755 ! WLEVL : input field of water level
756 ! WXI : input field of wind U-velocity (contravariant)
757 ! WYI : input field of wind V-velocity (contravariant)
758 ! XCGRID: Coordinates of computational grid in x-direction
759 ! XYTST : Grid point indices of test points
760 ! YCGRID: Coordinates of computational grid in y-direction
761 
762  INTEGER, SAVE, ALLOCATABLE :: kgrpnt(:), kgrbnd(:)
763  INTEGER, SAVE, ALLOCATABLE :: xytst(:)
764 ! REAL , SAVE, ALLOCATABLE :: AC2(:,:,:)
765 ! REAL , SAVE, ALLOCATABLE :: XCGRID(:,:), YCGRID(:,:)
766  REAL , SAVE, ALLOCATABLE :: xcgrid(:), ycgrid(:)
767  REAL , SAVE, ALLOCATABLE :: spcsig(:) , spcdir(:,:)
768  REAL , SAVE, ALLOCATABLE :: depth(:) , fric(:,:)
769  REAL , SAVE, ALLOCATABLE :: uxb(:,:) , uyb(:,:)
770  REAL , SAVE, ALLOCATABLE :: wxi(:,:) , wyi(:,:)
771  REAL , SAVE, ALLOCATABLE :: wlevl(:,:) , astdf(:,:)
772 
773 ! 8. Subroutines and functions used
774 !
775 ! ---
776 !
777 ! 9. Subroutines and functions calling
778 !
779 ! ---
780 !
781 ! 10. Error messages
782 !
783 ! ---
784 !
785 ! 11. Remarks
786 !
787 ! ---
788 !
789 ! 12. Structure
790 !
791 ! ---
792 !
793 ! 13. Source text
794 !
795  END MODULE m_genarr
796 
797  MODULE m_parall
798 !
799 !
800 ! --|-----------------------------------------------------------|--
801 ! | Delft University of Technology |
802 ! | Faculty of Civil Engineering and Geosciences |
803 ! | Environmental Fluid Mechanics Section |
804 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
805 ! | |
806 ! | Programmer: M. Zijlema |
807 ! --|-----------------------------------------------------------|--
808 !
809 !
810 ! SWAN (Simulating WAves Nearshore); a third generation wave model
811 ! Copyright (C) 2004-2005 Delft University of Technology
812 !
813 ! This program is free software; you can redistribute it and/or
814 ! modify it under the terms of the GNU General Public License as
815 ! published by the Free Software Foundation; either version 2 of
816 ! the License, or (at your option) any later version.
817 !
818 ! This program is distributed in the hope that it will be useful,
819 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
820 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
821 ! GNU General Public License for more details.
822 !
823 ! A copy of the GNU General Public License is available at
824 ! http://www.gnu.org/copyleft/gpl.html#SEC3
825 ! or by writing to the Free Software Foundation, Inc.,
826 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
827 !
828 !
829 ! 0. Authors
830 !
831 ! 40.31: Marcel Zijlema
832 ! 40.41: Marcel Zijlema
833 !
834 ! 1. Updates
835 !
836 ! Dec. 03: New Module
837 ! Jul. 04: introduction logicals
838 !
839 ! 2. Purpose
840 !
841 ! Contains data with respect to parallel process
842 ! based on distributed-memory apprach using MPI
843 !
844 ! 3. Method
845 !
846 ! ---
847 !
848 ! 4. Modules used
849 !
850 ! ---
851 !
852  IMPLICIT NONE
853 !
854 ! 5. Argument variables
855 !
856 ! ---
857 !
858 ! 6. Parameter variables
859 !
860 ! IHALOX : width of halo area in x-direction
861 ! IHALOY : width of halo area in y-direction
862 ! MASTER : rank of master process
863 !
864  INTEGER master
865  INTEGER ihalox, ihaloy
866  parameter(master = 1, ihalox = 3, ihaloy = 3)
867 !
868 ! 7. Local variables
869 !
870 ! *** variables for parallel process with MPI:
871 !
872 ! INODE : rank of present node
873 ! NPROC : number of nodes
874 ! PARLL : flag to denote run as parallel (.TRUE.) or not (.FALSE.)
875 ! SWINT : MPI datatype for integers
876 ! SWMAX : MPI collective maximum operation
877 ! SWMIN : MPI collective minimum operation
878 ! SWREAL : MPI datatype for reals
879 ! SWSUM : MPI collective summation
880 !
881  INTEGER inode, nproc
882  INTEGER swint, swreal
883  INTEGER swmax, swmin, swsum
884  LOGICAL parll
885 !
886 ! *** information related to global domain and subdomains
887 !
888 ! IBLKAD : administration array for subdomain interfaces
889 ! contents:
890 ! pos. 1 number of neighbouring subdomains
891 ! =m
892 ! pos. 3*i-1 number of i-th neighbour
893 ! pos. 3*i position of i-th neighbour with
894 ! respect to present subdomain
895 ! pos. 3*i+1 pointer of i-th neighbour in
896 ! last part of this array
897 ! pos. 3*m+2 number of overlapping unknowns
898 ! on subdomain interface
899 ! pos. 3*m+3 ... 3*m+2+n position of unknown in array
900 ! to be sent to neighbour
901 ! pos. 3*m+3+n ... 3*m+2*n+2 position of unknown in array
902 ! to be received from neighbour
903 ! IWEIG : weights to determine load per part
904 ! KGRBGL : array containing all boundary points in global domain
905 ! (+ 2 extra zeros as area separator for all separated areas)
906 ! KGRPGL : indirect addressing for grid points in global domain
907 ! =1: not active point
908 ! >1: active point
909 ! LENSPO : format length for spectral output
910 ! LMXF : logical indicating whether first x-point of subdomain equals
911 ! first x-point of global domain (=.TRUE.) or not (=.FALSE.)
912 ! LMXL : logical indicating whether last x-point of subdomain equals
913 ! last x-point of global domain (=.TRUE.) or not (=.FALSE.)
914 ! LMYF : logical indicating whether first y-point of subdomain equals
915 ! first y-point of global domain (=.TRUE.) or not (=.FALSE.)
916 ! LMYL : logical indicating whether last y-point of subdomain equals
917 ! last y-point of global domain (=.TRUE.) or not (=.FALSE.)
918 ! MCGRDGL : number of wet grid points in global computational grid
919 ! MXCGL : number of grid points in x-direction in global
920 ! computational grid
921 ! MXF : first index w.r.t. global grid in x-direction
922 ! MXL : last index w.r.t. global grid in x-direction
923 ! MYCGL : number of grid points in y-direction in global
924 ! computational grid
925 ! MYF : first index w.r.t. global grid in y-direction
926 ! MYL : last index w.r.t. global grid in y-direction
927 ! NBGGL : number of grid points for which boundary condition holds
928 ! in global domain
929 ! NGRBGL : number of boundary points in global domain
930 ! XCLMAX : maximum x-coordinate in subdomain
931 ! XCLMIN : minimum x-coordinate in subdomain
932 ! YCLMAX : maximum y-coordinate in subdomain
933 ! YCLMIN : minimum y-coordinate in subdomain
934 ! XGRDGL : x-coordinate of computational grid in global domain
935 ! YGRDGL : y-coordinate of computational grid in global domain
936 !
937  INTEGER mcgrdgl, mxcgl, mycgl
938  INTEGER mxf, mxl, myf, myl
939  INTEGER ngrbgl, nbggl
941 
942  INTEGER :: lenspo = 1000
943 
944  LOGICAL lmxf, lmxl, lmyf, lmyl
945 
946  INTEGER, SAVE, ALLOCATABLE :: iblkad(:)
947  INTEGER, SAVE, ALLOCATABLE :: iweig(:)
948  INTEGER, SAVE, ALLOCATABLE :: kgrpgl(:), kgrbgl(:)
949  REAL , SAVE, ALLOCATABLE :: xgrdgl(:), ygrdgl(:)
950 !
951 ! 8. Subroutines and functions used
952 !
953 ! ---
954 !
955 ! 9. Subroutines and functions calling
956 !
957 ! ---
958 !
959 ! 10. Error messages
960 !
961 ! ---
962 !
963 ! 11. Remarks
964 !
965 ! ---
966 !
967 ! 12. Structure
968 !
969 ! ---
970 !
971 ! 13. Source text
972 !
973  END MODULE m_parall
974 
975  MODULE m_diffr
976 !
977 !
978 ! --|-----------------------------------------------------------|--
979 ! | Delft University of Technology |
980 ! | Faculty of Civil Engineering |
981 ! | Environmental Fluid Mechanics Section |
982 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
983 ! | |
984 ! | Programmers: R.C. Ris, N. Booij, |
985 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
986 ! | M. Zijlema, E.E. Kriezi, |
987 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
988 ! --|-----------------------------------------------------------|--
989 !
990 !
991 ! SWAN (Simulating WAves Nearshore); a third generation wave model
992 ! Copyright (C) 2004-2005 Delft University of Technology
993 !
994 ! This program is free software; you can redistribute it and/or
995 ! modify it under the terms of the GNU General Public License as
996 ! published by the Free Software Foundation; either version 2 of
997 ! the License, or (at your option) any later version.
998 !
999 ! This program is distributed in the hope that it will be useful,
1000 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1001 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1002 ! GNU General Public License for more details.
1003 !
1004 ! A copy of the GNU General Public License is available at
1005 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1006 ! or by writing to the Free Software Foundation, Inc.,
1007 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1008 !
1009 !
1010 ! 0. Authors
1011 !
1012 ! 40.21: Agnieszka Herman, Nico Booij
1013 !
1014 ! 1. Updates
1015 !
1016 ! Aug. 01: New Module
1017 !
1018 ! 2. Purpose
1019 !
1020 ! Contains global variables used in diffraction procedure
1021 !
1022 ! 3. Method
1023 !
1024 ! MODULE construct
1025 !
1026 ! 4. Modules used
1027 !
1028 ! ---
1029 !
1030  IMPLICIT NONE
1031  SAVE
1032 !
1033 ! 5. Argument variables
1034 !
1035 ! ---
1036 !
1037 ! 6. Parameter variables
1038 !
1039 ! ---
1040 !
1041 ! 7. Local variables
1042 !
1043 ! DIFPARAM: contains diffraction parameter (second derivative of Hs)
1044 ! DIFPARDX: derivative of DIFPARAM in x-direction
1045 ! DIFPARDY: derivative of DIFPARAM in y-direction
1046 
1047  REAL, ALLOCATABLE :: difparam(:)
1048  REAL, ALLOCATABLE :: difpardx(:)
1049  REAL, ALLOCATABLE :: difpardy(:)
1050 
1051 ! 8. Subroutines and functions used
1052 !
1053 ! ---
1054 !
1055 ! 9. Subroutines and functions calling
1056 !
1057 ! DIFPAR : calculates the above arrays DIFPARAM, DIFPARDX, DIFPARDY
1058 ! SPROSD : computes propagation velocity in (x,y,theta) based on
1059 ! arrays DIFPARAM, DIFPARDX, DIFPARDY
1060 !
1061 ! 10. Error messages
1062 !
1063 ! ---
1064 !
1065 ! 11. Remarks
1066 !
1067 ! ---
1068 !
1069 ! 12. Structure
1070 !
1071 ! ---
1072 !
1073 ! 13. Source text
1074 !
1075  END MODULE m_diffr
1076 !MPI!/impi
1077 !MPI!/impi MODULE MPI
1078 !MPI!/impi INCLUDE 'mpif.h'
1079 !MPI!/impi END MODULE MPI
real, save ektot
Definition: swmod2.f90:106
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
real yclmax
Definition: swmod2.f90:940
integer, dimension(:), allocatable, save kgrbgl
Definition: swmod2.f90:948
real, dimension(:,:), allocatable, save uxb
Definition: swmod2.f90:769
integer, dimension(:), allocatable, save iblkad
Definition: swmod2.f90:946
integer ihalox
Definition: swmod2.f90:865
integer fld_table
Definition: swmod2.f90:230
real, dimension(:), allocatable, save xcgrid
Definition: swmod2.f90:766
logical lmxl
Definition: swmod2.f90:944
integer, dimension(:), allocatable, save xytst
Definition: swmod2.f90:763
integer mxcgl
Definition: swmod2.f90:937
integer swreal
Definition: swmod2.f90:882
real, dimension(:), allocatable, save, public af11
Definition: swmod2.f90:370
real, dimension(:), allocatable, save ycgrid
Definition: swmod2.f90:766
real, dimension(:), allocatable difpardx
Definition: swmod2.f90:1048
real, dimension(:,:), allocatable, save spcdir
Definition: swmod2.f90:767
real, dimension(:), allocatable, save, public cnl4_2
Definition: swmod2.f90:372
real, dimension(:), allocatable difparam
Definition: swmod2.f90:1047
integer, save nreoq
Definition: swmod2.f90:238
integer mcgrdgl
Definition: swmod2.f90:937
integer swmin
Definition: swmod2.f90:883
real xclmin
Definition: swmod2.f90:940
integer mycgl
Definition: swmod2.f90:937
integer, parameter max_outp_req
Definition: swmod2.f90:218
real, save sigm01
Definition: swmod2.f90:113
real, dimension(:,:), allocatable, save uyb
Definition: swmod2.f90:769
real, dimension(:), allocatable, save, public lambda
Definition: swmod2.f90:373
integer, dimension(:), allocatable, save kgrbnd
Definition: swmod2.f90:762
integer swint
Definition: swmod2.f90:882
type(riamdat), target, save friam
Definition: swmod2.f90:381
type(bspcdat), target, save fbndfil
Definition: swmod2.f90:510
real, dimension(:), allocatable difpardy
Definition: swmod2.f90:1049
integer inode
Definition: swmod2.f90:881
type(bgpdat), target, save fbgp
Definition: swmod2.f90:526
integer myl
Definition: swmod2.f90:938
type(obstdat), target, save fobstac
Definition: swmod2.f90:639
integer mxl
Definition: swmod2.f90:938
real, dimension(:,:), allocatable, save sigpow
Definition: swmod2.f90:120
type(riamdat), pointer, save curriam
Definition: swmod2.f90:382
integer ngrbgl
Definition: swmod2.f90:939
character(len=40) fix_spec
Definition: swmod2.f90:225
integer, dimension(:), allocatable, save iweig
Definition: swmod2.f90:947
real, dimension(:,:), allocatable, save astdf
Definition: swmod2.f90:771
real, save edrktot
Definition: swmod2.f90:105
integer nproc
Definition: swmod2.f90:881
integer myf
Definition: swmod2.f90:938
integer dec_spec
Definition: swmod2.f90:232
real, save etot2
Definition: swmod2.f90:108
character(len=40) flt_block
Definition: swmod2.f90:223
type(opsdat), pointer, save cops
Definition: swmod2.f90:251
integer, save, public mdia
Definition: swmod2.f90:363
real, dimension(:), allocatable, save xgrdgl
Definition: swmod2.f90:949
real, save sigm_10
Definition: swmod2.f90:112
real, dimension(:), allocatable, save depth
Definition: swmod2.f90:768
integer swsum
Definition: swmod2.f90:883
integer swmax
Definition: swmod2.f90:883
integer nbggl
Definition: swmod2.f90:939
logical parll
Definition: swmod2.f90:884
real, save etot4
Definition: swmod2.f90:109
integer lenspo
Definition: swmod2.f90:942
real, dimension(:,:), allocatable, save wlevl
Definition: swmod2.f90:771
integer mxf
Definition: swmod2.f90:938
character(len=1) out_comment
Definition: swmod2.f90:220
logical lmxf
Definition: swmod2.f90:944
type(orqdat), target, save forq
Definition: swmod2.f90:264
real, save etot1
Definition: swmod2.f90:107
logical, save lops
Definition: swmod2.f90:252
logical lmyf
Definition: swmod2.f90:944
real, dimension(:), allocatable, save ygrdgl
Definition: swmod2.f90:949
logical lmyl
Definition: swmod2.f90:944
integer ihaloy
Definition: swmod2.f90:865
real, dimension(:), allocatable, save, public cnl4_1
Definition: swmod2.f90:371
type(opsdat), target, save fops
Definition: swmod2.f90:250
integer, dimension(:), allocatable, save kgrpgl
Definition: swmod2.f90:948
real, save km_wam
Definition: swmod2.f90:110
character(len=40) flt_blkp
Definition: swmod2.f90:228
character(len=lenfnm), dimension(1:max_outp_req) outp_files
Definition: swmod2.f90:235
real, dimension(:,:), allocatable, save fric
Definition: swmod2.f90:768
real, save actot
Definition: swmod2.f90:104
integer dec_block
Definition: swmod2.f90:231
real, dimension(:,:), allocatable, save wyi
Definition: swmod2.f90:770
real, dimension(:,:), allocatable, save wxi
Definition: swmod2.f90:770
integer, dimension(:), allocatable, save kgrpnt
Definition: swmod2.f90:762
character(len=40) flt_table
Definition: swmod2.f90:224
type(bgpdat), pointer, save cubgp
Definition: swmod2.f90:527
real xclmax
Definition: swmod2.f90:940
real, save km01
Definition: swmod2.f90:111
integer master
Definition: swmod2.f90:864
real yclmin
Definition: swmod2.f90:940
type(bsdat), target, save fbs
Definition: swmod2.f90:519