[4756] | 1 | # MOSAIX |
---|
| 2 | |
---|
| 3 | ## SVN information |
---|
| 4 | |
---|
| 5 | svn propset svn:keywords "Date Revision HeadURL Author Id" *.bash *.xml *.py src/MOSAIX/* Utils/* |
---|
[4757] | 6 | $Author$ |
---|
| 7 | $Date$ |
---|
| 8 | $Revision$ |
---|
| 9 | $Id$ |
---|
| 10 | $HeadURL$ |
---|
[4756] | 11 | |
---|
| 12 | All documentation available at https://forge.ipsl.jussieu.fr/igcmg/wiki/IPSLCM6/MOSAIX |
---|
| 13 | |
---|
| 14 | Extraction : `svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/MOSAIX MOSAIX` |
---|
| 15 | |
---|
| 16 | or `svn co svn+ssh://omamce@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX MOSAIX` |
---|
| 17 | |
---|
[6190] | 18 | ## [XIOS](http://forge.ipsl.jussieu.fr/ioserver/) |
---|
[6235] | 19 | MOSAIC is known to work with XIOS2, revision 2379 |
---|
[4756] | 20 | |
---|
[6044] | 21 | XIOS : http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk |
---|
[4756] | 22 | |
---|
[6044] | 23 | Extraction : svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS |
---|
| 24 | |
---|
[6190] | 25 | ## Licensing |
---|
| 26 | |
---|
| 27 | MOSAIX is under CeCILL\_V2 licence. See `Licence_CeCILL_V2-en.txt`file |
---|
| 28 | for an english version of the licence and `Licence_CeCILL_V2-fr.txt` |
---|
| 29 | for a french version. |
---|
| 30 | |
---|
| 31 | Permission is hereby granted, free of charge, to any person or |
---|
| 32 | organization obtaining a copy of the software and accompanying |
---|
| 33 | documentation covered by this license (the "Software") to use, |
---|
| 34 | reproduce, display, distribute, execute, and transmit the Software, |
---|
| 35 | and to prepare derivative works of the Software, and to permit |
---|
| 36 | third-parties to whom the Software is furnished to do so, all subject |
---|
| 37 | to the following warning : |
---|
| 38 | |
---|
| 39 | ### Warning |
---|
| 40 | |
---|
| 41 | Warning, to install, configure, run, use any of MOSAIX software or to |
---|
| 42 | read the associated documentation you'll need at least one (1) brain |
---|
| 43 | in a reasonably working order. Lack of this implement will void any |
---|
| 44 | warranties (either express or implied). Authors assumes no |
---|
| 45 | responsability for errors, omissions, data loss, or any other |
---|
| 46 | consequences caused directly or indirectly by the usage of his |
---|
| 47 | software by incorrectly or partially configured |
---|
| 48 | |
---|
[4756] | 49 | ## MOSAIX |
---|
| 50 | |
---|
[6190] | 51 | MOSAIX is a small set of fortran routines, bash scripts, python |
---|
| 52 | scripts and xml files allowing to generate coupling weights for the |
---|
| 53 | IPSL Earth System Model. It is under development, and presently not |
---|
| 54 | used by the production runs. It aims to replace the old MOSAIC |
---|
| 55 | software. It uses XIOS as a library to compute weights. In the present |
---|
| 56 | state, it can handle ORCA, LMDZ lon/lat and DYNAMICO grids. |
---|
[4756] | 57 | |
---|
[6190] | 58 | MOSAIX can generate second order conservative interpolation |
---|
| 59 | weights. They are used in place of bilinear interpolation by |
---|
| 60 | [OASIS-MCT](https://portal.enes.org/oasis) |
---|
[4756] | 61 | |
---|
| 62 | As MOSAIX uses XIOS, it works in parallel, using MPI distributed memory. |
---|
| 63 | |
---|
| 64 | ## Compatibility with MOSAIC |
---|
| 65 | |
---|
[6190] | 66 | - Weights are not compatible with the weights generated by |
---|
| 67 | MOSAIC. The precision of the interpolation (conservation) is |
---|
| 68 | improved. The ocean mask interpolated on the atmosphere grid will |
---|
| 69 | be slightly different, and not compatible. |
---|
[4756] | 70 | |
---|
[6190] | 71 | - **Run-off** : runoff weights are computed with a different |
---|
| 72 | algorithm, the result can be quite different. |
---|
[4756] | 73 | |
---|
[6190] | 74 | - **Calving** : In IPSLCM6, the calving was integrated for each |
---|
| 75 | latitude of the grid on the LMDZ grid. Weights were use to |
---|
| 76 | aggregate several latitudes to compute an integral over a |
---|
| 77 | latitudinal band. This is not possible with DYNAMICO, and was |
---|
| 78 | abandon for rectilinear LMD grid. The atmosphere model must the |
---|
| 79 | integral over a region (presently latitudinal bands). The final |
---|
| 80 | result should be the same as with MOSAIC. |
---|
[6235] | 81 | |
---|
[6190] | 82 | ## Computer |
---|
[4756] | 83 | |
---|
[6190] | 84 | MOSAIX been developped and extensively used on Irene Skylake computer, |
---|
| 85 | using the Intel compilation tools. MOSAIX is supposed to work on any |
---|
| 86 | computer where XIOS works. |
---|
| 87 | |
---|
| 88 | It has been tested on Mac OS X, using `gcc` as a compiler. It is |
---|
[6235] | 89 | fragile, as regularly XIOS updates break the compatibility. |
---|
[6190] | 90 | |
---|
[4756] | 91 | ## TODO |
---|
| 92 | |
---|
[5917] | 93 | - Creates a non-masked grid for atmosphere, to compute integrals of run-off. |
---|
[6190] | 94 | - Creates 2<sup>nd</sup> order interpolation weights that conserve |
---|
| 95 | posivity. They won't be conservative. |
---|
| 96 | - Test on other computers : Irene AMD, Jean-Zay, etc ... |
---|
[4756] | 97 | |
---|
| 98 | ## Known problems |
---|
| 99 | |
---|
| 100 | - ? |
---|
| 101 | |
---|
| 102 | ## Future work |
---|
| 103 | |
---|
| 104 | - Geographical distribution of the calving for the northern hemisphere. |
---|
| 105 | |
---|
| 106 | ## Code availability |
---|
| 107 | |
---|
[5917] | 108 | - Web : [https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX](https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX) |
---|
[4756] | 109 | - SVN : svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/MOSAIX MOSAIX |
---|
| 110 | - SVN : svn co svn+ssh://<login>@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX MOSAIX |
---|
| 111 | |
---|
| 112 | ## Portability |
---|
| 113 | |
---|
[5917] | 114 | MOSAIX has been tested on Curie and Irene ([TGCC](https://www-tgcc.ccc.cea.fr)). |
---|
[4756] | 115 | |
---|
| 116 | ## Requirements |
---|
| 117 | |
---|
| 118 | - Fortran compiler, C++ compiler, MPI. |
---|
[6190] | 119 | - A working [XIOS](http://forge.ipsl.jussieu.fr/ioserver) |
---|
| 120 | library. Revision 1615 is known to work. |
---|
[4756] | 121 | - fcm version 1.2 |
---|
[6190] | 122 | - NetCDF fortran librairies. See |
---|
| 123 | [XIOS](http://forge.ipsl.jussieu.fr/ioserver) for a suitable version. |
---|
| 124 | - Python, version>=3.6 with |
---|
| 125 | [netCDF4](http://unidata.github.io/netcdf4-python/) and |
---|
| 126 | [numpy](http://www.numpy.org) modules. Python version>=2.7 mights work, but has not been tested recently. |
---|
[4756] | 127 | - Bash version>=4. |
---|
| 128 | - [âNCO](http://nco.sourceforge.net). Version 4.6.0 is known to work. |
---|
| 129 | |
---|
| 130 | ## Input files |
---|
| 131 | |
---|
[6190] | 132 | MOSAIX needs files describing the grid of the models. See |
---|
| 133 | `CreateWeightsMask.bash` and the bottom of this page. |
---|
[4756] | 134 | |
---|
| 135 | ## Output files |
---|
| 136 | |
---|
| 137 | All netCDF files have a detailed header. |
---|
| 138 | |
---|
[6190] | 139 | - Weight files `rmp_*`. Should have a rather explicit name. The name |
---|
| 140 | is configurable at the beginning of `CreateWeightsMask.bash`. |
---|
| 141 | - Diagnostic file used for debug `dia_*.nc` for each rmp file, |
---|
| 142 | except for runoff and calving. Debug information are directly in |
---|
| 143 | weight files in this last cases. |
---|
| 144 | - Grid description file for OASIS-MCT `grids.nc`, `areas.nc` and |
---|
| 145 | `masks.nc`. |
---|
| 146 | - A file containing the fraction of ocean in each atmosphere grid |
---|
| 147 | box. For instance `ICO40_grid_maskFrom_eORCA1.2.nc`. |
---|
[4758] | 148 | - A `README` file. Includes a checksum for each generated files. |
---|
[4756] | 149 | |
---|
| 150 | ## Scripts and codes |
---|
| 151 | |
---|
[6190] | 152 | * **CreateWeightsMask.bash**. Creates the weights to interpolate |
---|
| 153 | between atmospheric and ocean grid. Weight files are suitable for |
---|
| 154 | OASIS-MCT. Creates the fraction of ocean in atmospheric grid |
---|
| 155 | cells. Uses parallel processing with MPI. Has a configuration |
---|
| 156 | section at the beginning. |
---|
[4756] | 157 | |
---|
[6190] | 158 | - **CreateOasisGrids.bash**. Creates files `grids.nc`, `areas.nc` |
---|
| 159 | and `masks.nc` with information from both models, suitable for |
---|
| 160 | OASIS-MCT. Mono CPU. Launched by `CreateWeights.bash`. |
---|
[4756] | 161 | |
---|
[6190] | 162 | - **update_xml.py**. Python script used to perform on the fly |
---|
| 163 | editing of xml files. Used by `CreateWeights.bash`. More |
---|
| 164 | information with `python update_xml.py -h`. |
---|
[4756] | 165 | |
---|
[6190] | 166 | - **iodef\_atm\_to_oce.xml** and **iodef\_oce\_to_atm.xml**. xml |
---|
| 167 | files read by `interpol.f90`. These files are edited by |
---|
| 168 | `update_xml.py`. |
---|
[4756] | 169 | |
---|
[6190] | 170 | - **MOSAIX/src/MOSAIX/interpol.f90**. Fortran source using the XIOS |
---|
| 171 | library. |
---|
[4756] | 172 | |
---|
[6190] | 173 | - **make_mosaix**. Small script for compiling **interpol.f90**. You |
---|
| 174 | need to compile XIOS first. Uses compiler, compiler options and |
---|
| 175 | librairies defined by XIOS. |
---|
| 176 | |
---|
[4758] | 177 | ```bash |
---|
[4756] | 178 | make_xios \[options\] |
---|
| 179 | options : |
---|
| 180 | \[--xios path\] : path to XIOS. Default is ../XIOS |
---|
| 181 | \[--full\] : to regenerate dependencies and recompile from scratch |
---|
| 182 | Example : ./make_mosaix --xios ../XIOS |
---|
[4758] | 183 | ``` |
---|
| 184 | |
---|
[6190] | 185 | - **RunoffWeights.py**. Python code to generates weights for |
---|
| 186 | run-off. Launched by `CreateWeights.bash`. More information with |
---|
| 187 | python `RunOffWeights.py -h`. |
---|
[4756] | 188 | |
---|
[6190] | 189 | - Defines a coastal band on land in the atmosphere model. For LMDZ |
---|
| 190 | rectilinear grids, the width of this band is parametrized, in grid |
---|
| 191 | points. For ico grids, the band contains only point with a |
---|
| 192 | fraction of ocean in \]0,1\[. |
---|
[4756] | 193 | |
---|
[6190] | 194 | - Defines a coastal band on ocean in the ocean model. The width of |
---|
| 195 | this band is parametrized. |
---|
[4756] | 196 | |
---|
[6190] | 197 | - An atmosphere point of the coastal band is linked to an ocean |
---|
| 198 | point in the coastal band if the distance between the two is less |
---|
| 199 | than searchRadius. |
---|
[4756] | 200 | |
---|
[6190] | 201 | - **CalvingWeights.py**. Python code to generates weights for |
---|
| 202 | calving. Launched by `CreateWeights.bash`. More information with |
---|
| 203 | python `CalvingWeights.py -h`. |
---|
[4756] | 204 | |
---|
[6190] | 205 | - The atmosphere model integrate the calving over on specific |
---|
| 206 | regions. Presently the regions are three latitudinal bands with |
---|
| 207 | limits 90°S/40°S/50°N/90°N. |
---|
[4756] | 208 | |
---|
[6190] | 209 | - The weights distribute the calving in the ocean in the |
---|
| 210 | corresponding latitudinal bands. By default, the distribution is |
---|
| 211 | uniform. |
---|
[4756] | 212 | |
---|
[6190] | 213 | - For the southernmost band, it is possible to use a geographical |
---|
| 214 | distribution read in a file. These files are currently available |
---|
| 215 | for eORCA1 and eORCA025. |
---|
[4756] | 216 | |
---|
| 217 | ## Grids |
---|
| 218 | |
---|
[6190] | 219 | - _\[tuv\]orc_. ORCA grid at _\[TUV\]_ points. Masked on land, with |
---|
| 220 | area equal to grid box surface. |
---|
| 221 | - _tlmd_. LMD rectilinear grid at scalar (physics) point. Masked on |
---|
| 222 | land, with area equal to grid box surface. |
---|
| 223 | - _tico_. LMD icosahedron grid at scalar (physics) point. Masked on |
---|
| 224 | land, with area equal to grid box surface. |
---|
| 225 | - _olmd_. LMD rectilinear grid at scalar (physics) point. Not |
---|
| 226 | masked, with areas equal to 1. |
---|
| 227 | - _oico_. LMD icosahedron grid at scalar (physics) point. Not |
---|
| 228 | masked, with areas equal to 1. |
---|
| 229 | - _corc_. ORCA grid at _T_ point. Masked on land, duplicated (from |
---|
| 230 | periodicity) point masked, with area equal to grid box surface. |
---|
| 231 | - _oorc_. ORCA grid at _T_ point. Masked on land, duplicated (from |
---|
| 232 | periodicity) point masked, with area equal 1. |
---|
[4756] | 233 | |
---|
| 234 | ## Generating input grid files |
---|
| 235 | |
---|
| 236 | **Generating icosahedral grid in double precision using XIOS:** |
---|
| 237 | |
---|
| 238 | Here are the main changes: |
---|
| 239 | |
---|
| 240 | - File `context_lmdz.xml` : |
---|
| 241 | ```xml |
---|
| 242 | ..... |
---|
| 243 | <domain_definition> |
---|
| 244 | <domain id="dom_glo" data_dim="2" /> |
---|
| 245 | <domain id="dom_glo_p8" domain_ref="dom_glo" prec="8" /> |
---|
| 246 | <domain id="geordered" domain_ref="dom_glo"> |
---|
| 247 | <reorder_domain invert_lat="true" shift_lon_fraction="0"/> |
---|
| 248 | </domain> |
---|
| 249 | </domain_definition> |
---|
| 250 | ..... |
---|
| 251 | <grid_definition> |
---|
| 252 | ..... |
---|
| 253 | <grid id="grid_glo"> |
---|
| 254 | <domain domain_ref="dom_glo" /> |
---|
| 255 | </grid> |
---|
| 256 | |
---|
| 257 | <grid id="grid_glo_p8"> |
---|
| 258 | <domain domain_ref="dom_glo_p8" /> |
---|
| 259 | </grid> |
---|
| 260 | ..... |
---|
| 261 | ``` |
---|
| 262 | |
---|
| 263 | - File `field_def_lmdz.xml` : |
---|
| 264 | ```xml |
---|
| 265 | <field_definition level="1" prec="4" operation="average" freq_op="1ts" enabled=".true." default_value="9.96921e+36" domain_ref="dom_glo"> |
---|
| 266 | <field_group id="fields_2D_p8" grid_ref="grid_glo_p8" prec="8"> |
---|
| 267 | <field id="aire_p8" field_ref="aire" long_name="Grid area p8" unit="-" /> |
---|
| 268 | <field id="fract_oce_p8" field_ref="fract_oce" long_name="Fraction oce p8" unit="1" /> |
---|
| 269 | <field id="fract_sic_p8" field_ref="fract_sic" long_name="Fraction sic p8" unit="1" /> |
---|
| 270 | <field id="fract_oce_plus_sic_p8" long_name="Fraction oce plus sic p8" unit="1" /> |
---|
| 271 | <field id="mask_oce_plus_sic_p8" long_name="Masque oce plus sic p8" unit="1" /> |
---|
| 272 | </field_group> |
---|
| 273 | ... |
---|
| 274 | </field_definition> |
---|
| 275 | ``` |
---|
| 276 | |
---|
| 277 | - File `file_def_histmth_lmdz.xml` : |
---|
| 278 | ```xml |
---|
| 279 | <file_definition> |
---|
| 280 | <file_group id="defile"> |
---|
| 281 | <file id="grid_p8" name="grid_p8" output_freq="1d" sync_freq="10d" output_level="2" enabled="true" timeseries="none" time_counter="none"> |
---|
| 282 | <field_group grid_ref="grid_glo_p8" ts_enabled="true" freq_op="1d" expr="@this"> |
---|
| 283 | <field field_ref="aire_p8" level="1" operation="once" /> |
---|
| 284 | <field field_ref="fract_oce_p8" level="1" operation="once" /> |
---|
| 285 | <field field_ref="fract_sic_p8" level="1" operation="once" /> |
---|
| 286 | </field_group> |
---|
| 287 | |
---|
| 288 | <field_group grid_ref="grid_glo_p8" ts_enabled="true" freq_op="1d" > |
---|
| 289 | <field field_ref="fract_oce_plus_sic_p8" level="1" > fract_oce + fract_sic </field> |
---|
| 290 | <field field_ref="mask_oce_plus_sic_p8" level="1" > ((fract_oce + fract_sic) > 0) ? 1 : 0 </field> |
---|
| 291 | </field_group> |
---|
| 292 | </file> |
---|
| 293 | .......... |
---|
| 294 | ``` |
---|
| 295 | |
---|