wiki:BackwardIncompatibleChanges

Version 2 (modified by rlacroix, 9 years ago) (diff)

Account for xios_set_timestep being readded

Backward incompatible changes in XIOS 2.0

Although 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.

This 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.

  • the type attribute of the variable object is now more strictly checked. It must be one of:
    • bool
    • int or int32
    • int16
    • int64
    • float
    • double
    • string.

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>.

  • attributes corresponding to a duration should now be manipulated using the xios_duration type when using the Fortran interface. Affected attributes are:
    • timestep in context objects
    • freq_op and freq_offset in field objects
    • output_freq, sync_freq and split_freq in file objects.

Note that the old xios_time type have been removed.

The following code:

PROGRAM test
  USE xios
  ...
  TYPE(xios_time) :: dtime
  ...
  CALL xios_get_handle("test",ctx_hdl)
  CALL xios_set_current_context(ctx_hdl)
  ...
  dtime%second=3600
  CALL xios_set_timestep(dtime)
  ...
END PROGRAM test

will become:

PROGRAM test
  USE xios
  ...
  TYPE(xios_duration) :: dtime
  ...
  CALL xios_get_handle("test",ctx_hdl)
  CALL xios_set_current_context(ctx_hdl)
  ...
  dtime%second=3600
  CALL xios_set_timestep(dtime)
  ...
END PROGRAM test

or

PROGRAM test
  USE xios
  ...
  TYPE(xios_duration) :: dtime
  ...
  CALL xios_get_handle("test",ctx_hdl)
  CALL xios_set_current_context(ctx_hdl)
  ...
  dtime%second=3600
  CALL xios_set_context_attr("test", timestep=dtime)
  ...
END PROGRAM test
  • 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.

The following code:

PROGRAM test
  USE xios
  ...
  CALL xios_set_context_attr("test",calendar_type="Gregorian")
  CALL xios_set_context_attr("test",start_date="2000-01-01 00:00:00")
  CALL xios_set_context_attr("test",time_origin="1999-01-01 15:00:00")
  ...
END PROGRAM test

will become:

PROGRAM test
  USE xios
  ...
  TYPE(xios_date) :: start_date, time_origin
  ...
  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
  start_date = xios_date(2000, 01, 01, 00, 00, 00) 
  CALL xios_set_context_attr("test",start_date=start_date) 
  time_origin = xios_date(1999, 01, 01, 15, 00, 00) 
  CALL xios_set_context_attr("test",time_origin=time_origin) 
  ...
END PROGRAM test