-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswanser.ftn
7416 lines (7368 loc) · 286 KB
/
swanser.ftn
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
!
! SWAN - SERVICE ROUTINES
!
! Contents of this file
!
! READXY
! REFIXY
! INFRAM
! DISTR
! KSCIP1
! KSCIP2 40.59
! NG 40.59
! AC2TST
! CVCHEK 30.60
! CVMESH 30.60
! NEWTON 30.60
! EVALF 30.60
! SWOBST 30.60
! TCROSS 40.04
! SWTRCF
! REFLECT
! SSHAPE 40.00
! SINTRP 40.00
! HSOBND 32.01
! CHGBAS 40.00
! GAMMAF 40.00
! WRSPEC 40.00
!TIMG! SWTSTA 40.23
!TIMG! SWTSTO 40.23
!TIMG! SWPRTI 40.23
! TXPBLA 40.23
! INTSTR 40.23
! NUMSTR 40.23
! SWCOPI 40.23
! SWCOPR 40.23
!MatL4! SWI2B 40.30
!MatL4! SWR2B 40.30
! MKPATH 41.95
!
! functions:
! ----------
! DEGCNV (converts from cartesian convention to nautical and 32.01
! vice versa) 32.01
! ANGRAD (converts radians to degrees) 32.01
! ANGDEG (converts degrees to radians) 32.01
!
! subroutines:
! ------------
! HSOBND (Hs is calculated after a SWAN computation at all sides. 32.01
! The calculated wave height from SWAN is then compared with 32.01
! the wave heigth as provided by the user 32.01
!
!***********************************************************************
! *
SUBROUTINE READXY (NAMX, NAMY, XX, YY, KONT, XSTA, YSTA)
! *
!***********************************************************************
!
USE OCPCOMM1 40.41
USE SWCOMM2 40.41
!
!
! --|-----------------------------------------------------------|--
! | 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.22: John Cazes and Tim Campbell
! 40.13: Nico Booij
! 40.51: Marcel Zijlema
!
! 1. UPDATE
!
! Nov. 1996 offset values are added to standard values
! because they will be subtracted later
! 40.13, Nov. 01: a valid value for YY is required if a valid value
! for XX has been given; ocpcomm1.inc reactivated
! 40.51, Feb. 05: correction to location points equal to offset values
!
! 2. PURPOSE
!
! Read x and y, initialize offset values XOFFS and YOFFS
!
! 3. METHOD
!
! ---
!
! 4. PARAMETERLIST
!
! NAMX, NAMY inp char names of the two coordinates as given in
! the user manual
! XX, YY out real values of x and y taking into account offset
! KONT inp char what to be done if values are missing
! see doc. of INDBLE (Ocean Pack doc.)
! XSTA, YSTA inp real standard values of x and y
!
! 5. SUBROUTINES CALLING
!
!
!
! 6. SUBROUTINES USED
!
! INDBLE (Ocean Pack)
LOGICAL EQREAL
!
! 7. ERROR MESSAGES
!
! ---
!
! 8. REMARKS
!
! ---
!
! 9. STRUCTURE
!
! ----------------------------------------------------------------
! Read x and y in double prec.
! If this is first couple of values
! Then assign values to XOFFS and YOFFS
! make LXOFFS True
! ---------------------------------------------------------------
! make XX and YY equal to x and y taking into account offset
! ----------------------------------------------------------------
!
! 10. SOURCE TEXT
!
DOUBLE PRECISION XTMP, YTMP
CHARACTER NAMX *(*), NAMY *(*), KONT *(*)
SAVE IENT
DATA IENT /0/
CALL STRACE (IENT,'READXY')
!
CALL INDBLE (NAMX, XTMP, KONT, DBLE(XSTA)+DBLE(XOFFS))
IF (CHGVAL) THEN 40.13
! a valid value was given for XX 40.13
CALL INDBLE (NAMY, YTMP, 'REQ', DBLE(YSTA)+DBLE(YOFFS)) 40.13
ELSE 40.13
CALL INDBLE (NAMY, YTMP, KONT, DBLE(YSTA)+DBLE(YOFFS))
ENDIF 40.13
IF (.NOT.LXOFFS) THEN
XOFFS = REAL(XTMP)
YOFFS = REAL(YTMP)
LXOFFS = .TRUE.
ENDIF
IF (.NOT.EQREAL(XOFFS,REAL(XTMP))) THEN 40.51
XX = REAL(XTMP-DBLE(XOFFS))
ELSE IF (OPTG.EQ.3) THEN 40.51
XX = 1.E-5 40.51
ELSE 40.51
XX = 0. 40.51
END IF 40.51
IF (.NOT.EQREAL(YOFFS,REAL(YTMP))) THEN 40.51
YY = REAL(YTMP-DBLE(YOFFS))
ELSE IF (OPTG.EQ.3) THEN 40.51
YY = 1.E-5 40.51
ELSE 40.51
YY = 0. 40.51
END IF 40.51
!
RETURN
! * end of subroutine READXY *
END
!***********************************************************************
! *
SUBROUTINE REFIXY (NDS, XX, YY, IERR)
! *
!***********************************************************************
!
USE SWCOMM2 40.41
!
!
! --|-----------------------------------------------------------|--
! | 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.22: John Cazes and Tim Campbell
! 40.51: M. Zijlema
!
! 1. UPDATE
!
! first version: 10.18 (Sept 1994)
!
! 2. PURPOSE
!
! initialize offset values XOFFS and YOFFS, and shift XX and YY
!
! 3. METHOD
!
! ---
!
! 4. PARAMETERLIST
!
! NDS in int file reference number
! XX, YY out real values of x and y taking into account offset
! IERR out int error indicator: IERR=0: no error, =-1: end-
! of-file, =-2: read error
!
! 5. SUBROUTINES CALLING
!
!
!
! 6. SUBROUTINES USED
!
LOGICAL EQREAL
!
! 7. ERROR MESSAGES
!
! ---
!
! 8. REMARKS
!
! ---
!
! 9. STRUCTURE
!
! ----------------------------------------------------------------
! If this is first couple of values
! Then assign values to XOFFS and YOFFS
! make LXOFFS True
! ---------------------------------------------------------------
! make XX and YY equal to x and y taking into account offset
! ----------------------------------------------------------------
!
! 10. SOURCE TEXT
!
DOUBLE PRECISION XTMP, YTMP
REAL XX, YY
SAVE IENT
DATA IENT /0/
CALL STRACE (IENT,'REFIXY')
!
READ (NDS, *, END=10, ERR=20) XTMP, YTMP
IF (.NOT.LXOFFS) THEN
XOFFS = REAL(XTMP)
YOFFS = REAL(YTMP)
LXOFFS = .TRUE.
ENDIF
IF (.NOT.EQREAL(XOFFS,REAL(XTMP))) THEN 40.51
XX = REAL(XTMP-DBLE(XOFFS))
ELSE IF (OPTG.EQ.3) THEN 40.51
XX = 1.E-5 40.51
ELSE 40.51
XX = 0. 40.51
END IF 40.51
IF (.NOT.EQREAL(YOFFS,REAL(YTMP))) THEN 40.51
YY = REAL(YTMP-DBLE(YOFFS))
ELSE IF (OPTG.EQ.3) THEN 40.51
YY = 1.E-5 40.51
ELSE 40.51
YY = 0. 40.51
END IF 40.51
!
IERR = 0
RETURN
! end of file
10 IERR = -1
RETURN
! read error
20 IERR = -2
RETURN
! * end of subroutine REFIXY *
END
!***********************************************************************
! *
LOGICAL FUNCTION INFRAM (XQQ, YQQ)
! *
!***********************************************************************
!
USE OCPCOMM4 40.41
USE SWCOMM1 40.41
!
!
! --|-----------------------------------------------------------|--
! | 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.41: Marcel Zijlema
!
! 1. UPDATE
!
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Checking whether a point given in frame coordinates is located
! in the plotting frame (INFRAM = .TRUE.) or not (INFRAM = .FALSE.)
!
! 3. METHOD
!
! ---
!
! 4. PARAMETERLIST
!
! XQQ REAL input X-coordinate (output grid) of the point
! YQQ REAL input Y-coordinate (output grid) of the point
!
! 5. SUBROUTINES CALLING
!
! SPLSIT, PLNAME
!
! 6. SUBROUTINES USED
!
! none
!
! 7. ERROR MESSAGES
!
! ---
!
! 8. REMARKS
!
! ---
!
! 9. STRUCTURE
!
! ----------------------------------------------------------------
! Give INFRAM initial value true
! IF XQQ < 0, XQQ > XQLEN, YQQ < 0 OR YQQ > YQLEN, THEN
! INFRAM = false
! ----------------------------------------------------------------
!
! 10. SOURCE TEXT
!
SAVE IENT
DATA IENT/0/
IF (LTRACE) CALL STRACE (IENT,'INFRAM')
!
INFRAM = .TRUE.
IF (XQQ .LT. 0.) INFRAM = .FALSE.
IF (XQQ .GT. XQLEN) INFRAM = .FALSE.
IF (YQQ .LT. 0.) INFRAM = .FALSE.
IF (YQQ .GT. YQLEN) INFRAM = .FALSE.
!
RETURN
! * end of function INFRAM *
END
!***********************************************************************
! *
SUBROUTINE DISTR (CDIR, DIR, COEF, SPCDIR) 20.43
! *
!***********************************************************************
!
USE OCPCOMM4 40.41
USE SWCOMM3 40.41
!
!
! --|-----------------------------------------------------------|--
! | 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
!
! 30.82: IJsbrand Haagsma
! 40.22: John Cazes and Tim Campbell
! 40.41: Marcel Zijlema
!
! 1. Updates
!
! 0.1 , Jul. 87: Standard heading added
! 0.2 , Dec. 89: Value for energy outside of the sector changed
! from 0. to 1.E-6
! Oct. 90: Value for energy outside the sector changed to 1.E-10
! logical BDIR introduced to take care for case where
! none of the values is positive
! 30.82, Oct. 98: Updated description of several variables
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Computation of the distribution of the wave energy over the
! sectors, according to the given directional spread.
!
! 3. METHOD
!
! ---
!
! 4. Argument variables
!
! i SPCDIR: (*,1); spectral directions (radians) 30.82
! (*,2); cosine of spectral directions 30.82
! (*,3); sine of spectral directions 30.82
! (*,4); cosine^2 of spectral directions 30.82
! (*,5); cosine*sine of spectral directions 30.82
! (*,6); sine^2 of spectral directions 30.82
!
REAL SPCDIR(MDC,6) 30.82
!
! CDIR REAL output array containing the coefficients of
! (energy) distribution
! DIR REAL input main wave direction, in radians
! COEF REAL input coefficient of the directional distri-
! bution (cos**COEF)
!
! 5. SUBROUTINES CALLING
!
! REINVA (HISWA/SWREAD), STARTB and SWIND (both HISWA/COMPU)
!
! 6. SUBROUTINES USED
!
! none
!
! 7. Common blocks used
!
!
! 8. REMARKS
!
! ---
!
! 9. STRUCTURE
!
! -----------------------------------------------------------------
! For every direction of the grid do
! If the direction deviates less than PI/2 from the main wave
! direction, then
! Compute the coefficient cos**n
! Else
! Coefficient is 1.E-10
! -----------------------------------------------------------------
! If any of the directions deviated less than PI/2
! Then Compute the total of the coefficients
! For every direction of the grid do
! Divide the fraction of the distribution by the total
! -----------------------------------------------------------------
!
! 13. Source text
!
LOGICAL BDIR
REAL CDIR(*)
SAVE IENT
DATA IENT/0/
IF (LTRACE) CALL STRACE (IENT, 'DISTR')
!
SOMC = 0.
BDIR = .FALSE.
DO 10 ID0 = 1, MDC
TETA = SPCDIR(ID0,1)
ACOS = COS(TETA-DIR)
IF (ACOS .GT. 0.) THEN
BDIR = .TRUE.
CDIR(ID0) = MAX (ACOS**COEF, 1.E-10)
SOMC = SOMC + CDIR(ID0)
ELSE
CDIR(ID0) = 1.E-10
ENDIF
10 CONTINUE
IF (BDIR) THEN
CNORM = 1./(SOMC*DDIR)
DO 20 ID0 = 1, MDC
CDIR(ID0) = CDIR(ID0) * CNORM
20 CONTINUE
ENDIF
!
! ***** test *****
! IF(TESTFL .AND. ITEST .GE. 200)
IF( ITEST .GE. 200)
&WRITE(PRINTF,6010) CNORM,(CDIR(JJ) , JJ=1,MDC)
6010 FORMAT (' Test DISTR',F10.3/(10E12.4))
!
RETURN
! * end of subroutine DISTR *
END
!***********************************************************************
! *
SUBROUTINE KSCIP1 (MMT, SIG, D, K, CG, N, ND)
! *
!***********************************************************************
!
USE OCPCOMM4 40.41
USE SWCOMM3 40.41
!
IMPLICIT NONE
!
!
!
! --|-----------------------------------------------------------|--
! | 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
!
! 30.81: Annette Kieftenburg
! 40.22: John Cazes and Tim Campbell
! 40.41: Marcel Zijlema
! 41.16: Greg Wilson
!
! 1. Updates
!
! Aug. 94, ver. 10.10: arguments N and ND added
! Dec. 98, ND corrected, argument list adjusted and IMPLICIT NONE added
! 40.41, Aug. 04: tables replaced by Pade and other formulas
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
! 41.16, Mar. 11: correction: add dk/dh to dn/dh
!
! 2. Purpose
!
! Calculation of the wave number, group velocity, group number N
! and the derivative of N w.r.t. depth (=ND)
!
! 3. Method
!
! --
!
! 4. Argument variables
!
! MMT input number of frequency points
!
INTEGER MMT
!
! CG output group velocity
! D input local depth
! K output wave number
! N output ratio of group and phase velocity
! ND output derivative of N with respect to D
! SIG input rel. frequency for which wave parameters
! must be determined
!
REAL CG(MMT), D,
& K(MMT), N(MMT), ND(MMT), SIG(MMT)
!
! 6. Local variables
!
! C phase velocity
! FAC1 auxiliary factor
! FAC2 auxiliary factor
! FAC3 auxiliary factor
! IENT number of entries
! IS counter in frequency (sigma-space)
! KND dimensionless wave number
! ROOTDG square root of D/GRAV
! WGD square root of GRAV*D
! SND dimensionless frequency
! SND2 = SND*SND
!
INTEGER IENT, IS
REAL KND, ROOTDG, SND, WGD, SND2, C, FAC1, FAC2, FAC3
!
! 8. Subroutines used
!
! --
!
! 9. Subroutines calling
!
! SWOEXA, SWOEXF (Swan/Output)
!
! 10. Error messages
!
! --
!
! 11. Remarks
!
! --
!
! 12. Structure
!
! -----------------------------------------------------------------
! Compute non-dimensional frequency SND
! IF SND >= 2.5, then
! Compute wave number K, group velocity CGO, ratio of group
! and phase velocity N and its derivative ND according to
! deep water theory
! ELSE IF SND =< 1.e-6
! Compute wave number K, group velocity CGO, ratio of group
! and phase velocity N and its derivative ND
! according to extremely shallow water
! ELSE
! Compute wave number K, group velocity CGO and the ratio of
! group and phase velocity N by Pade and other simple formulas.
! Compute the derivative of N w.r.t. D = ND.
! -----------------------------------------------------------------
!
! 13. Source text
!
SAVE IENT
DATA IENT /0/
IF (LTRACE) CALL STRACE (IENT, 'KSCIP1')
!
ROOTDG = SQRT(D/GRAV) 30.81
WGD = ROOTDG*GRAV 30.81
DO 200 IS = 1, MMT
! SND is dimensionless frequency
SND = SIG(IS) * ROOTDG
IF (SND .GE. 2.5) THEN
! ******* deep water *******
K(IS) = SIG(IS) * SIG(IS) / GRAV 30.81
CG(IS) = 0.5 * GRAV / SIG(IS) 30.81
N(IS) = 0.5
ND(IS) = 0.
ELSE IF (SND.LT.1.E-6) THEN
! *** very shallow water *** 30.81
K(IS) = SND/D 30.81
CG(IS) = WGD
N(IS) = 1.
ND(IS) = 0.
ELSE
SND2 = SND*SND 40.41
C = SQRT(GRAV*D/(SND2+1./(1.+0.666*SND2+0.445*SND2**2 40.41
& -0.105*SND2**3+0.272*SND2**4))) 40.41
K(IS) = SIG(IS)/C 40.41
KND = K(IS)*D 40.41
FAC1 = 2.*KND/SINH(2.*KND) 40.41
N(IS) = 0.5*(1.+FAC1) 40.41
CG(IS)= N(IS)*C 40.41
FAC2 = SND2/KND 40.41
FAC3 = 2.*FAC2/(1.+FAC2*FAC2) 40.41
FAC2 = -K(IS)*(2.*N(IS)-1.)/(2.*D*N(IS)) 41.16
ND(IS)= FAC1*(0.5/D - K(IS)/FAC3 + FAC2*(0.5/K(IS) - D/FAC3)) 41.16 40.41
ENDIF
200 CONTINUE
!
RETURN
! end of subroutine KSCIP1 *
END
!***********************************************************************
! *
SUBROUTINE KSCIP2 (MMT, SIG, D, K, CG, N, ND, DMW, DM)
! *
!***********************************************************************
!
USE OCPCOMM4
USE SWCOMM3
!
IMPLICIT NONE
!
!
! --|-----------------------------------------------------------|--
! | 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.59: Erick Rogers
!
! 1. Updates
!
! 40.59, Aug. 07: copy from KSCIP1 and adaption to muddy bottom
!
! 2. Purpose
!
! Calculation of the wave number, group velocity, group number N
! and the derivative of N w.r.t. depth (=ND) in case of muddy bottom
!
! 3. Method
!
! Wave number based on Ng (2000) and other quantities derived thereof
!
! 4. Argument variables
!
! MMT input number of frequency points
!
INTEGER MMT
!
! CG output group velocity
! D input local depth
! DM input local depth of mud layer
! DMW output mud dissipation rate
! (is the imaginary part of the wave number)
! K in/out (the real part of) the wave number
! N output ratio of group and phase velocity
! ND output derivative of N with respect to D
! SIG input rel. frequency for which wave parameters
! must be determined
!
REAL CG(MMT), D, DM,
& K(MMT), N(MMT), ND(MMT), SIG(MMT), DMW(MMT)
!
! 6. Local variables
!
! C phase velocity
! DTILDE normalized mud depth = mud depth / delta_m,
! delta is the sblt= sqrt(2*visc/sigma)
! FAC1 auxiliary factor
! FAC2 auxiliary factor
! FAC3 auxiliary factor
! GAMMA this is the gamma used in Ng pg. 238. this is
! density(water)/density(mud)
! IENT number of entries
! IS counter in frequency space
! KINVISM kinematic viscosity of mud
! KINVISW kinematic viscosity of water
! KMUD (local) muddy wave number
! KND dimensionless wave number
! RHOM density of mud
! RHOW density of water
! SBLTM a function of viscosity and frequency
! ZETA this is zeta as used in Ng pg. 238. it is the
! ratio of Stokes boundary layer thicknesses,
! or delta_m/delta_w
!
INTEGER IENT, IS
REAL C, DTILDE, FAC1, FAC2, FAC3, GAMMA, KINVISM,
& KINVISW, KMUD, KND, RHOM, RHOW, SBLTM, ZETA
!
! 8. Subroutines used
!
! --
!
! 9. Subroutines calling
!
! --
!
! 10. Error messages
!
! --
!
! 11. Remarks
!
! --
!
! 12. Structure
!
! --
!
! 13. Source text
!
SAVE IENT
DATA IENT /0/
IF (LTRACE) CALL STRACE (IENT, 'KSCIP2')
!
RHOM = PMUD(2)
KINVISM = PMUD(3)
RHOW = PMUD(4)
KINVISW = PMUD(5)
!
ZETA = SQRT(KINVISM/KINVISW)
GAMMA = RHOW/RHOM
!
DO IS = 1, MMT
KND = K(IS)*D
IF ( KND.LT.10. .AND. DM.GT.1.E-5 ) THEN
SBLTM = SQRT(2.*KINVISM/SIG(IS))
DTILDE = DM/SBLTM
! calculate muddy wave number and dissipation rate using Ng (2000)
CALL NG(SIG(IS),D,DTILDE,ZETA,SBLTM,GAMMA,K(IS),KMUD,DMW(IS))
K(IS) = KMUD
! calculate ratio N, CG and derivative of N w.r.t. D
KND = K(IS)*D
IF ( KND.LT.35. ) THEN
FAC1 = 2.*KND/SINH(2.*KND)
ELSE
FAC1 = 2.E-30*KND
ENDIF
N(IS) = 0.5*(1.+FAC1)
C = SIG(IS)/K(IS)
CG(IS) = N(IS)*C
FAC2 = SIG(IS) * C / GRAV
FAC3 = 2.*FAC2/(1.+FAC2*FAC2)
FAC2 = -K(IS)*(2.*N(IS)-1.)/(2.*D*N(IS))
ND(IS) = FAC1*(0.5/D - K(IS)/FAC3 + FAC2*(0.5/K(IS) - D/FAC3))
ELSE
DMW(IS)= 0.
ENDIF
ENDDO
!
RETURN
! end of subroutine KSCIP2 *
END
!************************************************************************
! *
SUBROUTINE NG(SIGMA,H_WDEPTH,DTILDE,ZETA,SBLTM,GAMMA,WK,WKDR,DISS)
! *
!************************************************************************
!
USE OCPCOMM4
!
IMPLICIT NONE
!
!
! --|-----------------------------------------------------------|--
! | 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
!
! 1.00: Jim Kaihatu
! 40.??: Erick Rogers
! 40.59: Erick Rogers
!
! 1. Updates
!
! 1.00, Dec. 04: original
! 40.??, Mar. 05: adapted for SWAN
! 40.59, Aug. 07: included patch provided by Jim Kaihatu
! and finalized
!
! 2. Purpose
!
! Computes the muddy wavenumber using Ng (2000)
!
! 3. Method
!
! Reference: Ng, C.O., 2000. Water waves over a muddy bed:
! a two-layer Stokes boundary layer model
! Coastal Engineering 40(3), 221-242
!
! 4. Argument variables
!
REAL, INTENT(IN) :: SIGMA ! radian frequency (rad)
REAL, INTENT(IN) :: H_WDEPTH! water depth, denoted "h" in Ng (m)
REAL, INTENT(IN) :: DTILDE ! normalized mud depth = mud depth / SBLTM,
! delta is the sblt= sqrt(2*visc/sigma)
REAL, INTENT(IN) :: ZETA ! this is zeta as used in Ng pg. 238. it is
! the ratio of Stokes boundary layer
! thicknesses, or SBLTM/delta_w
REAL, INTENT(IN) :: GAMMA ! this is the gamma used in Ng pg. 238.
! this is density(water)/density(mud)
REAL, INTENT(IN) :: SBLTM ! SBLTM is what you get if you calculate
! sblt using the viscosity of the mud,
! SBLTM=sqrt(2*visc_m/sigma)
! .....also delta_m
REAL, INTENT(IN) :: WK ! unmuddy wavenumber
REAL, INTENT(OUT) :: WKDR ! muddy wavenumber
REAL, INTENT(OUT) :: DISS ! dissipation rate
!
! 5. Local variables
!
INTEGER :: IENT
REAL :: B1 ! an Ng coefficient
REAL :: B2 ! an Ng coefficient
REAL :: B3 ! an Ng coefficient
REAL :: BR ! an Ng coefficient
REAL :: BI ! an Ng coefficient
REAL :: BRP ! an Ng coefficient
REAL :: BIP ! an Ng coefficient
REAL :: DM ! mud depth, added June 2 2006
!
! 11. Remarks
!
! Calculations for the "B coefficients" came from a code by Jim Kaihatu
!
! 13. Source text
!
SAVE IENT
DATA IENT/0/
IF (LTRACE) CALL STRACE (IENT,'NG')
!
DM=DTILDE*SBLTM ! DTILDE=DM/SBLTM