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

Last change on this file since 501 was 501, checked in by ymipsl, 10 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

  • 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.7 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 txios(date)
9      INTEGER :: year, month, day, hour, minute, second
10   END TYPE txios(date)
11
12   TYPE txios(time)
13      REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0
14   END TYPE txios(time)   
15
16   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
17   
18      SUBROUTINE cxios_set_timestep(ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second) BIND(C)
19         IMPORT C_DOUBLE
20         REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month , ts_day   , &
21                                          ts_hour, ts_minute, ts_second
22      END SUBROUTINE cxios_set_timestep
23
24      SUBROUTINE cxios_update_calendar(step) BIND(C)
25         IMPORT C_INT
26         INTEGER (kind = C_INT), VALUE :: step
27      END SUBROUTINE cxios_update_calendar
28     
29   END INTERFACE
30   
31   CONTAINS ! Fonctions disponibles pour les utilisateurs.
32
33
34   SUBROUTINE xios(set_timestep)(timestep)
35      IMPLICIT NONE
36      TYPE(txios(time)), INTENT(IN):: timestep
37
38      CALL cxios_set_timestep(timestep%year, timestep%month , timestep%day, &
39                             timestep%hour, timestep%minute, timestep%second)
40
41   END SUBROUTINE xios(set_timestep)
42
43
44   
45   SUBROUTINE xios(update_calendar)(step)
46     IMPLICIT NONE
47     INTEGER, INTENT(IN):: step
48     
49      IF (step < 0) THEN
50         PRINT *, "L'argument 'step' ne peut être négatif"
51         STOP
52      END IF
53      CALL cxios_update_calendar(step)
54     
55   END SUBROUTINE xios(update_calendar)
56
57   
58END MODULE IDATE
Note: See TracBrowser for help on using the repository browser.