-
Notifications
You must be signed in to change notification settings - Fork 0
/
ocpcre.ftn
2503 lines (2501 loc) · 82.6 KB
/
ocpcre.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
! OCEAN PACK command reading routines
!
! Contents of this file:
! RDINIT
! NWLINE
! INKEYW
! INREAL
! INDBLE
! ININTG
! INCSTR
! INCTIM
! ININTV
! LEESEL
! GETKAR
! PUTKAR
! UPCASE
! KEYWIS
! WRNKEY
! IGNORE
! RDHMS
!
!****************************************************************
! *
SUBROUTINE RDINIT
! *
!****************************************************************
!
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
!
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
!
! 40.41: Marcel Zijlema
!
! 1. UPDATES
!
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Initialises the command reading system
!
! 3. METHOD
!
! 4. ARGUMENT VARIABLES
!
! 5. PARAMETER VARIABLES
!
! 6. LOCAL VARIABLES
!
! IENT : Number of entries into this subroutine
!
INTEGER IENT
!
! 8. SUBROUTINE USED
!
! 9. SUBROUTINES CALLING
!
! 10. ERROR MESSAGES
!
! 11. REMARKS
!
! 12. STRUCTURE
!
! 13. SOURCE TEXT
!
SAVE IENT
DATA IENT/0/
CALL STRACE (IENT,'RDINIT')
KAR = ';'
KARNR = LINELN + 1 40.00
ELTYPE = 'USED'
BLANK = ' '
RETURN
END
!****************************************************************
! *
SUBROUTINE NWLINE
! *
!****************************************************************
!
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
!
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
!
! 34.01: IJsbrand Haagsma
! 40.03: Nico Booij
! 40.41: Marcel Zijlema
!
! 1. UPDATES
!
! 34.01, Feb. 99: Changed STOP statement in a MSGERR(4,'message')
! 40.03, Apr. 99: length of command lines changed from 80 to LINELN (=120)
! name of input file included in error message
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Jumps to reading of the next input line,
! if the end of the previous one is reached.
!
! 3. METHOD
!
! 4. ARGUMENT VARIABLES
!
! 5. PARAMETER VARIABLES
!
! 6. LOCAL VARIABLES
!
! IENT : Number of entries into this subroutine
!
INTEGER IENT
!
! 8. SUBROUTINE USED
!
! 9. SUBROUTINES CALLING
!
! 10. ERROR MESSAGES
!
! 11. REMARKS
!
! 12. STRUCTURE
!
! 13. SOURCE TEXT
!
SAVE IENT
DATA IENT/0/
CALL STRACE (IENT,'NWLINE')
5 IF ((ELTYPE.EQ.'USED').OR.(ELTYPE.EQ.'EOR')) CALL LEESEL
IF (ELTYPE.EQ.'EOF') GOTO 90
IF (ELTYPE.EQ.'KEY' .AND. KEYWRD.NE.' ') GOTO 50
IF (ELTYPE.EQ.'INT') GOTO 50
IF (ELTYPE.EQ.'REAL') GOTO 50
IF (ELTYPE.EQ.'CHAR') GOTO 50
IF (KARNR.LE.LINELN) GOTO 50 40.03
! The end of the previous line is reached, there are no more
! unprocessed data items on that line.
! Jump to new line can take place.
WRITE (PRINTF,9) ' '
9 FORMAT (A4)
KARNR=0
KAR=' '
ELTYPE='USED'
GOTO 5
90 IF (ITEST.GE.10) THEN
INQUIRE (UNIT=INPUTF, NAME=FILENM) 40.03
WRITE (PRINTF, *) ' end of input file '//FILENM 40.03
ENDIF
50 RETURN
END
!****************************************************************
! *
SUBROUTINE INKEYW (KONT, CSTA)
! *
!****************************************************************
!
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
!
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
!
! 40.41: Marcel Zijlema
!
! 1. UPDATES
!
! ver 30.70, Jan. 1998: data type 'OTHR' is condidered
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! this subroutine reads a keyword.
!
! 3. METHOD
!
! 4. ARGUMENT VARIABLES
!
! KONT : action to be taken if no keyword is found in input:
! 'REQ' (required) error message
! 'STA' (standard) the value of csta is assigned to keywrd.
!
! CSTA : see above.
!
CHARACTER CSTA *(*), KONT *(*)
!
! 5. PARAMETER VARIABLES
!
! 6. LOCAL VARIABLES
!
! IENT : Number of entries into this subroutine
! LENS : length of default string (CSTA)
!
INTEGER IENT, LENS
!
! 8. SUBROUTINE USED
!
! 9. SUBROUTINES CALLING
!
! 10. ERROR MESSAGES
!
! 11. REMARKS
!
! 12. STRUCTURE
!
! 13. SOURCE TEXT
!
SAVE IENT
DATA IENT/0/
CALL STRACE ( IENT, 'INKEYW')
!
! if necessary, a new data item is read.
!
IF (ELTYPE.EQ.'KEY' .AND. KEYWRD.EQ.' ') GOTO 510
IF (ELTYPE.EQ.'KEY') GOTO 900
IF (ELTYPE.EQ.'EOR') GOTO 510
IF (ELTYPE.EQ.'USED') GOTO 510
GOTO 520
510 CALL LEESEL
520 IF (ELTYPE.EQ.'KEY') GOTO 900
! KEYWORD IS READ
IF ((KONT.EQ.'STA').OR.(KONT.EQ.'NSKP')) THEN
LENS = LEN(CSTA)
IF (LENS.GE.8) THEN
KEYWRD = CSTA(1:8)
ELSE
KEYWRD = ' '
KEYWRD(1:LENS) = CSTA
ENDIF
GOTO 900
ENDIF
! at the end of the input 'STOP' is generated.
IF (ELTYPE.EQ.'EOF') THEN
KEYWRD='STOP'
CALL MSGERR (2, 'STOP statement is missing')
GOTO 900
ENDIF
! ----------------------------------------------------------
! Data appear where a keyword is expected.
! The user must be informed.
! ----------------------------------------------------------
IF (ELTYPE.EQ.'EOR') THEN
KEYWRD = ' '
GOTO 900
ENDIF
IF (ELTYPE.EQ.'INT') THEN
CALL MSGERR (2, 'Data field skipped:'//ELTEXT)
GOTO 510
ENDIF
IF (ELTYPE.EQ.'REAL') THEN
CALL MSGERR (2, 'Data field skipped:'//ELTEXT)
GOTO 510
ENDIF
IF (ELTYPE.EQ.'CHAR' .OR. ELTYPE.EQ.'OTHR') THEN 30.70
CALL MSGERR (2, 'Data field skipped:'//ELTEXT)
GOTO 510
ENDIF
IF (ELTYPE.EQ.'EMPT') THEN
CALL MSGERR (2, 'Empty data field skipped')
GOTO 510
ENDIF
CALL MSGERR (3, 'Error subr. INKEYW')
! ----------------------------------------------------------
900 IF (ITEST.GE.10) WRITE (PRINTF,910) KEYWRD
910 FORMAT (' KEYWORD: ',A8)
RETURN
END
!****************************************************************
! *
SUBROUTINE INREAL (NAAM, R, KONT, RSTA)
! *
!****************************************************************
!
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
!
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.82: IJsbrand Haagsma
! 40.41: Marcel Zijlema
!
! 1. UPDATES
!
! 20.04, Aug. 93: logical CHGVAL is introduced it is made True if
! user changes value of an input parameter via INREAL
! 30.82, Sep. 98: To avoid errors using the Cray-cf90 compiler
! introduced a dummy
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Reads a REAL number in free format.
!
! 3. METHOD
!
! Uses the function INDBLE to read the number
!
! 4. ARGUMENT VARIABLES
!
! R : The value of the variable that is to be read.
! RSTA : Reference value needed for KONT='STA'or 'RQI'
!
REAL R, RSTA
!
! KONT : What to do with the variable?
! ='REQ' : variable is required
! ='UNC' : if no variable, then variable will not be changed
! ='STA' : if no variable, then variable will get value of RSTA
! ='RQI' : variable may not have the value of RSTA
! ='REP' : (REPEAT)
! ='NSKP': (NO SKIP) if data item is of different type,
! value is left unchanged
! NAAM : Name of the variable according to the user manual.
!
CHARACTER NAAM *(*), KONT *(*)
!
! 5. PARAMETER VARIABLES
!
! DRSTA : Double precision variant of RSTA
! RDBL : Double precision variant of R
!
DOUBLE PRECISION RDBL, DRSTA
!
! IENT : Number of entries into this subroutine
!
INTEGER IENT
!
! 6. LOCAL VARIABLES
!
! 8. SUBROUTINE USED
!
! 9. SUBROUTINES CALLING
!
! 10. ERROR MESSAGES
!
! 11. REMARKS
!
! 12. STRUCTURE
!
! 13. SOURCE TEXT
!
SAVE IENT
DATA IENT /0/
CALL STRACE ( IENT, 'INREAL')
!
RDBL = DBLE(R)
DRSTA = DBLE(RSTA) 30.82
CALL INDBLE (NAAM, RDBL, KONT, DRSTA) 30.82
!
! RDBL may have changed due to the value of KONT
!
R = REAL(RDBL)
RETURN
!
! End of subroutine INREAL
!
END
!
!****************************************************************
! *
SUBROUTINE INDBLE (NAAM, R, KONT, RSTA)
! *
!****************************************************************
!
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
!
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.72: IJsbrand Haagsma
! 40.03: Nico Booij
! 40.41: Marcel Zijlema
!
! 1. UPDATES
!
! 30.72, Oct. 97: Introduced logical function EQREAL for floating point
! comparisons
! 20.05, Aug. 93: NEW subroutine for double prec. data
! 40.03, Feb. 00: local copy of NAAM used in error message
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Reads a DOUBLE PRECISION number, in free format.
!
! 3. METHOD
!
! 4. ARGUMENT VARIABLES
!
! R : THE VARIABLE THAT IS TO BE READ.
! RSTA : SEE ABOVE
!
DOUBLE PRECISION R, RSTA
!
! KONT : What to do with the variable?
! ='REQ'; Value in input file is required
! ='UNC'; If no value, then variable will not be changed
! ='STA'; If no value, then variable will get value of RSTA
! ='RQI'; Variable may not have the value of RSTA
! ='REP' (repeat)
! ='NSKP' (no skip) if data item is of different type,
! value is left unchanged.
! NAAM : name of the variable according to the user's manual.
!
CHARACTER KONT *(*), NAAM *(*)
!
! 5. PARAMETER VARIABLES
!
! 6. LOCAL VARIABLES
!
! IENT : Number of entries into this subroutine
! LENNM : length of string NAAM
!
INTEGER IENT, LENNM
!
! NAAM_L : local copy of NAAM 40.03
!
CHARACTER (LEN=40) :: NAAM_L 40.03
!
! EQREAL :
!
LOGICAL EQREAL 30.72
!
! 8. SUBROUTINE USED
!
! 9. SUBROUTINES CALLING
!
! 10. ERROR MESSAGES
!
! 11. REMARKS
!
! 12. STRUCTURE
!
! 13. SOURCE TEXT
!
SAVE IENT
DATA IENT /0/
CALL STRACE ( IENT, 'INDBLE')
!
! if necessary, a new data item is read
!
CHGVAL = .FALSE.
NAAM_L = NAAM 40.03
IF (ELTYPE.EQ.'USED') CALL LEESEL
! consider type of data item
IF (ELTYPE.EQ.'KEY') THEN
! find out whether in input is written: NAAM=...
LENNM = LEN(NAAM)
IF (NAAM.NE.ELTEXT(1:LENNM)) GOTO 20
ELTYPE = 'USED'
CALL LEESEL
IF (ELTYPE.EQ.'REAL') GOTO 12
IF (ELTYPE.EQ.'INT') GOTO 14
GOTO 50
ENDIF
! if type is 'REAL' or 'INT', its value is assigned to R
12 IF (ELTYPE.EQ.'REAL') THEN
R = ELREAL
ELTYPE = 'USED'
IF (.NOT.EQREAL(REAL(R),REAL(RSTA))) CHGVAL = .TRUE. 30.72
GOTO 80
ENDIF
14 IF (ELTYPE.EQ.'INT') THEN
R = DBLE(ELINT)
ELTYPE = 'USED'
IF (.NOT.EQREAL(REAL(R),REAL(RSTA))) CHGVAL = .TRUE. 30.72
GOTO 80
ENDIF
IF (ELTYPE.EQ.'EOR') THEN
! find out whether end of repeat is reached,
! if so make R=RSTA.
IF (KONT.NE.'REP') GOTO 20
ELTYPE='USED'
GOTO 70
ENDIF
IF (ELTYPE.EQ.'EOF') GOTO 20
IF (ELTYPE.EQ.'EMPT') THEN
ELTYPE='USED'
GOTO 20
ENDIF
IF (ELTYPE.EQ.'ERR') GOTO 50
IF (ELTYPE.EQ.'CHAR' .OR. ELTYPE.EQ.'OTHR') THEN 30.04
IF (KONT.EQ.'NSKP') GOTO 70
CALL MSGERR (3,
& 'Wrong type of data for variable '//NAAM_L) 40.03
WRITE (PRINTF,18) NAAM, ELTEXT(1:LENCST)
18 FORMAT (' -> ',A, ' item=', A)
ELTYPE='USED'
GOTO 70 20.01
ENDIF
CALL MSGERR (3, 'Error subr. INREAL')
WRITE (PRINTF, '(1X,A,A)') ELTYPE, KONT
! -------------------------------------------------------------
! data item of different type is read, action according to KONT
! -------------------------------------------------------------
20 IF (KONT.EQ.'REQ') GOTO 30
IF (KONT.EQ.'REP') GOTO 70
IF (KONT.EQ.'RQI') GOTO 28
IF (KONT.EQ.'STA') GOTO 70
IF (KONT.EQ.'NSKP') GOTO 70
IF (KONT.EQ.'UNC') GOTO 80
!
CALL MSGERR (3, 'Error subr. INREAL')
WRITE (PRINTF, '(1X,A,A)') ELTYPE, KONT
GOTO 70
!
28 IF (.NOT.EQREAL(REAL(R),REAL(RSTA))) GOTO 80 30.72
30 CALL MSGERR (3, 'No value for variable '//NAAM_L) 40.03
WRITE (PRINTF,18) NAAM, ELTEXT(1:LENCST)
GOTO 70
!
50 CALL MSGERR (3, 'Read error with variable '//NAAM_L) 40.03
WRITE (PRINTF,18) NAAM, ELTEXT(1:LENCST)
ELTYPE='USED'
!
70 R = RSTA
80 IF (ITEST.GE.10) WRITE (PRINTF, 85) NAAM, R
85 FORMAT (1X,A8,'=',D12.4)
RETURN
END
!****************************************************************
! *
SUBROUTINE ININTG (NAAM, IV, KONT, ISTA)
! *
!****************************************************************
!
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
!
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
!
! 40.03: Nico Booij
! 40.41: Marcel Zijlema
!
! 1. UPDATES
!
! 20.04, August 1993: logical CHGVAL is introduced
! it is made True if user changes value
! of an input parameter via ININTG
! 40.03, Feb. 00: local copy of NAAM used in error message
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Reads an integer number, in free format
!
! 3. METHOD
!
! 4. ARGUMENT VARIABLES
!
! IV : integer variable which is to be assigned a value
! ISTA : default value
!
INTEGER IV, ISTA
!
! NAAM : name of the variable according to the user manual
! KONT : What to do with the variable?
! ='REQ'; error message if no value is found in the input file
! ='UNC'; If no value, then variable will not be changed
! ='STA'; If no value, then variable will get default value
! ='RQI'; Variable may not have the value of RSTA
! ='REP' (repeat)
! ='NSKP' (no skip) if data item is of different type,
! value is left unchanged.
!
CHARACTER NAAM *(*), KONT *(*)
!
! 5. PARAMETER VARIABLES
!
! PARAMETERS: SEE SUBR. INREAL
!
! 6. LOCAL VARIABLES
!
! IENT : Number of entries into this subroutine
! LENNM : length of the string NAAM
!
INTEGER IENT, LENNM
!
! NAAM_L : local copy of NAAM 40.03
!
CHARACTER (LEN=40) :: NAAM_L 40.03
!
! 8. SUBROUTINE USED
!
! 9. SUBROUTINES CALLING
!
! 10. ERROR MESSAGES
!
! 11. REMARKS
!
! 12. STRUCTURE
!
! 13. SOURCE TEXT
!
SAVE IENT
DATA IENT /0/
CALL STRACE ( IENT, 'ININTG')
!
CHGVAL = .FALSE.
NAAM_L = NAAM 40.03
! IF NECESSARY, A NEW DATA ITEM IS READ
IF (ELTYPE.EQ.'USED') CALL LEESEL
! CONSIDER TYPE OF DAT ITEM.
IF (ELTYPE.EQ.'EOR') GOTO 14
IF (ELTYPE.EQ.'KEY') GOTO 16
IF (ELTYPE.EQ.'EOF') GOTO 20
IF (ELTYPE.EQ.'EMPT') GOTO 18
IF (ELTYPE.EQ.'ERR') GOTO 50
IF (ELTYPE.EQ.'CHAR') GOTO 40
IF (ELTYPE.EQ.'OTHR') GOTO 40
IF (ELTYPE.EQ.'REAL') GOTO 40
! TYPE IS 'INT', VALUE IS ASSIGNED
12 IV=ELINT
IF (IV.NE.ISTA) CHGVAL = .TRUE.
ELTYPE='USED'
GOTO 80
14 IF (KONT.NE.'REP') GOTO 20
ELTYPE='USED'
GOTO 70 20.01
16 LENNM = LEN(NAAM)
IF (NAAM.NE.ELTEXT(1:LENNM)) GOTO 20
CALL LEESEL
IF (ELTYPE.EQ.'INT') GOTO 12
GOTO 50
18 ELTYPE='USED'
20 IF (KONT.EQ.'REQ') GOTO 30
IF (KONT.EQ.'REP') GOTO 70
IF (KONT.EQ.'RQI') GOTO 28
IF (KONT.EQ.'STA') GOTO 70
IF (KONT.EQ.'NSKP') GOTO 70
GOTO 80
28 IF (IV.NE.ISTA) GOTO 80
30 CALL MSGERR (2, 'No value for variable '//NAAM_L) 40.03
GOTO 70 20.01
40 IF (KONT.EQ.'NSKP') GOTO 70
CALL MSGERR (2, 'Wrong type of data for variable '//NAAM_L) 40.03
WRITE (PRINTF,41) NAAM, ELTEXT(1:LENCST) 30.04
41 FORMAT (' -> ',A8, ' item read=', A)
ELTYPE='USED'
GOTO 70 20.01
50 CALL MSGERR (2, 'Read error with variable '//NAAM_L) 40.03
WRITE (PRINTF,41) NAAM, ELTEXT(1:LENCST) 30.04
ELTYPE='USED'
70 IV=ISTA 20.01
80 IF (ITEST.GE.10) WRITE (PRINTF, 85) NAAM, IV
85 FORMAT (1X,A8,'=',I6)
RETURN
END
!****************************************************************
! *
SUBROUTINE INCSTR (NAAM, C, KONT, CSTA)
! *
!****************************************************************
!
USE OCPCOMM1 40.41
USE OCPCOMM2 40.41
USE OCPCOMM3 40.41
USE OCPCOMM4 40.41
!
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
!
! 40.03: Nico Booij
! 40.41: Marcel Zijlema
!
! 1. UPDATES
!
! 20.04, August 1993: logical CHGVAL is introduced
! it is made True if user changes value
! of an input parameter via INCSTR
! 40.03, Feb. 00: local copy of NAAM used in error message
! 40.41, Oct. 04: common blocks replaced by modules, include files removed
!
! 2. PURPOSE
!
! Reads a string in free format
!
! 3. METHOD
!
! 4. ARGUMENT VARIABLES
!
! NAAM : name of the variable according to the user manual
! KONT : What to do with the variable?
! ='REQ'; error message if no value is found in the input file
! ='UNC'; If no value, then variable will not be changed
! ='STA'; If no value, then variable will get default value
! ='RQI'; Variable may not have the value of CSTA
! ='REP' (repeat)
! ='NSKP' (no skip) if data item is of different type,
! value is left unchanged.
! C : string that is to be read from input file
! CSTA : default value of the string
!
CHARACTER NAAM *(*), KONT *(*), C *(*), CSTA *(*)
!
! 5. PARAMETER VARIABLES
!
! Parameters: see program documentation.
!
! 6. LOCAL VARIABLES
!
! IENT : Number of entries into this subroutine
! LENNM : length of the string NAAM
! LENW : length of the string C
! NS : length of the string CSTA
!
INTEGER IENT, LENNM, LENW, NS
!
! NAAM_L : local copy of NAAM 40.03
!
CHARACTER (LEN=40) :: NAAM_L 40.03
!
! 8. SUBROUTINE USED
!
! 9. SUBROUTINES CALLING
!
! 10. ERROR MESSAGES
!
! 11. REMARKS
!
! 12. STRUCTURE
!
! 13. SOURCE TEXT
!
SAVE IENT
DATA IENT /0/
CALL STRACE ( IENT, 'INCSTR')
!
CHGVAL = .FALSE.
NAAM_L = NAAM 40.03
LENW = LEN(C)
! IF NECESSARY, A NEW DATA ITEM IS READ.
IF (ELTYPE.EQ.'USED') CALL LEESEL
! CONSIDER TYPE OF DATA ITEM.
IF (ELTYPE.EQ.'KEY') THEN
! FIND OUT WHETHER IN INPUT IS WRITTEN: NAAM=....
LENNM = LEN(NAAM)
IF (NAAM.NE.ELTEXT(1:LENNM)) GOTO 20
ELTYPE = 'USED'
CALL LEESEL
IF (ELTYPE.EQ.'CHAR') GOTO 12
GOTO 50
ENDIF
12 IF (ELTYPE.EQ.'CHAR') THEN
! TYPE IS 'CHAR', VALUE IS ASSIGNED.
IF (LENCST.GT.LENW) THEN
CALL MSGERR (2,
& 'too long string given for: '//NAAM_L) 40.03
WRITE (PRINTF, 13) NAAM, ELTEXT(1:LENCST)
13 FORMAT (' name=', A, ' string=', A)
ENDIF
C = ELTEXT(1:LENW)
IF (C.NE.CSTA) CHGVAL = .TRUE.
ELTYPE='USED'
GOTO 80
ENDIF
IF (ELTYPE.EQ.'EOR') THEN
! END OF REPEAT GROUP, STANDARD VALUE IS ASSIGNED.
IF (KONT.NE.'REP') GOTO 20
ELTYPE='USED'
GOTO 70
ENDIF
IF (ELTYPE.EQ.'EOF') GOTO 20
IF (ELTYPE.EQ.'EMPT') THEN
ELTYPE='USED'
GOTO 20