Changes between Initial Version and Version 1 of BackwardIncompatibleChanges


Ignore:
Timestamp:
12/12/14 09:50:39 (8 years ago)
Author:
rlacroix
Comment:

Start documenting the backward incompatible changes in the current revision of XIOS 2.0

Legend:

Unmodified
Added
Removed
Modified
  • BackwardIncompatibleChanges

    v1 v1  
     1== Backward incompatible changes in XIOS 2.0 == 
     2 
     3Although we try to limit them as much as possible, there are some backward incompatible changes that you may notice when migrating from XIOS 1.0 to XIOS 2.O. 
     4 
     5This document lists all those changes at the time it was written and might not always be up-to-date due to XIOS 2.0 still being in development. 
     6 
     7- the `type` attribute of the `variable` object is now more strictly checked. It must be one of: 
     8  - `bool` 
     9  - `int` or `int32` 
     10  - `int16` 
     11  - `int64` 
     12  - `float` 
     13  - `double` 
     14  - `string`. 
     15 
     16  For example, `<variable id="my_attribute2" type="integer" >10</variable>` will become `<variable id="my_attribute2" type="int" >10</variable>` and `<variable id="print_file" type="boolean">true</variable>` will become `<variable id="print_file" type="bool">true</variable>`. 
     17- attributes corresponding to a duration should now be manipulated using the `xios_duration` type when using the Fortran interface. Affected attributes are: 
     18  - `timestep` in `context` objects 
     19  - `freq_op` and `freq_offset` in `field` objects 
     20  - `output_freq`, `sync_freq` and `split_freq` in `file` objects. 
     21 
     22  Note that the special interface `xios_set_timestep` and the corresponding `xios_time` type have been removed. 
     23 
     24  The following code: 
     25  {{{ 
     26  PROGRAM test 
     27    USE xios 
     28    ... 
     29    TYPE(xios_time) :: dtime 
     30    ... 
     31    CALL xios_get_handle("test",ctx_hdl) 
     32    CALL xios_set_current_context(ctx_hdl) 
     33    ... 
     34    dtime%second=3600 
     35    CALL xios_set_timestep(dtime) 
     36    ... 
     37  END PROGRAM test 
     38  }}} 
     39  will become: 
     40  {{{ 
     41  PROGRAM test 
     42    USE xios 
     43    ... 
     44    TYPE(xios_duration) :: dtime 
     45    ... 
     46    CALL xios_get_handle("test",ctx_hdl) 
     47    CALL xios_set_current_context(ctx_hdl) 
     48    ... 
     49    dtime%second=3600 
     50    CALL xios_set_context_attr("test", timestep=dtime) 
     51    ... 
     52  END PROGRAM test 
     53  }}} 
     54- attributes corresponding to a date should now be manipulated using the `xios_date` type when using the Fortran interface. Affected attributes are `start_date` and `time_origin` in `context` objects. 
     55 
     56  The following code: 
     57  {{{ 
     58  PROGRAM test 
     59    USE xios 
     60    ... 
     61    CALL xios_set_context_attr("test",calendar_type="Gregorian") 
     62    CALL xios_set_context_attr("test",start_date="2000-01-01 00:00:00") 
     63    CALL xios_set_context_attr("test",time_origin="1999-01-01 15:00:00") 
     64    ... 
     65  END PROGRAM test 
     66  }}} 
     67  will become: 
     68  {{{ 
     69  PROGRAM test 
     70    USE xios 
     71    ... 
     72    TYPE(xios_date) :: start_date, time_origin 
     73    ... 
     74    CALL xios_set_context_attr("test",calendar_type="Gregorian")  
     75    start_date = xios_date(2000, 01, 01, 00, 00, 00)  
     76    CALL xios_set_context_attr("test",start_date=start_date)  
     77    time_origin = xios_date(1999, 01, 01, 15, 00, 00)  
     78    CALL xios_set_context_attr("test",time_origin=time_origin)  
     79    ... 
     80  END PROGRAM test 
     81  }}}