-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswmod2.ftn
More file actions
1367 lines (1300 loc) · 40.9 KB
/
swmod2.ftn
File metadata and controls
1367 lines (1300 loc) · 40.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
! ALLOCATABLE DATA RELATED MODULES, file 2 of 3
!
! Contents of this file
!
! M_WCAP information for whitecapping
! OUTP_DATA information for output data
! M_SNL4 information for quadruplets
! M_SNL3 information for triads
! M_BNDSPEC information for boundary conditions
! M_OBSTA information for obstacles
! M_GENARR contains a number of general arrays
! M_PARALL information for parallelisation with MPI
! M_DIFFR information for diffraction
!
MODULE M_WCAP
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering and Geosciences |
! | Environmental Fluid Mechanics Section |
! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
! | |
! | Programmers: The SWAN team |
! --|-----------------------------------------------------------|--
!
!
! SWAN (Simulating WAves Nearshore); a third generation wave model
! Copyright (C) 1993-2024 Delft University of Technology
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
!
! 0. Authors
!
! 40.02: IJsbrand Haagsma
!
! 1. Updates
!
! Sep. 00: New Module
!
! 2. Purpose
!
! Create global variables used in whitecapping and integral parameter
! subroutines
!
! 3. Method
!
! MODULE construct
!
! 4. Modules used
!
! ---
!
IMPLICIT NONE
!
! 5. Argument variables
!
! ---
!
! 6. Parameter variables
!
! ---
!
! 7. Local variables
!
! ACTOT : Total action density per gridpoint
! EDRKTOT: Zeroth moment of energy / SQRT(wavenumber)
! EKTOT : Zeroth moment of energy * wavenumber
! ETOT1 : First moment of the energy density
! ETOT2 : Second moment of the energy density
! ETOT4 : Fourth moment of the energy density
! KM_WAM : Mean wavenumber according to the WAM-formulation
! KM01 : Mean wavenumber according to first and zeroth order moments
! SIGM_10: Mean frequency according to zeroth and first order moments
! SIGM01 : Mean frequency according to first and zeroth order moments
!
REAL, SAVE :: ACTOT
REAL, SAVE :: EDRKTOT
REAL, SAVE :: EKTOT
REAL, SAVE :: ETOT1
REAL, SAVE :: ETOT2
REAL, SAVE :: ETOT4
REAL, SAVE :: KM_WAM
REAL, SAVE :: KM01
REAL, SAVE :: SIGM_WAM
REAL, SAVE :: SIGM_10
REAL, SAVE :: SIGM01
!
!$OMP THREADPRIVATE(ACTOT, EDRKTOT, EKTOT, ETOT1, ETOT2, ETOT4,
!$OMP& KM_WAM, KM01, SIGM_WAM,
!$OMP& SIGM_10, SIGM01)
!
! SIGPOW : contains powers of relative frequencies
! second dimension indicates power of sigma
!
REAL, SAVE, ALLOCATABLE :: SIGPOW(:,:)
!
! 8. Subroutines and functions used
!
! ---
!
! 9. Subroutines and functions calling
!
! SSFILL :
! SINTGRL: Calculating integral paramters
! SWCAP : Calculating whitecapping source term
!
! 10. Error messages
!
! ---
!
! 11. Remarks
!
! ---
!
! 12. Structure
!
! ---
!
! 13. Source text
!
END MODULE M_WCAP
MODULE OUTP_DATA
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering and Geosciences |
! | Environmental Fluid Mechanics Section |
! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
! | |
! | Programmers: The SWAN team |
! --|-----------------------------------------------------------|--
!
!
! SWAN (Simulating WAves Nearshore); a third generation wave model
! Copyright (C) 1993-2024 Delft University of Technology
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
!
! 0. Authors
!
! 40.13: Nico Booij
! 40.31: Marcel Zijlema
! 41.78: Bert Jagers
! 41.95: Marcel Zijlema
!
! 1. Updates
!
! 40.13, July 01: New Module
! 40.13, Oct. 01: Longer filenames for output requests
! 40.31, Dec. 03: derive types OPSDAT, ORQDAT added
! 41.78, Mar. 21: delete linked lists
! 41.95, Jul. 22: introduction VTK and PVD attributes
!
! 2. Purpose
!
! Contains data needed during generation of output
!
! 3. Method
!
! MODULE construct
!
! 4. Modules used
!
USE OCPCOMM2
!
IMPLICIT NONE
!
! 5. Argument variables
!
! ---
!
! 6. Parameter variables
!
! ---
!
! 7. Local variables
INTEGER, PARAMETER :: MAX_OUTP_REQ = 250 ! max. number of output requests
CHARACTER (LEN=1) :: OUT_COMMENT = '%' ! comment sign for heading lines
LOGICAL :: LCOMPGRD
! formats for output:
CHARACTER (LEN=40) :: FLT_BLOCK = '(6E12.4)' ! floating point block
CHARACTER (LEN=40) :: FLT_TABLE = '(E11.4)' ! floating point table
CHARACTER (LEN=40) :: FIX_SPEC = '(200(1X,I4))' ! spectral output
! format for block output per process in case of collecting data
CHARACTER (LEN=40) :: FLT_BLKP = '(6E17.9)'
INTEGER :: FLD_TABLE = 12 ! field length for fixed-point table
INTEGER :: DEC_BLOCK = 4 ! number of decimals for fixed-point block
INTEGER :: DEC_SPEC = 4 ! number of decimals for spectral output
! longer filenames for output requests
CHARACTER (LEN=LENFNM) :: OUTP_FILES(1:MAX_OUTP_REQ)
! filenames for output; index is output request sequence number
INTEGER, SAVE :: NREOQ = 0 ! actual number of requests saved
! unit number PVD files
INTEGER :: UPVDF(1:MAX_OUTP_REQ)
! timestep counter for time-varying VTK files
INTEGER, SAVE :: NTVTK(1:MAX_OUTP_REQ) = -1
! output directory containing a series of time-varying VTK files
CHARACTER (LEN=LENFNM) :: VTKDIR(1:MAX_OUTP_REQ)
! textline containing VTK line in XML format
CHARACTER(LEN=1024) :: VTKLINE
! XML header lines
CHARACTER(LEN=25) :: XMLLIN1 = '<?xml version="1.0"?>'
CHARACTER(LEN= 5) :: XMLLIN2 = '<!--'
CHARACTER(LEN= 5) :: XMLLIN3 = '-->'
! default lines of PVD file
CHARACTER(LEN=80) :: PVDLIN1 = '<VTKFile type="Collection" '//
& 'version="0.1" byte_order="LittleEndian">'
CHARACTER(LEN=15) :: PVDLIN2 = ' <Collection>'
CHARACTER(LEN=15) :: PVDLIN3 = ' </Collection>'
CHARACTER(LEN=10) :: PVDLIN4 = '</VTKFile>'
TYPE OPSDAT
CHARACTER (LEN=1) :: PSTYPE ! type (F, C, P, ...)
CHARACTER (LEN=8) :: PSNAME ! name of point set
INTEGER :: OPI(2) ! integer coefficients
REAL :: OPR(5) ! real coefficients
INTEGER :: MIP ! number of points
REAL, POINTER :: XP(:), YP(:), XQ(:), YQ(:) ! point coordinates
TYPE(OPSDAT), POINTER :: NEXTOPS
END TYPE OPSDAT
TYPE(OPSDAT), SAVE, TARGET :: FOPS
TYPE(OPSDAT), SAVE, POINTER :: COPS
LOGICAL, SAVE :: LOPS = .FALSE.
TYPE ORQDAT
CHARACTER (LEN=4) :: RQTYPE ! type (BLK, TAB, SPC ...)
CHARACTER (LEN=8) :: PSNAME ! name of point set
INTEGER :: OQI(4) ! integer coefficients
REAL*8 :: OQR(2) ! real coefficients
INTEGER, POINTER :: IVTYP(:) ! type of output variable
REAL, POINTER :: FAC(:) ! multiplication factor of block output
TYPE(ORQDAT), POINTER :: NEXTORQ
END TYPE ORQDAT
TYPE(ORQDAT), SAVE, TARGET :: FORQ
LOGICAL, SAVE :: LORQ = .FALSE.
!
! 8. Subroutines and functions used
!
INTERFACE DELETE
MODULE PROCEDURE DELETEOPS
MODULE PROCEDURE DELETEORQ
END INTERFACE
!
! 9. Subroutines and functions calling
!
! SWREAD : reads data (command OUTPut OPTions)
! SWBLOK : produces block output
! SWTABP : produces table output
!
! 10. Error messages
!
! ---
!
! 11. Remarks
!
! ---
!
! 12. Structure
!
! ---
!
! 13. Source text
!
CONTAINS
!
RECURSIVE SUBROUTINE DELETEOPS ( OPS )
TYPE(OPSDAT) :: OPS
IF ( LOPS ) THEN
IF ( ASSOCIATED( OPS%XP ) ) THEN
DEALLOCATE( OPS%XP )
NULLIFY( OPS%XP )
ENDIF
IF ( ASSOCIATED( OPS%YP ) ) THEN
DEALLOCATE( OPS%YP )
NULLIFY( OPS%YP )
ENDIF
IF ( OPS%PSTYPE.EQ.'R' .AND. ASSOCIATED( OPS%XQ ) ) THEN
DEALLOCATE( OPS%XQ )
NULLIFY( OPS%XQ )
ENDIF
IF ( OPS%PSTYPE.EQ.'R' .AND. ASSOCIATED( OPS%YQ ) ) THEN
DEALLOCATE( OPS%YQ )
NULLIFY( OPS%YQ )
ENDIF
IF ( ASSOCIATED( OPS%NEXTOPS ) ) THEN
CALL DELETEOPS ( OPS%NEXTOPS )
DEALLOCATE( OPS%NEXTOPS )
NULLIFY( OPS%NEXTOPS )
ENDIF
ENDIF
END SUBROUTINE
!
RECURSIVE SUBROUTINE DELETEORQ ( ORQ )
TYPE(ORQDAT) :: ORQ
IF ( LORQ ) THEN
IF ( ASSOCIATED( ORQ%IVTYP ) ) THEN
DEALLOCATE( ORQ%IVTYP )
NULLIFY( ORQ%IVTYP )
ENDIF
IF ( ASSOCIATED( ORQ%FAC ) ) THEN
DEALLOCATE( ORQ%FAC )
NULLIFY( ORQ%FAC )
ENDIF
IF ( ASSOCIATED( ORQ%NEXTORQ ) ) THEN
CALL DELETEORQ ( ORQ%NEXTORQ )
DEALLOCATE( ORQ%NEXTORQ )
NULLIFY( ORQ%NEXTORQ )
ENDIF
ENDIF
END SUBROUTINE
END MODULE OUTP_DATA
MODULE M_SNL4
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering and Geosciences |
! | Environmental Fluid Mechanics Section |
! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
! | |
! | Programmers: The SWAN team |
! --|-----------------------------------------------------------|--
!
!
! SWAN (Simulating WAves Nearshore); a third generation wave model
! Copyright (C) 1993-2024 Delft University of Technology
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
!
! 0. Authors
!
! 40.17: IJsbrand Haagsma
!
! 1. Updates
!
! Feb. 01: New Module
!
! 2. Purpose
!
! Create global variables used in quadruplet subroutines
!
! 3. Method
!
! MODULE construct
!
! 4. Modules used
!
! ---
!
IMPLICIT NONE
!
! 5. Argument variables
!
! ---
!
! 6. Parameter variables
!
! ---
!
! 7. Local variables
! MDIA : Number of quadruplets in the MDIA formulation
INTEGER, PUBLIC, SAVE :: MDIA = 1
! AF11 : Contains the scaling frequency for the DIA.
! CNL4_1: Contains the values for C1 in the MDIA formulation.
! CNL4_2: Contains the values for C2 in the MDIA formulation.
! LAMBDA: Contains the values for lambda in the MDIA formulation.
REAL, PUBLIC, SAVE, ALLOCATABLE :: AF11(:)
REAL, PUBLIC, SAVE, ALLOCATABLE :: CNL4_1(:)
REAL, PUBLIC, SAVE, ALLOCATABLE :: CNL4_2(:)
REAL, PUBLIC, SAVE, ALLOCATABLE :: LAMBDA(:)
! 8. Subroutines and functions used
!
! ---
!
! 9. Subroutines and functions calling
!
! ---
!
! 10. Error messages
!
! ---
!
! 11. Remarks
!
! ---
!
! 12. Structure
!
! ---
!
! 13. Source text
!
END MODULE M_SNL4
MODULE M_SNL3
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering and Geosciences |
! | Environmental Fluid Mechanics Section |
! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
! | |
! | Programmer: Marcel Zijlema |
! --|-----------------------------------------------------------|--
!
!
! SWAN (Simulating WAves Nearshore); a third generation wave model
! Copyright (C) 1993-2024 Delft University of Technology
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
!
! 0. Authors
!
! 42.01: Marcel Zijlema
!
! 1. Updates
!
! November 2022: New module
!
! 2. Purpose
!
! creates variables and arrays used for triad interactions
!
! 3. Method
!
! MODULE construct
!
! 4. Modules used
!
! ---
!
IMPLICIT NONE
!
! 5. Argument variables
!
! ---
!
! 6. Parameter variables
!
! ---
!
! 7. Local variables
!
! BPHTMP: store unfiltered De Wit's biphase temporarily
! ISM : negative range for IS
! ISM1 : negative range for IS
! ISP : positive range for IS
! ISP1 : positive range for IS
! MSC4D : dimension for QTRI arrays
! QTRI1 : frequency-dependent interpolation data
! QTRI2 : frequency- and space-dependent scaling factors
! TCOLL : true if collinear, otherwise noncollinear
! WISM : interpolation weight factor corresponding to lower harmonic
! WISM1 : interpolation weight factor corresponding to lower harmonic
! WISP : interpolation weight factor corresponding to higher harmonic
! WISP1 : interpolation weight factor corresponding to higher harmonic
!
INTEGER MSC4D
!
INTEGER ISM(3,2), ISM1(3,2), ISP(3), ISP1(3)
REAL WISM(3,2), WISM1(3,2), WISP(3), WISP1(3)
!
REAL , DIMENSION(:) , SAVE, ALLOCATABLE :: BPHTMP
REAL , DIMENSION(:,:) , SAVE, ALLOCATABLE :: QTRI1
REAL , DIMENSION(:,:,:), SAVE, ALLOCATABLE :: QTRI2
!
LOGICAL :: TCOLL
! 8. Subroutines and functions used
!
! ---
!
! 9. Subroutines and functions calling
!
! ---
!
! 10. Error messages
!
! ---
!
! 11. Remarks
!
! ---
!
! 12. Structure
!
! ---
!
! 13. Source text
!
END MODULE M_SNL3
MODULE M_BNDSPEC
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering and Geosciences |
! | Environmental Fluid Mechanics Section |
! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
! | |
! | Programmers: The SWAN team |
! --|-----------------------------------------------------------|--
!
!
! SWAN (Simulating WAves Nearshore); a third generation wave model
! Copyright (C) 1993-2024 Delft University of Technology
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
!
! 0. Authors
!
! 40.31: Marcel Zijlema
! 41.78: Bert Jagers
!
! 1. Updates
!
! 40.31, Nov. 03: New Module
! 41.78, Mar. 21: delete linked lists
!
! 2. Purpose
!
! Contains data with respect to specification
! of boundary conditions
!
! 3. Method
!
! ---
!
! 4. Modules used
!
! ---
!
IMPLICIT NONE
!
! 5. Argument variables
!
! ---
!
! 6. Parameter variables
!
! ---
!
! 7. Local variables
!
! ALOBND : if true, user has specified boundary conditions
! BFILED : data concerning boundary condition files
! BGP : array containing data w.r.t. boundary grid points
! BSPLOC : place in array BSPECS where to store interpolated spectra
! BSPDIR : spectral directions of input spectrum
! BSPFRQ : spectral frequencies of input spectrum
! CUBGP : current item in list of boundary grid points
! DSHAPE : indicates option for computation of directional distribution
! in the spectrum (boundary spectra etc.)
! =1: directional spread in degrees is given
! =2: power of COS is given
! FBNDFIL : first boundary condition file in list of files
! FBGP : first item in list of boundary grid points
! FBS : first item in list of boundary spectrum parameters
! FSHAPE : indicates option for computation of frequency distribution
! in the spectrum (boundary spectra etc.)
! =1: Pierson-Moskowitz
! =2: Jonswap
! =3: bin
! =4: Gaussian
! NBS : index of BSPECS
! NEXTBGP : pointer to next item in list of boundary grid points
! NEXTBS : pointer to next item in list of boundary spectrum parameters
! NEXTBSPC: pointer to next boundary condition file in list
! SPPARM : integral parameters used for computation of
! incident spectrum. Meaning:
! 1: significant wave height
! 2: wave period (peak or mean)
! 3: average wave direction
! 4: directional distribution coefficient
LOGICAL :: ALOBND
TYPE BSPCDAT
INTEGER :: BFILED(20)
INTEGER, POINTER :: BSPLOC(:)
REAL, POINTER :: BSPDIR(:), BSPFRQ(:)
TYPE(BSPCDAT), POINTER :: NEXTBSPC
END TYPE BSPCDAT
TYPE(BSPCDAT), SAVE, TARGET :: FBNDFIL
LOGICAL, SAVE :: LBFILS = .FALSE.
TYPE BSDAT
INTEGER :: NBS
INTEGER :: FSHAPE, DSHAPE
REAL :: SPPARM(4)
TYPE(BSDAT), POINTER :: NEXTBS
END TYPE BSDAT
TYPE(BSDAT), SAVE, TARGET :: FBS
LOGICAL, SAVE :: LBS = .FALSE.
TYPE BGPDAT
INTEGER :: BGP(6)
TYPE(BGPDAT), POINTER :: NEXTBGP
END TYPE BGPDAT
TYPE(BGPDAT), SAVE, TARGET :: FBGP
TYPE(BGPDAT), SAVE, POINTER :: CUBGP
LOGICAL, SAVE :: LBGP = .FALSE.
! 8. Subroutines and functions used
!
INTERFACE DELETE
MODULE PROCEDURE DELETEBSPC
MODULE PROCEDURE DELETEBS
MODULE PROCEDURE DELETEBGP
END INTERFACE
!
! 9. Subroutines and functions calling
!
! ---
!
! 10. Error messages
!
! ---
!
! 11. Remarks
!
! ---
!
! 12. Structure
!
! ---
!
! 13. Source text
!
CONTAINS
!
RECURSIVE SUBROUTINE DELETEBSPC ( BSPC )
TYPE(BSPCDAT) :: BSPC
IF ( LBFILS ) THEN
IF ( ASSOCIATED( BSPC%BSPLOC ) ) THEN
DEALLOCATE( BSPC%BSPLOC )
NULLIFY( BSPC%BSPLOC )
ENDIF
IF ( ASSOCIATED( BSPC%BSPDIR ) ) THEN
DEALLOCATE( BSPC%BSPDIR )
NULLIFY( BSPC%BSPDIR )
ENDIF
IF ( ASSOCIATED( BSPC%BSPFRQ ) ) THEN
DEALLOCATE( BSPC%BSPFRQ )
NULLIFY( BSPC%BSPFRQ )
ENDIF
IF ( ASSOCIATED( BSPC%NEXTBSPC ) ) THEN
CALL DELETEBSPC ( BSPC%NEXTBSPC )
DEALLOCATE( BSPC%NEXTBSPC )
NULLIFY( BSPC%NEXTBSPC )
ENDIF
ENDIF
END SUBROUTINE
!
RECURSIVE SUBROUTINE DELETEBS ( BS )
TYPE(BSDAT) :: BS
IF ( LBS ) THEN
IF ( ASSOCIATED( BS%NEXTBS ) ) THEN
CALL DELETEBS ( BS%NEXTBS )
DEALLOCATE( BS%NEXTBS )
NULLIFY( BS%NEXTBS )
ENDIF
ENDIF
END SUBROUTINE
!
RECURSIVE SUBROUTINE DELETEBGP ( BGP )
TYPE(BGPDAT) :: BGP
IF ( LBGP ) THEN
IF ( ASSOCIATED( BGP%NEXTBGP ) ) THEN
CALL DELETEBGP ( BGP%NEXTBGP )
DEALLOCATE( BGP%NEXTBGP )
NULLIFY( BGP%NEXTBGP )
ENDIF
ENDIF
END SUBROUTINE
END MODULE M_BNDSPEC
MODULE M_OBSTA
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering and Geosciences |
! | Environmental Fluid Mechanics Section |
! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
! | |
! | Programmer: Marcel Zijlema |
! --|-----------------------------------------------------------|--
!
!
! SWAN (Simulating WAves Nearshore); a third generation wave model
! Copyright (C) 1993-2024 Delft University of Technology
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
!
! 0. Authors
!
! 40.31: Marcel Zijlema
!
! 1. Updates
!
! Nov. 03: New Module
!
! 2. Purpose
!
! Contains data with respect to obstacles
!
! 3. Method
!
! ---
!
! 4. Modules used
!
! ---
!
IMPLICIT NONE
!
! 5. Argument variables
!
! ---
!
! 6. Parameter variables
!
! ---
!
! 7. Local variables
!
! FOBSTAC : first obstacle in list of obstacles
! FBCOEF : freeboard dependent coefficients
! FBTYP1 : freeboard type: freeboard or not
! FBTYP2 : freeboard type: includes quay or not
! IGCOEF : FIG coefficients
! IGFRQD : frequency distribution for FIG source
! IGTYP : FIG type: FIG source term or not
! NCRPTS : number of corner points in obstacle
! NEXTOBST: pointer to next obstacle in list
! OBSTDONE: check handling obstacles done or not
! RFCOEF : reflection coefficients
! RFTYP1 : reflection type: standard (REFL)
! RFTYP2 : reflection type: diffusive/specular (RDIFF/RSPEC)
! RFTYP3 : reflection type: frequency-dependent (RFD)
! TRCF1D : frequency dependent transmission coefficients
! TRCF2D : frequency and direction dependent transmission coefficients
! TRCOEF : transmission coefficients
! TRTYPE : transmission type
! XCRP : x-coordinate of corner point
! YCRP : y-coordinate of corner point
LOGICAL, SAVE :: OBSTDONE
!
TYPE OBSTDAT
INTEGER :: TRTYPE
REAL :: TRCOEF(3)
REAL, POINTER :: TRCF1D(:), TRCF2D(:,:)
INTEGER :: RFTYP1, RFTYP2, RFTYP3
REAL :: RFCOEF(6)
INTEGER :: FBTYP1, FBTYP2
REAL :: FBCOEF(3)
INTEGER :: IGTYP
REAL :: IGCOEF(7)
REAL, POINTER :: IGFRQD(:)
INTEGER :: NCRPTS
REAL, POINTER :: XCRP(:), YCRP(:)
TYPE(OBSTDAT), POINTER :: NEXTOBST
END TYPE OBSTDAT
TYPE(OBSTDAT), SAVE, TARGET :: FOBSTAC
! 8. Subroutines and functions used
!
! ---
!
! 9. Subroutines and functions calling
!
! ---
!
! 10. Error messages
!
! ---
!
! 11. Remarks
!
! ---
!
! 12. Structure
!
! ---
!
! 13. Source text
!
END MODULE M_OBSTA
MODULE M_GENARR
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering and Geosciences |
! | Environmental Fluid Mechanics Section |
! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
! | |
! | Programmer: Marcel Zijlema |
! --|-----------------------------------------------------------|--
!
!
! SWAN (Simulating WAves Nearshore); a third generation wave model
! Copyright (C) 1993-2024 Delft University of Technology
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
!
! 0. Authors
!
! 40.31: Marcel Zijlema
! 41.75: Erick Rogers
!
! 1. Updates
!
! Oct. 03: New Module
! 41.75, Jan. 19: adding sea ice
!
! 2. Purpose
!
! Create several allocatable arrays for SWAN computation
!
! 3. Method
!
! The following arrays will be created:
!
! KGRPNT, KGRBND
! XYTST
! AC2
! XCGRID, YCGRID
! SPCSIG, SPCDIR
! DEPTH , FRIC
! UXB , UYB
! WXI , WYI
! WLEVL , ASTDF
! NPLAF, TURBF
! MUDLF
! AICEF, HICEF
! HSSF, TSSF, DSSF
!
! 4. Modules used
!
! ---
!
IMPLICIT NONE
!
! 5. Argument variables
!
! ---
!
! 6. Parameter variables
!
! ---
!
! 7. Local variables
!
! AC2 : Contains action density at present time step
! AICEF : input field containing ice concentration (fraction)
! ASTDF : input field of air-sea temperature difference
! DEPTH : input field of depth
! DSSF : input field containing sea-swell mean wave direction
! FRIC : input field of friction
! HICEF : input field containing ice thickness (meters)
! HSSF : input field containing sea-swell sig wave height
! KGRBND: array containing all boundary points
! (+ 2 extra zeros as area separator for all separated areas)
! KGRPNT: array containing indirect addresses for grid points