The TELEMAC-MASCARET system  trunk
read_ref_date.f
Go to the documentation of this file.
1  SUBROUTINE read_ref_date(LINE, DATE)
2 
4  IMPLICIT NONE
5 
6  CHARACTER(LEN=*), INTENT(IN) :: line
7  INTEGER, INTENT(OUT) :: date(6)
8 
9  INTEGER ierr
10 
11  ! Format of date 2012-12-31 12:00:00
12  READ(line(10:13),*,iostat=ierr) date(1)
13  IF (ierr.NE.0) THEN
14  WRITE(lu,*) 'COULD NOT READ REFERENCE YEAR', line
15  CALL plante(1)
16  stop
17  ENDIF
18  READ(line(15:16),*,iostat=ierr) date(2)
19  IF (ierr.NE.0) THEN
20  WRITE(lu,*) 'COULD NOT READ REFERENCE MONTH'
21  CALL plante(1)
22  stop
23  ENDIF
24  READ(line(18:19),*,iostat=ierr) date(3)
25  IF (ierr.NE.0) THEN
26  WRITE(lu,*) 'COULD NOT READ REFERENCE DAY'
27  CALL plante(1)
28  stop
29  ENDIF
30  READ(line(21:22),*,iostat=ierr) date(4)
31  IF (ierr.NE.0) THEN
32  WRITE(lu,*) 'COULD NOT READ REFERENCE HOUR'
33  CALL plante(1)
34  stop
35  ENDIF
36  READ(line(24:25),*,iostat=ierr) date(5)
37  IF (ierr.NE.0) THEN
38  WRITE(lu,*) 'COULD NOT READ REFERENCE MINUTE'
39  CALL plante(1)
40  stop
41  ENDIF
42  READ(line(27:28),*,iostat=ierr) date(6)
43  IF (ierr.NE.0) THEN
44  WRITE(lu,*) 'COULD NOT READ REFERENCE SECONDS'
45  CALL plante(1)
46  stop
47  ENDIF
48 
49  END SUBROUTINE read_ref_date