Changes between Version 1 and Version 2 of GroupActivities/Meetings/Retreat20151119/GuidelinesXIOS


Ignore:
Timestamp:
10/11/15 23:05:13 (5 years ago)
Author:
maignan
Comment:

--

Legend:

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

    v1 v2  
    1 * Guideline 2 
     1= XIOS Guidelines 
     2 
     3* '''Guideline 1''' (to be discussed)[[BR]] 
     4''Example1:'' 
     5{{{ 
     6CALL xios_orchidee_send_field("Qg",soilflx) 
     7}}} 
     8Qg: field id[[BR]] 
     9soilflx: the local variable in the FORTRAN code 
     10 
     11and in field_def: 
     12{{{ 
     13<field id="Qg" name="Qg" long_name="Ground heat flux" unit="W/m^2"/> 
     14}}} 
     15Name 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:'' 
     19{{{ 
     20CALL xios_orchidee_send_field ("soilflx" soilflx) 
     21}}} 
     22soilflx: field id[[BR]] 
     23soilflx: the local variable in the FORTRAN code 
     24 
     25and in field_def: 
     26{{{ 
     27<field id="soilflx" name="Qg" LONG_NAME="Ground heat flux" unit="W/m^2"/> 
     28}}} 
     29Name in output: Qg 
     30 
     31The results are the same. We see the advantage when, for another project for example, the variable is to be called differently in the outputs. 
     32For the first example, if we want to change the name of the variable in the output, this gives (without recompiling):[[BR]] 
     33''Example3:'' 
     34{{{ 
     35CALL xios_orchidee_send_field ("Qg" soilflx) 
     36}}} 
     37 
     38and in field_def: 
     39{{{ 
     40<field id="Qg" name="GroundHeatF" LONG_NAME="Ground heat flux" unit="W/m^2"/> 
     41}}} 
     42Name in output: GroundHeatF 
     43 
     44=> soilflx becomes Qg, which becomes GroundHeatF. 
     45 
     46Example 3 is quite feasible and there are probably cases like that in ORCHIDEE. But the following example makes more sense: 
     47''Example4:'' 
     48{{{ 
     49CALL xios_orchidee_send_field ("soilflx" soilflx) 
     50}}} 
     51and 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. 
     57 
     58* '''Guideline 2''' 
    259We do the "CALL XIOS send_file orchid" in the module where the variable is calculated. If the variable is changed in several places, we do the call in the last XIOS module where it is changed or in sechiba_main, this has to be decided case by case. 
    360 
    4 * Guideline 3  
     61* '''Guideline 3'''  
    562If the variable is only calculated for a specific run case, then we deactivate the output from xios_orchidee.f90 with xios_set_field_attr as for the case not calculated. This leaves us the possibility of having the same file_def_orchidee.xml for different setups. If we forgot, it will work but we will have declared variables in the .nc files without values, which is is troubling. As an exception, the stomate variables are not deactivated in this way, that would be too many exception cases. But since we traditionally separated variables between sechiba_history.nc and stomate_history.nc, we have no problem because we deactivate the whole stomate_history.nc file if stomate is not active. 
    663