source: XIOS/trunk/src/interface/fortran/idate.F90 @ 537

Last change on this file since 537 was 537, checked in by rlacroix, 9 years ago

Add a new attribute type for durations and use it for the context's timestep.

Note that the "xios_time" type and the "xios_set_timestep" procedure have been removed from the Fortran interface. Instead, the "xios_duration" type and the "xios_get_context_attr"/"xios_set_context_attr" procedures should now be used to get/set the timestep.

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 1.1 KB
Line 
1#include "xios_fortran_prefix.hpp"
2MODULE 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
38END MODULE IDATE
Note: See TracBrowser for help on using the repository browser.