Ignore:
Timestamp:
12/10/14 14:27:09 (9 years ago)
Author:
rlacroix
Message:

Add a new attribute type for dates and use it for the context's start_date and time_origin.

The "xios_date" type should now be used to get/set date attributes through the Fortran interface. This avoids using strings to manipulate dates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/test/test_xios_interface.f90

    r510 r532  
    1212  CHARACTER(len=*),PARAMETER :: id="client" 
    1313  INTEGER :: comm 
     14  TYPE(xios_date)      :: start_date, time_origin 
    1415  TYPE(xios_time)      :: dtime 
    1516  TYPE(xios_context) :: ctx_hdl 
     
    9697 
    9798  CALL xios_set_context_attr("atmosphere",calendar_type="Gregorian") 
    98   CALL xios_set_context_attr("atmosphere",start_date="2000-01-01 00:00:00") 
    99   CALL xios_set_context_attr("atmosphere",time_origin="1999-01-01 15:00:00") 
     99  start_date = xios_date(2000, 01, 01, 00, 00, 00) 
     100  CALL xios_set_context_attr("atmosphere",start_date=start_date) 
     101  time_origin = xios_date(1999, 01, 01, 15, 00, 00) 
     102  CALL xios_set_context_attr("atmosphere",time_origin=time_origin) 
    100103 
    101104  CALL xios_set_axis_attr("axis_atm",size=llm ,value=lval) ; 
     
    181184 
    182185  CALL xios_set_context_attr("surface",calendar_type="Gregorian") 
    183   CALL xios_set_context_attr("surface",start_date="2000-01-01 00:00:00") 
    184   CALL xios_set_context_attr("surface",time_origin="1999-01-01 15:00:00") 
     186  start_date = xios_date(2000, 01, 01, 00, 00, 00) 
     187  CALL xios_set_context_attr("surface",start_date=start_date) 
     188  time_origin = xios_date(1999, 01, 01, 15, 00, 00) 
     189  CALL xios_set_context_attr("surface",time_origin=time_origin) 
    185190 
    186191  CALL xios_set_axis_attr("axis_srf",size=llm ,value=lval) ; 
Note: See TracChangeset for help on using the changeset viewer.