Ignore:
Timestamp:
12/17/14 11:14:05 (10 years ago)
Author:
rlacroix
Message:

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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90

    r538 r545  
    153153    SUBROUTINE cxios_set_file_output_freq(file_hdl, output_freq) BIND(C) 
    154154      USE ISO_C_BINDING 
    155       USE IDATE 
     155      USE IDURATION 
    156156      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
    157157      TYPE(txios(duration)), VALUE :: output_freq 
     
    160160    SUBROUTINE cxios_get_file_output_freq(file_hdl, output_freq) BIND(C) 
    161161      USE ISO_C_BINDING 
    162       USE IDATE 
     162      USE IDURATION 
    163163      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
    164164      TYPE(txios(duration)) :: output_freq 
     
    214214    SUBROUTINE cxios_set_file_split_freq(file_hdl, split_freq) BIND(C) 
    215215      USE ISO_C_BINDING 
    216       USE IDATE 
     216      USE IDURATION 
    217217      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
    218218      TYPE(txios(duration)), VALUE :: split_freq 
     
    221221    SUBROUTINE cxios_get_file_split_freq(file_hdl, split_freq) BIND(C) 
    222222      USE ISO_C_BINDING 
    223       USE IDATE 
     223      USE IDURATION 
    224224      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
    225225      TYPE(txios(duration)) :: split_freq 
     
    256256    SUBROUTINE cxios_set_file_sync_freq(file_hdl, sync_freq) BIND(C) 
    257257      USE ISO_C_BINDING 
    258       USE IDATE 
     258      USE IDURATION 
    259259      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
    260260      TYPE(txios(duration)), VALUE :: sync_freq 
     
    263263    SUBROUTINE cxios_get_file_sync_freq(file_hdl, sync_freq) BIND(C) 
    264264      USE ISO_C_BINDING 
    265       USE IDATE 
     265      USE IDURATION 
    266266      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
    267267      TYPE(txios(duration)) :: sync_freq 
Note: See TracChangeset for help on using the changeset viewer.