Changes between Version 7 and Version 8 of Users/ModelInterfacing/InputsOutputs
- Timestamp:
- 2017-03-30T01:18:41+02:00 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Users/ModelInterfacing/InputsOutputs
v7 v8 1 1 = Inputs-Outputs (Using XIOS) 2 3 Last edition: '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' 2 4 3 5 Output of diagnostics in NEMO is usually done using XIOS. This is an efficient way of writing diagnostics because the time averaging, file writing and even some simple arithmetic or regridding is carried out in parallel to the NEMO model run. This page gives a basic introduction to using XIOS with NEMO. Much more information is available from the XIOS homepage above and from the NEMO reference manual. 4 6 5 Use of XIOS for diagnostics is activated using the pre-compiler key `key_iomput`. In nemo_v3_6_STABLE the default version of XIOS is XIOS1.0 but XIOS2.0 can be used by activating `key_xios2`. '''NB: Due to a change in the XIOS1.0 branch NEMO v3.6 STABLE will only work up to revision 703 of the XIOS1.0 branch without modifying the code manually.''' At the head of the NEMO trunk only XIOS2.0 can be used (XIOS2.0 is the XIOS trunk) and `key_xios2`is not required.7 Use of XIOS for diagnostics is activated using the pre-compiler key key_iomput. In nemo_v3_6_STABLE the default version of XIOS is XIOS1.0 but XIOS2.0 can be used by activating key_xios2. '''NB: Due to a change in the XIOS1.0 branch NEMO v3.6 STABLE will only work up to revision 703 of the XIOS1.0 branch without modifying the code manually.''' At the head of the NEMO trunk only XIOS2.0 can be used (XIOS2.0 is the XIOS trunk) and key_xios2 is not required. 6 8 7 9 == XIOS namelists … … 20 22 21 23 === Attached Mode 22 In attached mode XIOS runs on each of the cores used by NEMO. This method is less efficient than the detached mode but can be more convenient for testing or with small configurations. To activate this mode simply set "using_server" to false in the iodef.xml file and don't allocate any cores to XIOS. Note that due to the different domain decompositions between XIOS and NEMO if the total number of cores is larger than the number of grid points in the j direction then the model run will fail. 23 24 In attached mode XIOS runs on each of the cores used by NEMO. This method is less efficient than the detached mode but can be more convenient for testing or with small configurations. To activate this mode simply set `using_server` to false in the `iodef.xml` file and don't allocate any cores to XIOS. Note that due to the different domain decompositions between XIOS and NEMO if the total number of cores is larger than the number of grid points in the j direction then the model run will fail. 24 25 25 26 == Adding new diagnostics … … 27 28 1) Add any necessary code to calculate you new diagnostic in NEMO 28 29 29 2) Send the field to XIOS using {{{CALL iom_put( 'field_id', variable )}}} where 'field_id'is a unique id for your new diagnostics and variable is the fortran variable containing the data. This should be called at every model timestep regardless of how often you want to output the field. No time averaging should be done in the model code.30 2) Send the field to XIOS using `CALL iom_put( 'field_id', variable )` where `field_id` is a unique id for your new diagnostics and variable is the fortran variable containing the data. This should be called at every model timestep regardless of how often you want to output the field. No time averaging should be done in the model code. 30 31 31 32 3) If it is computationally expensive to calculate your new diagnostic you should also use "iom_use" to determine if it is requested in the current model run. For example, … … 39 40 }}} 40 41 41 4) Add a variable definition to the field_def.xml (or field_def-???.xml) file42 4) Add a variable definition to the `field_def.xml` (or `field_def-???.xml`) file 42 43 43 5) Add the variable to the iodef.xml or file_definition.xml file. 44 45 46 44 5) Add the variable to the `iodef.xml` or `file_definition.xml` file.