Ignore:
Timestamp:
11/19/15 16:55:17 (8 years ago)
Author:
rlacroix
Message:

Fortran interface: Add functions to convert date and duration to string.

File:
1 edited

Legend:

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

    r723 r794  
    1212  INTEGER :: comm 
    1313  TYPE(xios_duration) :: dtime 
     14  CHARACTER(len=20) :: dtime_str 
    1415  TYPE(xios_date) :: date 
     16  CHARACTER(len=20) :: date_str 
    1517  CHARACTER(len=15) :: calendar_type 
    1618  TYPE(xios_context) :: ctx_hdl 
     
    98100  PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
    99101  PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
    100   PRINT *, "time_origin = ", date 
     102  CALL xios_date_convert_to_string(date, date_str) 
     103  PRINT *, "time_origin = ", date_str 
    101104  PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
    102105  PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
     
    106109  dtime%timestep = 1 
    107110  dtime = 0.5 * dtime 
    108   PRINT *, "duration = ", dtime 
     111  CALL xios_duration_convert_to_string(dtime, dtime_str) 
     112  PRINT *, "duration = ", dtime_str 
    109113  date = date + 3 * (dtime + dtime) 
    110   PRINT *, "date = time_origin + 3 * (duration + duration) = ", date 
     114  CALL xios_date_convert_to_string(date, date_str) 
     115  PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 
    111116  PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
    112117  PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
Note: See TracChangeset for help on using the changeset viewer.