My Project
ocpmix.f90
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 ! Ocean Pack miscellaneous routines
13 !
14 ! real function DTTIME
15 ! subroutine DTINTI
16 ! subroutine DTRETI
17 ! char function DTTIWR
18 ! REPARM
19 ! INAR2D
20 ! STRACE
21 ! MSGERR
22 ! TABHED
23 ! FOR
24 ! logical function EQREAL
25 ! LSPLIT
26 ! BUGFIX
27 ! COPYCH (copied from file OCPDPN)
28 !
29 !*******************************************************************
30 ! *
31  REAL FUNCTION DTTIME (INTTIM)
32 ! *
33 !*******************************************************************
34 !
35  USE ocpcomm1
36  USE ocpcomm2
37  USE ocpcomm3
38  USE ocpcomm4
39 !
40  IMPLICIT NONE
41 !
42 !
43 ! --|-----------------------------------------------------------|--
44 ! | Delft University of Technology |
45 ! | Faculty of Civil Engineering |
46 ! | Environmental Fluid Mechanics Section |
47 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
48 ! | |
49 ! | Programmers: R.C. Ris, N. Booij, |
50 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
51 ! | M. Zijlema, E.E. Kriezi, |
52 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
53 ! --|-----------------------------------------------------------|--
54 !
55 !
56 ! SWAN (Simulating WAves Nearshore); a third generation wave model
57 ! Copyright (C) 2004-2005 Delft University of Technology
58 !
59 ! This program is free software; you can redistribute it and/or
60 ! modify it under the terms of the GNU General Public License as
61 ! published by the Free Software Foundation; either version 2 of
62 ! the License, or (at your option) any later version.
63 !
64 ! This program is distributed in the hope that it will be useful,
65 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
66 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67 ! GNU General Public License for more details.
68 !
69 ! A copy of the GNU General Public License is available at
70 ! http://www.gnu.org/copyleft/gpl.html#SEC3
71 ! or by writing to the Free Software Foundation, Inc.,
72 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
73 !
74 !
75 ! 0. Authors
76 !
77 ! 30.74: IJsbrand Haagsma (Include version)
78 ! 40.41: Marcel Zijlema
79 !
80 ! 1. Updates
81 !
82 ! 9705, May 97: month number is checked
83 ! 30.74, Nov. 97: Prepared for version with INCLUDE statements
84 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
85 !
86 ! 2. Purpose
87 !
88 ! DTTIME gives time in seconds from a reference day
89 ! it also initialises the reference day
90 !
91 ! 3. Method
92 !
93 ! every fourth year is a leap-year, but not the century-years, however
94 ! also leap-years are: year 0, 1000, 2000 etc.
95 ! 1 jan of year 0 is daynumber 1.
96 !
97 ! 4. Argument variables
98 !
99 ! INTTIM(1): year
100 ! (2): month
101 ! (3): day
102 ! (4): hour
103 ! (5): minute
104 ! (6): second
105 !
106  INTEGER inttim(6)
107 !
108 ! 5. PARAMETER VARIABLES
109 !
110 ! 6. LOCAL VARIABLES
111 !
112 ! IDYMON : number of days of each month (February counts as 28 days)
113 ! IYEAR : number of years after substacking the centuries
114 ! IYRM1 : ??
115 ! IDNOW : ??
116 ! I : ??
117 ! II : ??
118 !
119  INTEGER idymon(12), iyear, iyrm1, idnow, i, ii
120 !
121 ! LEAPYR : Whether year in INTTIM(1) is a leapyear
122 ! LOGREF : ??
123 !
124  LOGICAL leapyr, logref
125 !
126 ! REFDAY day number of the reference day; the reference time is 0:00
127 ! of the reference day; the first day entered is used as
128 ! reference day.
129 !
130 !
131 ! 8. SUBROUTINE USED
132 !
133 ! 9. SUBROUTINES CALLING
134 !
135 ! 10. ERROR MESSAGES
136 !
137 ! 11. REMARKS
138 !
139 ! 12. STRUCTURE
140 !
141 ! 13. SOURCE TEXT
142 !
143  SAVE logref, idymon
144  DATA idymon /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
145  DATA logref /.false./
146 !
147  iyear = inttim(1)
148  iyrm1 = iyear-1
149  leapyr=(mod(iyear,4) == 0 .AND. mod(iyear,100) /= 0) .OR. &
150  mod(iyear,1000) == 0
151  idnow=0
152  IF(inttim(2) > 12)THEN
153  WRITE (printf, 8) inttim(2), (inttim(ii), ii=1,6)
154  8 FORMAT (' erroneous month ', i2, ' in date/time ', 6i4)
155  ELSE IF(inttim(2) > 1)THEN
156  DO 10 i = 1,inttim(2)-1
157  idnow=idnow+idymon(i)
158  10 CONTINUE
159  ENDIF
160  idnow=idnow+inttim(3)
161  IF(leapyr .AND. inttim(2) > 2) idnow=idnow+1
162  idnow = idnow + iyear*365 + iyrm1/4 - iyrm1/100 + iyrm1/1000 + 1
163  IF(iyear == 0) idnow=idnow-1
164  IF(.NOT.logref)THEN
165  refday = idnow
166  logref = .true.
167  dttime = 0.
168  ELSE
169  dttime = real(idnow-refday) * 24.*3600.
170  ENDIF
171  dttime = dttime + 3600.*real(inttim(4)) + 60.*real(inttim(5)) + &
172  REAL(inttim(6))
173  RETURN
174  END FUNCTION dttime
175 !*****************************************************************
176 ! *
177  SUBROUTINE inar2d (ARR, MGA, &
178  NDSL, &
179  NDSD, IDFM, RFORM, &
180  IDLA, VFAC, &
181  NHED, NHEDF)
182 ! *
183 !*****************************************************************
184 !
185  USE ocpcomm1
186  USE ocpcomm2
187  USE ocpcomm3
188  USE ocpcomm4
189 !
190  IMPLICIT NONE
191 !
192 !
193 ! --|-----------------------------------------------------------|--
194 ! | Delft University of Technology |
195 ! | Faculty of Civil Engineering |
196 ! | Environmental Fluid Mechanics Section |
197 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
198 ! | |
199 ! | Programmers: R.C. Ris, N. Booij, |
200 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
201 ! | M. Zijlema, E.E. Kriezi, |
202 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
203 ! --|-----------------------------------------------------------|--
204 !
205 !
206 ! SWAN (Simulating WAves Nearshore); a third generation wave model
207 ! Copyright (C) 2004-2005 Delft University of Technology
208 !
209 ! This program is free software; you can redistribute it and/or
210 ! modify it under the terms of the GNU General Public License as
211 ! published by the Free Software Foundation; either version 2 of
212 ! the License, or (at your option) any later version.
213 !
214 ! This program is distributed in the hope that it will be useful,
215 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
216 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
217 ! GNU General Public License for more details.
218 !
219 ! A copy of the GNU General Public License is available at
220 ! http://www.gnu.org/copyleft/gpl.html#SEC3
221 ! or by writing to the Free Software Foundation, Inc.,
222 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
223 !
224 !
225 ! 0. Authors
226 !
227 ! 30.72: IJsbrand Haagsma
228 ! 30.74: IJsbrand Haagsma (Include version)
229 ! 30.82: IJsbrand Haagsma
230 ! 34.01: Jeroen Adema
231 ! 40.00: Nico Booij
232 ! 40.02: IJsbrand Haagsma
233 ! 40.03: Nico Booij
234 ! 40.08: Erick Rogers
235 ! 40.13: Nico Booij
236 ! 40.41: Marcel Zijlema
237 !
238 ! 1. Updates
239 !
240 ! 01.05, Feb. 90: Before reading values in the array are divided by VFAC,
241 ! in order to retain correct values for points where no
242 ! value was given
243 ! 01.06, Apr. 91: i/o status is printed if read error occurs
244 ! 30.72, Sept 97: Changed DO-block with one CONTINUE to DO-block with
245 ! two CONTINUE's
246 ! 30.72, Sept 97: Corrected reading of heading lines for SERIES of files
247 ! in dynamic mode
248 ! 30.74, Nov. 97: Prepared for version with INCLUDE statements
249 ! 40.00, July 98: SWAN specific statements modified
250 ! unformatted read: heading lines also read unformatted
251 ! distinction between NDSD (data file) and NDSL (file list)
252 ! 30.82, Sep. 98: Added INQUIRE statement to produce correct file name in
253 ! case of a read error
254 ! 34.01, Feb. 99: Introducing STPNOW
255 ! 40.02, Sep. 00: Replaced computed GOTO with CASE construct
256 ! 40.02, Sep. 00: Replaced reserved words IOSTAT with IOERR and STATUS with IERR
257 ! 40.03, Jul. 00: END= added to READ statement for correct reading of series
258 ! of files
259 ! 40.03, Jul. 00: TRIM used to improve readability of message
260 ! 40.13, Apr. 01: END=930 added in READ statement; corresponding error message added
261 ! 40.08, Mar. 03: Changed an INQUIRE statement so that it does not produce
262 ! misleading results.
263 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
264 !
265 ! 2. Purpose
266 !
267 ! Reads a 2d array from dataset
268 ! is used to read e.g. bathymetry, one component of wind velocity
269 !
270 ! 3. METHOD
271 !
272 ! 4. ARGUMENT VARIABLES
273 !
274 ! IDFM : input format index
275 ! IDLAM : input lay-out indicator
276 ! MXA : input number of points along x-side of grid
277 ! MYA : input number of points along y-side of grid
278 ! NDSD : input unit number of the file from which to read the dataset
279 ! NDSL : input unit number of the file containing the list of filenames
280 ! NHEDF : input number of heading lines in the file (first lines).
281 ! NHEDL : input number of heading lines in the file
282 ! before each array
283 !
284  INTEGER IDFM, IDLA, MGA, NDSD, NDSL, NHED, NHEDF
285 !
286 ! ARR : input results appear in this array
287 ! RFORM : input format used in reading data (char. string)
288 ! VFAC : input factor by which data must be multiplied.
289 !
290  REAL ARR(MGA), VFAC
291 !
292  CHARACTER RFORM *(*)
293 !
294 ! 5. PARAMETER VARIABLES
295 !
296 ! 6. LOCAL VARIABLES
297 !
298 ! IERR : ??
299 ! IENT : number of entries into this subroutine
300 ! IOERR : input 0 : Full messages printed
301 ! -1: Only error messages printed
302 ! -2: No messages printed
303 ! output error indicator
304 ! IH : ??
305 ! IX : ??
306 ! IY : ??
307 ! NUMFIL : ??
308 !
309  INTEGER IERR, IENT, IOERR, IH, IX, IY, NUMFIL
310 !
311 ! HEDLIN : Content of a header line
312 !
313  CHARACTER HEDLIN *80
314 !
315 ! 8. SUBROUTINE USED
316 !
317  LOGICAL STPNOW
318 !
319 ! 9. SUBROUTINES CALLING
320 !
321 ! 10. ERROR MESSAGES
322 !
323 ! 11. REMARKS
324 !
325 ! 12. STRUCTURE
326 !
327 ! 13. SOURCE TEXT
328 !
329  INTEGER IG
330  SAVE IENT
331  DATA IENT /0/
332  CALL STRACE (IENT, 'INAR2D')
333 !
334 999 IF(ndsd < 0) RETURN
335 ! no reading from file due to open error
336 !
337 ! *** NUMFIL is the number of that is open in one time step **
338  numfil = 0
339 ! IF(ITEST >= 100)THEN
340 ! WRITE (PRINTF, 12) MXA, MYA, NDSD, IDFM, RFORM, 40.00
341 ! & IDLA, VFAC, NHED
342 ! 12 FORMAT (' * TEST INAR2D *', 4I4, 1X, A16, I3, 1X, E12.4, I3)
343 ! ENDIF
344 !
345 ! Read heading lines, and print the same:
346 !
347  11 IF (nhed.GT.0) THEN
348  IF (idfm.LT.0) THEN
349  IF (itest.GE.30) &
350  WRITE (printf, '(I3,A)') nhed, ' Heading lines'
351  DO 28 ih=1, nhed
352  READ (ndsd, end=910)
353  28 CONTINUE
354  ELSE
355  DO 30 ih=1, nhed
356  READ (ndsd, '(A80)', end=910) hedlin
357  IF (ih.EQ.1) WRITE (printf, '(A)') ' ** Heading lines **'
358  WRITE (printf, '(A4,A80)') ' -> ', hedlin
359  30 CONTINUE
360  ENDIF
361  ENDIF
362 !
363 ! divide existing values in the array by VFAC
364 !
365  DO ig = 1, mga
366  arr(ig) = arr(ig) / vfac
367  END DO
368 !
369 ! start reading of 2D-array
370 !
371  READ(ndsd, end=910, err=920, iostat=ierr) (arr(ig), ig=1,mga)
372  GOTO 900
373 !
374 ! *** End of data file, in case SERIES next file is opened
375 ! *** unit = NDSD is closed before the next one is opened
376 !
377  910 CONTINUE
378  CLOSE(ndsd)
379  numfil = numfil + 1
380  IF (numfil .GE. 2) GO TO 911
381  IF (ndsl.GT.0) THEN
382  READ (ndsl, '(A)', end=930) filenm
383  IF (idfm.NE.-1) THEN
384  ioerr = 0
385  CALL for (ndsd, filenm, 'OF', ioerr)
386  IF (stpnow()) RETURN
387  ELSE
388  ioerr = 0
389  CALL for (ndsd, filenm, 'OU', ioerr)
390  IF (stpnow()) RETURN
391  ENDIF
392 !
393 ! Read heading lines, and print these:
394 !
395  2 IF (nhedf.GT.0) THEN
396  IF (idfm.LT.0) THEN
397  IF (itest.GE.30) WRITE (printf, '(I3,A,A)') nhedf, &
398  ' Heading lines at begin of file ', trim(filenm)
399  DO 828 ih=1, nhedf
400  READ (ndsd)
401  828 CONTINUE
402  ELSE
403  WRITE (printf, '(A,A,A)') ' ** Heading lines file ', &
404  trim(filenm), ' **'
405  DO 830 ih=1, nhedf
406  READ (ndsd, '(A80)') hedlin
407  WRITE (printf, '(A4,A80)') ' -> ', hedlin
408  830 CONTINUE
409  ENDIF
410  ENDIF
411  GO TO 11
412  ENDIF
413 !
414 ! error message when end of file is encountered
415 !
416 ! --- initialize FILENM so that previous value is not used 40.08
417 ! in case unit NDSD does not exist 40.08
418  911 filenm='DUMMY'
419 ! --------------------------------------------------------------------40.08
420 ! THIS INQUIRE STATEMENT IS PROBLEMATIC, SINCE (AT LEAST 40.08
421 ! SOMETIMES) NDSD HAS ALREADY BEEN CLOSED, SO THE INQUIRE 40.08
422 ! STATEMENT SHOULD NOT WORK. 40.08
423 ! --------------------------------------------------------------------40.08
424  INQUIRE (unit=ndsd, name=filenm)
425  CALL msgerr (2, 'Unexpected end of file while reading '// &
426  trim(filenm))
427  ndsd = 0
428  idla = -1
429 ! Value of IDLA=-1 signals end of file to calling program
430 !
431  GOTO 900
432 !
433 ! --- initialize FILENM
434  920 filenm='DUMMY'
435  INQUIRE (unit=ndsd, name=filenm)
436  CALL msgerr (2, 'Error while reading file '//trim(filenm))
437  WRITE (printf, 922) ierr
438  922 FORMAT (' i/o status ', i6)
439  idla = -2
440 ! Value of IDLA=-2 signals read error to calling program
441 !
442 ! Multiply all values in the array by VFAC
443 !
444  900 DO ig = 1, mga
445  arr(ig) = arr(ig) * vfac
446  END DO
447 !
448  990 IF (itest.GE.100 .OR. idla.LT.0) THEN
449 ! DO 996 IY=MYA, 1, -1
450 ! WRITE (PRINTF, 994) (ARR(IX,IY), IX=1,MXA)
451 ! 994 FORMAT ((1X, 10E12.4))
452 ! 996 CONTINUE
453  ENDIF
454  RETURN
455 
456 ! No more files in NDSL:
457 ! --- initialize FILENM
458  930 filenm='DUMMY'
459  INQUIRE (unit=ndsl, name=filenm)
460  CALL msgerr (2, 'Series of input files ended in '//trim(filenm))
461  RETURN
462 
463  END SUBROUTINE inar2d
464 !
465 !*****************************************************************
466 ! *
467  SUBROUTINE strace (IENT, SUBNAM)
468 ! *
469 !*****************************************************************
470 !
471  USE ocpcomm1
472  USE ocpcomm2
473  USE ocpcomm3
474  USE ocpcomm4
475  USE m_parall
476 !
477  IMPLICIT NONE
478 !
479 !
480 ! --|-----------------------------------------------------------|--
481 ! | Delft University of Technology |
482 ! | Faculty of Civil Engineering |
483 ! | Environmental Fluid Mechanics Section |
484 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
485 ! | |
486 ! | Programmers: R.C. Ris, N. Booij, |
487 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
488 ! | M. Zijlema, E.E. Kriezi, |
489 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
490 ! --|-----------------------------------------------------------|--
491 !
492 !
493 ! SWAN (Simulating WAves Nearshore); a third generation wave model
494 ! Copyright (C) 2004-2005 Delft University of Technology
495 !
496 ! This program is free software; you can redistribute it and/or
497 ! modify it under the terms of the GNU General Public License as
498 ! published by the Free Software Foundation; either version 2 of
499 ! the License, or (at your option) any later version.
500 !
501 ! This program is distributed in the hope that it will be useful,
502 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
503 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
504 ! GNU General Public License for more details.
505 !
506 ! A copy of the GNU General Public License is available at
507 ! http://www.gnu.org/copyleft/gpl.html#SEC3
508 ! or by writing to the Free Software Foundation, Inc.,
509 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
510 !
511 !
512 ! 0. AUTHORS
513 !
514 ! 40.41: Marcel Zijlema
515 !
516 ! 1. UPDATES
517 !
518 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
519 !
520 ! 2. PURPOSE
521 !
522 ! This subroutine produces depending on the value of 'ITRACE'
523 ! a message containing the name 'SUBNAM'. the purpose of this
524 ! action is to detect the entry of a subroutine.
525 !
526 ! 3. METHOD
527 !
528 ! the first executable statement of subroutine 'AAA' has to
529 ! be : CALL STRACE(IENT,'AAA')
530 ! further is necessary : DATA IENT/0/
531 ! IF ITRACE=0, no message
532 ! IF ITRACE>0, a message is printed up to ITRACE times
533 !
534 ! 4. ARGUMENT VARIABLES
535 !
536 ! IENT : i/o Number of entries into the calling subroutine
537 !
538  INTEGER IENT
539 !
540 ! SUBNAM : inp name of the calling subroutine.
541 !
542  CHARACTER SUBNAM *(*)
543 !
544 ! 5. PARAMETER VARIABLES
545 !
546 ! 6. LOCAL VARIABLES
547 ! 40.31
548 !$ LOGICAL,EXTERNAL :: OMP_IN_PARALLEL 40.31
549 !
550 ! 8. SUBROUTINE USED
551 !
552 ! 9. SUBROUTINES CALLING
553 !
554 ! 10. ERROR MESSAGES
555 !
556 ! 11. REMARKS
557 !
558 ! 12. STRUCTURE
559 !
560 ! 13. SOURCE TEXT
561 !
562  IF(itrace == 0) RETURN
563  IF(ient > itrace) RETURN
564 !$ IF(OMP_IN_PARALLEL())THEN
565 !$OMP MASTER
566 !$ IENT=IENT+1
567 !$ WRITE (PRTEST, 10) SUBNAM
568 !$ IF(SCREEN /= PRINTF) WRITE (SCREEN, 10) SUBNAM
569 !$OMP END MASTER
570 !$ ELSE
571  ient=ient+1
572  WRITE (prtest, 10) subnam
573  IF(screen /= printf .AND. inode == master) WRITE (screen, 10) subnam
574 !$ ENDIF
575 10 FORMAT (' ++ trace subr: ',a)
576  RETURN
577  END SUBROUTINE strace
578 
579 !*****************************************************************
580 ! *
581  SUBROUTINE msgerr (LEV,STRING)
582 ! *
583 !*****************************************************************
584 !
585  USE ocpcomm1
586  USE ocpcomm2
587  USE ocpcomm3
588  USE ocpcomm4
589  USE m_parall
590 !
591  IMPLICIT NONE
592 !
593 !
594 ! --|-----------------------------------------------------------|--
595 ! | Delft University of Technology |
596 ! | Faculty of Civil Engineering |
597 ! | Environmental Fluid Mechanics Section |
598 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
599 ! | |
600 ! | Programmers: R.C. Ris, N. Booij, |
601 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
602 ! | M. Zijlema, E.E. Kriezi, |
603 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
604 ! --|-----------------------------------------------------------|--
605 !
606 !
607 ! SWAN (Simulating WAves Nearshore); a third generation wave model
608 ! Copyright (C) 2004-2005 Delft University of Technology
609 !
610 ! This program is free software; you can redistribute it and/or
611 ! modify it under the terms of the GNU General Public License as
612 ! published by the Free Software Foundation; either version 2 of
613 ! the License, or (at your option) any later version.
614 !
615 ! This program is distributed in the hope that it will be useful,
616 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
617 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
618 ! GNU General Public License for more details.
619 !
620 ! A copy of the GNU General Public License is available at
621 ! http://www.gnu.org/copyleft/gpl.html#SEC3
622 ! or by writing to the Free Software Foundation, Inc.,
623 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
624 !
625 !
626 ! 0. AUTHORS
627 !
628 ! 40.02: IJsbrand Haagsma
629 ! 40.03, 40.13: Nico Booij
630 ! 40.30: Marcel Zijlema
631 ! 40.41: Marcel Zijlema
632 !
633 ! 1. UPDATES
634 !
635 ! 40.03, Aug. 00: variable ERRFNM introduced in order to get correct
636 ! message on UNIX system
637 ! 40.02, Sep. 00: Removed STOP statement
638 ! 40.13, Nov. 01: OPEN statement instead of CALL FOR
639 ! to prevent recursive subroutines calling
640 ! 40.30, Jan. 03: introduction distributed-memory approach using MPI
641 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
642 !
643 ! 2. PURPOSE
644 !
645 ! Error messages are produced by subroutine MSGERR. if necessary
646 ! the value of LEVERR is increased.
647 ! In case of a high error level an error message file is opened
648 !
649 ! 3. METHOD
650 !
651 ! 4. ARGUMENT VARIABLES
652 !
653 ! LEV : indicates how severe the present error is
654 ! STRING : contents of the present error message
655 !
656  INTEGER LEV
657 !
658  CHARACTER STRING*(*)
659 !
660 ! 5. PARAMETER VARIABLES
661 !
662 ! 6. LOCAL VARIABLES
663 !
664 ! IERR : if non-zero error message file was already opened unsuccessfully
665 ! IERRF : unit reference number of the error message file
666 ! ILPOS : actual length of error message filename
667 !
668  INTEGER, SAVE :: IERR=0, ierrf=0
669  INTEGER ILPOS
670 !
671 ! ERRM : error message prefix
672 !
673  CHARACTER (LEN=17) :: ERRM
674 !
675 ! ERRFNM : name of error message file
676 !
677  CHARACTER (LEN=LENFNM), SAVE :: ERRFNM = 'Errfile'
678 !
679 ! 8. SUBROUTINE USED
680 !
681 ! ---
682 !
683 ! 9. SUBROUTINES CALLING
684 !
685 ! 10. ERROR MESSAGES
686 !
687 ! 11. REMARKS
688 !
689 ! 12. STRUCTURE
690 !
691 ! 13. SOURCE TEXT
692 !
693 !
694  IF(lev > leverr) leverr=lev
695  IF(lev == 0)THEN
696  errm = 'Message '
697  ELSE IF(lev == 1)THEN
698  errm = 'Warning '
699  ELSE IF(lev == 2)THEN
700  errm = 'Error '
701  ELSE IF(lev == 3)THEN
702  errm = 'Severe error '
703  ELSE
704  errm = 'Terminating error'
705  ENDIF
706  WRITE (printf,12) errm, string
707 12 FORMAT (' ** ', a, ': ',a)
708  IF(lev > maxerr)THEN
709  IF(ierrf == 0)THEN
710  IF(ierr /= 0) RETURN
711 !
712 ! append node number to ERRFNM in case of
713 ! parallel computing
714 !
715  IF(parll)THEN
716  ilpos = index( errfnm, ' ' )-1
717  WRITE(errfnm(ilpos+1:ilpos+4),13) inode
718 13 FORMAT('-',i3.3)
719  END IF
720 !
721  ierrf = 17
722  OPEN (unit=ierrf, file=errfnm, form='FORMATTED')
723  ENDIF
724  WRITE (ierrf,14) errm, string
725 14 FORMAT (a, ': ',a)
726  ENDIF
727 !
728  RETURN
729 !
730  END SUBROUTINE msgerr
731 
732 !
733 !*****************************************************************
734 ! *
735  LOGICAL FUNCTION stpnow()
736 ! *
737 !*****************************************************************
738 !
739  USE ocpcomm4
740 !
741  IMPLICIT NONE
742 !
743 !
744 ! --|-----------------------------------------------------------|--
745 ! | Delft University of Technology |
746 ! | Faculty of Civil Engineering |
747 ! | Environmental Fluid Mechanics Section |
748 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
749 ! | |
750 ! | Programmers: R.C. Ris, N. Booij, |
751 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
752 ! | M. Zijlema, E.E. Kriezi, |
753 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
754 ! --|-----------------------------------------------------------|--
755 !
756 !
757 ! SWAN (Simulating WAves Nearshore); a third generation wave model
758 ! Copyright (C) 2004-2005 Delft University of Technology
759 !
760 ! This program is free software; you can redistribute it and/or
761 ! modify it under the terms of the GNU General Public License as
762 ! published by the Free Software Foundation; either version 2 of
763 ! the License, or (at your option) any later version.
764 !
765 ! This program is distributed in the hope that it will be useful,
766 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
767 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
768 ! GNU General Public License for more details.
769 !
770 ! A copy of the GNU General Public License is available at
771 ! http://www.gnu.org/copyleft/gpl.html#SEC3
772 ! or by writing to the Free Software Foundation, Inc.,
773 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
774 !
775 !
776 ! 0. Authors
777 !
778 ! 30.82, Feb. 99: IJsbrand Haagsma
779 ! 40.41: Marcel Zijlema
780 !
781 ! 1. Updates
782 !
783 ! 30.82: New function
784 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
785 !
786 ! 2. Purpose
787 !
788 ! Function determines wheter the SWAN program should be stopped
789 ! due to a terminating error
790 !
791 ! 3. Method
792 !
793 ! Compares two common variables (the maximum allowable error-level,
794 ! MAXERR and the actual error-level: LEVERR).
795 !
796 ! 4. ARGUMENT VARIABLES
797 !
798 ! 5. PARAMETER VARIABLES
799 !
800 ! 6. LOCAL VARIABLES
801 !
802 ! IENT : Number of entries into this subroutine
803 !
804  INTEGER ient
805 !
806 ! 8. SUBROUTINE USED
807 !
808 ! 9. SUBROUTINES CALLING
809 !
810 ! 10. ERROR MESSAGES
811 !
812 ! 11. REMARKS
813 !
814 ! 12. STRUCTURE
815 !
816 ! 13. SOURCE TEXT
817 !
818  SAVE ient
819  DATA ient /0/
820  CALL strace (ient,'STPNOW')
821 !
822  IF(leverr >= 4)THEN
823  stpnow = .true.
824  ELSE
825  stpnow = .false.
826  END IF
827  IF(maxerr == -1) stpnow = .false.
828 !
829  RETURN
830  END FUNCTION stpnow
831 
832 !*****************************************************************
833 ! *
834  SUBROUTINE for (IUNIT, DDNAME, SF, IOSTAT)
835 ! *
836 !*****************************************************************
837 !
838  USE ocpcomm1
839  USE ocpcomm2
840  USE ocpcomm3
841  USE ocpcomm4
842 !
843  IMPLICIT NONE
844 !
845 !
846 ! --|-----------------------------------------------------------|--
847 ! | Delft University of Technology |
848 ! | Faculty of Civil Engineering |
849 ! | Environmental Fluid Mechanics Section |
850 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
851 ! | |
852 ! | Programmers: R.C. Ris, N. Booij, |
853 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
854 ! | M. Zijlema, E.E. Kriezi, |
855 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
856 ! --|-----------------------------------------------------------|--
857 !
858 !
859 ! SWAN (Simulating WAves Nearshore); a third generation wave model
860 ! Copyright (C) 2004-2005 Delft University of Technology
861 !
862 ! This program is free software; you can redistribute it and/or
863 ! modify it under the terms of the GNU General Public License as
864 ! published by the Free Software Foundation; either version 2 of
865 ! the License, or (at your option) any later version.
866 !
867 ! This program is distributed in the hope that it will be useful,
868 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
869 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
870 ! GNU General Public License for more details.
871 !
872 ! A copy of the GNU General Public License is available at
873 ! http://www.gnu.org/copyleft/gpl.html#SEC3
874 ! or by writing to the Free Software Foundation, Inc.,
875 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
876 !
877 !
878 ! 0. Authors
879 !
880 ! 30.13: Nico Booij
881 ! 30.70: Nico Booij
882 ! 30.82: IJsbrand Haagsma
883 ! 34.01: IJsbrand Haagsma
884 ! 40.00, 40.03: Nico Booij
885 ! 40.41: Marcel Zijlema
886 !
887 ! 1. Updates
888 !
889 ! 30.13, Jan. 96: new structure
890 ! 30.70, Feb. 98: terminating error if input file does not exist
891 ! 30.82, Nov. 98: Introduced recordlength of 1000 for new files to
892 ! avoid errors on the Cray-J90
893 ! 34.01, Feb. 99: STOP statement removed
894 ! 40.00, Feb. 99: DIRCH2 replaces DIRCH1 in filenames
895 ! 40.03, May 00: modification for Linux: local copy of filename
896 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
897 !
898 ! 1. PURPOSE
899 !
900 ! General open file routine.
901 !
902 ! 2. METHOD
903 !
904 ! FORTRAN 77 OPEN option.
905 ! INQUIRE
906 !
907 ! 3. METHOD
908 !
909 ! 4. ARGUMENT VARIABLES
910 !
911 ! IUNIT int input =0 : get free unit number
912 ! >0 : fixed unit number
913 ! output allocated unit number
914 ! DDNAME char input ddname/filename string (empty if IUNIT>0)
915 ! SF char*2 input file qualifiers
916 ! 1st char: O(ld),N(ew),S(cratch),U(nknown)
917 ! 2nd char: F(ormatted),U(nformatted)
918 ! IOSTAT int input 0 : Full messages printed
919 ! -1: Only error messages printed
920 ! -2: No messages printed
921 ! output error indicator
922 !
923  INTEGER IUNIT, IOSTAT
924  CHARACTER DDNAME*(LENFNM), SF*2
925 !
926 ! 5. PARAMETER VAR. (CONSTANTS)
927 !
928 ! Error codes:
929 !
930 ! IOSTAT = IESUCC No errors
931 ! IOSTAT > 0 I/O error
932 ! IOSTAT = IENUNF No free unit number found
933 ! IOSTAT = IEUNBD Specified unit number out of bounds
934 ! IOSTAT = IENODD No filename supplied with IUNIT=0
935 ! IOSTAT = IEDDNM Incorrect filename supplied with IUNIT>0
936 ! IOSTAT = IEEXST Specified unit number does not exist
937 ! IOSTAT = IEOPEN Specified unit number already opened
938 ! IOSTAT = IESTAT Error in file qualifiers
939 ! IOSTAT = IENSCR Named scratch file
940 ! IOSTAT = IENSIO No specified I/O error
941 !
942  INTEGER IESUCC, IENUNF, IEUNBD, IENODD, &
943  IEDDNM, IEEXST, IEOPEN, IESTAT, IENSCR
944  PARAMETER (IESUCC= 0,ienunf= -1,ieunbd= -2,ienodd= -3, &
945  ieddnm= -4,ieexst= -5,ieopen= -6,iestat= -7, &
946  ienscr=-12)
947 !
948 ! EMPTY blank string
949 !
950  CHARACTER EMPTY*(*)
951  PARAMETER (EMPTY= ' ')
952 !
953 ! 6. LOCAL VARIABLES
954 !
955 ! IENT number of entries into this subroutine
956 ! IFO format index
957 ! IFUN free unit number
958 ! II counter
959 ! IOSTTM aux. error index
960 ! IS file status index
961 ! IUTTM aux. unit number
962 !
963  INTEGER IENT, IFO, IFUN, II, IOSTTM, IS, IUTTM
964 !
965 ! EXIST if true, file exists
966 ! OPENED if true, file is opened
967 !
968  LOGICAL EXIST, OPENED
969 !
970 ! S
971 ! F
972 ! FILTTM auxiliary
973 ! FISTAT file status, values: OLD, NEW, UNKNOWN
974 ! FORM formatting, values: FORMATTED, UNFORMATTED
975 ! DDNAME_L local copy of DDNAME
976 !
977  CHARACTER S, F, FILTTM *(LENFNM), DDNAME_L *(LENFNM)
978  CHARACTER *11 FISTAT(4),FORM(2)
979 !
980 ! 4. SUBROUTINES USED
981 !
982 !
983 ! 5. ERROR MESSAGES
984 !
985 ! and error messages added using MSGERR
986 !
987 !
988 ! 6. REMARKS
989 !
990 ! Free unit number search interval: FUNLO<=IUNIT<=FUNHI
991 ! FUNLO, FUNHI, IUNMIN and IUNMAX were initialized by OCPINI,
992 ! they are transmitted via module OCPCOMM4
993 !
994 ! 7. STRUCTURE
995 !
996 ! ----------------------------------------------------------------
997 ! Check file qualifiers
998 ! ----------------------------------------------------------------
999 ! If IUNIT = 0
1000 ! Then If DDNAME = ' '
1001 ! Then error message
1002 ! Else Inquire to find if file exists and is opened,
1003 ! and if so, to find correct unit number
1004 ! If file is not opened
1005 ! Then get a free unit number, assign value to IUNIT
1006 ! open the file
1007 ! Else assign correct unit number to IUNIT
1008 ! Else Inquire to find if file exists and is opened,
1009 ! and if so, to find correct filename
1010 ! If file with unit nr IUNIT is already open
1011 ! Then If filename does not correspond to DDNAME
1012 ! Then Close file with old filename and unit IUNIT
1013 ! Open file with new filename DDNAME and unit IUNIT
1014 ! Else If DDNAME is not empty
1015 ! Then Open file with new filename DDNAME and unit IUNIT
1016 ! Else Open file with unit IUNIT
1017 ! ----------------------------------------------------------------
1018 !
1019 ! 8. SOURCE TEXT
1020 !
1021  SAVE ient, ifun
1022 !
1023  DATA fistat(1),fistat(2) / 'OLD','NEW'/ &
1024  fistat(3),fistat(4) / 'SCRATCH','UNKNOWN'/ &
1025  form(1),form(2) / 'FORMATTED','UNFORMATTED'/
1026 !
1027  DATA ient /0/, ifun /0/
1028  CALL strace (ient, 'FOR')
1029 !
1030  IF(itest >= 80) WRITE (prtest, 2) iunit, ddname, sf, iostat
1031 2 FORMAT (' Entry FOR: ', i3, 1x, a36, a2, i7)
1032  ddname_l = ddname
1033 !
1034 ! check file qualifiers
1035 !
1036  IF((iunit /= 0) .AND. ((iunit < iunmin) .OR. (iunit > iunmax)))THEN
1037  IF(iostat > -2) CALL msgerr (3, 'Unit number out of range')
1038  iostat= ieunbd
1039  RETURN
1040  END IF
1041 !
1042  s = sf(1:1)
1043  f = sf(2:2)
1044  is = index('ONSU',s)
1045  ifo = index('FU',f)
1046  IF((is == 0) .OR. (ifo == 0))THEN
1047  IF(iostat > -2) CALL msgerr (3,'Error in file qualifiers')
1048  iostat= iestat
1049  RETURN
1050  END IF
1051 !
1052  IF((s == 'S') .AND. (ddname /= empty))THEN
1053  IF(iostat > -2) CALL msgerr (3, 'Named scratch file')
1054  iostat= ienscr
1055  RETURN
1056  END IF
1057 !
1058  IF(ddname /= empty)THEN
1059 ! directory separation character is replaced in filenames
1060  DO ii = 1, len(ddname)
1061  IF(ddname(ii:ii) == dirch1) ddname(ii:ii) = dirch2
1062  ENDDO
1063  ENDIF
1064 !
1065  IF(iunit == 0)THEN
1066  IF(ddname == empty)THEN
1067  IF(iostat > -1) CALL msgerr (3, 'No filename given')
1068  iostat= ienodd
1069  RETURN
1070  ELSE
1071 ! Was the file opened already ?
1072  INQUIRE (file=ddname, iostat=iosttm, exist=exist, &
1073  opened=opened, number=iuttm)
1074  IF(iosttm /= iesucc)THEN
1075  IF(iostat > -1) &
1076  CALL msgerr (2,'Inquire failed, filename: '//ddname_l)
1077  iostat = iosttm
1078  RETURN
1079  ENDIF
1080 ! If file does not exist, print term. error
1081  IF(is == 1 .AND. .NOT. exist)THEN
1082  CALL msgerr (4,'File cannot be opened/does not exist: '//ddname_l)
1083  iostat = ieexst
1084  END IF
1085  IF(opened)THEN
1086  IF(iostat.GT.-1) &
1087  CALL msgerr (2, 'File is already opened: '//ddname_l)
1088  iostat = ieopen
1089  iunit = iuttm
1090  RETURN
1091  ENDIF
1092 ! Assign free unit number
1093  IF(ifun == 0)THEN
1094  ifun = funlo
1095  ELSE
1096  ifun = ifun + 1
1097  ENDIF
1098  iunit = ifun
1099  IF(iunit > funhi)THEN
1100  IF(iostat > -2) CALL msgerr (3, 'All free units used')
1101  iostat= ienunf
1102  ENDIF
1103  END IF
1104  OPEN (unit=iunit,err=999,iostat=iosttm,file=ddname, &
1105 !/Cray RECL=1000, &
1106 !/SGI RECL=1000, &
1107 !CVIS SHARED, &
1108  status=fistat(is),access='SEQUENTIAL',form=form(ifo))
1109  ELSE
1110  INQUIRE (unit=iunit, name=filttm, iostat=iosttm, &
1111  exist=exist, opened=opened)
1112  IF(iosttm /= iesucc)THEN
1113  IF(iostat > -1) &
1114  CALL msgerr (2,'Inquire failed, filename: '//filttm)
1115  iostat = iosttm
1116  RETURN
1117  ENDIF
1118  IF(opened)THEN
1119  IF(iostat > -1)THEN
1120  CALL msgerr (1,'File is already opened, filename: '//filttm)
1121  ENDIF
1122  IF(filttm /= ddname .AND. filttm /= empty)THEN
1123  IF(iostat > -2)THEN
1124  WRITE (printf, '(A, I4, 6A)') ' unit', iunit, &
1125  ' filenames: ', filttm, ' and: ', ddname
1126  CALL msgerr (2, 'filename and unit number inconsistent')
1127  ENDIF
1128  iostat = ieddnm
1129 ! close old file and open new one with given filename
1130  CLOSE (iunit)
1131  OPEN (unit=iunit,err=999,iostat=iosttm,status=fistat(is), &
1132 !/Cray RECL=1000, &
1133 !/SGI RECL=1000, &
1134 !CVIS SHARED, &
1135  file=ddname,access='SEQUENTIAL',form=form(ifo))
1136  IF(iosttm /= iesucc) iostat = iosttm
1137  GOTO 80
1138  ENDIF
1139  iostat = ieopen
1140  RETURN
1141  END IF
1142  IF(ddname /= empty)THEN
1143  OPEN (unit=iunit,err=999,iostat=iosttm,status=fistat(is), &
1144 !/Cray RECL=1000, &
1145 !/SGI RECL=1000, &
1146 !CVIS SHARED, &
1147  file=ddname,access='SEQUENTIAL',form=form(ifo))
1148  ELSE
1149  OPEN (unit=iunit,err=999,iostat=iosttm,status=fistat(is), &
1150 !/Cray RECL=1000, &
1151 !/SGI RECL=1000, &
1152 !CVIS SHARED, &
1153  access='SEQUENTIAL',form=form(ifo))
1154  END IF
1155  END IF
1156  hiopen = ifun
1157 80 IF(itest >= 30) WRITE (printf, 82) iunit, ddname, sf
1158 82 FORMAT (' File opened: ', i6, 2x, a36, 2x, a2)
1159  RETURN
1160 !
1161 ! in case file cannot be opened:
1162 !
1163 999 IF(iostat > -2)THEN
1164  CALL msgerr (3, 'File open failed, filename: '//ddname_l)
1165  WRITE (printf,15) ddname, iosttm, sf
1166 15 FORMAT (' File -> ', a36, 2x, ' IOSTAT=', i6, 4x, a2)
1167  ENDIF
1168  iunit = -1
1169  iostat= iosttm
1170 
1171  RETURN
1172  END SUBROUTINE for
1173 
1174 !***********************************************************************
1175 ! *
1176  LOGICAL FUNCTION eqreal (REAL1, REAL2 )
1177 ! *
1178 !***********************************************************************
1179 !
1180  USE ocpcomm1
1181  USE ocpcomm2
1182  USE ocpcomm3
1183  USE ocpcomm4
1184 !
1185  IMPLICIT NONE
1186 !
1187 !
1188 ! --|-----------------------------------------------------------|--
1189 ! | Delft University of Technology |
1190 ! | Faculty of Civil Engineering |
1191 ! | Environmental Fluid Mechanics Section |
1192 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1193 ! | |
1194 ! | Programmers: R.C. Ris, N. Booij, |
1195 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1196 ! | M. Zijlema, E.E. Kriezi, |
1197 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1198 ! --|-----------------------------------------------------------|--
1199 !
1200 !
1201 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1202 ! Copyright (C) 2004-2005 Delft University of Technology
1203 !
1204 ! This program is free software; you can redistribute it and/or
1205 ! modify it under the terms of the GNU General Public License as
1206 ! published by the Free Software Foundation; either version 2 of
1207 ! the License, or (at your option) any later version.
1208 !
1209 ! This program is distributed in the hope that it will be useful,
1210 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1211 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ! GNU General Public License for more details.
1213 !
1214 ! A copy of the GNU General Public License is available at
1215 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1216 ! or by writing to the Free Software Foundation, Inc.,
1217 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1218 !
1219 !
1220 ! 0. Authors
1221 !
1222 ! 30.72 IJsbrand Haagsma
1223 ! 30.60 Nico Booij
1224 ! 40.04 Annette Kieftenburg
1225 ! 40.41: Marcel Zijlema
1226 !
1227 ! 1. Updates
1228 !
1229 ! 30.72, Oct. 97: Changed from EXCYES to make floating point point comparisons
1230 ! 30.60, July 97: new subroutine (EXCYES)
1231 ! 40.04, Aug. 00: introduced EPSILON and TINY
1232 ! 40.41, Oct. 04: common blocks replaced by modules, include files removed
1233 !
1234 ! 2. Purpose
1235 !
1236 ! to determine whether a value (usually a value read from file)
1237 ! is an exception value or not
1238 ! Later (30.72) used to make comparisons of floating points within reasonable bounds
1239 !
1240 ! 3. Method (updated...)
1241 !
1242 ! Checks whether ABS(REAL1-REAL2) .LE. TINY(REAL1) or whether this 40.04
1243 ! difference is .LE. then EPS (= EPSILON(REAL1)*ABS(REAL1-REAL2) ) 40.04
1244 !
1245 ! 4. Argument variables
1246 !
1247 ! REAL1 : input value that is to be tested
1248 ! REAL2 : input given exception value
1249 !
1250  REAL real1, real2
1251 !
1252 ! 5. Parameter variables
1253 !
1254 ! 6. Local variables
1255 !
1256 ! EPS : Small number (related to REAL1 and its difference with REAL2)
1257 ! IENT : Number of entries into this subroutine
1258 !
1259  REAL eps
1260  INTEGER ient
1261 !
1262 ! 8. Subroutines used
1263 !
1264 ! 9. Subroutines calling
1265 !
1266 ! SWREAD
1267 ! SWDIM
1268 ! SIRAY
1269 ! SWBOUN
1270 ! SWODDC
1271 ! SWOEXD
1272 ! SWOEXA
1273 ! SWOEXF
1274 ! SWPLOT
1275 ! SWSPEC
1276 ! ISOLIN
1277 ! SNYPT2
1278 ! INCTIM
1279 ! INDBLE
1280 !
1281 ! 10. Error messages
1282 !
1283 ! 11. Remarks
1284 !
1285 ! 12. Structure
1286 !
1287 ! 13. Source text
1288 !
1289  SAVE ient
1290  DATA ient/0/
1291  CALL strace(ient,'EQREAL')
1292  eqreal = .false.
1293 !
1294  eps = epsilon(real1)*abs(real1-real2)
1295  IF (eps ==0) eps = tiny(real1)
1296  IF (abs(real1-real2) .GT. tiny(real1)) THEN
1297  IF (abs(real1-real2) .LT. eps) eqreal = .true.
1298  ELSE
1299  eqreal = .true.
1300  ENDIF
1301  RETURN
1302  END FUNCTION eqreal
1303 !*****************************************************************
1304 ! *
1305  SUBROUTINE dtreti (TSTRNG, IOPT, TIMESC)
1306 ! *
1307 !*****************************************************************
1308 !
1309  IMPLICIT NONE
1310 !
1311 !
1312 ! --|-----------------------------------------------------------|--
1313 ! | Delft University of Technology |
1314 ! | Faculty of Civil Engineering |
1315 ! | Environmental Fluid Mechanics Section |
1316 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
1317 ! | |
1318 ! | Programmers: R.C. Ris, N. Booij, |
1319 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
1320 ! | M. Zijlema, E.E. Kriezi, |
1321 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
1322 ! --|-----------------------------------------------------------|--
1323 !
1324 !
1325 ! SWAN (Simulating WAves Nearshore); a third generation wave model
1326 ! Copyright (C) 2004-2005 Delft University of Technology
1327 !
1328 ! This program is free software; you can redistribute it and/or
1329 ! modify it under the terms of the GNU General Public License as
1330 ! published by the Free Software Foundation; either version 2 of
1331 ! the License, or (at your option) any later version.
1332 !
1333 ! This program is distributed in the hope that it will be useful,
1334 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
1335 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1336 ! GNU General Public License for more details.
1337 !
1338 ! A copy of the GNU General Public License is available at
1339 ! http://www.gnu.org/copyleft/gpl.html#SEC3
1340 ! or by writing to the Free Software Foundation, Inc.,
1341 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1342 !
1343 !
1344 ! 0. AUTHORS
1345 !
1346 ! 1. UPDATES
1347 !
1348 ! 2. PURPOSE
1349 !
1350 ! 3. METHOD
1351 !
1352 ! 4. ARGUMENT VARIABLES
1353 !
1354 ! IOPT : input option number
1355 !
1356  INTEGER IOPT
1357 !
1358 ! TIMESC : output time in seconds from given reference day REFDAY
1359 !
1360  REAL TIMESC
1361 !
1362 ! TSTRNG : input time string
1363 !
1364  CHARACTER TSTRNG *(*)
1365 !
1366 ! 5. PARAMETER VARIABLES
1367 !
1368 ! 6. LOCAL VARIABLES
1369 !
1370 ! ITIME : ??
1371 !
1372  INTEGER ITIME(6)
1373 !
1374 ! DTTIME : Gives time in seconds from a reference day it also initialises the
1375 ! reference day
1376 !
1377  REAL DTTIME
1378 !
1379 ! 8. SUBROUTINE USED
1380 !
1381 ! DTSTTI (installation dependent subroutines)
1382 !
1383 ! 9. SUBROUTINES CALLING
1384 !
1385 ! 10. ERROR MESSAGES
1386 !
1387 ! 11. REMARKS
1388 !
1389 ! 12. STRUCTURE
1390 !
1391 ! 13. SOURCE TEXT
1392 !
1393  CALL dtstti (iopt, tstrng, itime)
1394  timesc = dttime(itime)
1395  RETURN
1396  END SUBROUTINE dtreti
integer funhi
Definition: swmod1.f90:515
character(len=lenfnm) filenm
Definition: swmod1.f90:280
subroutine strace(IENT, SUBNAM)
Definition: ocpmix.f90:468
integer hiopen
Definition: swmod1.f90:515
integer maxerr
Definition: swmod1.f90:536
integer prtest
Definition: swmod1.f90:517
integer refday
Definition: swmod1.f90:161
real function dttime(INTTIM)
Definition: ocpmix.f90:32
logical function eqreal(REAL1, REAL2)
Definition: ocpmix.f90:1177
integer funlo
Definition: swmod1.f90:515
integer inode
Definition: swmod2.f90:881
integer screen
Definition: swmod1.f90:517
integer printf
Definition: swmod1.f90:517
logical function stpnow()
Definition: ocpmix.f90:736
integer itest
Definition: swmod1.f90:536
subroutine msgerr(LEV, STRING)
Definition: ocpmix.f90:582
logical parll
Definition: swmod2.f90:884
subroutine for(IUNIT, DDNAME, SF, IOSTAT)
Definition: ocpmix.f90:835
integer iunmin
Definition: swmod1.f90:517
subroutine dtstti(IOPT, TIMSTR, DTTIME)
Definition: ocpids.f90:436
integer itrace
Definition: swmod1.f90:536
subroutine dtreti(TSTRNG, IOPT, TIMESC)
Definition: ocpmix.f90:1306
integer leverr
Definition: swmod1.f90:536
integer iunmax
Definition: swmod1.f90:516
character(len=1) dirch1
Definition: swmod1.f90:279
character(len=1) dirch2
Definition: swmod1.f90:279
subroutine inar2d(ARR, MGA, NDSL, NDSD, IDFM, RFORM, IDLA, VFAC, NHED, NHEDF)
Definition: ocpmix.f90:182
integer master
Definition: swmod2.f90:864