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/fieldgroup_interface_attr.F90

    r538 r545  
    151151    SUBROUTINE cxios_set_fieldgroup_freq_offset(fieldgroup_hdl, freq_offset) BIND(C) 
    152152      USE ISO_C_BINDING 
    153       USE IDATE 
     153      USE IDURATION 
    154154      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    155155      TYPE(txios(duration)), VALUE :: freq_offset 
     
    158158    SUBROUTINE cxios_get_fieldgroup_freq_offset(fieldgroup_hdl, freq_offset) BIND(C) 
    159159      USE ISO_C_BINDING 
    160       USE IDATE 
     160      USE IDURATION 
    161161      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    162162      TYPE(txios(duration)) :: freq_offset 
     
    172172    SUBROUTINE cxios_set_fieldgroup_freq_op(fieldgroup_hdl, freq_op) BIND(C) 
    173173      USE ISO_C_BINDING 
    174       USE IDATE 
     174      USE IDURATION 
    175175      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    176176      TYPE(txios(duration)), VALUE :: freq_op 
     
    179179    SUBROUTINE cxios_get_fieldgroup_freq_op(fieldgroup_hdl, freq_op) BIND(C) 
    180180      USE ISO_C_BINDING 
    181       USE IDATE 
     181      USE IDURATION 
    182182      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 
    183183      TYPE(txios(duration)) :: freq_op 
Note: See TracChangeset for help on using the changeset viewer.