source: TOOLS/MOSAIX/README.md @ 6764

Last change on this file since 6764 was 6235, checked in by omamce, 21 months ago

O.M. : MOSAIX :

  • update README.md for the propoer revision of XIOS
  • change make_mosaix to adapt to different fcm versions
  • Property svn:keywords set to Date Revision HeadURL Author Id
File size: 11.7 KB
Line 
1# MOSAIX
2
3## SVN information
4
5    svn propset svn:keywords "Date Revision HeadURL Author Id" *.bash *.xml *.py src/MOSAIX/* Utils/*
6    $Author$
7    $Date$
8    $Revision$
9    $Id$
10    $HeadURL$
11
12All documentation available at https://forge.ipsl.jussieu.fr/igcmg/wiki/IPSLCM6/MOSAIX
13
14Extraction : `svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/MOSAIX MOSAIX`
15
16or `svn co svn+ssh://omamce@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX MOSAIX`
17
18## [XIOS](http://forge.ipsl.jussieu.fr/ioserver/)
19MOSAIC is known to work with XIOS2, revision 2379
20
21XIOS : http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk
22
23Extraction : svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS
24
25## Licensing
26
27MOSAIX 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 
31Permission is hereby granted, free of charge, to any person or
32organization obtaining a copy of the software and accompanying
33documentation covered by this license (the "Software") to use,
34reproduce, display, distribute, execute, and transmit the Software,
35and to prepare derivative works of the Software, and to permit
36third-parties to whom the Software is furnished to do so, all subject
37to the following warning :
38
39### Warning
40
41Warning, to install, configure, run, use any of MOSAIX software or to
42read the associated documentation you'll need at least one (1) brain
43in a reasonably working order. Lack of this implement will void any
44warranties (either express or implied). Authors assumes no
45responsability for errors, omissions, data loss, or any other
46consequences caused directly or indirectly by the usage of his
47software by incorrectly or partially configured
48
49## MOSAIX
50
51MOSAIX is a small set of fortran routines, bash scripts, python
52scripts and xml files allowing to generate coupling weights for the
53IPSL Earth System Model. It is under development, and presently not
54used by the production runs. It aims to replace the old MOSAIC
55software. It uses XIOS as a library to compute weights. In the present
56state, it can handle ORCA, LMDZ lon/lat and DYNAMICO grids.
57
58MOSAIX can generate second order conservative interpolation
59weights.  They are used in place of bilinear interpolation by
60[OASIS-MCT](https://portal.enes.org/oasis)
61
62As MOSAIX uses XIOS, it works in parallel, using MPI distributed memory.
63
64## Compatibility with MOSAIC
65
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.
70
71-   **Run-off** : runoff weights are computed with a different
72    algorithm, the result can be quite different.
73
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.
81
82## Computer
83
84MOSAIX been developped and extensively used on Irene Skylake computer,
85using the Intel compilation tools. MOSAIX is supposed to work on any
86computer where XIOS works.
87
88It has been tested on Mac OS X, using `gcc` as a compiler. It is
89fragile, as regularly XIOS updates break the compatibility.
90
91## TODO
92
93-   Creates a non-masked grid for atmosphere, to compute integrals of run-off.
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 ...
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
108-   Web : [https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX](https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX)
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
114MOSAIX has been tested on Curie and Irene ([TGCC](https://www-tgcc.ccc.cea.fr)).
115
116## Requirements
117
118-   Fortran compiler, C++ compiler, MPI.
119-   A working [XIOS](http://forge.ipsl.jussieu.fr/ioserver)
120    library. Revision 1615 is known to work.
121-   fcm version 1.2
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.
127-   Bash version>=4.
128-   [​NCO](http://nco.sourceforge.net). Version 4.6.0 is known to work.
129
130## Input files
131
132MOSAIX needs files describing the grid of the models. See
133`CreateWeightsMask.bash` and the bottom of this page.
134
135## Output files
136
137All netCDF files have a detailed header.
138
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`.
148-   A `README` file. Includes a checksum for each generated files.
149
150## Scripts and codes
151
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.
157
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`.
161
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`.
165
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`.
169
170-   **MOSAIX/src/MOSAIX/interpol.f90**. Fortran source using the XIOS
171    library.
172
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
177```bash
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
183```
184                       
185- **RunoffWeights.py**. Python code to generates weights for
186  run-off. Launched by `CreateWeights.bash`. More information with
187  python `RunOffWeights.py -h`.
188
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\[.
193
194  - Defines a coastal band on ocean in the ocean model. The width of
195    this band is parametrized.
196
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.
200
201- **CalvingWeights.py**. Python code to generates weights for
202  calving. Launched by `CreateWeights.bash`. More information with
203  python `CalvingWeights.py -h`.
204
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.
208
209  - The weights distribute the calving in the ocean in the
210    corresponding latitudinal bands. By default, the distribution is
211    uniform.
212
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.
216
217## Grids
218
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.
233
234## Generating input grid files
235
236**Generating icosahedral grid in double precision using XIOS:**
237
238Here 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) &gt; 0) ? 1 : 0 </field>
291                  </field_group>
292                </file>
293        ..........
294```
295
Note: See TracBrowser for help on using the repository browser.