source: TOOLS/MOSAIX/README.md @ 6048

Last change on this file since 6048 was 6044, checked in by omamce, 2 years ago

O.M. : MOASAIX/README.md : correct informations about XIOS revision

  • Property svn:keywords set to Date Revision HeadURL Author Id
File size: 10.1 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 XIOS revision 2286
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## MOSAIX
26
27MOSAIX is a small set of fortran routines, bash scripts, python scripts and xml files allowing to generate coupling weights for IPSL Earth System Model. It is under development, and presently not used by the production runs. It aims to replace the old MOSAIC software. It uses XIOS as a library to compute weights. In the present state, it can handle ORCA, LMDZ lon/lat and DYNAMICO grids.
28
29MOSAIX can generate 2<sup>nd</sup> order conservative interpolation weights. They are used in place of bilinear interpolation by [OASIS-MCT](https://portal.enes.org/oasis)
30
31As MOSAIX uses XIOS, it works in parallel, using MPI distributed memory.
32
33## Compatibility with MOSAIC
34
35-   Weights are not compatible with the weights generated by MOSAIC. The precision of the interpolation (conservation) is improved. The ocean mask interpolated on the atmosphere grid will be slightly different, and not compatible.
36
37-   **Run-off** : runoff weights are computed with a different algorithm, the result can be quite different.
38
39-   **Calving** : In IPSLCM6, the calving was integrated for each latitude of the grid on the LMDZ grid. Weights were use to aggregate several latitudes to compute an integral over a latitudinal band.. This is not possible with DYNAMICO, and was abandon for rectilinear LMD grid. The atmosphere model must the integral over a region (presently latitudinal bands). The final result should be the same as with MOSAIC.
40
41## TODO
42
43-   Creates a non-masked grid for atmosphere, to compute integrals of run-off.
44-   Creates 2<sup>nd</sup> order interpolation weights that conserve posivity. They won't be conservative.
45
46## Known problems
47
48-   ?
49
50## Future work
51
52-   Geographical distribution of the calving for the northern hemisphere.
53
54## Code availability
55
56-   Web : [https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX](https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX)
57-   SVN : svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/MOSAIX MOSAIX
58-   SVN : svn co svn+ssh://<login>@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX MOSAIX
59
60## Portability
61
62MOSAIX has been tested on Curie and Irene ([TGCC](https://www-tgcc.ccc.cea.fr)).
63
64## Requirements
65
66-   Fortran compiler, C++ compiler, MPI.
67-   A working [XIOS](http://forge.ipsl.jussieu.fr/ioserver) library. Revision 1615 is known to work.
68-   fcm version 1.2
69-   NetCDF fortran librairies. See [XIOS](http://forge.ipsl.jussieu.fr/ioserver) for a suitable version.
70-   Python, version>=3.6 with [netCDF4](http://unidata.github.io/netcdf4-python/) and [numpy](http://www.numpy.org) modules. Python version>=2.7 mights work, but has not been tested recently.
71-   Bash version>=4.
72-   [​NCO](http://nco.sourceforge.net). Version 4.6.0 is known to work.
73
74## Input files
75
76MOSAIX needs files describing the grid of the models. See `CreateWeightsMask.bash` and the bottom of this page.
77
78## Output files
79
80All netCDF files have a detailed header.
81
82-   Weight files `rmp_*`. Should have a rather explicit name. The name is configurable at the beginning of `CreateWeightsMask.bash`.
83-   Diagnostic file used for debug `dia_*.nc` for each rmp file, except for runoff and calving. Debug information are directly in weight files in this last cases.
84-   Grid description file for OASIS-MCT `grids.nc`, `areas.nc` and `masks.nc`.
85-   A file containing the fraction of ocean in each atmosphere grid box. For instance `ICO40_grid_maskFrom_eORCA1.2.nc`.
86-   A `README` file. Includes a checksum for each generated files.
87
88## Scripts and codes
89
90*   **CreateWeightsMask.bash**. Creates the weights to interpolate between atmospheric and ocean grid. Weight files are suitable for OASIS-MCT. Creates the fraction of ocean in atmospheric grid cells. Uses parallel processing with MPI. Has a configuration section at the beginning.
91
92-   **CreateOasisGrids.bash**. Creates files `grids.nc`, `areas.nc` and `masks.nc` with information from both models, suitable for OASIS-MCT. Mono CPU. Launched by `CreateWeights.bash`.
93
94-   **update_xml.py**. Python script used to perform on the fly editing of xml files. Used by `CreateWeights.bash`. More information with `python update_xml.py -h`.
95
96-   **iodef\_atm\_to_oce.xml** and **iodef\_oce\_to_atm.xml**. xml files read by `interpol.f90`. These files are edited by `update_xml.py`.
97
98-   **MOSAIX/src/MOSAIX/interpol.f90**. Fortran source using the XIOS library.
99
100-   **make_mosaix**. Small script for compiling **interpol.f90**. You need to compile XIOS first. Uses compiler, compiler options and librairies defined by XIOS.
101```bash
102        make_xios \[options\]
103            options :
104                   \[--xios path\] : path to XIOS. Default is ../XIOS
105                   \[--full\]      : to regenerate dependencies and recompile from scratch
106            Example : ./make_mosaix --xios ../XIOS
107```
108                       
109- **RunoffWeights.py**. Python code to generates weights for run-off. Launched by `CreateWeights.bash`. More information with python `RunOffWeights.py -h`.
110
111  - Defines a coastal band on land in the atmosphere model. For LMDZ rectilinear grids, the width of this band is parametrized, in grid points. For ico grids, the band contains only point with a fraction of ocean in \]0,1\[.
112
113  - Defines a coastal band on ocean in the ocean model. The width of this band is parametrized.
114
115  - An atmosphere point of the coastal band is linked to an ocean point in the coastal band if the distance between the two is less than searchRadius.
116
117- **CalvingWeights.py**. Python code to generates weights for calving. Launched by `CreateWeights.bash`. More information with python `CalvingWeights.py -h`.
118
119  - The atmosphere model integrate the calving over on specific regions. Presently the regions are three latitudinal bands with limits 90°S/40°S/50°N/90°N.
120
121  - The weights distribute the calving in the ocean in the corresponding latitudinal bands. By default, the distribution is uniform.
122
123  - For the southernmost band, it is possible to use a geographical distribution read in a file. These files are currently available for eORCA1 and eORCA025.
124
125## Grids
126
127-   _\[tuv\]orc_. ORCA grid at _\[TUV\]_ points. Masked on land, with area equal to grid box surface.
128-   _tlmd_. LMD rectilinear grid at scalar (physics) point. Masked on land, with area equal to grid box surface.
129-   _tico_. LMD icosahedron grid at scalar (physics) point. Masked on land, with area equal to grid box surface.
130-   _olmd_. LMD rectilinear grid at scalar (physics) point. Not masked, with areas equal to 1.
131-   _oico_. LMD icosahedron grid at scalar (physics) point. Not masked, with areas equal to 1.
132-   _corc_. ORCA grid at _T_ point. Masked on land, duplicated (from periodicity) point masked, with area equal to grid box surface.
133-   _oorc_. ORCA grid at _T_ point. Masked on land, duplicated (from periodicity) point masked, with area equal 1.
134
135## Generating input grid files
136
137**Generating icosahedral grid in double precision using XIOS:**
138
139Here are the main changes:
140
141-   File `context_lmdz.xml` :
142```xml
143        .....
144         <domain_definition>
145             <domain id="dom_glo" data_dim="2" />
146             <domain id="dom_glo_p8"  domain_ref="dom_glo"  prec="8" />
147             <domain id="geordered"  domain_ref="dom_glo">
148             <reorder_domain invert_lat="true" shift_lon_fraction="0"/>
149            </domain>
150         </domain_definition>
151        .....
152         <grid_definition>
153        .....
154             <grid id="grid_glo">
155                <domain domain_ref="dom_glo" />
156             </grid>
157         
158             <grid id="grid_glo_p8">
159                <domain domain_ref="dom_glo_p8" />
160             </grid>
161        .....
162```
163               
164-   File `field_def_lmdz.xml` :
165```xml
166        <field_definition level="1" prec="4" operation="average" freq_op="1ts" enabled=".true." default_value="9.96921e+36" domain_ref="dom_glo">
167            <field_group id="fields_2D_p8" grid_ref="grid_glo_p8" prec="8">
168              <field id="aire_p8" field_ref="aire" long_name="Grid area p8" unit="-"    />
169              <field id="fract_oce_p8" field_ref="fract_oce" long_name="Fraction oce p8"   unit="1" />
170              <field id="fract_sic_p8" field_ref="fract_sic"   long_name="Fraction sic p8"   unit="1" />
171              <field id="fract_oce_plus_sic_p8" long_name="Fraction oce plus sic p8"   unit="1" />
172              <field id="mask_oce_plus_sic_p8" long_name="Masque oce plus sic p8"  unit="1" />
173            </field_group>
174        ...
175        </field_definition>
176```
177
178-   File `file_def_histmth_lmdz.xml` :
179```xml
180        <file_definition>
181            <file_group id="defile">
182                <file id="grid_p8" name="grid_p8" output_freq="1d" sync_freq="10d" output_level="2" enabled="true" timeseries="none" time_counter="none">
183                  <field_group grid_ref="grid_glo_p8" ts_enabled="true" freq_op="1d" expr="@this"> 
184                      <field field_ref="aire_p8" level="1" operation="once"  />
185                      <field field_ref="fract_oce_p8" level="1" operation="once" />
186                      <field field_ref="fract_sic_p8" level="1" operation="once" /> 
187                  </field_group>                               
188                         
189                  <field_group grid_ref="grid_glo_p8" ts_enabled="true" freq_op="1d" > 
190                      <field field_ref="fract_oce_plus_sic_p8" level="1" > fract_oce + fract_sic </field>   
191                      <field field_ref="mask_oce_plus_sic_p8" level="1" > ((fract_oce + fract_sic) &gt; 0) ? 1 : 0 </field>
192                  </field_group>
193                </file>
194        ..........
195```
196
Note: See TracBrowser for help on using the repository browser.