1 | #include "xios_fortran_prefix.hpp" |
---|
2 | MODULE IDATE |
---|
3 | USE, INTRINSIC :: ISO_C_BINDING |
---|
4 | |
---|
5 | ! enum XCalendarType |
---|
6 | INTEGER(kind = C_INT), PARAMETER :: D360 = 0 , ALLLEAP = 1 , NOLEAP = 2 , JULIAN = 3 , GREGORIAN = 4 |
---|
7 | |
---|
8 | TYPE, BIND(C) :: txios(date) |
---|
9 | INTEGER(kind = C_INT) :: year, month, day, hour, minute, second |
---|
10 | END TYPE txios(date) |
---|
11 | |
---|
12 | TYPE, BIND(C) :: txios(duration) |
---|
13 | REAL(kind = C_DOUBLE) :: year=0, month=0, day=0, hour=0, minute=0, second=0, timestep=0 |
---|
14 | END TYPE txios(duration) |
---|
15 | |
---|
16 | INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 |
---|
17 | |
---|
18 | SUBROUTINE cxios_update_calendar(step) BIND(C) |
---|
19 | IMPORT C_INT |
---|
20 | INTEGER (kind = C_INT), VALUE :: step |
---|
21 | END SUBROUTINE cxios_update_calendar |
---|
22 | |
---|
23 | END INTERFACE |
---|
24 | |
---|
25 | CONTAINS ! Fonctions disponibles pour les utilisateurs. |
---|
26 | |
---|
27 | SUBROUTINE xios(update_calendar)(step) |
---|
28 | IMPLICIT NONE |
---|
29 | INTEGER, INTENT(IN):: step |
---|
30 | |
---|
31 | IF (step < 0) THEN |
---|
32 | PRINT *, "L'argument 'step' ne peut être négatif" |
---|
33 | STOP |
---|
34 | END IF |
---|
35 | CALL cxios_update_calendar(step) |
---|
36 | END SUBROUTINE xios(update_calendar) |
---|
37 | |
---|
38 | END MODULE IDATE |
---|