source: XIOS/trunk/src/interface/fortran/context_interface.f90 @ 549

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

Expose the calendar operations through the Fortran interface.

  • Add arithmetic operations on the xios_duration and xios_date types:
    • xios_duration + xios_duration = xios_duration
    • xios_duration - xios_duration = xios_duration
    • scalar * xios_duration = xios_duration * scalar = xios_duration
    • - xios_duration = xios_duration
    • xios_date + xios_duration = xios_date
    • xios_date - xios_duration = xios_date
    • xios_date - xios_date = xios_duration
  • Add comparison operations on the xios_duration and xios_date types:
    • xios_duration: ==, /=
    • xios_date: ==, /=, <, <=, >, >=
  • Add a new function "xios_date_convert_to_seconds" to convert a date into the number of seconds since the time origin of the calendar
  • Define some constant durations "xios_second", "xios_minute", "xios_hour", "xios_day", "xios_month", "xios_year" et "xios_timestep" to ease the definition of new durations (for example, 10h is just 10 * xios_hour)
  • Add a new function "xios_set_calendar" so that one can manually create the calendar attached to the current context and thus use the calendar operations before calling "xios_close_context_definition". This function can accept optional parameters so that the calendar attributes (calendar_type, start_date, time_origin and timestep) can be easily overwritten. Note that you cannot define a new calendar after one was already created (either because "xios_set_calendar" or "xios_close_context_definition" was used)
  • Readd the function "xios_set_timestep" as a simplified alias of "xios_set_context_attr(context, timestep)" for the current context
  • 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.3 KB
Line 
1MODULE CONTEXT_INTERFACE
2   USE, INTRINSIC :: ISO_C_BINDING
3
4   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
5
6      SUBROUTINE cxios_context_handle_create(ret, idt, idt_size) BIND(C)
7         import C_CHAR, C_INTPTR_T, C_INT
8         INTEGER  (kind = C_INTPTR_T)               :: ret
9         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
10         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
11      END SUBROUTINE cxios_context_handle_create
12
13      SUBROUTINE cxios_context_get_current(context) BIND(C)
14         import C_INTPTR_T
15         INTEGER (kind = C_INTPTR_T) :: context
16      END SUBROUTINE cxios_context_get_current
17
18      SUBROUTINE cxios_context_set_current(context, withswap) BIND(C)
19         import C_BOOL, C_INT, C_INTPTR_T
20         INTEGER (kind = C_INTPTR_T), VALUE :: context
21         LOGICAL (kind = C_BOOL)    , VALUE :: withswap
22      END SUBROUTINE cxios_context_set_current
23
24      SUBROUTINE cxios_context_valid_id(ret, idt, idt_size) BIND(C)
25         USE ISO_C_BINDING
26         LOGICAL  (kind = C_BOOL)                   :: ret
27         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
28         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
29      END SUBROUTINE cxios_context_valid_id
30
31   END INTERFACE
32
33END MODULE CONTEXT_INTERFACE
Note: See TracBrowser for help on using the repository browser.