My Project
ocpcre.f90
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 ! OCEAN PACK command reading routines
13 !
14 ! Contents of this file:
15 ! RDINIT
16 ! NWLINE
17 ! INKEYW
18 ! INREAL
19 ! INDBLE
20 ! ININTG
21 ! INCSTR
22 ! INCTIM
23 ! ININTV
24 ! LEESEL
25 ! GETKAR
26 ! PUTKAR
27 ! UPCASE
28 ! KEYWIS
29 ! WRNKEY
30 ! IGNORE
31 ! RDHMS
32 !
33 !****************************************************************
34 ! *
35  SUBROUTINE rdinit
36 ! *
37 !****************************************************************
38 !
39  USE ocpcomm1
40  USE ocpcomm2
41  USE ocpcomm3
42  USE ocpcomm4
43 !
44  IMPLICIT NONE
45 !
46 !
47 ! --|-----------------------------------------------------------|--
48 ! | Delft University of Technology |
49 ! | Faculty of Civil Engineering |
50 ! | Environmental Fluid Mechanics Section |
51 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
52 ! | |
53 ! | Programmers: R.C. Ris, N. Booij, |
54 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
55 ! | M. Zijlema, E.E. Kriezi, |
56 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
57 ! --|-----------------------------------------------------------|--
58 !
59 !
60 ! SWAN (Simulating WAves Nearshore); a third generation wave model
61 ! Copyright (C) 2004-2005 Delft University of Technology
62 !
63 ! This program is free software; you can redistribute it and/or
64 ! modify it under the terms of the GNU General Public License as
65 ! published by the Free Software Foundation; either version 2 of
66 ! the License, or (at your option) any later version.
67 !
68 ! This program is distributed in the hope that it will be useful,
69 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
70 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
71 ! GNU General Public License for more details.
72 !
73 ! A copy of the GNU General Public License is available at
74 ! http://www.gnu.org/copyleft/gpl.html#SEC3
75 ! or by writing to the Free Software Foundation, Inc.,
76 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
77 !
78 !
79 ! 0. AUTHORS
80 !
81 ! 40.41: Marcel Zijlema
82 !
83 ! 1. UPDATES
84 !
85 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
86 !
87 ! 2. PURPOSE
88 !
89 ! Initialises the command reading system
90 !
91 ! 3. METHOD
92 !
93 ! 4. ARGUMENT VARIABLES
94 !
95 ! 5. PARAMETER VARIABLES
96 !
97 ! 6. LOCAL VARIABLES
98 !
99 ! IENT : Number of entries into this subroutine
100 !
101  INTEGER IENT
102 !
103 ! 8. SUBROUTINE USED
104 !
105 ! 9. SUBROUTINES CALLING
106 !
107 ! 10. ERROR MESSAGES
108 !
109 ! 11. REMARKS
110 !
111 ! 12. STRUCTURE
112 !
113 ! 13. SOURCE TEXT
114 !
115  SAVE ient
116  DATA ient/0/
117  CALL strace (ient,'RDINIT')
118  kar = ';'
119  karnr = lineln + 1
120  eltype = 'USED'
121  blank = ' '
122  RETURN
123  END SUBROUTINE rdinit
124 
125 !****************************************************************
126 ! *
127  SUBROUTINE nwline
128 ! *
129 !****************************************************************
130 !
131  USE ocpcomm1
132  USE ocpcomm2
133 ! USE OCPCOMM3
134  USE ocpcomm4
135 !
136  IMPLICIT NONE
137 !
138 !
139 ! --|-----------------------------------------------------------|--
140 ! | Delft University of Technology |
141 ! | Faculty of Civil Engineering |
142 ! | Environmental Fluid Mechanics Section |
143 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
144 ! | |
145 ! | Programmers: R.C. Ris, N. Booij, |
146 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
147 ! | M. Zijlema, E.E. Kriezi, |
148 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
149 ! --|-----------------------------------------------------------|--
150 !
151 !
152 ! SWAN (Simulating WAves Nearshore); a third generation wave model
153 ! Copyright (C) 2004-2005 Delft University of Technology
154 !
155 ! This program is free software; you can redistribute it and/or
156 ! modify it under the terms of the GNU General Public License as
157 ! published by the Free Software Foundation; either version 2 of
158 ! the License, or (at your option) any later version.
159 !
160 ! This program is distributed in the hope that it will be useful,
161 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
162 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
163 ! GNU General Public License for more details.
164 !
165 ! A copy of the GNU General Public License is available at
166 ! http://www.gnu.org/copyleft/gpl.html#SEC3
167 ! or by writing to the Free Software Foundation, Inc.,
168 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
169 !
170 !
171 ! 0. AUTHORS
172 !
173 ! 34.01: IJsbrand Haagsma
174 ! 40.03: Nico Booij
175 ! 40.41: Marcel Zijlema
176 !
177 ! 1. UPDATES
178 !
179 ! 34.01, Feb. 99: Changed STOP statement in a MSGERR(4,'message')
180 ! 40.03, Apr. 99: length of command lines changed from 80 to LINELN (=120)
181 ! name of input file included in error message
182 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
183 !
184 ! 2. PURPOSE
185 !
186 ! Jumps to reading of the next input line,
187 ! if the end of the previous one is reached.
188 !
189 ! 3. METHOD
190 !
191 ! 4. ARGUMENT VARIABLES
192 !
193 ! 5. PARAMETER VARIABLES
194 !
195 ! 6. LOCAL VARIABLES
196 !
197 ! IENT : Number of entries into this subroutine
198 !
199  INTEGER IENT
200 !
201 ! 8. SUBROUTINE USED
202 !
203 ! 9. SUBROUTINES CALLING
204 !
205 ! 10. ERROR MESSAGES
206 !
207 ! 11. REMARKS
208 !
209 ! 12. STRUCTURE
210 !
211 ! 13. SOURCE TEXT
212 !
213  SAVE ient
214  DATA ient/0/
215  CALL strace (ient,'NWLINE')
216 5 IF((eltype == 'USED').OR.(eltype == 'EOR')) CALL leesel
217 ! print*,'after calling LEESEL. ***********',ELTYPE
218  IF(eltype == 'EOF') GOTO 90
219  IF(eltype == 'KEY' .AND. keywrd /= ' ') GOTO 50
220  IF(eltype == 'INT') GOTO 50
221  IF(eltype == 'REAL') GOTO 50
222  IF(eltype == 'CHAR') GOTO 50
223  IF(karnr <= lineln) GOTO 50
224 ! The end of the previous line is reached, there are no more
225 ! unprocessed data items on that line.
226 ! Jump to new line can take place.
227  WRITE (printf,9) ' '
228 9 FORMAT (a4)
229  karnr=0
230  kar=' '
231  eltype='USED'
232  GOTO 5
233 90 IF(itest >= 10)THEN
234  INQUIRE (unit=inputf, name=filenm)
235  WRITE (printf, *) ' end of input file '//filenm
236  ENDIF
237 50 RETURN
238  END SUBROUTINE nwline
239 
240 !****************************************************************
241 ! *
242  SUBROUTINE inkeyw (KONT, CSTA)
243 ! *
244 !****************************************************************
245 !
246  USE ocpcomm1
247  USE ocpcomm2
248  USE ocpcomm3
249  USE ocpcomm4
250 !
251  IMPLICIT NONE
252 !
253 !
254 ! --|-----------------------------------------------------------|--
255 ! | Delft University of Technology |
256 ! | Faculty of Civil Engineering |
257 ! | Environmental Fluid Mechanics Section |
258 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
259 ! | |
260 ! | Programmers: R.C. Ris, N. Booij, |
261 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
262 ! | M. Zijlema, E.E. Kriezi, |
263 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
264 ! --|-----------------------------------------------------------|--
265 !
266 !
267 ! SWAN (Simulating WAves Nearshore); a third generation wave model
268 ! Copyright (C) 2004-2005 Delft University of Technology
269 !
270 ! This program is free software; you can redistribute it and/or
271 ! modify it under the terms of the GNU General Public License as
272 ! published by the Free Software Foundation; either version 2 of
273 ! the License, or (at your option) any later version.
274 !
275 ! This program is distributed in the hope that it will be useful,
276 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
277 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
278 ! GNU General Public License for more details.
279 !
280 ! A copy of the GNU General Public License is available at
281 ! http://www.gnu.org/copyleft/gpl.html#SEC3
282 ! or by writing to the Free Software Foundation, Inc.,
283 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
284 !
285 !
286 ! 0. AUTHORS
287 !
288 ! 40.41: Marcel Zijlema
289 !
290 ! 1. UPDATES
291 !
292 ! ver 30.70, Jan. 1998: data type 'OTHR' is condidered
293 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
294 !
295 ! 2. PURPOSE
296 !
297 ! this subroutine reads a keyword.
298 !
299 ! 3. METHOD
300 !
301 ! 4. ARGUMENT VARIABLES
302 !
303 ! KONT : action to be taken if no keyword is found in input:
304 ! 'REQ' (required) error message
305 ! 'STA' (standard) the value of csta is assigned to keywrd.
306 !
307 ! CSTA : see above.
308 !
309  CHARACTER CSTA *(*), KONT *(*)
310 !
311 ! 5. PARAMETER VARIABLES
312 !
313 ! 6. LOCAL VARIABLES
314 !
315 ! IENT : Number of entries into this subroutine
316 ! LENS : length of default string (CSTA)
317 !
318  INTEGER IENT, LENS
319 !
320 ! 8. SUBROUTINE USED
321 !
322 ! 9. SUBROUTINES CALLING
323 !
324 ! 10. ERROR MESSAGES
325 !
326 ! 11. REMARKS
327 !
328 ! 12. STRUCTURE
329 !
330 ! 13. SOURCE TEXT
331 !
332  SAVE ient
333  DATA ient/0/
334  CALL strace ( ient, 'INKEYW')
335 !
336 ! if necessary, a new data item is read.
337 !
338  IF(eltype == 'KEY' .AND. keywrd == ' ') GOTO 510
339  IF(eltype == 'KEY') GOTO 900
340  IF(eltype == 'EOR') GOTO 510
341  IF(eltype == 'USED') GOTO 510
342  GOTO 520
343 510 CALL leesel
344 520 IF(eltype == 'KEY') GOTO 900
345 ! KEYWORD IS READ
346  IF((kont == 'STA').OR.(kont == 'NSKP'))THEN
347  lens = len(csta)
348  IF(lens >= 8)THEN
349  keywrd = csta(1:8)
350  ELSE
351  keywrd = ' '
352  keywrd(1:lens) = csta
353  ENDIF
354  GOTO 900
355  ENDIF
356 ! at the end of the input 'STOP' is generated.
357  IF(eltype == 'EOF')THEN
358  keywrd='STOP'
359  CALL msgerr (2, 'STOP statement is missing')
360  GOTO 900
361  ENDIF
362 ! ----------------------------------------------------------
363 ! Data appear where a keyword is expected.
364 ! The user must be informed.
365 ! ----------------------------------------------------------
366  IF(eltype == 'EOR')THEN
367  keywrd = ' '
368  GOTO 900
369  ENDIF
370  IF(eltype == 'INT')THEN
371  CALL msgerr (2, 'Data field skipped:'//eltext)
372  GOTO 510
373  ENDIF
374  IF(eltype == 'REAL')THEN
375  CALL msgerr (2, 'Data field skipped:'//eltext)
376  GOTO 510
377  ENDIF
378  IF(eltype == 'CHAR' .OR. eltype == 'OTHR')THEN
379  CALL msgerr (2, 'Data field skipped:'//eltext)
380  GOTO 510
381  ENDIF
382  IF(eltype == 'EMPT')THEN
383  CALL msgerr (2, 'Empty data field skipped')
384  GOTO 510
385  ENDIF
386  CALL msgerr (3, 'Error subr. INKEYW')
387 ! ----------------------------------------------------------
388 900 IF(itest >= 10) WRITE (printf,910) keywrd
389 910 FORMAT (' KEYWORD: ',a8)
390  RETURN
391  END SUBROUTINE inkeyw
392 
393 !****************************************************************
394 ! *
395  SUBROUTINE inreal (NAAM, R, KONT, RSTA)
396 ! *
397 !****************************************************************
398 !
399  USE ocpcomm1
400  USE ocpcomm2
401  USE ocpcomm3
402  USE ocpcomm4
403  USE mod_utils
404 !
405  IMPLICIT NONE
406 !
407 !
408 ! SWAN (Simulating WAves Nearshore); a third generation wave model
409 ! Copyright (C) 2004-2005 Delft University of Technology
410 ! FVCOM-SWAVE; a third generation wave model
411 ! Copyright (C) 2008-2009 University of Massachusetts Dartmouth
412 !
413 ! This program is free software; you can redistribute it and/or
414 ! modify it under the terms of the GNU General Public License as
415 ! published by the Free Software Foundation; either version 2 of
416 ! the License, or (at your option) any later version.
417 !
418 ! This program is distributed in the hope that it will be useful,
419 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
420 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
421 ! GNU General Public License for more details.
422 !
423 ! A copy of the GNU General Public License is available at
424 ! http://www.gnu.org/copyleft/gpl.html#SEC3
425 ! or by writing to the Free Software Foundation, Inc.,
426 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
427 !
428 !
429 ! 0. AUTHORS
430 !
431 ! Jianhua Qi Dec. 20 2006
432 !
433 ! 1. UPDATES
434 !
435 ! 2. PURPOSE
436 !
437 ! Reads a REAL number in free format.
438 !
439 ! 3. METHOD
440 !
441 ! 4. ARGUMENT VARIABLES
442 !
443 ! R : The value of the variable that is to be read.
444 ! RSTA : Reference value needed for KONT='STA'or 'RQI'
445 !
446  REAL R, RSTA
447 !
448 ! KONT : What to do with the varible?
449 ! ='REQ'; Variable is required
450 ! ='UNC'; If no variable, then variable will not be changed
451 ! ='STA'; If no variable, then variable will get value of RSTA
452 ! ='RQI'; Variable may not have the value of RSTA
453 ! ='REP' (REPEAT)
454 ! ='NSKP' (NO SKIP) IF DATA ITEM IS OF DIFFERENT TYPE,
455 ! VALUE IS LEFT UNCHANGED.
456 ! NAAM : Name of the variable according to the user manual.
457 !
458  CHARACTER NAAM *(*), KONT *(*)
459 !
460 ! 5. PARAMETER VARIABLES
461 !
462 ! 6. LOCAL VARIABLES
463 !
464 ! INPFIL
465 ! ISCAN
466 ! FNTMP
467 !
468  CHARACTER(LEN=7) INPFIL
469  INTEGER ISCAN
470  REAL(SP) FNTMP
471 !
472 ! 8. SUBROUTINE USED
473 !
474 ! 9. SUBROUTINES CALLING
475 !
476 ! 10. ERROR MESSAGES
477 !
478 ! 11. REMARKS
479 !
480 ! 12. STRUCTURE
481 !
482 ! 13. SOURCE TEXT
483 !
484 ! INTEGER, SAVE IENT
485 ! DATA IENT /0/
486 ! CALL STRACE ( IENT, 'INREAL')
487 !
488  inpfil = "./INPUT"
489 
490  chgval = .false.
491  iscan = scan_file2(inpfil,naam,fscal = fntmp)
492  IF(iscan == 0)THEN
493  IF(abs(r-fntmp) > 1.0e-6)chgval = .true.
494  r = fntmp
495  ELSE
496  IF(kont == 'STA')THEN
497  r = rsta
498  ELSE IF(kont == 'REQ')THEN
499  WRITE(printf,*)'ERROR READING ',naam,': ',iscan
500  CALL pstop
501  END IF
502  END IF
503 
504 !JQI IF(KONT == 'STA')THEN
505 !JQI R = RSTA
506 !JQI ELSE
507 !JQI ISCAN = SCAN_FILE(INPFIL,NAAM,FSCAL = FNTMP)
508 !JQI IF(ISCAN == 0)THEN
509 !JQI IF(ABS(R-FNTMP) > 1.0E-6)CHGVAL = .TRUE.
510 !JQI R = FNTMP
511 !JQI ELSE
512 !JQI IF(KONT /= 'UNC')THEN
513 !JQI WRITE(PRINTF,*)'ERROR READING ',NAAM,': ',ISCAN
514 !JQI CALL PSTOP
515 !JQI END IF
516 !JQI END IF
517 !JQI END IF
518 
519  RETURN
520  END SUBROUTINE inreal
521 
522 !****************************************************************
523 ! *
524  SUBROUTINE inintg (NAAM, IV, KONT, ISTA)
525 ! *
526 !****************************************************************
527 !
528  USE ocpcomm1
529  USE ocpcomm2
530  USE ocpcomm3
531  USE ocpcomm4
532  USE mod_utils
533 !
534  IMPLICIT NONE
535 !
536 !
537 ! SWAN (Simulating WAves Nearshore); a third generation wave model
538 ! Copyright (C) 2004-2005 Delft University of Technology
539 ! FVCOM-SWAVE; a third generation wave model
540 ! Copyright (C) 2008-2009 University of Massachusetts Dartmouth
541 !
542 ! This program is free software; you can redistribute it and/or
543 ! modify it under the terms of the GNU General Public License as
544 ! published by the Free Software Foundation; either version 2 of
545 ! the License, or (at your option) any later version.
546 !
547 ! This program is distributed in the hope that it will be useful,
548 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
549 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
550 ! GNU General Public License for more details.
551 !
552 ! A copy of the GNU General Public License is available at
553 ! http://www.gnu.org/copyleft/gpl.html#SEC3
554 ! or by writing to the Free Software Foundation, Inc.,
555 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
556 !
557 !
558 ! 0. AUTHORS
559 !
560 ! Jianhua Qi
561 !
562 ! 1. UPDATES
563 !
564 ! 2. PURPOSE
565 !
566 ! Reads an integer number, in free format
567 !
568 ! 3. METHOD
569 !
570 ! 4. ARGUMENT VARIABLES
571 !
572 ! IV : integer variable which is to be assigned a value
573 ! ISTA : default value
574 !
575  INTEGER IV, ISTA
576 !
577 ! NAAM : name of the variable according to the user manual
578 ! KONT : What to do with the variable?
579 ! ='REQ'; error message if no value is found in the input file
580 ! ='UNC'; If no value, then variable will not be changed
581 ! ='STA'; If no value, then variable will get default value
582 ! ='RQI'; Variable may not have the value of RSTA
583 ! ='REP' (repeat)
584 ! ='NSKP' (no skip) if data item is of different type,
585 ! value is left unchanged.
586 !
587  CHARACTER NAAM *(*), KONT *(*)
588 !
589 ! 5. PARAMETER VARIABLES
590 !
591 ! PARAMETERS: SEE SUBR. INREAL
592 !
593 ! 6. LOCAL VARIABLES
594 !
595 ! INPFIL
596 ! ISCAN
597 ! INTMP
598 !
599  CHARACTER(LEN=7) INPFIL
600  INTEGER ISCAN
601  INTEGER INTMP
602 !
603 ! 8. SUBROUTINE USED
604 !
605 ! 9. SUBROUTINES CALLING
606 !
607 ! 10. ERROR MESSAGES
608 !
609 ! 11. REMARKS
610 !
611 ! 12. STRUCTURE
612 !
613 ! 13. SOURCE TEXT
614 !
615 ! SAVE IENT
616 ! DATA IENT /0/
617 ! CALL STRACE ( IENT, 'ININTG')
618 !
619  inpfil = "./INPUT"
620 
621 !JQIJQI IF(KONT == 'STA')THEN
622 !JQIJQI IV = ISTA
623 !JQIJQI ELSE
624 !JQIJQI ISCAN = SCAN_FILE(INPFIL,NAAM,ISCAL = INTMP)
625 !JQIJQI IF(ISCAN == 0)THEN
626 !JQIJQI IV = INTMP
627 !JQIJQI ELSE
628 !JQIJQI IF(KONT /= 'UNC')THEN
629 !JQIJQI WRITE(PRINTF,*)'ERROR READING ',NAAM,': ',ISCAN
630 !JQIJQI CALL PSTOP
631 !JQIJQI END IF
632 !JQIJQI END IF
633 !JQIJQI END IF
634 
635  iscan = scan_file2(inpfil,naam,iscal = intmp)
636  IF(iscan == 0)THEN
637  iv = intmp
638  ELSE
639  IF(kont == 'STA')THEN
640  iv = ista
641  ELSE IF(kont == 'REQ')THEN
642  WRITE(printf,*)'ERROR READING ',naam,': ',iscan
643  CALL pstop
644  END IF
645  END IF
646 
647  RETURN
648  END SUBROUTINE inintg
649 
650 !****************************************************************
651 ! *
652  SUBROUTINE inlogc (NAAM, L, KONT, LSTA)
653 ! *
654 !****************************************************************
655 !
656  USE ocpcomm1
657  USE ocpcomm2
658  USE ocpcomm3
659  USE ocpcomm4
660  USE mod_utils
661 !
662  IMPLICIT NONE
663 !
664 !
665 ! SWAN (Simulating WAves Nearshore); a third generation wave model
666 ! Copyright (C) 2004-2005 Delft University of Technology
667 ! FVCOM-SWAVE; a third generation wave model
668 ! Copyright (C) 2008-2009 University of Massachusetts Dartmouth
669 !
670 ! This program is free software; you can redistribute it and/or
671 ! modify it under the terms of the GNU General Public License as
672 ! published by the Free Software Foundation; either version 2 of
673 ! the License, or (at your option) any later version.
674 !
675 ! This program is distributed in the hope that it will be useful,
676 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
677 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
678 ! GNU General Public License for more details.
679 !
680 ! A copy of the GNU General Public License is available at
681 ! http://www.gnu.org/copyleft/gpl.html#SEC3
682 ! or by writing to the Free Software Foundation, Inc.,
683 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
684 !
685 !
686 ! 0. AUTHORS
687 !
688 ! Jianhua Qi Dec. 20 2006
689 !
690 ! 1. UPDATES
691 !
692 ! 2. PURPOSE
693 !
694 ! Reads a REAL number in free format.
695 !
696 ! 3. METHOD
697 !
698 ! 4. ARGUMENT VARIABLES
699 !
700 ! R : The value of the variable that is to be read.
701 ! RSTA : Reference value needed for KONT='STA'or 'RQI'
702 !
703  LOGICAL L, LSTA
704 !
705 ! KONT : What to do with the varible?
706 ! ='REQ'; Variable is required
707 ! ='UNC'; If no variable, then variable will not be changed
708 ! ='STA'; If no variable, then variable will get value of RSTA
709 ! ='RQI'; Variable may not have the value of RSTA
710 ! ='REP' (REPEAT)
711 ! ='NSKP' (NO SKIP) IF DATA ITEM IS OF DIFFERENT TYPE,
712 ! VALUE IS LEFT UNCHANGED.
713 ! NAAM : Name of the variable according to the user manual.
714 !
715  CHARACTER NAAM *(*), KONT *(*)
716 !
717 ! 5. PARAMETER VARIABLES
718 !
719 ! 6. LOCAL VARIABLES
720 !
721 ! INPFIL
722 ! ISCAN
723 ! FNTMP
724 !
725  CHARACTER(LEN=7) INPFIL
726  INTEGER ISCAN
727  LOGICAL LTMP
728 !
729 ! 8. SUBROUTINE USED
730 !
731 ! 9. SUBROUTINES CALLING
732 !
733 ! 10. ERROR MESSAGES
734 !
735 ! 11. REMARKS
736 !
737 ! 12. STRUCTURE
738 !
739 ! 13. SOURCE TEXT
740 !
741 ! INTEGER, SAVE IENT
742 ! DATA IENT /0/
743 ! CALL STRACE ( IENT, 'INREAL')
744 !
745  inpfil = "./INPUT"
746  iscan = scan_file2(inpfil,naam,lval = ltmp)
747  IF(iscan == 0)THEN
748  l = ltmp
749  ELSE
750  IF(kont == 'STA')THEN
751  l = lsta
752  ELSE IF(kont == 'REQ')THEN
753  WRITE(printf,*)'ERROR READING ',naam,': ',iscan
754  CALL pstop
755  END IF
756  END IF
757 
758 !JQI IF(KONT == 'STA')THEN
759 !JQI L = LSTA
760 !JQI ELSE
761 !JQI ISCAN = SCAN_FILE(INPFIL,NAAM,LVAL = LTMP)
762 !JQI IF(ISCAN == 0)THEN
763 !JQI L = LTMP
764 !JQI ELSE
765 !JQI IF(KONT /= 'UNC')THEN
766 !JQI WRITE(PRINTF,*)'ERROR READING ',NAAM,': ',ISCAN
767 !JQI CALL PSTOP
768 !JQI END IF
769 !JQI END IF
770 !JQI END IF
771 
772  RETURN
773  END SUBROUTINE inlogc
774 !****************************************************************
775 ! *
776  SUBROUTINE incstr (NAAM, C, KONT, CSTA)
777 ! *
778 !****************************************************************
779 !
780  USE ocpcomm1
781  USE ocpcomm2
782  USE ocpcomm3
783  USE ocpcomm4
784  USE mod_utils
785 !
786  IMPLICIT NONE
787 !
788 !
789 ! SWAN (Simulating WAves Nearshore); a third generation wave model
790 ! Copyright (C) 2004-2005 Delft University of Technology
791 ! FVCOM-SWAVE; a third generation wave model
792 ! Copyright (C) 2008-2009 University of Massachusetts Dartmouth
793 !
794 ! This program is free software; you can redistribute it and/or
795 ! modify it under the terms of the GNU General Public License as
796 ! published by the Free Software Foundation; either version 2 of
797 ! the License, or (at your option) any later version.
798 !
799 ! This program is distributed in the hope that it will be useful,
800 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
801 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
802 ! GNU General Public License for more details.
803 !
804 ! A copy of the GNU General Public License is available at
805 ! http://www.gnu.org/copyleft/gpl.html#SEC3
806 ! or by writing to the Free Software Foundation, Inc.,
807 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
808 !
809 !
810 ! 0. AUTHORS
811 !
812 ! Jianhua Qi
813 !
814 ! 1. UPDATES
815 !
816 ! 2. PURPOSE
817 !
818 ! Reads a string in free format
819 !
820 ! 3. METHOD
821 !
822 ! 4. ARGUMENT VARIABLES
823 !
824 ! NAAM : name of the variable according to the user manual
825 ! KONT : What to do with the variable?
826 ! ='REQ'; error message if no value is found in the input file
827 ! ='UNC'; If no value, then variable will not be changed
828 ! ='STA'; If no value, then variable will get default value
829 ! ='RQI'; Variable may not have the value of CSTA
830 ! ='REP' (repeat)
831 ! ='NSKP' (no skip) if data item is of different type,
832 ! value is left unchanged.
833 ! C : string that is to be read from input file
834 ! CSTA : default value of the string
835 !
836  CHARACTER NAAM *(*), KONT *(*), C *(*), CSTA *(*)
837 !
838 ! 5. PARAMETER VARIABLES
839 !
840 ! 6. LOCAL VARIABLES
841 !
842 ! INPFIL
843 ! ISCAN
844 ! INTMP
845 !
846  CHARACTER(LEN=7) INPFIL
847  INTEGER ISCAN
848  CHARACTER(LEN=80) CHTMP
849 !
850 ! 8. SUBROUTINE USED
851 !
852 ! 9. SUBROUTINES CALLING
853 !
854 ! 10. ERROR MESSAGES
855 !
856 ! 11. REMARKS
857 !
858 ! 12. STRUCTURE
859 !
860 ! 13. SOURCE TEXT
861 !
862 ! SAVE IENT
863 ! DATA IENT /0/
864 ! CALL STRACE ( IENT, 'INCSTR')
865 !
866  inpfil = "./INPUT"
867  iscan = scan_file2(inpfil,naam,cval = chtmp)
868  IF(iscan == 0)THEN
869  c = trim(chtmp)
870  ELSE
871  IF(kont == 'STA')THEN
872  c = csta
873  ELSE IF(kont == 'REQ')THEN
874  WRITE(printf,*)'ERROR READING ',naam,': ',iscan
875  CALL pstop
876  END IF
877  END IF
878 
879 !JQI IF(KONT == 'STA')THEN
880 !JQI C = CSTA
881 !JQI ELSE
882 !JQI ISCAN = SCAN_FILE(INPFIL,NAAM,CVAL = CHTMP)
883 !JQI IF(ISCAN == 0)THEN
884 !JQI C = TRIM(CHTMP)
885 !JQI ELSE
886 !JQI IF(KONT /= 'UNC')THEN
887 !JQI WRITE(PRINTF,*)'ERROR READING ',NAAM,': ',ISCAN
888 !JQI CALL PSTOP
889 !JQI END IF
890 !JQI END IF
891 !JQI END IF
892 
893  RETURN
894  END SUBROUTINE incstr
895 
896 !****************************************************************
897 ! *
898  SUBROUTINE inctim (IOPTIM, NAAM, RV, KONT, RSTA)
899 ! *
900 !****************************************************************
901 !
902  USE ocpcomm1
903  USE ocpcomm2
904  USE ocpcomm3
905  USE ocpcomm4
906  USE mod_utils
907 !
908  IMPLICIT NONE
909 !
910 !
911 ! SWAN (Simulating WAves Nearshore); a third generation wave model
912 ! Copyright (C) 2004-2005 Delft University of Technology
913 ! FVCOM-SWAVE; a third generation wave model
914 ! Copyright (C) 2008-2009 University of Massachusetts Dartmouth
915 !
916 ! This program is free software; you can redistribute it and/or
917 ! modify it under the terms of the GNU General Public License as
918 ! published by the Free Software Foundation; either version 2 of
919 ! the License, or (at your option) any later version.
920 !
921 ! This program is distributed in the hope that it will be useful,
922 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
923 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
924 ! GNU General Public License for more details.
925 !
926 ! A copy of the GNU General Public License is available at
927 ! http://www.gnu.org/copyleft/gpl.html#SEC3
928 ! or by writing to the Free Software Foundation, Inc.,
929 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
930 !
931 !
932 ! 0. AUTHORS
933 !
934 ! Jianhua Qi
935 !
936 ! 1. UPDATES
937 !
938 ! 2. PURPOSE
939 !
940 ! Reads and interprets a time string
941 !
942 ! 3. METHOD
943 !
944 ! 4. ARGUMENT VARIABLES
945 !
946 ! IOPTIM int inp time reading option (see subr DTSTTI)
947 !
948 !
949  INTEGER IOPTIM
950 !
951 ! RV : variable that is to be assigned a value
952 ! RSTA : default value
953 !
954  REAL RV, RSTA
955 !
956 ! NAAM : name of the variable according to the user manual
957 ! KONT : What to do with the variable?
958 ! ='REQ'; error message if no value is found in the input file
959 ! ='UNC'; If no value, then variable will not be changed
960 ! ='STA'; If no value, then variable will get default value
961 ! ='RQI'; Variable may not have the value of RSTA
962 ! ='REP' (repeat)
963 ! ='NSKP' (no skip) if data item is of different type,
964 ! value is left unchanged.
965 !
966  CHARACTER NAAM *(*), KONT *(*)
967 !
968 ! 5. PARAMETER VARIABLES
969 !
970 ! PARAMETERS: SEE PROGRAM DOCUMENTATION.
971 !
972 ! 6. LOCAL VARIABLES
973 !
974 ! IENT : Number of entries into this subroutine
975 ! LENMN : length of the string NAAM
976 !
977 ! INPFIL
978 ! ISCAN
979 ! INTMP
980 !
981  CHARACTER(LEN=7) INPFIL
982  INTEGER ISCAN
983  REAL FNTMP
984  CHARACTER(LEN=80) CHTMP
985  CHARACTER(LEN=24) C
986  REAL R
987  INTEGER IENT, LENNM,INTR
988 !
989 ! NAAM_L : local copy of NAAM
990 !
991  CHARACTER (LEN=40) :: NAAM_L
992 !
993 ! EQREAL : logical function, True if arguments are equal
994 !
995  LOGICAL EQREAL
996 !
997 ! 8. SUBROUTINE USED
998 !
999 ! 9. SUBROUTINES CALLING
1000 !
1001 ! 10. ERROR MESSAGES
1002 !
1003 ! 11. REMARKS
1004 !
1005 ! 12. STRUCTURE
1006 !
1007 ! 13. SOURCE TEXT
1008 !
1009  SAVE ient
1010  DATA ient /0/
1011  CALL strace ( ient, 'INCTIM')
1012 !
1013  inpfil = "./INPUT"
1014  iscan = scan_file2(inpfil,naam,cval = chtmp)
1015  IF(iscan == 0)THEN
1016  c = trim(chtmp)
1017  ELSE
1018 !JQI IF(KONT == 'STA')THEN
1019 !JQI RV = RSTA
1020 !JQI ELSE IF(KONT == 'REQ')THEN
1021  WRITE(printf,*)'ERROR READING ',naam,': ',iscan
1022  CALL pstop
1023 !JQI END IF
1024  END IF
1025 
1026 !JQI IF(KONT == 'STA')THEN
1027 !JQI RV = RSTA
1028 !JQI ELSE
1029 !JQI! ISCAN = SCAN_FILE(INPFIL,NAAM,FSCAL = FNTMP)
1030 !JQI ISCAN = SCAN_FILE(INPFIL,NAAM,CVAL = CHTMP)
1031 !JQI IF(ISCAN == 0)THEN
1032 !JQI! R = FNTMP
1033 !JQI! INTR = INT(R)
1034 !JQI! WRITE(C,'(F24.6)') R !R
1035 !JQI C = TRIM(CHTMP)
1036 !JQI! print*,'INTR=',INTR,R,'C=',c
1037 !JQI! print*,'C=',c
1038 !JQI ELSE
1039 !JQI IF(KONT /= 'UNC')THEN
1040 !JQI WRITE(PRINTF,*)'ERROR READING ',NAAM,': ',ISCAN
1041 !JQI CALL PSTOP
1042 !JQI END IF
1043 !JQI END IF
1044 !JQI END IF
1045 
1046 ! CALL DTRETI (ELTEXT(1:LENCST), IOPTIM, RV)
1047  CALL dtreti (c, ioptim, rv)
1048 !JQI IF (.NOT.EQREAL(RV,RSTA)) CHGVAL = .TRUE.
1049 
1050  RETURN
1051  END SUBROUTINE inctim
1052 
1053 !*******************************************************************
1054 ! *
1055  SUBROUTINE inintv (NAME, RVAR, KONT, RSTA)
1056 ! *
1057 !*******************************************************************
1058 !
1059  USE ocpcomm1
1060  USE ocpcomm2
1061  USE ocpcomm3
1062  USE ocpcomm4
1063 !
1064  IMPLICIT NONE
1065 !
1066 !
1067 ! --|-----------------------------------------------------------|--
1068 ! | Delft University of Technology |
1069 ! | Faculty of Civil Engineering |
1070 ! | Environmental Fluid Mechanics Section |
1071 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1072 ! | |
1073 ! | Programmers: R.C. Ris, N. Booij, |
1074 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1075 ! | M. Zijlema, E.E. Kriezi, |
1076 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1077 ! --|-----------------------------------------------------------|--
1078 !
1079 !
1080 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1081 ! Copyright (C) 2004-2005 Delft University of Technology
1082 !
1083 ! This program is free software; you can redistribute it and/or
1084 ! modify it under the terms of the GNU General Public License as
1085 ! published by the Free Software Foundation; either version 2 of
1086 ! the License, or (at your option) any later version.
1087 !
1088 ! This program is distributed in the hope that it will be useful,
1089 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1090 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1091 ! GNU General Public License for more details.
1092 !
1093 ! A copy of the GNU General Public License is available at
1094 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1095 ! or by writing to the Free Software Foundation, Inc.,
1096 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1097 !
1098 !
1099 ! 0. AUTHORS
1100 !
1101 ! 40.41: Marcel Zijlema
1102 !
1103 ! 1. UPDATES
1104 !
1105 ! Dec 1995, ver 30.09 : new subroutine
1106 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
1107 !
1108 ! 2. PURPOSE
1109 !
1110 ! Read a time interval in the form: number DAY/HR/MIN/SEC
1111 !
1112 ! 3. METHOD
1113 !
1114 ! 4. ARGUMENT VARIABLES
1115 !
1116 ! NAAM : name of the variable according to the user manual
1117 ! KONT : What to do with the variable?
1118 ! ='REQ'; error message if no value is found in the input file
1119 ! ='UNC'; If no value, then variable will not be changed
1120 ! ='STA'; If no value, then variable will get default value
1121 ! ='RQI'; Variable may not have the value of RSTA
1122 ! ='REP' (repeat)
1123 ! ='NSKP' (no skip) if data item is of different type,
1124 ! value is left unchanged.
1125 !
1126  CHARACTER NAME *(*), KONT *(*)
1127 !
1128 ! RSTA : default value
1129 ! RVAR : variable that is to be assigned a value
1130 !
1131  REAL RSTA, RVAR
1132 !
1133 ! 5. PARAMETER VARIABLES
1134 !
1135 ! 6. LOCAL VARIABLES
1136 !
1137 ! IENT : Number of entries into this subroutine
1138 !
1139  INTEGER IENT
1140 !
1141 ! FAC : a factor, value depends on unit of time used
1142 ! RI : auxiliary variable
1143 !
1144  REAL FAC, RI
1145 !
1146 ! KEYWIS : logical function, True if keyword encountered is equal to
1147 ! keyword in user manual
1148 !
1149  LOGICAL KEYWIS
1150 !
1151 ! 8. SUBROUTINE USED
1152 !
1153 ! 9. SUBROUTINES CALLING
1154 !
1155 ! 10. ERROR MESSAGES
1156 !
1157 ! 11. REMARKS
1158 !
1159 ! 12. STRUCTURE
1160 !
1161 ! -------------------------------------------------------------
1162 ! Call INREAL to read number of time units
1163 ! If a value was read
1164 ! Then Read time unit
1165 ! Case time unit is
1166 ! DAY: Fac = 24*3600
1167 ! HR: Fac = 3600
1168 ! MI: Fac = 60
1169 ! SEC: Fac = 1
1170 ! Else Fac = 1
1171 ! -------------------------------------------------------------
1172 ! Interval in seconds = Fac * number of time units
1173 ! -------------------------------------------------------------
1174 !
1175 ! 13. SOURCE TEXT
1176 !
1177  SAVE ient
1178  DATA ient /0/
1179  CALL strace (ient, 'ININTV')
1180 !
1181  CALL inreal (name, ri, kont, rsta)
1182  IF(chgval)THEN
1183  CALL inkeyw ('STA', 'S')
1184  IF(keywis('DA'))THEN
1185  fac = 24.*3600.
1186  ELSE IF(keywis('HR'))THEN
1187  fac = 3600.
1188  ELSE IF(keywis('MI'))THEN
1189  fac = 60.
1190  ELSE
1191  CALL ignore ('S')
1192  fac = 1.
1193  ENDIF
1194  ELSE
1195  fac = 1.
1196  ENDIF
1197  rvar = fac * ri
1198  RETURN
1199  END SUBROUTINE inintv
1200 
1201 !****************************************************************
1202 ! *
1203  SUBROUTINE leesel
1204 ! *
1205 !****************************************************************
1206 !
1207  USE ocpcomm1
1208  USE ocpcomm2
1209 ! USE OCPCOMM3
1210  USE ocpcomm4
1211 !
1212  IMPLICIT NONE
1213 !
1214 !
1215 ! --|-----------------------------------------------------------|--
1216 ! | Delft University of Technology |
1217 ! | Faculty of Civil Engineering |
1218 ! | Environmental Fluid Mechanics Section |
1219 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1220 ! | |
1221 ! | Programmers: R.C. Ris, N. Booij, |
1222 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1223 ! | M. Zijlema, E.E. Kriezi, |
1224 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1225 ! --|-----------------------------------------------------------|--
1226 !
1227 !
1228 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1229 ! Copyright (C) 2004-2005 Delft University of Technology
1230 !
1231 ! This program is free software; you can redistribute it and/or
1232 ! modify it under the terms of the GNU General Public License as
1233 ! published by the Free Software Foundation; either version 2 of
1234 ! the License, or (at your option) any later version.
1235 !
1236 ! This program is distributed in the hope that it will be useful,
1237 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1238 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1239 ! GNU General Public License for more details.
1240 !
1241 ! A copy of the GNU General Public License is available at
1242 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1243 ! or by writing to the Free Software Foundation, Inc.,
1244 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1245 !
1246 !
1247 ! 0. AUTHORS
1248 !
1249 ! 40.13: Nico Booij
1250 ! 40.41: Marcel Zijlema
1251 !
1252 ! 1. UPDATES
1253 !
1254 ! Jan. 1994, mod. 20.05: ELREAL is made double precision
1255 ! 40.13, Jan. 01: ! is now added as comment sign
1256 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
1257 !
1258 ! 2. PURPOSE
1259 !
1260 ! reads a new data item from the string 'KAART'.
1261 ! type of the item is determined, and the contents appears
1262 ! in ELTEXT, ELINT, or ELREAL, as the case may be.
1263 ! the following types are distinguished:
1264 ! 'KEY' keyword
1265 ! 'INT' integer or real number
1266 ! 'REAL' real number
1267 ! 'CHAR' character string enclosed in quotes
1268 ! 'EMPT' empty data field
1269 ! 'OTHR' non-empty data item not recognized as real, int or char,
1270 ! possibly a time string
1271 ! 'EOF' end of input file
1272 !
1273 ! 'EOR' end of repeat, or end of record
1274 ! 'ERR' error
1275 ! 'USED' used, item last read is processed already.
1276 !
1277 ! 3. METHOD
1278 !
1279 ! difference between comment signs $ and !: 40.13
1280 ! everything on an input line behind a ! is ignored
1281 ! text between two $-signs (on one line) is intepreted as comment
1282 ! text behind two $-signs is intepreted as valid input
1283 !
1284 ! 4. ARGUMENT VARIABLES
1285 !
1286 ! 5. PARAMETER VARIABLES
1287 !
1288 ! 6. LOCAL VARIABLES
1289 !
1290 ! IENT : Number of entries into this subroutine
1291 ! IRK : auxiliary value used to detect errors
1292 ! ISIGN1 : sign of mantissa part
1293 ! ISIGN2 : sign of exponent part
1294 ! ISTATE : state of the number reading process
1295 ! J : counter
1296 ! JJ : counter
1297 ! JKAR : counts the number of characters in the data field
1298 ! NREP : repetition number
1299 ! NUM1 : value of integer part of mantissa
1300 ! NUM2 : exponent value
1301 !
1302  INTEGER IENT, IRK, ISIGN1, ISIGN2, ISTATE, J, JJ, JKAR, NREP, &
1303  NUM1, NUM2
1304 !
1305 ! RMANT : real mantissa value
1306 !
1307  DOUBLE PRECISION RMANT
1308 !
1309 ! QUOTE : the quote character
1310 !
1311  CHARACTER QUOTE *1
1312 !
1313 ! 8. SUBROUTINE USED
1314 !
1315 ! 9. SUBROUTINES CALLING
1316 !
1317 ! 10. ERROR MESSAGES
1318 !
1319 ! 11. REMARKS
1320 !
1321 ! 12. STRUCTURE
1322 !
1323 ! 13. SOURCE TEXT
1324 !
1325  SAVE ient, quote, nrep
1326  DATA quote/''''/ , ient/0/, nrep/1/
1327  CALL strace ( ient, 'LEESEL')
1328 !
1329  IF(nrep > 1)THEN
1330  nrep = nrep - 1
1331  GOTO 190
1332  ENDIF
1333 !
1334 ! initialisations
1335 !
1336 2 nrep = 1
1337  DO j=1,lineln,4
1338  eltext(j:j+3) = ' '
1339  END DO
1340  jkar = 1
1341  elint=0
1342  elreal=0.
1343 !
1344 ! start processing data item
1345 !
1346  IF(karnr == 0) GOTO 12
1347 ! process a new character
1348 10 IF(kar == '!' .OR. karnr > lineln)THEN
1349 ! end of the line is reached, if repetition factor is >1
1350 ! the data item is assumed to be empty
1351  IF(nrep > 1) GOTO 28
1352 ! end of the line is reached, if no repetition factor appears
1353 ! the data item is assumed to be of type 'EOR'
1354  eltype='EOR'
1355  IF(kar == '!') karnr = lineln+1
1356  GOTO 190
1357  ENDIF
1358 ! skip leading blanks or Tab characters
1359 11 IF(kar /= ' ' .AND. kar /= tabc) GOTO 20
1360 
1361 ! print*,'before getkar 1'
1362 12 CALL getkar
1363 ! print*,'after getkar 1'
1364 ! end of input file was reached
1365  IF(eltype == 'EOF')THEN
1366 ! generate keyword STOP
1367  eltext='STOP'
1368  GOTO 190
1369  ENDIF
1370  GOTO 10
1371 ! if character is comma, empty data field
1372 20 IF(kar /= ',') GOTO 30
1373 ! print*,'before getkar 2'
1374  CALL getkar
1375 ! print*,'after getkar 2'
1376 28 eltype='EMPT'
1377  GOTO 190
1378 ! Notice: jump to label 28 (empty data field)
1379 ! if after repetition a comment, a keyword, end of record etc. is found.
1380 ! --------------------------------------------------------
1381 ! see whether end of repeat (; or /) is marked
1382 30 IF(index(';/',kar) > 0)THEN
1383  IF(nrep > 1) GOTO 28
1384  eltype='EOR'
1385 ! print*,'before getkar 3'
1386  CALL getkar
1387 ! print*,'after getkar 3'
1388  GOTO 190
1389  ENDIF
1390 ! ( marks the beginning of a data item group; is ignored
1391 38 IF(kar == '(') GOTO 12
1392 ! --------------------------------------------------------
1393 ! comment; data enclosed in comment identifiers is interpreted as comment
1394 ! print*,'KAR=',KAR,'COMID=',COMID,NREP
1395 40 IF(kar == comid)THEN
1396  IF(nrep > 1) GOTO 28
1397 ! print*,'before getkar 4'
1398 41 CALL getkar
1399 ! print*,'after getkar 4'
1400  IF(karnr > lineln) GOTO 10
1401  IF(kar /= comid) GOTO 41
1402  GOTO 12
1403  ENDIF
1404 ! -------------------------------------------------------
1405 ! if item is a number, read this integer or real number
1406 !
1407 ! integer number: SIGN1]NUM1
1408 ! real: SIGN1]NUM1].]MANT]E]SIGN2]NUM2
1409 ! ISTATE = 10 9 8 7 6 5 4 3
1410 ! SIGN1, SIGN2: + OR -
1411 ! NUM1, NUM2, MANT: series of digits
1412 ! -------------------------------------------------------
1413 50 IF(index('+-.0123456789',kar) == 0) GOTO 80
1414  num1=0
1415  num2=0
1416  isign1=1
1417  isign2=1
1418  istate=10
1419  irk=0
1420  rmant=0.
1421  eltype='INT'
1422  IF(index('+-',kar) == 0) GOTO 52
1423  istate=9
1424  IF(kar == '-') isign1=-1
1425  CALL putkar (eltext, kar, jkar)
1426 ! print*,'before getkar 5'
1427  CALL getkar
1428 ! print*,'after getkar 5'
1429 ! **** part before decimal point ****
1430 52 IF(index('0123456789',kar) == 0) GOTO 54
1431  irk=1
1432  istate=8
1433  num1=10*num1+index('123456789',kar)
1434  CALL putkar (eltext, kar, jkar)
1435 ! print*,'before getkar 6'
1436  CALL getkar
1437 ! print*,'after getkar 6'
1438  GOTO 52
1439 54 IF(kar /= '.') GOTO 56
1440  istate=7
1441  eltype='REAL'
1442  CALL putkar (eltext, kar, jkar)
1443 ! print*,'before getkar 7'
1444  CALL getkar
1445 ! print*,'after getkar 7'
1446 56 jj=-1
1447 ! **** part after decimal point ****
1448 57 IF(index('0123456789',kar) == 0) GOTO 58
1449  irk=1
1450  istate=6
1451  rmant = rmant + dble(index('123456789',kar))*1.d1**jj
1452  jj=jj-1
1453  CALL putkar (eltext, kar, jkar)
1454 ! print*,'before getkar 8'
1455  CALL getkar
1456 ! print*,'after getkar 8'
1457  GOTO 57
1458 58 IF(istate >= 9 .OR. irk == 0) GOTO 120
1459 ! **** exponent part ****
1460  IF(index('DdEe^',kar) == 0) GOTO 66
1461  istate=5
1462  irk=0
1463  IF(eltype == 'INT') eltype='REAL'
1464  CALL putkar (eltext, kar, jkar)
1465 ! print*,'before getkar 9'
1466  CALL getkar
1467 ! print*,'after getkar 9'
1468  IF(index('+-',kar) == 0) GOTO 62
1469  IF(kar == '-') isign2=-1
1470  istate=4
1471  CALL putkar (eltext, kar, jkar)
1472 ! print*,'before getkar 10'
1473  CALL getkar
1474 ! print*,'after getkar 10'
1475 62 IF(index('0123456789',kar) == 0) GOTO 66
1476  irk=1
1477  istate=3
1478  num2=10*num2+index('123456789',kar)
1479  CALL putkar (eltext, kar, jkar)
1480 ! print*,'before getkar 11'
1481  CALL getkar
1482 ! print*,'after getkar 11'
1483  GOTO 62
1484 ! **** a number is put together ****
1485 66 IF(irk == 0) GOTO 120
1486  IF(index('+-.',kar) >= 1) eltype='OTHR'
1487  istate=2
1488  IF(itest >= 330) WRITE (printf,699) eltype, isign1, num1, &
1489  rmant, isign2, num2
1490 699 FORMAT (1x, a4, 2i6, f12.9, 2i6)
1491  IF(eltype == 'REAL') elreal = &
1492  isign1*(dble(num1)+rmant) * 1.d1**(isign2*num2)
1493  IF(eltype == 'INT') elint = isign1*num1
1494  lencst = jkar - 1
1495 ! skip trailing blanks
1496 67 IF(kar /= ' ' .AND. kar /= tabc) GOTO 68
1497  istate=1
1498 ! print*,'before getkar 12'
1499  CALL getkar
1500 ! print*,'after getkar 12'
1501  GOTO 67
1502 ! If a * is encountered now, it is interpreted as a repetition factor.
1503 68 IF(kar == '*')THEN
1504  IF(eltype == 'INT' .AND. elint > 0)THEN
1505  nrep = elint
1506  elint = 0
1507 ! print*,'before getkar 13'
1508  CALL getkar
1509 ! print*,'after getkar 13'
1510  GOTO 10
1511  ELSE
1512  CALL msgerr (2, 'Wrong repetition factor')
1513 ! print*,'before getkar 14'
1514  CALL getkar
1515 ! print*,'after getkar 14'
1516  GOTO 190
1517  ENDIF
1518  ENDIF
1519 69 IF(kar == ',')THEN
1520 ! print*,'before getkar 15'
1521  CALL getkar
1522 ! print*,'after getkar 15'
1523  GOTO 190
1524  ENDIF
1525  IF(istate == 1) GOTO 190
1526  IF(index(' ;',kar) /= 0 .OR. kar == tabc)THEN
1527  GOTO 190
1528  ENDIF
1529 ! number is not followed by , blank or tab; type is made OTHR:
1530  GOTO 120
1531 ! ----------------------------------------------------------
1532 ! a character string is read; it start and ends with a quote
1533 ! ----------------------------------------------------------
1534 80 IF(kar == quote)THEN
1535  eltype='CHAR'
1536  lencst = 0
1537  jj=1
1538 ! print*,'before getkar 16'
1539 82 CALL getkar
1540 ! print*,'after getkar 16'
1541 ! end of the string: end of record or closing quote
1542  IF(karnr > lineln) GOTO 190
1543  IF(kar == quote)THEN
1544 ! print*,'before getkar 17'
1545  CALL getkar
1546 ! print*,'after getkar 17'
1547 ! new character is not a quote; end of the string
1548  IF(kar /= quote) GOTO 88
1549 ! double quote is read as a single quote; continue
1550  ENDIF
1551 ! put the character into ELTEXT
1552 84 eltext(jj:jj) = kar
1553  lencst = jj
1554  jj=jj+1
1555  GOTO 82
1556 ! process characters behind the string
1557 ! print*,'before getkar 18'
1558 87 CALL getkar
1559 ! print*,'after getkar 18'
1560 ! skip trailing blanks
1561 88 IF(kar == ' ' .OR. kar == tabc) GOTO 87
1562  IF(kar /= ',') GOTO 190
1563 ! print*,'before getkar 19'
1564  CALL getkar
1565 ! print*,'after getkar 19'
1566  GOTO 190
1567  ENDIF
1568 ! -------------------------------------------------------
1569 ! a keyword is read
1570 ! a keyword starts with a letter (upper or lower case)
1571 ! -------------------------------------------------------
1572 90 CALL upcase (kar)
1573 ! print*,'KAR= ',KAR,'QUOTE= ',QUOTE
1574  IF(index('ABCDEFGHIJKLMNOPQRSTUVWXYZ',kar) > 0)THEN
1575  IF(nrep > 1) GOTO 28
1576  eltype='KEY'
1577  istate=2
1578  jj=1
1579 92 eltext(jj:jj) = kar
1580  lencst = jj
1581 ! print*,'before getkar 20'
1582  CALL getkar
1583 ! print*,'after getkar 20'
1584  CALL upcase (kar)
1585  jj=jj+1
1586 ! next characters: letters, digits or - _ .
1587  IF(index('ABCDEFGHIJKLMNOPQRSTUVWXYZ',kar) >= 1) GOTO 92
1588  IF(index('0123456789-_.',kar) >= 1) GOTO 92
1589 ! keyword is read
1590  keywrd = eltext(1:8)
1591 ! print*,'KEYWRD= ',KEYWRD
1592 ! trailing blanks or tab char are skipped
1593 94 IF(kar /= ' ' .AND. kar /= tabc) GOTO 96
1594 ! print*,'before getkar 21'
1595  CALL getkar
1596 ! print*,'after getkar 21'
1597  GOTO 94
1598 ! closure character : or = is processed
1599 96 IF(index('=:',kar) == 0) GOTO 190
1600 ! print*,'before getkar 22'
1601  CALL getkar
1602 ! print*,'after getkar 22'
1603  GOTO 190
1604  ENDIF
1605 ! --------------------------------------------------
1606 ! continuation symbol is read
1607 ! --------------------------------------------------
1608 100 IF(index('_&',kar) == 0) GOTO 120
1609  IF(nrep > 1) GOTO 28
1610 110 karnr=0
1611  GOTO 12
1612 ! --------------------------------------------------
1613 ! other type of data
1614 ! --------------------------------------------------
1615 120 eltype='OTHR'
1616 122 eltext(jkar:jkar) = kar
1617  lencst = jkar
1618  jkar=jkar+1
1619 ! print*,'before getkar 23'
1620  CALL getkar
1621 ! print*,'after getkar 23'
1622  IF(index(' ,;', kar) >= 1 .OR. kar == tabc) GOTO 126
1623  GOTO 122
1624 ! print*,'before getkar 24'
1625 126 CALL getkar
1626 ! print*,'after getkar 24'
1627 ! 127 CALL MSGERR (3, 'Read error in: ')
1628 ! WRITE (PRINTF,129) ELTEXT
1629 ! 129 FORMAT (A)
1630 ! RETURN
1631 ! --------------------------------------------------
1632 ! test output and return to calling program
1633 ! --------------------------------------------------
1634 190 IF(itest >= 120) WRITE (prtest, 199) kar, karnr, eltype, elreal, &
1635  elint, nrep, eltext(1:lencst)
1636 199 FORMAT (' test LEESEL: ', a1, 1x, i4, 1x, a4, d12.4, 2i6, 2x, a)
1637  RETURN
1638  END SUBROUTINE leesel
1639 
1640 !****************************************************************
1641 ! *
1642  SUBROUTINE getkar
1643 ! *
1644 !****************************************************************
1645 !
1646  USE ocpcomm1
1647  USE ocpcomm2
1648 ! USE OCPCOMM3
1649  USE ocpcomm4
1650 !
1651  IMPLICIT NONE
1652 !
1653 !
1654 ! --|-----------------------------------------------------------|--
1655 ! | Delft University of Technology |
1656 ! | Faculty of Civil Engineering |
1657 ! | Environmental Fluid Mechanics Section |
1658 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1659 ! | |
1660 ! | Programmers: R.C. Ris, N. Booij, |
1661 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1662 ! | M. Zijlema, E.E. Kriezi, |
1663 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1664 ! --|-----------------------------------------------------------|--
1665 !
1666 !
1667 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1668 ! Copyright (C) 2004-2005 Delft University of Technology
1669 !
1670 ! This program is free software; you can redistribute it and/or
1671 ! modify it under the terms of the GNU General Public License as
1672 ! published by the Free Software Foundation; either version 2 of
1673 ! the License, or (at your option) any later version.
1674 !
1675 ! This program is distributed in the hope that it will be useful,
1676 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1677 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1678 ! GNU General Public License for more details.
1679 !
1680 ! A copy of the GNU General Public License is available at
1681 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1682 ! or by writing to the Free Software Foundation, Inc.,
1683 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1684 !
1685 !
1686 ! 0. AUTHORS
1687 !
1688 ! 40.13: Nico Booij
1689 ! 40.41: Marcel Zijlema
1690 !
1691 ! 1. UPDATES
1692 !
1693 ! 40.13, Jan. 2001: TRIM used to limit output
1694 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
1695 !
1696 ! 2. PURPOSE
1697 !
1698 ! This procedure reads a next character (KAR) from the string KAART.
1699 ! The position of this character in KAART is indicated by KARNR.
1700 ! If needed, a new input line is read.
1701 ! At the end of the input file ELTYPE is made 'EOF'.
1702 !
1703 ! 3. METHOD
1704 !
1705 ! 4. ARGUMENT VARIABLES
1706 !
1707 ! 5. PARAMETER VARIABLES
1708 !
1709 ! 6. LOCAL VARIABLES
1710 !
1711 ! IENT : Number of entries into this subroutine
1712 !
1713  INTEGER IENT
1714 !
1715 ! 8. SUBROUTINE USED
1716 !
1717 ! 9. SUBROUTINES CALLING
1718 !
1719 ! 10. ERROR MESSAGES
1720 !
1721 ! 11. REMARKS
1722 !
1723 ! 12. STRUCTURE
1724 !
1725 ! 13. SOURCE TEXT
1726 !
1727  SAVE ient
1728  DATA ient /0/
1729  CALL strace (ient, 'GETKAR')
1730 
1731  IF(karnr == 0)THEN
1732  READ(inputf, '(A)', end=20) kaart
1733 
1734 ! print*,'KAART=',trim(KAART),lineln
1735  IF(itest >= -10) WRITE (printf, '(1X,A)') trim(kaart)
1736  karnr=1
1737  ENDIF
1738  IF(karnr > lineln)THEN
1739  kar=';'
1740  GOTO 90
1741  ENDIF
1742  kar = kaart(karnr:karnr)
1743 ! print*,'KAR=',trim(KAR)
1744  karnr=karnr+1
1745  GOTO 90
1746 ! end of file is encountered
1747 20 eltype='EOF'
1748  kar='@'
1749 90 IF(itest >= 320) WRITE (printf, '(" Test GETKAR", 2X, A4, 2X, A1, I4)') &
1750  eltype, kar, karnr
1751 
1752  RETURN
1753  END SUBROUTINE getkar
1754 
1755 !****************************************************************
1756 ! *
1757  SUBROUTINE putkar (LTEXT, KARR, JKAR)
1758 ! *
1759 !****************************************************************
1760 !
1761  USE ocpcomm1
1762  USE ocpcomm2
1763 ! USE OCPCOMM3
1764  USE ocpcomm4
1765 !
1766  IMPLICIT NONE
1767 !
1768 !
1769 ! --|-----------------------------------------------------------|--
1770 ! | Delft University of Technology |
1771 ! | Faculty of Civil Engineering |
1772 ! | Environmental Fluid Mechanics Section |
1773 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1774 ! | |
1775 ! | Programmers: R.C. Ris, N. Booij, |
1776 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1777 ! | M. Zijlema, E.E. Kriezi, |
1778 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1779 ! --|-----------------------------------------------------------|--
1780 !
1781 !
1782 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1783 ! Copyright (C) 2004-2005 Delft University of Technology
1784 !
1785 ! This program is free software; you can redistribute it and/or
1786 ! modify it under the terms of the GNU General Public License as
1787 ! published by the Free Software Foundation; either version 2 of
1788 ! the License, or (at your option) any later version.
1789 !
1790 ! This program is distributed in the hope that it will be useful,
1791 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1792 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1793 ! GNU General Public License for more details.
1794 !
1795 ! A copy of the GNU General Public License is available at
1796 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1797 ! or by writing to the Free Software Foundation, Inc.,
1798 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1799 !
1800 !
1801 ! 0. AUTHORS
1802 !
1803 ! 40.41: Marcel Zijlema
1804 !
1805 ! 1. UPDATES
1806 !
1807 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
1808 !
1809 ! 2. PURPOSE
1810 !
1811 ! this procedure inserts a character (KARR) usually read by GETKAR
1812 ! into the string LTEXT, usually equal to ELTEXT, in the place
1813 ! JKAR. After this JKAR is increased by 1.
1814 !
1815 ! 3. METHOD
1816 !
1817 ! 4. ARGUMENT VARIABLES
1818 !
1819 ! JKAR : counts the number of characters in a data field
1820 !
1821  INTEGER JKAR
1822 !
1823 ! LTEXT : a character string; after a number of calls it should
1824 ! contain the character representation of a data field
1825 ! KARR : character to be inserted into LTEXT
1826 !
1827  CHARACTER LTEXT *(*), KARR *1
1828 !
1829 ! 5. PARAMETER VARIABLES
1830 !
1831 ! 6. LOCAL VARIABLES
1832 !
1833 ! IENT : Number of entries into this subroutine
1834 !
1835  INTEGER IENT
1836 !
1837 ! 8. SUBROUTINE USED
1838 !
1839 ! 9. SUBROUTINES CALLING
1840 !
1841 ! 10. ERROR MESSAGES
1842 !
1843 ! 11. REMARKS
1844 !
1845 ! 12. STRUCTURE
1846 !
1847 ! 13. SOURCE TEXT
1848 !
1849  SAVE ient
1850  DATA ient /0/
1851  CALL strace (ient, 'PUTKAR')
1852 
1853  IF(jkar > len(ltext)) CALL msgerr (2, 'PUTKAR, string too long')
1854  ltext(jkar:jkar) = karr
1855  lencst = jkar
1856  jkar = jkar + 1
1857  RETURN
1858  END SUBROUTINE putkar
1859 
1860 !****************************************************************
1861 ! *
1862  SUBROUTINE upcase (CHARST)
1863 ! *
1864 !****************************************************************
1865 !
1866  USE ocpcomm1
1867  USE ocpcomm2
1868 ! USE OCPCOMM3
1869  USE ocpcomm4
1870 !
1871  IMPLICIT NONE
1872 !
1873 !
1874 ! --|-----------------------------------------------------------|--
1875 ! | Delft University of Technology |
1876 ! | Faculty of Civil Engineering |
1877 ! | Environmental Fluid Mechanics Section |
1878 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1879 ! | |
1880 ! | Programmers: R.C. Ris, N. Booij, |
1881 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1882 ! | M. Zijlema, E.E. Kriezi, |
1883 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1884 ! --|-----------------------------------------------------------|--
1885 !
1886 !
1887 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1888 ! Copyright (C) 2004-2005 Delft University of Technology
1889 !
1890 ! This program is free software; you can redistribute it and/or
1891 ! modify it under the terms of the GNU General Public License as
1892 ! published by the Free Software Foundation; either version 2 of
1893 ! the License, or (at your option) any later version.
1894 !
1895 ! This program is distributed in the hope that it will be useful,
1896 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1897 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1898 ! GNU General Public License for more details.
1899 !
1900 ! A copy of the GNU General Public License is available at
1901 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1902 ! or by writing to the Free Software Foundation, Inc.,
1903 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1904 !
1905 !
1906 ! 0. AUTHORS
1907 !
1908 ! 40.41: Marcel Zijlema
1909 !
1910 ! 1. UPDATES
1911 !
1912 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
1913 !
1914 ! 2. PURPOSE
1915 !
1916 ! changes all characters of the string CHARST from lower to
1917 ! upper case
1918 !
1919 ! 3. METHOD
1920 !
1921 ! 4. ARGUMENT VARIABLES
1922 !
1923 ! CHARST : a character string
1924 !
1925  CHARACTER*(*) CHARST
1926 !
1927 ! 5. PARAMETER VARIABLES
1928 !
1929 ! 6. LOCAL VARIABLES
1930 !
1931 ! IC : sequence number of a character in the string CHARST
1932 ! IENT : Number of entries into this subroutine
1933 ! KK : position of a character in a given string
1934 ! LLCC : length of the given character string
1935 !
1936  INTEGER IC, IENT, KK, LLCC
1937 !
1938 ! ABCUP : A to Z upper case characters
1939 ! ABCLO : a to z lower case characters
1940 ! CC : a character
1941 !
1942  CHARACTER ABCUP *26, ABCLO *26, CC *1
1943 !
1944 ! 8. SUBROUTINE USED
1945 !
1946 ! 9. SUBROUTINES CALLING
1947 !
1948 ! 10. ERROR MESSAGES
1949 !
1950 ! 11. REMARKS
1951 !
1952 ! 12. STRUCTURE
1953 !
1954 ! 13. SOURCE TEXT
1955 !
1956  SAVE ient
1957  DATA ient /0/
1958  DATA abcup /'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
1959  DATA abclo /'abcdefghijklmnopqrstuvwxyz'/
1960  CALL strace (ient, 'UPCASE')
1961 !
1962  llcc = len(charst)
1963  DO ic = 1, llcc
1964  cc = charst(ic:ic)
1965  kk = index(abclo, cc)
1966  IF(kk /= 0) charst(ic:ic) = abcup(kk:kk)
1967  END DO
1968  RETURN
1969  END SUBROUTINE upcase
1970 
1971 !****************************************************************
1972 ! *
1973  LOGICAL FUNCTION keywis (STRING)
1974 ! *
1975 !****************************************************************
1976 !
1977  USE ocpcomm1
1978  USE ocpcomm2
1979  USE ocpcomm3
1980  USE ocpcomm4
1981 !
1982  IMPLICIT NONE
1983 !
1984 !
1985 ! --|-----------------------------------------------------------|--
1986 ! | Delft University of Technology |
1987 ! | Faculty of Civil Engineering |
1988 ! | Environmental Fluid Mechanics Section |
1989 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1990 ! | |
1991 ! | Programmers: R.C. Ris, N. Booij, |
1992 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1993 ! | M. Zijlema, E.E. Kriezi, |
1994 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1995 ! --|-----------------------------------------------------------|--
1996 !
1997 !
1998 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1999 ! Copyright (C) 2004-2005 Delft University of Technology
2000 !
2001 ! This program is free software; you can redistribute it and/or
2002 ! modify it under the terms of the GNU General Public License as
2003 ! published by the Free Software Foundation; either version 2 of
2004 ! the License, or (at your option) any later version.
2005 !
2006 ! This program is distributed in the hope that it will be useful,
2007 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
2008 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2009 ! GNU General Public License for more details.
2010 !
2011 ! A copy of the GNU General Public License is available at
2012 ! http://www.gnu.org/copyleft/gpl.html#SEC3
2013 ! or by writing to the Free Software Foundation, Inc.,
2014 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2015 !
2016 !
2017 ! 0. AUTHORS
2018 !
2019 ! 40.41: Marcel Zijlema
2020 !
2021 ! 1. UPDATES
2022 !
2023 ! 40.00, July
2024 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
2025 !
2026 ! 2. PURPOSE
2027 !
2028 ! This procedure tests whether a keyword given by the user
2029 ! coincides with a keyword known in the program (i.e. string).
2030 ! if so, keywis is made .True., otherwise it is .False.
2031 ! also ELTYPE is made 'USED', so that next element can be read.
2032 !
2033 ! 3. METHOD
2034 !
2035 ! 4. ARGUMENT VARIABLES
2036 !
2037 ! STRING : a keyword which is compared with a keyword found in the input file
2038 !
2039  CHARACTER string *(*)
2040 !
2041 ! 5. PARAMETER VARIABLES
2042 !
2043 ! 6. LOCAL VARIABLES
2044 !
2045 ! IENT : Number of entries into this subroutine
2046 ! J : counter
2047 ! LENSS : length of the keyword STRING
2048 !
2049  INTEGER ient, j, lenss
2050 !
2051 ! KAR1 : a character of the keyword appearing in the input file
2052 ! KAR2 : corresponding character in the STRING
2053 !
2054  CHARACTER kar1 *1, kar2 *1
2055 !
2056 ! 8. SUBROUTINE USED
2057 !
2058 ! 9. SUBROUTINES CALLING
2059 !
2060 ! 10. ERROR MESSAGES
2061 !
2062 ! 11. REMARKS
2063 !
2064 ! 12. STRUCTURE
2065 !
2066 ! 13. SOURCE TEXT
2067 !
2068  SAVE ient
2069  DATA ient /0/
2070  CALL strace (ient, 'KEYWIS')
2071 !
2072  keywis = .false.
2073  IF(eltype == 'USED') GOTO 30
2074 !
2075  keywis=.true.
2076  lenss = len(string)
2077  DO j=1, lenss
2078  kar1 = keywrd(j:j)
2079  kar2 = string(j:j)
2080  IF(kar1 /= kar2 .AND. kar2 /= ' ')THEN
2081  keywis=.false.
2082  GOTO 30
2083  ENDIF
2084  END DO
2085  IF(eltype == 'KEY') eltype = 'USED'
2086 30 RETURN
2087  END FUNCTION keywis
2088 
2089 !****************************************************************
2090 ! *
2091  SUBROUTINE wrnkey
2092 ! *
2093 !****************************************************************
2094 !
2095  USE ocpcomm1
2096  USE ocpcomm2
2097  USE ocpcomm3
2098  USE ocpcomm4
2099 !
2100  IMPLICIT NONE
2101 !
2102 !
2103 ! --|-----------------------------------------------------------|--
2104 ! | Delft University of Technology |
2105 ! | Faculty of Civil Engineering |
2106 ! | Environmental Fluid Mechanics Section |
2107 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
2108 ! | |
2109 ! | Programmers: R.C. Ris, N. Booij, |
2110 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
2111 ! | M. Zijlema, E.E. Kriezi, |
2112 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
2113 ! --|-----------------------------------------------------------|--
2114 !
2115 !
2116 ! SWAN (Simulating WAves Nearshore); a third generation wave model
2117 ! Copyright (C) 2004-2005 Delft University of Technology
2118 !
2119 ! This program is free software; you can redistribute it and/or
2120 ! modify it under the terms of the GNU General Public License as
2121 ! published by the Free Software Foundation; either version 2 of
2122 ! the License, or (at your option) any later version.
2123 !
2124 ! This program is distributed in the hope that it will be useful,
2125 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
2126 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2127 ! GNU General Public License for more details.
2128 !
2129 ! A copy of the GNU General Public License is available at
2130 ! http://www.gnu.org/copyleft/gpl.html#SEC3
2131 ! or by writing to the Free Software Foundation, Inc.,
2132 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2133 !
2134 !
2135 ! 0. AUTHORS
2136 !
2137 ! 40.41: Marcel Zijlema
2138 !
2139 ! 1. UPDATES
2140 !
2141 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
2142 !
2143 ! 2. PURPOSE
2144 !
2145 ! THIS PROCEDURE PRODUCES AN ERROR MESSAGE
2146 ! IT IS CALLED IF AN ILLEGAL KEYWORD IS FOUND IN THE
2147 ! USER'S INPUT. IT MAKES ELTYPE = 'USED'
2148 !
2149 ! 3. METHOD
2150 !
2151 ! 4. ARGUMENT VARIABLES
2152 !
2153 ! 5. PARAMETER VARIABLES
2154 !
2155 ! 6. LOCAL VARIABLES
2156 !
2157 ! IENT : Number of entries into this subroutine
2158 !
2159  INTEGER IENT
2160 !
2161 ! 8. SUBROUTINE USED
2162 !
2163 ! 9. SUBROUTINES CALLING
2164 !
2165 ! 10. ERROR MESSAGES
2166 !
2167 ! 11. REMARKS
2168 !
2169 ! 12. STRUCTURE
2170 !
2171 ! 13. SOURCE TEXT
2172 !
2173  SAVE ient
2174  DATA ient /0/
2175  CALL strace (ient, 'WRNKEY')
2176 !
2177  CALL msgerr (2, 'Illegal keyword: '//keywrd)
2178  eltype = 'USED'
2179  RETURN
2180  END SUBROUTINE wrnkey
2181 
2182 !****************************************************************
2183 ! *
2184  SUBROUTINE ignore (STRING)
2185 ! *
2186 !****************************************************************
2187 !
2188  USE ocpcomm1
2189  USE ocpcomm2
2190  USE ocpcomm3
2191  USE ocpcomm4
2192 !
2193  IMPLICIT NONE
2194 !
2195 !
2196 ! --|-----------------------------------------------------------|--
2197 ! | Delft University of Technology |
2198 ! | Faculty of Civil Engineering |
2199 ! | Environmental Fluid Mechanics Section |
2200 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
2201 ! | |
2202 ! | Programmers: R.C. Ris, N. Booij, |
2203 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
2204 ! | M. Zijlema, E.E. Kriezi, |
2205 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
2206 ! --|-----------------------------------------------------------|--
2207 !
2208 !
2209 ! SWAN (Simulating WAves Nearshore); a third generation wave model
2210 ! Copyright (C) 2004-2005 Delft University of Technology
2211 !
2212 ! This program is free software; you can redistribute it and/or
2213 ! modify it under the terms of the GNU General Public License as
2214 ! published by the Free Software Foundation; either version 2 of
2215 ! the License, or (at your option) any later version.
2216 !
2217 ! This program is distributed in the hope that it will be useful,
2218 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
2219 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2220 ! GNU General Public License for more details.
2221 !
2222 ! A copy of the GNU General Public License is available at
2223 ! http://www.gnu.org/copyleft/gpl.html#SEC3
2224 ! or by writing to the Free Software Foundation, Inc.,
2225 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2226 !
2227 !
2228 ! 0. AUTHORS
2229 !
2230 ! 40.41: Marcel Zijlema
2231 !
2232 ! 1. UPDATES
2233 !
2234 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
2235 !
2236 ! 2. PURPOSE
2237 !
2238 ! This procedure calls subroutine INKEYW to read a keyword.
2239 ! if this keyword is equal to string, eltype is made 'USED'.
2240 ! it is used if a keyword can occur in the input which
2241 ! does not lead to any action.
2242 !
2243 ! 3. METHOD
2244 !
2245 ! 4. ARGUMENT VARIABLES
2246 !
2247 ! STRING : keyword (if appearing in input file) that can be ignored
2248 !
2249  CHARACTER STRING *(*)
2250 !
2251 ! 5. PARAMETER VARIABLES
2252 !
2253 ! 6. LOCAL VARIABLES
2254 !
2255 ! IENT : Number of entries into this subroutine
2256 !
2257  INTEGER IENT
2258 !
2259 ! KEYWIS : logical function
2260 !
2261  LOGICAL KEYWIS
2262 !
2263 ! 8. SUBROUTINE USED
2264 !
2265 ! 9. SUBROUTINES CALLING
2266 !
2267 ! 10. ERROR MESSAGES
2268 !
2269 ! 11. REMARKS
2270 !
2271 ! 12. STRUCTURE
2272 !
2273 ! 13. SOURCE TEXT
2274 !
2275  SAVE ient
2276  DATA ient /0/
2277  CALL strace (ient, 'IGNORE')
2278 !
2279  CALL inkeyw ('STA', 'XXXX')
2280  IF(keywis(string)) RETURN
2281  IF(keywis('XXXX')) RETURN
2282  IF(itest >= 60) WRITE (printf, 5) keywrd, eltype
2283 5 FORMAT (' NOT IGNORED: ', a, 2x, a)
2284  RETURN
2285  END SUBROUTINE ignore
2286 
subroutine incstr(NAAM, C, KONT, CSTA)
Definition: ocpcre.f90:777
character(len=lenfnm) filenm
Definition: swmod1.f90:280
subroutine strace(IENT, SUBNAM)
Definition: ocpmix.f90:468
character *8 keywrd
Definition: swmod1.f90:137
subroutine ignore(STRING)
Definition: ocpcre.f90:2185
subroutine getkar
Definition: ocpcre.f90:1643
subroutine inctim(IOPTIM, NAAM, RV, KONT, RSTA)
Definition: ocpcre.f90:899
character *4 eltype
Definition: swmod1.f90:134
subroutine inreal(NAAM, R, KONT, RSTA)
Definition: ocpcre.f90:396
character *4 blank
Definition: swmod1.f90:131
subroutine inlogc(NAAM, L, KONT, LSTA)
Definition: ocpcre.f90:653
subroutine inintv(NAME, RVAR, KONT, RSTA)
Definition: ocpcre.f90:1056
integer prtest
Definition: swmod1.f90:517
integer lencst
Definition: swmod1.f90:152
logical function keywis(STRING)
Definition: ocpcre.f90:1974
integer elint
Definition: swmod1.f90:152
integer inputf
Definition: swmod1.f90:516
integer printf
Definition: swmod1.f90:517
subroutine pstop
Definition: mod_utils.f90:273
integer itest
Definition: swmod1.f90:536
subroutine nwline
Definition: ocpcre.f90:128
subroutine rdinit
Definition: ocpcre.f90:36
character *(lineln) eltext
Definition: swmod1.f90:133
character kar
Definition: swmod1.f90:136
subroutine upcase(CHARST)
Definition: ocpcre.f90:1863
subroutine msgerr(LEV, STRING)
Definition: ocpmix.f90:582
integer function scan_file2(FNAME, VNAME, ISCAL, FSCAL, IVEC, FVEC, CVEC, NSZE, CVAL, LVAL)
Definition: mod_utils.f90:2304
subroutine inkeyw(KONT, CSTA)
Definition: ocpcre.f90:243
logical chgval
Definition: swmod1.f90:154
double precision elreal
Definition: swmod1.f90:153
subroutine wrnkey
Definition: ocpcre.f90:2092
integer karnr
Definition: swmod1.f90:152
character tabc
Definition: swmod1.f90:138
subroutine dtreti(TSTRNG, IOPT, TIMESC)
Definition: ocpmix.f90:1306
character *(lineln) kaart
Definition: swmod1.f90:135
subroutine leesel
Definition: ocpcre.f90:1204
subroutine inintg(NAAM, IV, KONT, ISTA)
Definition: ocpcre.f90:525
integer lineln
Definition: swmod1.f90:91
character comid
Definition: swmod1.f90:132
subroutine putkar(LTEXT, KARR, JKAR)
Definition: ocpcre.f90:1758