Ignore:
Timestamp:
01/26/15 14:39:26 (9 years ago)
Author:
rlacroix
Message:

Revised calendar functionalities:

  • the calendar is now configured from a specific calendar child node of the context in the XML configuration file. Example: <calendar type="Gregorian" start_date="2012-03-01 15:00:00" time_origin="2012-02-29 15:00:00" timestep="1h" />
  • the calendar type should now be configured when defining the start time and/or the time origin.
  • the start time and the time origin are now optional, 0000-01-01 00:00:00 will be used by default. It is also possible to define them partially. For example, 2015 and 2014-12 are valid dates corresponding respectively to 2015-01-01 00:00:00 and 2014-12-01 00:00:00.
  • an optional duration offset can be added to the start date and time origin. For example, it's possible to define the date 2015-01-12 12:00:00 as 2015-01-11 + 36h or 2015-01-11 12:00:00 + 1d. The duration format is the same as the time step. Being that the date is optional, it is possible to only use a duration (for example + 42s is the same as 0000-01-01 00:00:00 + 42s). An error will be raised if a duration based on the time step is used before the time step was configured. For example, the following would cause an error: <calendar type="Gregorian" start_date="+ 1ts" /> but <calendar type="Gregorian" start_date="+ 1ts" timestep="0.5h" /> would not.
  • new Fortran interface to define the calendar:
    • xios_define_calendar(type[, timestep, start_date, time_origin]) will create a calendar when none had previously been defined. Only the type argument is mandatory, the rest is optional. Calendar operations on dates and durations are possible as soon as the calendar is created (either using this procedure or directly from the XML configuration file).
    • the following getter and setter procedures are available: xios_set_timestep, xios_set_start_date, xios_set_time_origin, xios_get_calendar_type, xios_get_timestep, xios_get_start_date, xios_get_time_origin.
  • new Fortran interface to interact with the calendar: xios_update_calendar, xios_get_current_date, xios_get_year_length_in_seconds, xios_get_day_length_in_seconds.
  • new Fortran interface for date conversion: xios_date_get_second_of_year, xios_date_get_day_of_year, xios_date_get_fraction_of_year, xios_date_get_second_of_day, xios_date_get_fraction_of_day.
  • two new placeholders are available to format the file name when splitting the output (split_freq_format attribute):
    • %S the number of seconds since the time origin
    • %D the integral number of days since the time origin
