Changes between Version 3 and Version 4 of GroupActivities/Meetings/Retreat20151119/GuidelinesXIOS


Ignore:
Timestamp:
11/09/15 16:39:34 (5 years ago)
Author:
nvuilsce
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GroupActivities/Meetings/Retreat20151119/GuidelinesXIOS

    v3 v4  
    1 = XIOS Guidelines 
     1= XIOS Guidelines = 
    22 
    3 == '''Guideline 1''' (to be discussed) == 
    4 ''Example1:'' 
     3For the moment, calls to XIOS (for writting outputs) in the code of ORCHIDEE completely mimic those that were done to IOIPSL (the old I/O library). [[BR]] 
     4Because XIOS has advanced features (compared to IOIPSL), we propose to take advantages of these features in order to simplify the way that we output variables into ORCHIDEE. Here below, are described some of these features and how we can benefit of them : 
     5 
     6 
     7 
     8== '''Guideline 1''' : Id name == 
     9With XIOS, we can easily rename any output variable by modifying the field_def file. This is possible without recompiling the code. What we only have to do in the code is to specify a Id name for each variable that is output. '''By default, we propose that the Id name should be the same as the name of the variable in the code.''' 
     10Here below is an example with the Ground heat flux variable that is output in the thermosoil_main routine (thermosoil.f90 file) 
     11 
     12''Example:''[[BR]] 
     13 
     14For the moment, we have line [http://forge.ipsl.jussieu.fr/orchidee/browser/trunk/ORCHIDEE/src_sechiba/thermosoil.f90#L622 622] 
    515{{{ 
    616CALL xios_orchidee_send_field("Qg",soilflx) 
    717}}} 
    8 Qg: field id[[BR]] 
    9 soilflx: the local variable in the FORTRAN code 
     18where Qg is the field id[[BR]] 
     19and soilflx, the local variable in the FORTRAN code 
    1020 
    1121and in field_def: 
     
    1323<field id="Qg" name="Qg" long_name="Ground heat flux" unit="W/m^2"/> 
    1424}}} 
    15 Name in output: Qg  (because name="Qg") 
    16  
    17 '''The name of the "field id" should be the same as the name of the variable'''. Here is example1 modified according to this method:[[BR]] 
    18 ''Example 2:'' 
     25where name is the name of variable in the output file: here "Qg"  (because name="Qg") 
     26------------------------------- 
     27Using the same name for the Id and the variable in the code, we should have now :[[BR]] 
     28in the code: 
    1929{{{ 
    20 CALL xios_orchidee_send_field ("soilflx" soilflx) 
     30CALL xios_orchidee_send_field("soilflx",soilflx) 
    2131}}} 
    22 soilflx: field id[[BR]] 
    23 soilflx: the local variable in the FORTRAN code 
    24  
    25 and in field_def: 
     32and in the field_def file:[[BR]] 
    2633{{{ 
    27 <field id="soilflx" name="Qg" LONG_NAME="Ground heat flux" unit="W/m^2"/> 
    28 }}} 
    29 Name in output: Qg 
    30  
    31 The results are the same. We see the advantage when, for another project for example, the variable is to be called differently in the outputs. 
    32 For the first example, if we want to change the name of the variable in the output, this gives (without recompiling):[[BR]] 
    33 ''Example3:'' 
    34 {{{ 
    35 CALL xios_orchidee_send_field ("Qg" soilflx) 
     34<field id="soilflx" name="Qg" long_name="Ground heat flux" unit="W/m^2"/> 
    3635}}} 
    3736 
    38 and in field_def: 
    39 {{{ 
    40 <field id="Qg" name="GroundHeatF" LONG_NAME="Ground heat flux" unit="W/m^2"/> 
    41 }}} 
    42 Name in output: GroundHeatF 
     37For variables which are vectors, such as the variable 'carbon' 
    4338 
    44 => soilflx becomes Qg, which becomes GroundHeatF. 
    45  
    46 Example 3 is quite feasible and there are probably cases like that in ORCHIDEE. But the following example makes more sense: 
    47 ''Example4:'' 
    48 {{{ 
    49 CALL xios_orchidee_send_field ("soilflx" soilflx) 
    50 }}} 
    51 and in fiels_def: 
    52 {{{ 
    53 <field id="soilflx" name="GroundHeatF" LONG_NAME="Ground heat flux" unit="W/m^2"/> 
    54 }}} 
    55  
    56 => In this case, soilflx becomes GroundHeatF directly. 
     39== '''Guideline 2''' : Units == 
     40We propose to output variables with the same units  
    5741 
    5842== '''Guideline 2''' ==