-
Notifications
You must be signed in to change notification settings - Fork 0
/
swanpre1.ftn
6229 lines (6188 loc) · 298 KB
/
swanpre1.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/READ file 1 of 2
!
! Contents of this file:
!
! SWREAD: Reading and processing of the user commands describing the model
! SINPGR: Read parameters of an input grid
! SREDEP
! SSFILL
! CGINIT
! SWDIM
! CGBOUN determines boundary of true computational region
! INITVA: Processing command INIT and compute initial state of 30.70
! the wave field 30.70
! BACKUP 40.00
!
!***********************************************************************
! *
SUBROUTINE SWREAD (COMPUT) 40.31 30.90
! *
!***********************************************************************
! Modules
USE TIMECOMM 40.41
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
USE SWCOMM1 40.41
USE SWCOMM2 40.41
USE SWCOMM3 40.41
USE SWCOMM4 40.41
USE OUTP_DATA 40.13
USE M_SNL4 40.17
USE M_GENARR 40.31
USE M_OBSTA 40.31
USE M_PARALL 40.31
USE SwanGriddata 40.80
!
IMPLICIT NONE
!
!
! --|-----------------------------------------------------------|--
! | Delft University of Technology |
! | Faculty of Civil Engineering |
! | 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-2016 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 2 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.
!
! A copy of the GNU General Public License is available at
! http://www.gnu.org/copyleft/gpl.html#SEC3
! or by writing to the Free Software Foundation, Inc.,
! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
!
!
! 0. Authors
!
! 30.60: Nico Booij
! 30.61: Roberto Padilla
! 30.70: Nico Booij
! 30.72: IJsbrand Haagsma
! 30.74: IJsbrand Haagsma (Include version)
! 30.75: Nico Booij
! 30.80: Nico Booij
! 30.81: Annette Kieftenburg
! 30.82: IJsbrand Haagsma
! 30.90: IJsbrand Haagsma
! 32.01: Roeland Ris & Cor van der Schelde
! 32.02: Roeland Ris & Cor van der Schelde (1D-version)
! 32.06: Roeland Ris
! 33.08: W. Erick Rogers
! 33.09: Nico Booij
! 33.10: W. Erick Rogers and Nico Booij
! 34.01: Jeroen Adema
! 40.00: Nico Booij
! 40.02: IJsbrand Haagsma
! 40.03: Nico Booij
! 40.09: Annette Kieftenburg
! 40.10: IJsbrand Haagsma
! 40.12: IJsbrand Haagsma
! 40.13: Nico Booij
! 40.14: Annette Kieftenburg
! 40.16: IJsbrand Haagsma
! 40.17: IJsbrand Haagsma
! 40.18: Annette Kieftenburg
! 40.21: Agnieszka Herman
! 40.23: Marcel Zijlema
! 40.28: Annette Kieftenburg
! 40.30: Marcel Zijlema
! 40.38: Annette Kieftenburg
! 40.08: W. Erick Rogers
! 40.31: Marcel Zijlema
! 40.35: Nico Booij
! 40.41: Marcel Zijlema
! 40.51: Marcel Zijlema
! 40.55: Marcel Zijlema
! 40.80: Marcel Zijlema
! 40.87: Marcel Zijlema
! 41.65: Marcel Zijlema
!
! 1. Updates
!
! 30.60, July 97: command CGRID, exception values added
! 30.60, Aug. 97: JCOOX and JCOOY used when addingco ordinate arrays change in
! command BOUND option SEGM
! 30.60, Aug. 97: PNUMS(20) is set to 0.1 in command WIND if third generation
! is used
! 30.60, Aug. 97: argument XYTST added in call of SWDIM
! 30.60, Aug. 97: activate initial condition in commands WIND and GEN3
! 30.60, Aug. 97: command CGRID, default keyword is REG keyword EXC is not
! required
! 30.60, Aug. 97: command OBST, names changed into ALPHA and BETA; control
! strings changed from UNC into STA
! 30.60, Aug. 97: uncommented statement CALL WRNKEY
! 30.70, Sep. 97: value of PWTAIL(1) is set to 5 in command GEN3 JANS,
! GROWTH JANS and WCAP JANS
! 30.72, Oct. 97: logical function EQREAL introduced for floating point
! comparisons
! 30.72, Nov. 97: Added the command syntax for all the commands as comments
! from the user manual
! 30.72, Nov. 97: Header renewed, updated method and argument variable
! description
! 30.72, Nov. 97: Did set the correct pointers for command GEN3 JANS, as
! was already done correctly for command WCAP JANS
! 30.74, Nov. 97: Prepared for version with INCLUDE statements
! 30.72, Jan. 98: Removed reference to quadruplets in WIND command
! 32.01, Jan. 98: Introduced SET NAUT command (project h3268)
! 32.01, Jan. 98: Introduced keyword CON/VAR in command
! BOU STAT ... SPEC1D/SPEC2D
! 30.72, Jan. 98: Moved BOU NONSTAT non operational warning to end of
! command BOU
! 30.72, Jan. 98: Changed size of JAUX(7) array to MCGRD
! 32.01, Jan. 98: Modifications for nautical convention, interpolation of
! spectra at the boundary and warning (project h3268)
! 32.02, Feb. 98: Introduced 1D-version
! 30.70, Feb. 98: MODE DYN modified into MODE NONSTationary
! option WINDGrowth added in command OFF
! Nautical convention introduced into command CGRID (sector)
! in command SET name 'negmes' changed into 'maxmes'
! 30.72, Mar. 98: Leave limiter on when ITRIAD > 0 in command OFF QUAD
! 30.70, Mar. 98: option CON/VAR after options SPEC1D/SPEC2D
! keyword STAT made optional
! name GRWMX changed into LIMITER
! assignment of limiter in command OFF QUAD corrected
! 30.75, Mar. 98: set ICOND=1 (default init.cond.) for nonstationary mode
! 30.82, Apr. 98: removed reference to commons KAART and KAR
! 40.00, Sep. 98: in command OBST square of TRCOEF is stored (this is used
! as transmission coefficient for action density)
! 30.90, Oct. 98: Introduced EQUIVALENCE POOL-arrays
! 30.81, Nov. 98: Adjustment for 1-D case of new boundary conditions
! 30.80, Nov. 98: Provision for limitation on Ctheta (refraction)
! 40.00, Jan. 99: new command OUTPUT QUANTITY: allows user to change
! properties of output quantities.
! 34.01, Feb. 99: Introducing STPNOW
! 30.82, Mar. 99: Deactivate limiter for GEN1 and GEN2
! 40.00, Apr. 99: restructure command MODE: Nonstat Oned is now possible
! 33.08, July 98: input for model with higher order "S&L" scheme.
! 33.09, Aug. 98: input for spherical coordinates
! 32.06, June 99: Set correct values for IGEN
! 30.82, Aug. 99: Modified default values for PTRIAD, after deactivating
! limiter for only the triads.
! 30.82, Aug. 99: Modified command NUM to include settings for the SETUP
! and the global stop criterion
! 40.01, Sep. 99: XASM and YASM replace fixed numbers
! 40.03, Dec. 99: command QUANTITY corrected
! 40.10, Mar. 00: prepared for exact quadruplets
! 33.10, Jan. 00: input for model with higher order "SORDUP" scheme
! 40.03, May 00: command INCLude added, array INCNUM added
! 40.09, May 00: TRCOEF**2 replaced by TRCOEF (to make command options
! TRANSM and DAM consistent with one another in subroutine
! SWTRCOEF in swanser)
! 40.09, May. 00: Reflection command option added
! 40.03, Aug. 00: error message if start time is before current time (command COMP)
! Sep. 00: inconsistency with manual corrected
! 40.02, Sep. 00: Changed SCHEME command to PROP and handling [cdlim] modified
! 40.02, Oct. 00: In case of Nautical directions then output in not w.r.t. frame
! 40.02, Oct. 00: Recalculate whitecapping coefficients for new SWCAP routine
! 40.02, Oct. 00: Avoided real/int conflict by introducing RPOOL in SREDEP
! 40.02, Oct. 00: Avoided real/int conflict by introducing replacing
! RPOOL for POOL in various calls
! 40.02, Oct. 00: Initialisation of IERR
! 40.12, Feb. 01: Avoided type conflict for OUTPS
! 40.18, Apr. 01: Reflection option extended
! 40.13, July 01: reading of PTRIAD(4) added in command TRIad
! command OUTPut OPTions added; module OUTP_DATA added
! command OUTPUT QUANTITY is made obsolete
! 40.13, Aug. 01: [xpc] and [ypc] are required in case of spherical coordinates
! [ylenc] and [myc] not required in 1-D mode
! 40.13, Oct. 01: USE OUTP_DATA added in view of longer filenames
! 40.13, Oct. 01: value of SPDIR1 in full circle case changed
! 40.13, Nov. 01: size of array BSPAUX increased
! 40.13, Nov. 01: command OUTPUT OPTIONS added
! 40.18, Apr. 01: Reflection option extended, scatter
! 40.28, Dec. 01: Reflection option extended, freq. dep.
! 40.38, Feb. 02: Reflection option extended, diffuse
! 40.14, Dec. 01: Extra check on user defined coefficients added
! 40.16, Dec. 01: Implemented limiter switches
! 40.17, Dec. 01: Implemented Multiple DIA
! 40.21, Aug. 01: Diffraction option added
! 40.23, Aug. 02: under-relaxation factor added
! 40.23, Sep. 02: coefficient urslim must be stored in PTRIAD(5)
! 40.23, Nov. 02: keyword FLUXLIM added
! 40.30, Feb. 03: introduction distributed-memory approach using MPI
! 40.08, Mar. 03: warning message added for use of curvilinear
! coordinate system
! 40.31, Dec. 03: removing POOL-mechanism
! 40.35, Jun. 04: introducing turbulent viscosity model
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
! 40.51, Jun. 06: correct input of MDIA
! 40.55, Dec. 05: introducing vegetation model
! 40.80, Jun. 07: extension to unstructured grids
! 40.87, Apr. 08: in keyword QUANTITY more than 1 output parameter at once
! is possible and addition of [fmin] and [fmax]
! 41.65, Jun. 16: extension frequency and direction dependent tranmission coefficients
!
! 2. Purpose
!
! Reading and processing of the user commands describing the model
!
! 3. Method (updated 30.72)
!
! A new line is read, in which the first keyword determines what the
! command is. The command is read and processed. Common variable are
! given proper values. After processing
! the command the program returns to label 100, to process a new command.
! This is repeated until the command STOP is found or the end of file is
! reached.
!
! Depending on the commands, the argument variable COMPUT is given a value,
! depending on which the program will make a computation is some form or not.
!
! 4. Argument variables (updated 30.72)
!
! COMPUT Output variable that determine the sort of computation to be
! performed by SWAN
! ='COMP'; computation requested
! ='NOCO'; no computation but output requested
! ='RETR'; retrieve data previous computation
! ='STOP'; make computation, output and stop
!
! 5. Parameter variables
!
INTEGER, PARAMETER :: MXINCL = 10 40.03
INTEGER, PARAMETER :: NVOTP = 15 40.87
!
! 6. Local variables
!
! DUM Dummy variable 40.18
! FD1 Coeff. for freq. dep. reflection: vertical displacement 40.28
! FD2 Coeff. for freq. dep. reflection: shape parameter 40.28
! FD3 Coeff. for freq. dep. reflection: directional coefficient 40.28
! FD4 Coeff. for freq. dep. reflection: bending point of freq. 40.28
! ICNL4 Counter for reading CNL4_? values 40.17
! ILAMBDA Counter for reading LAMBDA values 40.17
! INCLEV Include level, increases at INCL command, 40.03
! decreases at end-of-file 40.03
! INCNUM Unit reference numbers of included files 40.03
! ITMP1 auxiliary integer 40.31
! ITMP2 auxiliary integer 40.31
! ITMP3 auxiliary integer 40.31
! ITMP4 auxiliary integer 40.31
! LREF Indicates whether reflection is active (#0.) or not (=0.) 40.09
! LREFDIFF Indicates whether scattered reflection is active (#0.) 40.18
! or not (=0.) 40.18
! LRFRD Indicates whether frequency dependent reflection is 40.28
! active (#0.) or not (=0.) 40.28
! MORE Indicates whether more entries of a loop need to be 40.17
! performed 40.17
! POWN user defined power of redistribution function 40.18
! RLAMBDA Dummy array containing lambda values for quadruplets 40.17
!
INTEGER :: MPTST,IPP,NLEN,ITRAS,JJ,IGR2,IGRD,MXS,MYS
INTEGER :: IVAL,NUMCOR,MSS,I,J,NVAR,IVTYPE,IFTMAX
REAL :: TRCF,HGT,SLP,BK,OGAM,OBET,REF0,XP,YP
REAL :: ALTMP,FRLOW,FRHIG,DIFF,GAMMA,TMPDIR,VALX,VALY
REAL :: DEGCNV
REAL :: HH, CC, DD
INTEGER :: NN
!
INTEGER, SAVE :: INCNUM(1:MXINCL) = 0 40.03
INTEGER, SAVE :: INCLEV = 1 40.03
!
INTEGER :: IOSTAT = 0 40.02
INTEGER :: ICNL4, ILAMBDA 40.17
INTEGER :: ITMP1, ITMP2, ITMP3, ITMP4 40.31
!
LOGICAL :: MORE 40.17
LOGICAL, SAVE :: LOBST = .FALSE. 40.31
!
INTEGER :: LREF, LREFDIFF, LRFRD 40.31
REAL :: POWN, DUM 40.31 40.18
REAL :: FD1, FD2, FD3, FD4 40.31 40.28
REAL, ALLOCATABLE :: RLAMBDA(:) 40.17
CHARACTER*6 QOVSNM 40.87
CHARACTER*40 QOVLNM 40.87
REAL QR(9) 40.87
TYPE(OBSTDAT), POINTER :: OBSTMP 40.31
TYPE(OBSTDAT), SAVE, POINTER :: COBST 40.31
TYPE(OPSDAT), POINTER :: OPSTMP 40.31
TYPE XYPT 40.31
REAL :: X, Y
TYPE(XYPT), POINTER :: NEXTXY
END TYPE XYPT
TYPE(XYPT), TARGET :: FRST 40.31
TYPE(XYPT), POINTER :: CURR, TMP 40.31
TYPE AUXT 40.87
INTEGER :: I 40.87
TYPE(AUXT), POINTER :: NEXTI 40.87
END TYPE AUXT 40.87
TYPE(AUXT), TARGET :: FRSTQ 40.87
TYPE(AUXT), POINTER :: CURRQ, TMPQ 40.87
TYPE VEGPT 40.55
INTEGER :: N 40.55
REAL :: H, D, C 40.55
TYPE(VEGPT), POINTER :: NEXTV 40.55
END TYPE VEGPT 40.55
TYPE(VEGPT), TARGET :: FRSTV 40.55
TYPE(VEGPT), POINTER :: CURRV, TMPV 40.55
TYPE TRCFPT 41.65
REAL :: C 41.65
TYPE(TRCFPT), POINTER :: NEXTFT 41.65
END TYPE TRCFPT 41.65
TYPE(TRCFPT), TARGET :: FRSTFT 41.65
TYPE(TRCFPT), POINTER :: CURRFT, TMPFT 41.65
!
! 8. Subroutines used
!
! DEGCNV: Transforms dir. from nautical to cartesian or vice versa 32.01
! INITVA: Processing comm. INIT and comp. initial state of wave field 30.70
! SINPGR: Read parameters of an input grid
! SWINIT
! REINC
! SWRBC
! SREDEP
! SPRCON
! SPROUT
! RETSTP read test points 40.00
! SWNDPR (SWAN/SWREAD)
! OCPINI
! NWLINE
! INKEYW
! INCSTR
! ININTG
! INREAL
! FOR
! KEYWIS
LOGICAL :: KEYWIS 40.03
! COPYCH
LOGICAL :: EQREAL 40.00
! (all Ocean Pack)
!
LOGICAL STPNOW 34.01
!
! 9. Subroutines calling
!
! SWMAIN
!
! 10. Error messages
!
! ---
!
! 11. Remarks
!
! The description of the structure of this subroutine is very
! short as most of the source code can easily be understood with
! the aid of the command descriptions in the user manual and the
! purpose of the subroutines from the system documentation.
!
! 12. Structure
!
! ----------------------------------------------------------------
! Call NWLINE for reading new line of user input
! Call INKEYW to read a new command from user input
! If the command is equal to one of the SWAN commands, then
! Read and process the rest of the command
! ----------------------------------------------------------------
!
! 13. Source text
!
LOGICAL :: FOUND 40.03
LOGICAL, SAVE :: RUNMADE = .FALSE. 40.03
!
! *** The logical variable LOGCOM has a record about which ***
! *** commands have been given to know if all the information ***
! *** for certain command is available: *** 40.31
! *** LOGCOM(2): command CGRID has been carried out *** 40.31
! *** LOGCOM(3): command READINP BOTTOM has been carried out *** 40.31
! *** LOGCOM(4): command READ COOR has been carried out *** 40.31
! *** LOGCOM(5): command READ UNSTRUC has been carried out *** 40.80
! *** LOGCOM(6): array AC2 has been allocated *** 40.31
! *** In the current version, LOGCOM(1) has no meanings *** 40.80 40.31
!
LOGICAL, SAVE :: LOGCOM(1:6) = .FALSE. 40.03
INTEGER TIMARR(6) 40.31 30.00
CHARACTER PSNAME *8, PNAME *8, COMPUT *(*), PTYPE *1, DTTIWR *18 40.00
INTEGER, SAVE :: IENT = 0 ! number of entries to this subr
INTEGER, SAVE :: LWINDR = 0 ! if non-zero, there is wind
INTEGER, SAVE :: LWINDM = 3 ! type of wind growth formulation
INTEGER, ALLOCATABLE :: IARR(:) 40.31
INTEGER IVOTP(NVOTP), INDX(1) 40.87
DATA IVOTP /10, 11, 13, 15, 16, 17, 18, 19, 40.87
& 28, 32, 33, 42, 43, 47, 48 / 40.87
CALL STRACE (IENT, 'SWREAD')
!
! ***** read command *****
!
100 CALL NWLINE
IF (ELTYPE.EQ.'EOF') THEN
! end-of-file encountered in (included) input file 40.03
! return to previous input file
CLOSE (INCNUM(INCLEV)) 40.03
INCLEV = INCLEV - 1
IF (INCLEV.EQ.0) THEN
CALL MSGERR (4, ' unexpected end of command input') 40.03
RETURN
ENDIF
ELTYPE = 'USED'
INPUTF = INCNUM(INCLEV) 40.03
ENDIF
!
IF ( ITEST .GE. 200) THEN 30.70
WRITE (PRTEST,*) ' BNAUT NA LABEL 100 IN SWREAD =', BNAUT 32.01
ENDIF 32.01
!
CALL INKEYW ('REQ',' ')
!
! ------------------------------------------------------------------
! PROCESSING OF COMMANDS
! ------------------------------------------------------------------
!
! STOP 30.21
!
! ============================================================
!
! STOP
!
! ============================================================
!
IF (KEYWIS ('STOP')) THEN
IF (RUNMADE) THEN
COMPUT = 'STOP'
ELSE
WRITE (PRINTF,*)' ** No computation requested **'
COMPUT = 'NOCO'
ENDIF
RETURN
ENDIF
!
! ------------------------------------------------------------------
!
! PROJECT reading of project title and description
!
! ===============================================================
!
! PROJect 'NAME' 'NR'
!
! 'title1'
!
! 'title2'
!
! 'title3'
!
! ===============================================================
!
IF (KEYWIS ('PROJ')) THEN
CALL INCSTR ('NAME', PROJID, 'UNC', BLANK)
CALL INCSTR ('NR', PROJNR, 'REQ', BLANK)
CALL NWLINE
IF (STPNOW()) RETURN 34.01
CALL INCSTR ('TITLE1',PROJT1,'UNC',' ')
CALL NWLINE
IF (STPNOW()) RETURN 34.01
CALL INCSTR ('TITLE2',PROJT2,'UNC',' ')
CALL NWLINE
IF (STPNOW()) RETURN 34.01
CALL INCSTR ('TITLE3',PROJT3,'UNC',' ')
GOTO 100
ENDIF
!
! INCLUDE include another file in command file
! ------------------------------------------------------------------
! INCLude 'FILE'
! ------------------------------------------------------------------
!
IF (KEYWIS ('INCL')) THEN
IF (INCLEV.EQ.1) INCNUM(INCLEV) = INPUTF 40.03
CALL INCSTR ('FILE' , FILENM , 'REQ', ' ')
INCLEV = INCLEV + 1
IF (INCLEV.GT.MXINCL) THEN
CALL MSGERR (4, 'too many INCLUDE levels') 40.03
RETURN
ENDIF
IOSTAT = 0
CALL FOR (INCNUM(INCLEV), FILENM, 'OF', IOSTAT) 40.03
INPUTF = INCNUM(INCLEV)
GOTO 100
ENDIF
!
! ===========================================================
!
! POOL
!
! ===========================================================
!
IF (KEYWIS ('POOL')) THEN
CALL MSGERR(1,'Keyword POOL is not relevant anymore!') 40.31
GOTO 100
ENDIF
!
! ------------------------------------------------------------------
! TEST parameters for required test output
!
! =============================================================
!
! / -> IJ < [i] [j] > | < [k] > \
! TEST [itest] [itrace] POINTS < > &
! \ XY < [x] [y] > /
!
! PAR 'fname' S1D 'fname' S2D 'fname'
!
! ============================================================
!
IF (KEYWIS ('TEST')) THEN
CALL ININTG ('ITEST' , ITEST , 'STA', 30)
! statements restructured:
IF (ITEST.GE.30) THEN
IF (ERRPTS.EQ.0.AND.IAMMASTER) THEN 40.95 40.30 40.13
ERRPTS = 16
OPEN (ERRPTS, FILE='ERRPTS',
& STATUS='UNKNOWN', FORM='FORMATTED')
ENDIF 40.13
ENDIF
CALL ININTG ('ITRACE', ITRACE, 'UNC', 0)
IF (ITRACE.GT.0) THEN
LTRACE =.TRUE.
ELSE
LTRACE =.FALSE.
ENDIF
CALL INKEYW ('STA', ' ')
IF (KEYWIS('POI')) THEN
NPTST = 0
MPTST = 50
IPP = 2 40.80
IF (OPTG.EQ.5) IPP = 1 40.80
IF (.NOT.ALLOCATED(IARR)) ALLOCATE(IARR(IPP*MPTST)) 40.80 40.31
!
CALL RETSTP (IPP*MPTST, IARR, KGRPNT, KGRBND, XCGRID, YCGRID, 40.80 40.31
& SPCSIG, SPCDIR) 40.31
IF (STPNOW()) RETURN 34.01
NPTSTA = MAX(1,NPTST) 40.00
IF (.NOT.ALLOCATED(XYTST)) ALLOCATE(XYTST(IPP*NPTSTA)) 40.80 40.31
CALL SWCOPI (IARR,XYTST,IPP*NPTSTA) 40.80 40.31
DEALLOCATE(IARR) 40.31
ELSE
IF (.NOT.ALLOCATED(XYTST)) ALLOCATE(XYTST(0))
ENDIF
GOTO 100
ENDIF
!
! ------------------------------------------------------------------
!
! INTEst parameters for required test output during input
!
! ============================================================
!
! INTE [intes] (NOT documented)
!
! ============================================================
!
IF (KEYWIS ('INTE')) THEN
CALL ININTG ('INTES' , INTES , 'STA', 30)
GO TO 100
ENDIF
! ------------------------------------------------------------------
! COTEst parameters for required test output during computation
!
! ============================================================
!
! COTE [cotes] (NOT documented)
!
! ============================================================
IF (KEYWIS ('COTE')) THEN
CALL ININTG ('COTES' , ICOTES , 'STA', 30)
GO TO 100
ENDIF
!
! ------------------------------------------------------------------
!
! OUTEst parameters for required test output during output
!
! ============================================================
!
! OUTE [itest] (NOT documented)
!
! ============================================================
!
IF (KEYWIS ('OUTE')) THEN
CALL ININTG ('ITEST' , IOUTES , 'STA', 30)
GO TO 100
ENDIF
! ============================================================
! OUTPut OPTIons 'comment' (TABle [field]) (BLOck [ndec] [len]) &
! (SPEC [ndec])
! ============================================================
IF (KEYWIS('OUTP')) THEN 40.13
CALL IGNORE ('OPT')
CALL INCSTR ('COMMENT', OUT_COMMENT, 'UNC', ' ')
CALL INKEYW ('STA', ' ')
IF (KEYWIS('TAB')) THEN
CALL ININTG ('FIELD', FLD_TABLE, 'STA', 11)
IF (FLD_TABLE.GT.16) CALL MSGERR (2, '[field] is too large')
IF (FLD_TABLE.LT.8) CALL MSGERR (2, '[field] is too small')
WRITE (FLT_TABLE, 232) FLD_TABLE, FLD_TABLE-7
232 FORMAT ('(E', I2, '.', I1, ')')
IF (ITEST.GE.30) WRITE (PRINTF, 234) FLT_TABLE
234 FORMAT (' Format floating point table: ', A)
CALL INKEYW ('STA', ' ')
ENDIF
IF (KEYWIS('BLO')) THEN
CALL ININTG ('NDEC', DEC_BLOCK, 'STA', 4)
IF (DEC_BLOCK.GT.9) CALL MSGERR (2, '[ndec] is too large')
CALL ININTG ('LEN', NLEN, 'STA', 200)
IF (NLEN.GT.9999) CALL MSGERR (2, '[len] is too large')
WRITE (FLT_BLOCK, 242) NLEN, DEC_BLOCK+7, DEC_BLOCK
242 FORMAT ('(', I4, '(1X,E', I2, '.', I1, '))')
IF (ITEST.GE.30) WRITE (PRINTF, 244) FLT_BLOCK
244 FORMAT (' Format floating point block: ', A)
CALL INKEYW ('STA', ' ')
ENDIF
IF (KEYWIS('SPEC')) THEN
CALL ININTG ('NDEC', DEC_SPEC, 'STA', 5)
IF (DEC_SPEC.GT.9) CALL MSGERR (2, '[ndec] is too large')
CALL ININTG ('LEN', NLEN, 'STA', 200)
IF (NLEN.GT.9999) CALL MSGERR (2, '[len] is too large')
WRITE (FIX_SPEC, 252) NLEN, DEC_SPEC
252 FORMAT ('(', I4, '(1X,I', I1, '))')
IF (ITEST.GE.30) WRITE (PRINTF, 254) FIX_SPEC
254 FORMAT (' Format spectral output: ', A)
LENSPO = NLEN*(DEC_SPEC+1)
ENDIF
IF (KEYWIS('QUA')) THEN
CALL MSGERR (3,
& 'command OUTP QUANT is obsolete, use QUANTITY')
ENDIF
GOTO 100
ENDIF 40.13
!
! ------------------------------------------------------------------
!
! BOTTOM definition of bottom grid
!
! ============================================================
!
! BOTtom ... (OBSOLETE command)
!
! ============================================================
!
IF (KEYWIS ('BOT')) THEN
CALL MSGERR (2, 'command BOTTOM is replaced by INP BOT')
GOTO 100
ENDIF
!
! ------------------------------------------------------------------
!
! MODE : Set STATionary, DYNamic (NONSTAtionary) or 1D SWAN model 32.02
!
! ========================================
!
! | -> STAtionary | | -> TWODimensional | 40.00
! MODE < > < > (NOUPDATe) 40.07
! | NONSTationary | | ONEDimensional | 40.00
!
! ========================================
!
IF (KEYWIS ('MODE')) THEN 30.21
CALL INKEYW ('STA',' ')
IF (KEYWIS('NONST') .OR. KEYWIS ('DYN')) THEN 30.70
IF (NSTATM.EQ.0) CALL MSGERR (2, 'Mode Nonst incorrect here') 40.00
NSTATM = 1 40.00
NSTATC = 1 40.00
!
! switch on flag for computation of default initial condition 30.75
ICOND = 1 30.75
! no relaxation 40.23
PNUMS(30) = 0. 40.23
ELSEIF (KEYWIS ('STA')) THEN 40.00
IF (NSTATM.EQ.1) CALL MSGERR (2, 'Mode STAT incorrect here') 40.00
NSTATM = 0 40.00
CALL INKEYW ('STA',' ') 32.02
ENDIF 32.02
!
! *** Logical ONED added for 1d-computations 32.02
!
CALL INKEYW ('STA', ' ') 40.00
IF (KEYWIS ('ONED')) THEN 40.00
ONED = .TRUE. 32.02
IF (PARLL) THEN 40.30
CALL MSGERR(4,'1D mode is not supported in parallel run') 40.30
RETURN 40.30
END IF 40.30
ELSEIF (KEYWIS ('TWOD')) THEN
ONED = .FALSE. 32.02
ENDIF
!
! *** Logical ACUPDA added to avoid updating action densities 40.07
!
CALL INKEYW ('STA', ' ') 40.07
IF (KEYWIS ('NOUPDAT')) THEN 40.07
ACUPDA = .FALSE. 40.07
ENDIF
!
GOTO 100
ENDIF
!
! ------------------------------------------------------------------
! =======================================================================
!
! | BSBT |
! PROP < | SEC | |
! | GSE [waveage] < MIN > |
! | | HR | |
! | | DAY | |
!
! FLUXLIM
!
! =======================================================================
!
IF (KEYWIS ('PROP')) THEN 40.02
CALL INKEYW ('STA',' ') 40.02
IF (KEYWIS ('BSBT') .OR. KEYWIS ('BTBS')) THEN 40.02
PROPSN = 1 40.02
PROPSS = 1 40.02
ELSE IF (KEYWIS ('GSE')) THEN 40.02
IF (OPTG.NE.5 .AND. PROPSN.NE.3) THEN 41.00 40.02
CALL MSGERR(2, 40.02
& 'Anti-GSE only allowed for S&L scheme.') 40.02
ENDIF 40.02
CALL ININTV('WAVEAGE', WAVAGE, 'STA', 0.) 40.02
ENDIF 40.02
IF (KEYWIS ('FLUXLIM')) THEN 40.23
PROPFL = 1 40.23
PNUMS(6) = 0. 40.23
END IF 40.23
GOTO 100 40.02
ENDIF 40.02
!
! ------------------------------------------------------------------
!
! COORD : spherical or cartesian coordinates
!
! =============================================================
!
! COORDinates / -> CARTesian \ REPeating
! \ SPHErical [rearth] UM/QC /
!
! =============================================================
!
IF (KEYWIS ('COORD')) THEN 33.09
CALL INKEYW ('STA',' ') 33.09
IF (KEYWIS ('CART')) THEN 33.09
KSPHER = 0 33.09
ELSE IF (KEYWIS ('SPHE')) THEN 33.09
KSPHER = 1 33.09
CALL INREAL ('REARTH', REARTH, 'UNC', 0.) 33.09
LENDEG = REARTH * PI / 180. 33.09
! change properties of output quantities Xp and Yp
OVUNIT(1) = 'degr'
OVLLIM(1) = -200.
OVULIM(1) = 400.
OVLEXP(1) = -180.
OVHEXP(1) = 360.
OVEXCV(1) = -999.
OVUNIT(2) = 'degr'
OVLLIM(2) = -100.
OVULIM(2) = 100.
OVLEXP(2) = -90.
OVHEXP(2) = 90.
OVEXCV(2) = -999.
CALL INKEYW ('STA','CCM') 33.09
IF (KEYWIS ('QC')) THEN 33.09
! quasi-cartesian projection method
PROJ_METHOD = 0 33.09
ELSE IF (KEYWIS ('CCM')) THEN 33.09
! uniform Mercator projection (default for spherical coordinates)
PROJ_METHOD = 1 33.09
ENDIF 33.09
ELSE 33.09
CALL WRNKEY
ENDIF 33.09
CALL INKEYW ('STA',' ') 33.09
IF (KEYWIS ('REP')) THEN 33.09
KREPTX = 1 33.09
ENDIF 33.09
GO TO 100 33.09
ENDIF 33.09
!
! ------------------------------------------------------------------
!
! ** Command COMPUTE ** 30.00
!
! ==============================================================
!
! | STATionary [time] |
! COMPute ( < > ) 40.00
! | | -> Sec | |
! | ([tbegc] [deltc] < MIn > [tendc]) |
! | HR |
! | DAy |
!
! ==============================================================
!
IF (KEYWIS ('COMP')) THEN
COMPUT = 'COMP' 30.00
RUNMADE = .TRUE. 30.00
CALL INKEYW ('STA',' ')
IF (NSTATM.LE.0 .OR. KEYWIS('STAT')) THEN 40.00
IF (NSTATM.EQ.-1) NSTATM = 0 40.00
IF (NSTATM.GT.0) CALL INCTIM (ITMOPT,'TIME',TINIC,'REQ',0.) 40.00
IF (TINIC .LT. TIMCO) THEN 40.03
CALL MSGERR (2, '[time] before current time') 40.03
TINIC = TIMCO 40.03
ENDIF 40.03
TFINC = TINIC 40.00
TIMCO = TINIC 40.00
DT = 1.E10 40.00
RDTIM = 0. 40.00
NSTATC = 0 40.00
MTC = 1 40.41
ELSE
CALL IGNORE ('NONST')
IF (TIMCO .LT. -0.9E10) THEN 40.00
CALL INCTIM (ITMOPT,'TBEGC',TINIC,'REQ',0.) 40.03
ELSE
CALL INCTIM (ITMOPT,'TBEGC',TINIC,'STA',TIMCO) 40.03
ENDIF
IF (TINIC .LT. TIMCO) THEN 40.03
CALL MSGERR (2, 'start time [tbegc] before current time') 40.03
TINIC = TIMCO 40.03
ENDIF 40.03
CALL ININTV ('DELTC', DT, 'REQ', 0.) 40.03
CALL INCTIM (ITMOPT,'TENDC',TFINC,'REQ',0.) 40.03
NSTATC = 1 40.00
!
! *** tfinc must be greater than tinic **
DIFF = TFINC - TINIC
IF (DIFF .LE. 0.) CALL MSGERR (3,
& 'start time [tbegc] greater or equal end time [tendc]')
!
! **The number of computational steps is calculated
RDTIM = 1./DT
MTC = NINT ((TFINC - TINIC)/DT) 30.50
IF (MOD(TFINC-TINIC,DT).GT.0.01*DT .AND.
& MOD(TFINC-TINIC,DT).LT.0.99*DT)
& CALL MSGERR (1,
& 'DT is not a fraction of the computational period')
TIMCO = TINIC
ENDIF
IF (NSTATM.GT.0) CHTIME = DTTIWR(ITMOPT, TIMCO) 40.00
NCOMPT = NCOMPT + 1 40.41
IF (NCOMPT.GT.50) CALL MSGERR (2, 40.41
& 'No more than 50 COMPUTE commands are allowed') 40.41
RCOMPT(NCOMPT,1) = REAL(NSTATC) 40.41
RCOMPT(NCOMPT,2) = REAL(MTC) 40.41
RCOMPT(NCOMPT,3) = TFINC 40.41
RCOMPT(NCOMPT,4) = TINIC 40.41
RCOMPT(NCOMPT,5) = DT 40.41
! set ITERMX equal to MXITST in case of stationary computations
! and to MXITNS otherwise
IF (NSTATC.EQ.0) THEN
ITERMX = MXITST 40.03
ELSE
ITERMX = MXITNS 40.03
ENDIF
RETURN 30.00
ENDIF
!
! ------------------------------------------------------------------
!
! *** OBSTACLE Definition of obstacles in comp grid. *** 30.61
!
! ============================================================
!
! | -> TRANSm [trcoef] |
! | TRANS1d < [trcoef] > |
! | TRANS2d < [trcoef] > |
! OBSTacle < > &
! | | -> GODA [hgt] [alpha] [beta] |
! | DAM < |
! | DANGremond [hgt] [slope] [Bk] |
! 40.18
! | -> RSPEC | 40.18
! ( REFLec [reflc] < > ) &
! | RDIFF [pown] | 40.13 40.18
!
! LINe < [xp] [yp] > 40.18 40.09
!
! ============================================================
!
IF (KEYWIS ('OBST')) THEN
!
ALLOCATE(OBSTMP) 40.31
OBSTMP%TRCOEF(1) = 0. 40.31
OBSTMP%TRCOEF(2) = 0. 40.31
OBSTMP%TRCOEF(3) = 0. 40.31
OBSTMP%RFCOEF(1) = 0. 40.31
OBSTMP%RFCOEF(2) = 0. 40.31
OBSTMP%RFCOEF(3) = 0. 40.31
OBSTMP%RFCOEF(4) = 0. 40.31
OBSTMP%RFCOEF(5) = 0. 40.31
OBSTMP%RFCOEF(6) = 0. 40.31
!
! data concerning transmission of energy over/through the obstacle
!
CALL INKEYW ('STA', ' ')
IF (KEYWIS ('TRANS1') .OR. KEYWIS ('TRFREQ')) THEN 41.65
ITRAS = 11
IFTMAX = 0
FRSTFT%C = 0.
NULLIFY(FRSTFT%NEXTFT)
CURRFT => FRSTFT
403 CALL INREAL ('TRCOEF',TRCF,'REP',-1.)
IF ( TRCF.NE.-1. ) THEN
IF ( TRCF.LT.0. .OR. TRCF.GT.1. ) THEN
CALL MSGERR(3,'Transmission coefficient is not allowed')
CALL MSGERR(3,'to be greater than 1 or smaller than 0!')
END IF
IFTMAX = IFTMAX + 1
ALLOCATE(TMPFT)
TMPFT%C = TRCF
NULLIFY(TMPFT%NEXTFT)
CURRFT%NEXTFT => TMPFT
CURRFT => TMPFT
GO TO 403
END IF
IF ( IFTMAX.EQ.0 ) THEN
CALL MSGERR(2,'No frequency dep. transmission coeffs found')
ELSE IF ( IFTMAX.NE.MSC ) THEN
CALL MSGERR(2,'Number of transmission coeffs not equal to')
CALL MSGERR(2,'number of frequencies!')
CALL MSGERR(2,'When less, then these coeffs are filled up')
CALL MSGERR(2,'with 1.')
CALL MSGERR(2,'When more, then these coeffs are ignored')
END IF
ALLOCATE(OBSTMP%TRCF1D(MSC))
OBSTMP%TRCF1D(:) = 1.
CURRFT => FRSTFT%NEXTFT
DO JJ = 1, MIN(MSC,IFTMAX)
OBSTMP%TRCF1D(JJ) = CURRFT%C
CURRFT => CURRFT%NEXTFT
END DO
DEALLOCATE(TMPFT)
ELSE IF (KEYWIS ('TRANS2')) THEN 41.65
ITRAS = 12
IFTMAX = 0
FRSTFT%C = 0.
NULLIFY(FRSTFT%NEXTFT)
CURRFT => FRSTFT
404 CALL INREAL ('TRCOEF',TRCF,'REP',-1.)
IF ( TRCF.NE.-1. ) THEN
IF ( TRCF.LT.0. .OR. TRCF.GT.1. ) THEN
CALL MSGERR(3,'Transmission coefficient is not allowed')
CALL MSGERR(3,'to be greater than 1 or smaller than 0!')
END IF
IFTMAX = IFTMAX + 1
ALLOCATE(TMPFT)
TMPFT%C = TRCF
NULLIFY(TMPFT%NEXTFT)