Location:
XIOS/trunk/src/interface
Files:
6 added
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c/iccalendar.cpp

    r545 r549  
    11#include "xmlioserver.hpp" 
    22 
     3#include "icdate.hpp" 
    34#include "exception.hpp" 
    45#include "timer.hpp" 
     
    89extern "C" 
    910{ 
    10   void cxios_create_calendar() 
    11   { 
    12     CTimer::get("XIOS").resume(); 
    13     xios::CContext* context = CContext::getCurrent(); 
    14     if (context->hasClient) 
    15       context->solveCalendar(); 
    16     CTimer::get("XIOS").suspend(); 
    17   } 
    18  
    1911  void cxios_update_calendar(int step) 
    2012  { 
     
    2618    CTimer::get("XIOS").suspend(); 
    2719  } 
     20 
     21  void cxios_get_current_date(cxios_date* current_date_c) 
     22  { 
     23    CTimer::get("XIOS").resume(); 
     24    const xios::CContext* context = CContext::getCurrent(); 
     25    const boost::shared_ptr<xios::CCalendar> cal = context->getCalendar(); 
     26    if (!cal) 
     27      ERROR("void cxios_get_current_date(cxios_date* current_date_c)", 
     28            << "Impossible to get the current date: no calendar was defined."); 
     29    const CDate& currentDate = cal->getCurrentDate(); 
     30    current_date_c->year = currentDate.getYear(); 
     31    current_date_c->month = currentDate.getMonth(); 
     32    current_date_c->day = currentDate.getDay(); 
     33    current_date_c->hour = currentDate.getHour(); 
     34    current_date_c->minute = currentDate.getMinute(); 
     35    current_date_c->second = currentDate.getSecond(); 
     36    CTimer::get("XIOS").suspend(); 
     37  } 
     38 
     39  int cxios_get_year_length_in_seconds(int year) 
     40  { 
     41    CTimer::get("XIOS").resume(); 
     42    const boost::shared_ptr<xios::CCalendar> cal = CContext::getCurrent()->getCalendar(); 
     43    if (!cal) 
     44      ERROR("int cxios_get_year_length_in_seconds(int year)", 
     45            << "Impossible to get the year length: no calendar was defined."); 
     46    int length = cal->getYearTotalLength(CDate(*cal, year, 01, 01)); 
     47    CTimer::get("XIOS").suspend(); 
     48 
     49    return length; 
     50  } 
     51 
     52  int cxios_get_day_length_in_seconds() 
     53  { 
     54    CTimer::get("XIOS").resume(); 
     55    const boost::shared_ptr<xios::CCalendar> cal = CContext::getCurrent()->getCalendar(); 
     56    if (!cal) 
     57      ERROR("int cxios_get_day_length_in_seconds()", 
     58            << "Impossible to get the day length: no calendar was defined."); 
     59    int length = cal->getDayLengthInSeconds(); 
     60    CTimer::get("XIOS").suspend(); 
     61 
     62    return length; 
     63  } 
    2864} 
  • XIOS/trunk/src/interface/c/icdate.cpp

    r545 r549  
    144144    return (date1 >= date2); 
    145145  } 
     146 
     147  int cxios_date_get_second_of_year(cxios_date date_c) 
     148  { 
     149    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_year(cxios_date date_c)"), 
     150                                   date_c.year, date_c.month, date_c.day, 
     151                                   date_c.hour, date_c.minute, date_c.second); 
     152    return date.getSecondOfYear(); 
     153  } 
     154 
     155  double cxios_date_get_day_of_year(cxios_date date_c) 
     156  { 
     157    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_day_of_year(cxios_date date_c)"), 
     158                                   date_c.year, date_c.month, date_c.day, 
     159                                   date_c.hour, date_c.minute, date_c.second); 
     160    return date.getDayOfYear(); 
     161  } 
     162 
     163  double cxios_date_get_fraction_of_year(cxios_date date_c) 
     164  { 
     165    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_year(cxios_date date_c)"), 
     166                                   date_c.year, date_c.month, date_c.day, 
     167                                   date_c.hour, date_c.minute, date_c.second); 
     168    return date.getFractionOfYear(); 
     169  } 
     170 
     171  int cxios_date_get_second_of_day(cxios_date date_c) 
     172  { 
     173    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_day(cxios_date date_c)"), 
     174                                   date_c.year, date_c.month, date_c.day, 
     175                                   date_c.hour, date_c.minute, date_c.second); 
     176    return date.getSecondOfDay(); 
     177  } 
     178 
     179  double cxios_date_get_fraction_of_day(cxios_date date_c) 
     180  { 
     181    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_day(cxios_date date_c)"), 
     182                                   date_c.year, date_c.month, date_c.day, 
     183                                   date_c.hour, date_c.minute, date_c.second); 
     184    return date.getFractionOfDay(); 
     185  } 
    146186} // extern "C" 
  • XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp

    r537 r549  
    1717{ 
    1818  typedef xios::CContext*  context_Ptr; 
    19    
    20   void cxios_set_context_calendar_type(context_Ptr context_hdl, const char * calendar_type, int calendar_type_size) 
    21   { 
    22     std::string calendar_type_str; 
    23     if(!cstr2string(calendar_type, calendar_type_size, calendar_type_str)) return; 
    24      CTimer::get("XIOS").resume(); 
    25     context_hdl->calendar_type.fromString(calendar_type_str); 
    26      CTimer::get("XIOS").suspend(); 
    27   } 
    28    
    29   void cxios_get_context_calendar_type(context_Ptr context_hdl, char * calendar_type, int calendar_type_size) 
    30   { 
    31      CTimer::get("XIOS").resume(); 
    32     if(!string_copy(context_hdl->calendar_type.getInheritedStringValue(),calendar_type , calendar_type_size)) 
    33       ERROR("void cxios_get_context_calendar_type(context_Ptr context_hdl, char * calendar_type, int calendar_type_size)", <<"Input string is to short"); 
    34      CTimer::get("XIOS").suspend(); 
    35   } 
    36    
    37   bool cxios_is_defined_context_calendar_type(context_Ptr context_hdl ) 
    38   { 
    39      CTimer::get("XIOS").resume(); 
    40     return context_hdl->calendar_type.hasInheritedValue(); 
    41      CTimer::get("XIOS").suspend(); 
    42   } 
    43    
    44    
    4519   
    4620  void cxios_set_context_output_dir(context_Ptr context_hdl, const char * output_dir, int output_dir_size) 
     
    7044   
    7145   
    72   void cxios_set_context_start_date(context_Ptr context_hdl, cxios_date start_date_c) 
    73   { 
    74     CTimer::get("XIOS").resume(); 
    75     context_hdl->start_date.allocate(); 
    76     CDate& start_date = context_hdl->start_date.get(); 
    77     start_date.setDate(start_date_c.year, 
    78                            start_date_c.month, 
    79                            start_date_c.day, 
    80                            start_date_c.hour, 
    81                            start_date_c.minute, 
    82                            start_date_c.second); 
    83     if (start_date.hasRelCalendar()) 
    84       start_date.checkDate(); 
    85     CTimer::get("XIOS").suspend(); 
    86   } 
    87    
    88   void cxios_get_context_start_date(context_Ptr context_hdl, cxios_date* start_date_c) 
    89   { 
    90     CTimer::get("XIOS").resume(); 
    91     CDate start_date = context_hdl->start_date.getInheritedValue(); 
    92     start_date_c->year = start_date.getYear(); 
    93     start_date_c->month = start_date.getMonth(); 
    94     start_date_c->day = start_date.getDay(); 
    95     start_date_c->hour = start_date.getHour(); 
    96     start_date_c->minute = start_date.getMinute(); 
    97     start_date_c->second = start_date.getSecond(); 
    98     CTimer::get("XIOS").suspend(); 
    99   } 
    100    
    101   bool cxios_is_defined_context_start_date(context_Ptr context_hdl ) 
    102   { 
    103      CTimer::get("XIOS").resume(); 
    104     return context_hdl->start_date.hasInheritedValue(); 
    105      CTimer::get("XIOS").suspend(); 
    106   } 
    107    
    108    
    109    
    110   void cxios_set_context_time_origin(context_Ptr context_hdl, cxios_date time_origin_c) 
    111   { 
    112     CTimer::get("XIOS").resume(); 
    113     context_hdl->time_origin.allocate(); 
    114     CDate& time_origin = context_hdl->time_origin.get(); 
    115     time_origin.setDate(time_origin_c.year, 
    116                            time_origin_c.month, 
    117                            time_origin_c.day, 
    118                            time_origin_c.hour, 
    119                            time_origin_c.minute, 
    120                            time_origin_c.second); 
    121     if (time_origin.hasRelCalendar()) 
    122       time_origin.checkDate(); 
    123     CTimer::get("XIOS").suspend(); 
    124   } 
    125    
    126   void cxios_get_context_time_origin(context_Ptr context_hdl, cxios_date* time_origin_c) 
    127   { 
    128     CTimer::get("XIOS").resume(); 
    129     CDate time_origin = context_hdl->time_origin.getInheritedValue(); 
    130     time_origin_c->year = time_origin.getYear(); 
    131     time_origin_c->month = time_origin.getMonth(); 
    132     time_origin_c->day = time_origin.getDay(); 
    133     time_origin_c->hour = time_origin.getHour(); 
    134     time_origin_c->minute = time_origin.getMinute(); 
    135     time_origin_c->second = time_origin.getSecond(); 
    136     CTimer::get("XIOS").suspend(); 
    137   } 
    138    
    139   bool cxios_is_defined_context_time_origin(context_Ptr context_hdl ) 
    140   { 
    141      CTimer::get("XIOS").resume(); 
    142     return context_hdl->time_origin.hasInheritedValue(); 
    143      CTimer::get("XIOS").suspend(); 
    144   } 
    145    
    146    
    147    
    148   void cxios_set_context_timestep(context_Ptr context_hdl, cxios_duration timestep_c) 
    149   { 
    150     CTimer::get("XIOS").resume(); 
    151     context_hdl->timestep.allocate(); 
    152     CDuration& timestep = context_hdl->timestep.get(); 
    153     timestep.year = timestep_c.year; 
    154     timestep.month = timestep_c.month; 
    155     timestep.day = timestep_c.day; 
    156     timestep.hour = timestep_c.hour; 
    157     timestep.minute = timestep_c.minute; 
    158     timestep.second = timestep_c.second; 
    159     timestep.timestep = timestep_c.timestep; 
    160     CTimer::get("XIOS").suspend(); 
    161   } 
    162    
    163   void cxios_get_context_timestep(context_Ptr context_hdl, cxios_duration* timestep_c) 
    164   { 
    165     CTimer::get("XIOS").resume(); 
    166     CDuration timestep = context_hdl->timestep.getInheritedValue(); 
    167     timestep_c->year = timestep.year; 
    168     timestep_c->month = timestep.month; 
    169     timestep_c->day = timestep.day; 
    170     timestep_c->hour = timestep.hour; 
    171     timestep_c->minute = timestep.minute; 
    172     timestep_c->second = timestep.second; 
    173     timestep_c->timestep = timestep.timestep; 
    174     CTimer::get("XIOS").suspend(); 
    175   } 
    176    
    177   bool cxios_is_defined_context_timestep(context_Ptr context_hdl ) 
    178   { 
    179      CTimer::get("XIOS").resume(); 
    180     return context_hdl->timestep.hasInheritedValue(); 
    181      CTimer::get("XIOS").suspend(); 
    182   } 
    183    
    184    
    185    
    18646   
    18747} 
  • XIOS/trunk/src/interface/fortran/calendar_interface.F90

    r545 r549  
     1#include "xios_fortran_prefix.hpp" 
     2 
    13MODULE CALENDAR_INTERFACE 
    24   USE, INTRINSIC :: ISO_C_BINDING 
    3       
     5 
    46   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    5  
    6       SUBROUTINE cxios_create_calendar() BIND(C) 
    7       END SUBROUTINE cxios_create_calendar 
    87 
    98      SUBROUTINE cxios_update_calendar(step) BIND(C) 
     
    1211      END SUBROUTINE cxios_update_calendar 
    1312 
     13      SUBROUTINE cxios_get_current_date(current_date) BIND(C) 
     14         USE IDATE 
     15         TYPE(txios(date))             :: current_date 
     16      END SUBROUTINE cxios_get_current_date 
     17 
     18      INTEGER(kind = C_INT) FUNCTION cxios_get_year_length_in_seconds(year) BIND(C) 
     19         USE ISO_C_BINDING 
     20         INTEGER(kind = C_INT), VALUE :: year 
     21      END FUNCTION cxios_get_year_length_in_seconds 
     22 
     23      INTEGER(kind = C_INT) FUNCTION cxios_get_day_length_in_seconds() BIND(C) 
     24         USE ISO_C_BINDING 
     25      END FUNCTION cxios_get_day_length_in_seconds 
     26 
    1427   END INTERFACE 
    15       
     28 
    1629END MODULE CALENDAR_INTERFACE 
  • XIOS/trunk/src/interface/fortran/date_interface.F90

    r545 r549  
    77      INTEGER(kind = C_INT) :: year, month, day, hour, minute, second 
    88   END TYPE txios(date) 
    9       
     9 
    1010   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    1111 
     
    7575      END FUNCTION cxios_date_ge 
    7676 
     77      INTEGER(kind = C_INT) FUNCTION cxios_date_get_second_of_year(date) BIND(C) 
     78         USE ISO_C_BINDING 
     79         IMPORT :: txios(date) 
     80         TYPE(txios(date)), VALUE :: date 
     81      END FUNCTION cxios_date_get_second_of_year 
     82 
     83      REAL(kind = C_DOUBLE) FUNCTION cxios_date_get_day_of_year(date) BIND(C) 
     84         USE ISO_C_BINDING 
     85         IMPORT :: txios(date) 
     86         TYPE(txios(date)), VALUE :: date 
     87      END FUNCTION cxios_date_get_day_of_year 
     88 
     89      REAL(kind = C_DOUBLE) FUNCTION cxios_date_get_fraction_of_year(date) BIND(C) 
     90         USE ISO_C_BINDING 
     91         IMPORT :: txios(date) 
     92         TYPE(txios(date)), VALUE :: date 
     93      END FUNCTION cxios_date_get_fraction_of_year 
     94 
     95      INTEGER(kind = C_INT) FUNCTION cxios_date_get_second_of_day(date) BIND(C) 
     96         USE ISO_C_BINDING 
     97         IMPORT :: txios(date) 
     98         TYPE(txios(date)), VALUE :: date 
     99      END FUNCTION cxios_date_get_second_of_day 
     100 
     101      REAL(kind = C_DOUBLE) FUNCTION cxios_date_get_fraction_of_day(date) BIND(C) 
     102         USE ISO_C_BINDING 
     103         IMPORT :: txios(date) 
     104         TYPE(txios(date)), VALUE :: date 
     105      END FUNCTION cxios_date_get_fraction_of_day 
     106 
    77107   END INTERFACE 
    78       
     108 
    79109END MODULE DATE_INTERFACE 
  • XIOS/trunk/src/interface/fortran/icalendar.F90

    r545 r549  
    33   USE, INTRINSIC :: ISO_C_BINDING 
    44   USE CALENDAR_INTERFACE 
     5   USE ICALENDAR_WRAPPER 
    56   USE IDATE 
    67   USE IDURATION 
     
    910   INTEGER(kind = C_INT), PARAMETER :: D360 = 0 , ALLLEAP = 1 , NOLEAP = 2 , JULIAN = 3 , GREGORIAN = 4 
    1011 
     12   INTERFACE xios(set_start_date) 
     13      MODULE PROCEDURE xios(set_start_date_date), xios(set_start_date_dur) 
     14   END INTERFACE xios(set_start_date) 
     15 
     16   INTERFACE xios(set_time_origin) 
     17      MODULE PROCEDURE xios(set_time_origin_date), xios(set_time_origin_dur) 
     18   END INTERFACE xios(set_time_origin) 
     19 
    1120   CONTAINS ! Fonctions disponibles pour les utilisateurs. 
    1221 
    13    SUBROUTINE xios(set_calendar)(calendar_type, start_date, time_origin, timestep) 
    14       USE ICONTEXT, ONLY : txios(context), xios(get_current_context) 
    15       USE icontext_attr, ONLY : xios(set_context_attr_hdl) 
    16       USE IDATE, ONLY : txios(date) 
    17       USE IDURATION, ONLY : txios(duration) 
    18       IMPLICIT NONE 
    19       CHARACTER(len = *),    OPTIONAL, INTENT(IN) :: calendar_type 
     22   SUBROUTINE xios(define_calendar)(type, timestep, start_date, time_origin) 
     23      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     24      USE icalendar_wrapper_attr, ONLY : xios(set_calendar_wrapper_attr_hdl) 
     25      USE IDURATION, ONLY : txios(duration) 
     26      USE IDATE, ONLY : txios(date) 
     27      IMPLICIT NONE 
     28      CHARACTER(len = *),              INTENT(IN) :: type 
     29      TYPE(txios(duration)), OPTIONAL, INTENT(IN) :: timestep 
    2030      TYPE(txios(date)),     OPTIONAL, INTENT(IN) :: start_date 
    2131      TYPE(txios(date)),     OPTIONAL, INTENT(IN) :: time_origin 
    22       TYPE(txios(duration)), OPTIONAL, INTENT(IN) :: timestep 
    23       TYPE(txios(context)) :: context 
    24  
    25       CALL xios(get_current_context)(context) 
    26  
    27       IF (PRESENT(calendar_type)) THEN 
    28          CALL xios(set_context_attr_hdl)(context, calendar_type=calendar_type) 
    29       END IF 
     32      TYPE(txios(calendar_wrapper)) :: calendar_wrapper 
     33 
     34      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     35 
     36      CALL xios(set_calendar_wrapper_attr_hdl)(calendar_wrapper, type=type) 
     37      IF (PRESENT(timestep)) THEN 
     38         CALL xios(set_calendar_wrapper_attr_hdl)(calendar_wrapper, timestep=timestep) 
     39      END IF 
     40 
     41      CALL xios(create_calendar)(calendar_wrapper) 
     42 
    3043      IF (PRESENT(start_date)) THEN 
    31          CALL xios(set_context_attr_hdl)(context, start_date=start_date) 
     44         CALL xios(set_start_date_hdl)(calendar_wrapper, start_date=start_date) 
    3245      END IF 
    3346      IF (PRESENT(time_origin)) THEN 
    34          CALL xios(set_context_attr_hdl)(context, time_origin=time_origin) 
    35       END IF 
    36       IF (PRESENT(time_origin)) THEN 
    37          CALL xios(set_context_attr_hdl)(context, timestep=timestep) 
    38       END IF 
    39  
    40       CALL cxios_create_calendar() 
    41    END SUBROUTINE xios(set_calendar) 
     47         CALL xios(set_time_origin_hdl)(calendar_wrapper, time_origin=time_origin) 
     48      END IF 
     49   END SUBROUTINE xios(define_calendar) 
     50 
     51   SUBROUTINE xios(get_calendar_type)(calendar_type) 
     52      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     53      USE icalendar_wrapper_attr, ONLY : xios(get_calendar_wrapper_attr_hdl) 
     54      IMPLICIT NONE 
     55      CHARACTER(len = *), INTENT(OUT) :: calendar_type 
     56      TYPE(txios(calendar_wrapper))   :: calendar_wrapper 
     57 
     58      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     59 
     60      CALL xios(get_calendar_wrapper_attr_hdl)(calendar_wrapper, type=calendar_type) 
     61   END SUBROUTINE xios(get_calendar_type) 
    4262 
    4363   SUBROUTINE xios(set_timestep)(timestep) 
    44       USE ICONTEXT, ONLY : txios(context), xios(get_current_context) 
    45       USE icontext_attr, ONLY : xios(set_context_attr_hdl) 
     64      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     65      USE icalendar_wrapper_attr, ONLY : xios(set_calendar_wrapper_attr_hdl) 
    4666      USE IDURATION, ONLY : txios(duration) 
    4767      IMPLICIT NONE 
    4868      TYPE(txios(duration)), INTENT(IN) :: timestep 
    49       TYPE(txios(context)) :: context 
    50  
    51       CALL xios(get_current_context)(context) 
    52  
    53       CALL xios(set_context_attr_hdl)(context, timestep=timestep) 
     69      TYPE(txios(calendar_wrapper))     :: calendar_wrapper 
     70 
     71      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     72 
     73      CALL xios(set_calendar_wrapper_attr_hdl)(calendar_wrapper, timestep=timestep) 
     74 
     75      CALL xios(update_calendar_timestep)(calendar_wrapper) 
    5476   END SUBROUTINE xios(set_timestep) 
    5577 
     78   SUBROUTINE xios(get_timestep)(timestep) 
     79      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     80      USE icalendar_wrapper_attr, ONLY : xios(get_calendar_wrapper_attr_hdl) 
     81      USE IDURATION, ONLY : txios(duration) 
     82      IMPLICIT NONE 
     83      TYPE(txios(duration)), INTENT(OUT) :: timestep 
     84      TYPE(txios(calendar_wrapper))      :: calendar_wrapper 
     85 
     86      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     87 
     88      CALL xios(get_calendar_wrapper_attr_hdl)(calendar_wrapper, timestep=timestep) 
     89   END SUBROUTINE xios(get_timestep) 
     90 
     91   SUBROUTINE xios(set_start_date_date)(start_date) 
     92      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     93      USE IDATE, ONLY : txios(date) 
     94      IMPLICIT NONE 
     95      TYPE(txios(date)), INTENT(IN) :: start_date 
     96      TYPE(txios(calendar_wrapper)) :: calendar_wrapper 
     97 
     98      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     99 
     100      CALL xios(set_start_date_hdl)(calendar_wrapper, start_date) 
     101   END SUBROUTINE xios(set_start_date_date) 
     102 
     103   SUBROUTINE xios(set_start_date_dur)(start_date) 
     104      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     105      USE IDURATION, ONLY : txios(duration) 
     106      USE IDATE, ONLY : txios(date) 
     107      IMPLICIT NONE 
     108      TYPE(txios(duration)), INTENT(IN) :: start_date 
     109      TYPE(txios(calendar_wrapper))     :: calendar_wrapper 
     110      TYPE(txios(date))                 :: start_date_date 
     111 
     112      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     113 
     114      start_date_date = start_date 
     115      CALL xios(set_start_date_hdl)(calendar_wrapper, start_date_date) 
     116   END SUBROUTINE xios(set_start_date_dur) 
     117 
     118   SUBROUTINE xios(get_start_date)(start_date) 
     119      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     120      USE IDATE, ONLY : txios(date) 
     121      IMPLICIT NONE 
     122      TYPE(txios(date)), INTENT(OUT) :: start_date 
     123      TYPE(txios(calendar_wrapper))  :: calendar_wrapper 
     124 
     125      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     126 
     127      CALL xios(get_start_date_hdl)(calendar_wrapper, start_date) 
     128   END SUBROUTINE xios(get_start_date) 
     129 
     130   SUBROUTINE xios(set_time_origin_date)(time_origin) 
     131      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     132      USE IDATE, ONLY : txios(date) 
     133      IMPLICIT NONE 
     134      TYPE(txios(date)), INTENT(IN) :: time_origin 
     135      TYPE(txios(calendar_wrapper)) :: calendar_wrapper 
     136 
     137      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     138 
     139      CALL xios(set_time_origin_hdl)(calendar_wrapper, time_origin) 
     140   END SUBROUTINE xios(set_time_origin_date) 
     141 
     142   SUBROUTINE xios(set_time_origin_dur)(time_origin) 
     143      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     144      USE IDURATION, ONLY : txios(duration) 
     145      USE IDATE, ONLY : txios(date) 
     146      IMPLICIT NONE 
     147      TYPE(txios(duration)), INTENT(IN) :: time_origin 
     148      TYPE(txios(calendar_wrapper))     :: calendar_wrapper 
     149      TYPE(txios(date))                 :: time_origin_date 
     150 
     151      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     152 
     153      time_origin_date = time_origin 
     154      CALL xios(set_time_origin_hdl)(calendar_wrapper, time_origin_date) 
     155   END SUBROUTINE xios(set_time_origin_dur) 
     156 
     157   SUBROUTINE xios(get_time_origin)(time_origin) 
     158      USE ICALENDAR_WRAPPER, ONLY : txios(calendar_wrapper), xios(get_default_calendar_wrapper_handle) 
     159      USE IDATE, ONLY : txios(date) 
     160      IMPLICIT NONE 
     161      TYPE(txios(date)), INTENT(OUT) :: time_origin 
     162      TYPE(txios(calendar_wrapper))  :: calendar_wrapper 
     163 
     164      CALL xios(get_default_calendar_wrapper_handle)(calendar_wrapper) 
     165 
     166      CALL xios(get_time_origin_hdl)(calendar_wrapper, time_origin) 
     167   END SUBROUTINE xios(get_time_origin) 
     168 
    56169   SUBROUTINE xios(update_calendar)(step) 
    57170      IMPLICIT NONE 
    58171      INTEGER, INTENT(IN) :: step 
    59        
     172 
    60173      IF (step < 0) THEN 
    61174         PRINT *, "L'argument 'step' ne peut être négatif" 
     
    65178   END SUBROUTINE xios(update_calendar) 
    66179 
     180   SUBROUTINE xios(get_current_date)(current_date) 
     181      USE IDATE, ONLY : txios(date) 
     182      IMPLICIT NONE 
     183      TYPE(txios(date)), INTENT(OUT) :: current_date 
     184 
     185      CALL cxios_get_current_date(current_date) 
     186   END SUBROUTINE xios(get_current_date) 
     187 
     188   FUNCTION xios(get_year_length_in_seconds)(year) RESULT(res) 
     189      IMPLICIT NONE 
     190      INTEGER(kind = C_INT), INTENT(IN) :: year 
     191      INTEGER(kind = C_INT) :: res 
     192 
     193      res = cxios_get_year_length_in_seconds(year) 
     194   END FUNCTION xios(get_year_length_in_seconds) 
     195 
     196   FUNCTION xios(get_day_length_in_seconds)() RESULT(res) 
     197      IMPLICIT NONE 
     198      INTEGER(kind = C_INT) :: res 
     199 
     200      res = cxios_get_day_length_in_seconds() 
     201   END FUNCTION xios(get_day_length_in_seconds) 
     202 
    67203END MODULE ICALENDAR 
  • XIOS/trunk/src/interface/fortran/idate.F90

    r545 r549  
    3737   END INTERFACE 
    3838 
     39   INTERFACE ASSIGNMENT(=) 
     40      MODULE PROCEDURE xios(date_assign_duration) 
     41   END INTERFACE 
     42 
    3943   CONTAINS ! Fonctions disponibles pour les utilisateurs. 
    4044 
     
    140144   END FUNCTION xios(date_ge) 
    141145 
     146   SUBROUTINE xios(date_assign_duration)(date, dur) 
     147      USE DATE_INTERFACE, only : txios(date) 
     148      USE IDURATION, only : txios(duration) 
     149      IMPLICIT NONE 
     150      TYPE(txios(date)), INTENT(OUT) :: date 
     151      TYPE(txios(duration)), INTENT(IN) :: dur 
     152 
     153      date = txios(date)(0, 1, 1, 0, 0, 0) + dur 
     154   END SUBROUTINE xios(date_assign_duration) 
     155 
     156   FUNCTION xios(date_get_second_of_year)(date) RESULT(res) 
     157      USE DATE_INTERFACE, only : txios(date) 
     158      IMPLICIT NONE 
     159      TYPE(txios(date)), INTENT(OUT) :: date 
     160      INTEGER(kind = C_INT) :: res 
     161 
     162      res = cxios_date_get_second_of_year(date) 
     163   END FUNCTION xios(date_get_second_of_year) 
     164 
     165   FUNCTION xios(date_get_day_of_year)(date) RESULT(res) 
     166      USE DATE_INTERFACE, only : txios(date) 
     167      IMPLICIT NONE 
     168      TYPE(txios(date)), INTENT(OUT) :: date 
     169      REAL(kind = C_DOUBLE) :: res 
     170 
     171      res = cxios_date_get_day_of_year(date) 
     172   END FUNCTION xios(date_get_day_of_year) 
     173 
     174   FUNCTION xios(date_get_fraction_of_year)(date) RESULT(res) 
     175      USE DATE_INTERFACE, only : txios(date) 
     176      IMPLICIT NONE 
     177      TYPE(txios(date)), INTENT(OUT) :: date 
     178      REAL(kind = C_DOUBLE) :: res 
     179 
     180      res = cxios_date_get_fraction_of_year(date) 
     181   END FUNCTION xios(date_get_fraction_of_year) 
     182 
     183   FUNCTION xios(date_get_second_of_day)(date) RESULT(res) 
     184      USE DATE_INTERFACE, only : txios(date) 
     185      IMPLICIT NONE 
     186      TYPE(txios(date)), INTENT(OUT) :: date 
     187      INTEGER(kind = C_INT) :: res 
     188 
     189      res = cxios_date_get_second_of_day(date) 
     190   END FUNCTION xios(date_get_second_of_day) 
     191 
     192   FUNCTION xios(date_get_fraction_of_day)(date) RESULT(res) 
     193      USE DATE_INTERFACE, only : txios(date) 
     194      IMPLICIT NONE 
     195      TYPE(txios(date)), INTENT(OUT) :: date 
     196      REAL(kind = C_DOUBLE) :: res 
     197 
     198      res = cxios_date_get_fraction_of_day(date) 
     199   END FUNCTION xios(date_get_fraction_of_day) 
     200 
    142201END MODULE IDATE 
  • XIOS/trunk/src/interface/fortran/ixios.F90

    r545 r549  
    33MODULE XIOS 
    44 
    5 USE icalendar, ONLY : xios(set_calendar), xios(set_timestep), xios(update_calendar) 
     5USE icalendar, ONLY : xios(define_calendar), xios(set_timestep), xios(set_start_date), xios(set_time_origin), & 
     6                      xios(get_calendar_type), xios(get_timestep), xios(get_start_date), xios(get_time_origin), & 
     7                      xios(update_calendar), xios(get_current_date), & 
     8                      xios(get_year_length_in_seconds), xios(get_day_length_in_seconds) 
    69 
    710USE icontext, ONLY : txios(context), xios(get_context_handle), xios(set_current_context),    & 
     
    2427                  xios(date_add_duration), xios(date_sub_duration), xios(date_sub), & 
    2528                  xios(date_eq), xios(date_neq), xios(date_lt), xios(date_le), xios(date_gt), xios(date_ge), & 
     29                  xios(date_get_second_of_year), xios(date_get_day_of_year), xios(date_get_fraction_of_year), & 
     30                  xios(date_get_second_of_day), xios(date_get_fraction_of_day), & 
    2631                  OPERATOR(+), OPERATOR(-), & 
    27                   OPERATOR(==), OPERATOR(/=), OPERATOR(<), OPERATOR(<=), OPERATOR(>), OPERATOR(>=) 
     32                  OPERATOR(==), OPERATOR(/=), OPERATOR(<), OPERATOR(<=), OPERATOR(>), OPERATOR(>=), & 
     33                  ASSIGNMENT(=) 
    2834 
    2935USE idomain, ONLY : txios(domain), txios(domaingroup), xios(get_domain_handle),  & 
     
    200206           xios(field_is_active) 
    201207 
    202  PUBLIC :: xios(set_calendar), xios(set_timestep), xios(update_calendar) 
     208 PUBLIC :: xios(define_calendar), xios(set_timestep), xios(set_start_date), xios(set_time_origin), & 
     209           xios(get_calendar_type), xios(get_timestep), xios(get_start_date), xios(get_time_origin), & 
     210           xios(update_calendar), xios(get_current_date), & 
     211           xios(get_year_length_in_seconds), xios(get_day_length_in_seconds) 
    203212 
    204213 PUBLIC :: xios(year), xios(month), xios(day), xios(hour), xios(minute), xios(second), xios(timestep), & 
     
    208217 PUBLIC :: xios(date_convert_to_seconds), & 
    209218           xios(date_add_duration), xios(date_sub_duration), xios(date_sub), & 
    210            xios(date_eq), xios(date_neq), xios(date_lt), xios(date_le), xios(date_gt), xios(date_ge) 
     219           xios(date_eq), xios(date_neq), xios(date_lt), xios(date_le), xios(date_gt), xios(date_ge), & 
     220           xios(date_get_second_of_year), xios(date_get_day_of_year), xios(date_get_fraction_of_year), & 
     221           xios(date_get_second_of_day), xios(date_get_fraction_of_day) 
    211222 
    212223 PUBLIC :: OPERATOR(+), OPERATOR(-), OPERATOR(*), & 
    213            OPERATOR(==), OPERATOR(/=), OPERATOR(<), OPERATOR(<=), OPERATOR(>), OPERATOR(>=) 
     224           OPERATOR(==), OPERATOR(/=), OPERATOR(<), OPERATOR(<=), OPERATOR(>), OPERATOR(>=), & 
     225           ASSIGNMENT(=) 
    214226 
    215227 PUBLIC :: xios(getVar) 
  • XIOS/trunk/src/interface/fortran_attr/context_interface_attr.F90

    r545 r549  
    88   
    99  INTERFACE ! Do not call directly / interface FORTRAN 2003 <-> C99 
    10      
    11      
    12     SUBROUTINE cxios_set_context_calendar_type(context_hdl, calendar_type, calendar_type_size) BIND(C) 
    13       USE ISO_C_BINDING 
    14       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    15       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: calendar_type 
    16       INTEGER  (kind = C_INT)     , VALUE        :: calendar_type_size 
    17     END SUBROUTINE cxios_set_context_calendar_type 
    18      
    19     SUBROUTINE cxios_get_context_calendar_type(context_hdl, calendar_type, calendar_type_size) BIND(C) 
    20       USE ISO_C_BINDING 
    21       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    22       CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: calendar_type 
    23       INTEGER  (kind = C_INT)     , VALUE        :: calendar_type_size 
    24     END SUBROUTINE cxios_get_context_calendar_type 
    25      
    26     FUNCTION cxios_is_defined_context_calendar_type(context_hdl ) BIND(C) 
    27       USE ISO_C_BINDING 
    28       LOGICAL(kind=C_BOOL) :: cxios_is_defined_context_calendar_type 
    29       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    30     END FUNCTION cxios_is_defined_context_calendar_type 
    3110     
    3211     
     
    5231     
    5332     
    54     SUBROUTINE cxios_set_context_start_date(context_hdl, start_date) BIND(C) 
    55       USE ISO_C_BINDING 
    56       USE IDATE 
    57       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    58       TYPE(txios(date)), VALUE :: start_date 
    59     END SUBROUTINE cxios_set_context_start_date 
    60      
    61     SUBROUTINE cxios_get_context_start_date(context_hdl, start_date) BIND(C) 
    62       USE ISO_C_BINDING 
    63       USE IDATE 
    64       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    65       TYPE(txios(date)) :: start_date 
    66     END SUBROUTINE cxios_get_context_start_date 
    67      
    68     FUNCTION cxios_is_defined_context_start_date(context_hdl ) BIND(C) 
    69       USE ISO_C_BINDING 
    70       LOGICAL(kind=C_BOOL) :: cxios_is_defined_context_start_date 
    71       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    72     END FUNCTION cxios_is_defined_context_start_date 
    73      
    74      
    75     SUBROUTINE cxios_set_context_time_origin(context_hdl, time_origin) BIND(C) 
    76       USE ISO_C_BINDING 
    77       USE IDATE 
    78       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    79       TYPE(txios(date)), VALUE :: time_origin 
    80     END SUBROUTINE cxios_set_context_time_origin 
    81      
    82     SUBROUTINE cxios_get_context_time_origin(context_hdl, time_origin) BIND(C) 
    83       USE ISO_C_BINDING 
    84       USE IDATE 
    85       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    86       TYPE(txios(date)) :: time_origin 
    87     END SUBROUTINE cxios_get_context_time_origin 
    88      
    89     FUNCTION cxios_is_defined_context_time_origin(context_hdl ) BIND(C) 
    90       USE ISO_C_BINDING 
    91       LOGICAL(kind=C_BOOL) :: cxios_is_defined_context_time_origin 
    92       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    93     END FUNCTION cxios_is_defined_context_time_origin 
    94      
    95      
    96     SUBROUTINE cxios_set_context_timestep(context_hdl, timestep) BIND(C) 
    97       USE ISO_C_BINDING 
    98       USE IDURATION 
    99       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    100       TYPE(txios(duration)), VALUE :: timestep 
    101     END SUBROUTINE cxios_set_context_timestep 
    102      
    103     SUBROUTINE cxios_get_context_timestep(context_hdl, timestep) BIND(C) 
    104       USE ISO_C_BINDING 
    105       USE IDURATION 
    106       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    107       TYPE(txios(duration)) :: timestep 
    108     END SUBROUTINE cxios_get_context_timestep 
    109      
    110     FUNCTION cxios_is_defined_context_timestep(context_hdl ) BIND(C) 
    111       USE ISO_C_BINDING 
    112       LOGICAL(kind=C_BOOL) :: cxios_is_defined_context_timestep 
    113       INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 
    114     END FUNCTION cxios_is_defined_context_timestep 
    115      
    116      
    11733    END INTERFACE 
    11834   
  • XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90

    r537 r549  
    1212   
    1313  SUBROUTINE xios(set_context_attr)  & 
    14     ( context_id, calendar_type, output_dir, start_date, time_origin, timestep ) 
     14    ( context_id, output_dir ) 
    1515     
    1616    IMPLICIT NONE 
    1717      TYPE(txios(context))  :: context_hdl 
    1818      CHARACTER(LEN=*), INTENT(IN) ::context_id 
    19       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: calendar_type 
    2019      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_dir 
    21       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: start_date 
    22       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: time_origin 
    23       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: timestep 
    2420       
    2521      CALL xios(get_context_handle)(context_id,context_hdl) 
    2622      CALL xios(set_context_attr_hdl_)   & 
    27       ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     23      ( context_hdl, output_dir ) 
    2824     
    2925  END SUBROUTINE xios(set_context_attr) 
    3026   
    3127  SUBROUTINE xios(set_context_attr_hdl)  & 
    32     ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     28    ( context_hdl, output_dir ) 
    3329     
    3430    IMPLICIT NONE 
    3531      TYPE(txios(context)) , INTENT(IN) :: context_hdl 
    36       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: calendar_type 
    3732      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_dir 
    38       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: start_date 
    39       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: time_origin 
    40       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: timestep 
    4133       
    4234      CALL xios(set_context_attr_hdl_)  & 
    43       ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     35      ( context_hdl, output_dir ) 
    4436     
    4537  END SUBROUTINE xios(set_context_attr_hdl) 
    4638   
    4739  SUBROUTINE xios(set_context_attr_hdl_)   & 
    48     ( context_hdl, calendar_type_, output_dir_, start_date_, time_origin_, timestep_ ) 
     40    ( context_hdl, output_dir_ ) 
    4941     
    5042    IMPLICIT NONE 
    5143      TYPE(txios(context)) , INTENT(IN) :: context_hdl 
    52       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: calendar_type_ 
    5344      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_dir_ 
    54       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: start_date_ 
    55       TYPE(txios(date))  , OPTIONAL, INTENT(IN) :: time_origin_ 
    56       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: timestep_ 
    57        
    58       IF (PRESENT(calendar_type_)) THEN 
    59         CALL cxios_set_context_calendar_type(context_hdl%daddr, calendar_type_, len(calendar_type_)) 
    60       ENDIF 
    6145       
    6246      IF (PRESENT(output_dir_)) THEN 
    6347        CALL cxios_set_context_output_dir(context_hdl%daddr, output_dir_, len(output_dir_)) 
    64       ENDIF 
    65        
    66       IF (PRESENT(start_date_)) THEN 
    67         CALL cxios_set_context_start_date(context_hdl%daddr, start_date_) 
    68       ENDIF 
    69        
    70       IF (PRESENT(time_origin_)) THEN 
    71         CALL cxios_set_context_time_origin(context_hdl%daddr, time_origin_) 
    72       ENDIF 
    73        
    74       IF (PRESENT(timestep_)) THEN 
    75         CALL cxios_set_context_timestep(context_hdl%daddr, timestep_) 
    7648      ENDIF 
    7749       
     
    8153   
    8254  SUBROUTINE xios(get_context_attr)  & 
    83     ( context_id, calendar_type, output_dir, start_date, time_origin, timestep ) 
     55    ( context_id, output_dir ) 
    8456     
    8557    IMPLICIT NONE 
    8658      TYPE(txios(context))  :: context_hdl 
    8759      CHARACTER(LEN=*), INTENT(IN) ::context_id 
    88       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: calendar_type 
    8960      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_dir 
    90       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: start_date 
    91       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: time_origin 
    92       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: timestep 
    9361       
    9462      CALL xios(get_context_handle)(context_id,context_hdl) 
    9563      CALL xios(get_context_attr_hdl_)   & 
    96       ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     64      ( context_hdl, output_dir ) 
    9765     
    9866  END SUBROUTINE xios(get_context_attr) 
    9967   
    10068  SUBROUTINE xios(get_context_attr_hdl)  & 
    101     ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     69    ( context_hdl, output_dir ) 
    10270     
    10371    IMPLICIT NONE 
    10472      TYPE(txios(context)) , INTENT(IN) :: context_hdl 
    105       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: calendar_type 
    10673      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_dir 
    107       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: start_date 
    108       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: time_origin 
    109       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: timestep 
    11074       
    11175      CALL xios(get_context_attr_hdl_)  & 
    112       ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     76      ( context_hdl, output_dir ) 
    11377     
    11478  END SUBROUTINE xios(get_context_attr_hdl) 
    11579   
    11680  SUBROUTINE xios(get_context_attr_hdl_)   & 
    117     ( context_hdl, calendar_type_, output_dir_, start_date_, time_origin_, timestep_ ) 
     81    ( context_hdl, output_dir_ ) 
    11882     
    11983    IMPLICIT NONE 
    12084      TYPE(txios(context)) , INTENT(IN) :: context_hdl 
    121       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: calendar_type_ 
    12285      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_dir_ 
    123       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: start_date_ 
    124       TYPE(txios(date))  , OPTIONAL, INTENT(OUT) :: time_origin_ 
    125       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: timestep_ 
    126        
    127       IF (PRESENT(calendar_type_)) THEN 
    128         CALL cxios_get_context_calendar_type(context_hdl%daddr, calendar_type_, len(calendar_type_)) 
    129       ENDIF 
    13086       
    13187      IF (PRESENT(output_dir_)) THEN 
    13288        CALL cxios_get_context_output_dir(context_hdl%daddr, output_dir_, len(output_dir_)) 
    133       ENDIF 
    134        
    135       IF (PRESENT(start_date_)) THEN 
    136         CALL cxios_get_context_start_date(context_hdl%daddr, start_date_) 
    137       ENDIF 
    138        
    139       IF (PRESENT(time_origin_)) THEN 
    140         CALL cxios_get_context_time_origin(context_hdl%daddr, time_origin_) 
    141       ENDIF 
    142        
    143       IF (PRESENT(timestep_)) THEN 
    144         CALL cxios_get_context_timestep(context_hdl%daddr, timestep_) 
    14589      ENDIF 
    14690       
     
    15094   
    15195  SUBROUTINE xios(is_defined_context_attr)  & 
    152     ( context_id, calendar_type, output_dir, start_date, time_origin, timestep ) 
     96    ( context_id, output_dir ) 
    15397     
    15498    IMPLICIT NONE 
    15599      TYPE(txios(context))  :: context_hdl 
    156100      CHARACTER(LEN=*), INTENT(IN) ::context_id 
    157       LOGICAL, OPTIONAL, INTENT(OUT) :: calendar_type 
    158       LOGICAL(KIND=C_BOOL) :: calendar_type_tmp 
    159101      LOGICAL, OPTIONAL, INTENT(OUT) :: output_dir 
    160102      LOGICAL(KIND=C_BOOL) :: output_dir_tmp 
    161       LOGICAL, OPTIONAL, INTENT(OUT) :: start_date 
    162       LOGICAL(KIND=C_BOOL) :: start_date_tmp 
    163       LOGICAL, OPTIONAL, INTENT(OUT) :: time_origin 
    164       LOGICAL(KIND=C_BOOL) :: time_origin_tmp 
    165       LOGICAL, OPTIONAL, INTENT(OUT) :: timestep 
    166       LOGICAL(KIND=C_BOOL) :: timestep_tmp 
    167103       
    168104      CALL xios(get_context_handle)(context_id,context_hdl) 
    169105      CALL xios(is_defined_context_attr_hdl_)   & 
    170       ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     106      ( context_hdl, output_dir ) 
    171107     
    172108  END SUBROUTINE xios(is_defined_context_attr) 
    173109   
    174110  SUBROUTINE xios(is_defined_context_attr_hdl)  & 
    175     ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     111    ( context_hdl, output_dir ) 
    176112     
    177113    IMPLICIT NONE 
    178114      TYPE(txios(context)) , INTENT(IN) :: context_hdl 
    179       LOGICAL, OPTIONAL, INTENT(OUT) :: calendar_type 
    180       LOGICAL(KIND=C_BOOL) :: calendar_type_tmp 
    181115      LOGICAL, OPTIONAL, INTENT(OUT) :: output_dir 
    182116      LOGICAL(KIND=C_BOOL) :: output_dir_tmp 
    183       LOGICAL, OPTIONAL, INTENT(OUT) :: start_date 
    184       LOGICAL(KIND=C_BOOL) :: start_date_tmp 
    185       LOGICAL, OPTIONAL, INTENT(OUT) :: time_origin 
    186       LOGICAL(KIND=C_BOOL) :: time_origin_tmp 
    187       LOGICAL, OPTIONAL, INTENT(OUT) :: timestep 
    188       LOGICAL(KIND=C_BOOL) :: timestep_tmp 
    189117       
    190118      CALL xios(is_defined_context_attr_hdl_)  & 
    191       ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep ) 
     119      ( context_hdl, output_dir ) 
    192120     
    193121  END SUBROUTINE xios(is_defined_context_attr_hdl) 
    194122   
    195123  SUBROUTINE xios(is_defined_context_attr_hdl_)   & 
    196     ( context_hdl, calendar_type_, output_dir_, start_date_, time_origin_, timestep_ ) 
     124    ( context_hdl, output_dir_ ) 
    197125     
    198126    IMPLICIT NONE 
    199127      TYPE(txios(context)) , INTENT(IN) :: context_hdl 
    200       LOGICAL, OPTIONAL, INTENT(OUT) :: calendar_type_ 
    201       LOGICAL(KIND=C_BOOL) :: calendar_type__tmp 
    202128      LOGICAL, OPTIONAL, INTENT(OUT) :: output_dir_ 
    203129      LOGICAL(KIND=C_BOOL) :: output_dir__tmp 
    204       LOGICAL, OPTIONAL, INTENT(OUT) :: start_date_ 
    205       LOGICAL(KIND=C_BOOL) :: start_date__tmp 
    206       LOGICAL, OPTIONAL, INTENT(OUT) :: time_origin_ 
    207       LOGICAL(KIND=C_BOOL) :: time_origin__tmp 
    208       LOGICAL, OPTIONAL, INTENT(OUT) :: timestep_ 
    209       LOGICAL(KIND=C_BOOL) :: timestep__tmp 
    210        
    211       IF (PRESENT(calendar_type_)) THEN 
    212         calendar_type__tmp=cxios_is_defined_context_calendar_type(context_hdl%daddr) 
    213         calendar_type_=calendar_type__tmp 
    214       ENDIF 
    215130       
    216131      IF (PRESENT(output_dir_)) THEN 
    217132        output_dir__tmp=cxios_is_defined_context_output_dir(context_hdl%daddr) 
    218133        output_dir_=output_dir__tmp 
    219       ENDIF 
    220        
    221       IF (PRESENT(start_date_)) THEN 
    222         start_date__tmp=cxios_is_defined_context_start_date(context_hdl%daddr) 
    223         start_date_=start_date__tmp 
    224       ENDIF 
    225        
    226       IF (PRESENT(time_origin_)) THEN 
    227         time_origin__tmp=cxios_is_defined_context_time_origin(context_hdl%daddr) 
    228         time_origin_=time_origin__tmp 
    229       ENDIF 
    230        
    231       IF (PRESENT(timestep_)) THEN 
    232         timestep__tmp=cxios_is_defined_context_timestep(context_hdl%daddr) 
    233         timestep_=timestep__tmp 
    234134      ENDIF 
    235135       
Note: See TracChangeset for help on using the changeset viewer.