| 43 | === Configuration interface, internal XIOS configuration, and model time |
| 44 | |
| 45 | The user configuration of the multiple linear regression diagnostics (definition of regressors, selection of fields for analysis, and output frequency) is proposed to be made feasible entirely in the form of additional XIOS configuration. |
| 46 | |
| 47 | A field definition for each regressor would define the arithmetic expression as a function of the model time (`diamlr_time`) and, if required, use placeholders for parameters of tidal constituents. As an example, a configuration section similar to |
| 48 | |
| 49 | {{{ |
| 50 | <field id="diamlr_time" grid_ref="diamlr_grid" /> |
| 51 | |
| 52 | <field id="diamlr_r001" field_ref="diamlr_time" expr="diamlr_time^0.0" enabled=".TRUE." /> |
| 53 | <field id="diamlr_r002" field_ref="diamlr_time" expr="diamlr_time^1.0" enabled=".TRUE." /> |
| 54 | <field id="diamlr_r003" field_ref="diamlr_time" expr="diamlr_time^2.0" enabled=".TRUE." /> |
| 55 | <field id="diamlr_r004" field_ref="diamlr_time" expr="sin( 1.992384990861e-7 * diamlr_time )" enabled=".TRUE." /> |
| 56 | <field id="diamlr_r005" field_ref="diamlr_time" expr="cos( 1.992384990861e-7 * diamlr_time )" enabled=".TRUE." /> |
| 57 | <field id="diamlr_r006" field_ref="diamlr_time" expr="__TDE_M2_amplitude__ * sin( __TDE_M2_omega__ * diamlr_time + __TDE_M2_phase__ )" enabled=".TRUE." /> |
| 58 | <field id="diamlr_r007" field_ref="diamlr_time" expr="__TDE_M2_amplitude__ * cos( __TDE_M2_omega__ * diamlr_time + __TDE_M2_phase__ )" enabled=".TRUE." /> |
| 59 | }}} |
| 60 | |
| 61 | would define seven regressors: three regressors required to fit a polynomial of degree 2; two orthogonal, sinusoidal regressors required to fit the seasonal cycle; and two orthogonal, sinusoidal regressors of the M2 tidal-constituent frequency with parameters provided by the tidal-forcing implementation in NEMO through substitution of placeholders during model initialisation. |
| 62 | |
| 63 | The fields selected for the analysis could be listed as dedicated fields that make reference to fields available for model output. As an example, a configuration similar to |
| 64 | |
| 65 | {{{ |
| 66 | <field id="diamlr_f001" field_ref="ssh" enabled=".TRUE." /> |
| 67 | <field id="diamlr_f002" field_ref="toce" enabled=".TRUE." /> |
| 68 | }}} |
| 69 | |
| 70 | would select the sea-surface height and potential temperature fields for regression analysis. |
| 71 | |
| 72 | Overall, the frequency of intermediate data output would be set using a configuration line similar to |
| 73 | |
| 74 | {{{ |
| 75 | <file_group id="diamlr_files" output_freq="1y" enabled=".TRUE." />, |
| 76 | }}} |
| 77 | |
| 78 | which would result in the output of annual scalar products. |
| 79 | |
| 80 | In order to process and output the full set of scalar products required for the least-squares linear regression analysis, however, a more complex XIOS configuration |
| 81 | is required. This complex configuration of XIOS can be derived from the simple user configuration outlined above. Therefore, during the initialisation of the relevant XIOS context in NEMO, the regression-specific user configuration can be read out and in turn the full configuration can be generated using the XIOS API (currently, XIOS contexts are defined and **closed** in subroutine `iom_init` of module `iom`, source:/NEMO/trunk/src/OCE/IOM/iom.F90@10817; the new implementation would modify module `iom` so that closing the XIOS context can optionally be deferred in order to enable other subroutines to add or modify the XIOS configuration). |
| 82 | |
| 83 | The substitution of tidal-constituent parameters in regressor expressions would make use of recent developments of the tidal forcing mechanism (see ticket #2194), and therefore the development branch at source:/NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/ would be merged into the development branch for the new linear regression analysis diagnostics. |
| 84 | |
| 85 | In order to enable seamless analysis across restart boundaries, regressor expressions would require to be formulated as a function of a continuous model time that extends across model restarts. Therefore, the new implementation would send the time from the start of the simulation (available as variable `adatrj`) to XIOS as field `diamlr_time`. |