Changes between Version 10 and Version 11 of IPSLCM6/MOSAIX


Ignore:
Timestamp:
12/12/18 16:27:29 (6 years ago)
Author:
omamce
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IPSLCM6/MOSAIX

    v10 v11  
    33MOSAIX 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. 
    44 
    5 MOSAIX work in parallel, using MPI distributed memory. 
     5MOSAIX can generate 2^nd^ order interpolation weights. They are used in place of bilinear interpolation by OASIS-MCT. 
     6 
     7As MOSAIX uses XIOS, it works in parallel, using MPI distributed memory.  
     8 
     9== Compatibility with MOZAIC == 
     10 
     11* Weights are generally compatible with the weights generated by MOSAIC. The precision of the interpolation (conservation) is improved. 
     12  
     13* '''Run-off''' : runoff weights are computed with a different algorithm, the result can be quite different. 
     14 
     15* '''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. 
    616 
    717== Known problems == 
    8 * None so far ... 
     18* Must determine if weight file should in netCDF3 or netCDF4 for OASIS-MCT. 
     19 
     20== Future work == 
     21* Geographical distribution of the calving for the northern hemisphere 
    922 
    1023== Code availability == 
     
    1629MOSAIX has been tested on Curie and Irene (TGCC) .  
    1730 
    18 == Requirement == 
    19 * A working XIOS library (http://forge.ipsl.jussieu.fr/ioserver). 
     31== Requirements == 
     32* A working [[http://forge.ipsl.jussieu.fr/ioserver|XIOS]] library. 
    2033* fcm version 1.2 
    21 * NetCDF. See XIOS for a suitable version. 
    22 * Python version>3.6 with netCDF4 and numpy modules 
    23 * NCO 
     34* NetCDF fortran librairies. See [[http://forge.ipsl.jussieu.fr/ioserver|XIOS]] for a suitable version. 
     35* Python, version>3.6 with [[http://unidata.github.io/netcdf4-python/|netCDF4]] and [[http://www.numpy.org|numpy]] modules 
     36* [[http://nco.sourceforge.net|NCO]] 
    2437 
    2538== Input files == 
    26 MOSAIX needs files describing the grid of the models. See {{{CreateWeightsMask.bash}}} 
     39MOSAIX needs files describing the grid of the models. See {{{CreateWeightsMask.bash}}} and the bottom of this page. 
     40 
     41== Output files == 
     42All netCDF files have a detailed header. 
     43* Weight files {{{rmp_*}}}. Should have a rather explicit name. 
     44* 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 case. 
     45* Grid description file for OASIS-MCT {{{grids.nc}}}, {{{areas.nc}}} and {{{masks.nc}}} 
     46* A file containing the fraction of ocean in each atmosphere grid box. For instance {{{ICO40_grid_maskFrom_eORCA1.2.nc}}}. 
     47* A README file. Include a checksum for each generated files. 
    2748 
    2849== Scripts and codes == 
    2950 
    30 * '''!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. Use parallel processing with MPI. 
     51* '''!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. 
    3152 
    32 * '''!CreateOasisGrids.bash'''.  Creates files {{{grids.nc}}}, {{{areas.nc}}} and {{{masks.nc}}} with information from both models, suitable for OASIS-MCT. Mono CPU. Automatically started by !CreateWeightsMask.bash. 
     53* '''!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}}}. 
    3354 
    3455* '''update_xml.py'''. Python script used to perform on the fly editing of xml files. Used by the previous bashes. 
    3556 
    36 * '''iodef_atm_to_oce.xml''' and '''iodef_oce_to_atm.xml'''.  
     57* '''iodef_atm_to_oce.xml''' and '''iodef_oce_to_atm.xml'''.  xml files read by {{{interpol.f90}}}. This file are edited by {{{update_xml.py}}}. 
    3758 
    3859* '''MOSAIX/src/MOSAIX/interpol.f90'''. Fortran source using the XIOS library.  
    3960 
    40 * '''make_mosaix'''. Small script for compiling '''interpol.f90'''. You need to compile XIOS first. Use compiler, compiler options and librairies defined by XIOS. 
     61* '''make_mosaix'''. Small script for compiling '''interpol.f90'''. You need to compile XIOS first. Uses compiler, compiler options and librairies defined by XIOS. 
    4162 
    42 * '''!RunoffWeights.py'''. Python code to generates weights for run-off.  
     63* '''!RunoffWeights.py'''. Python code to generates weights for run-off. Launched by {{{CreateWeights.bash}}}. 
    4364   
    4465  1) 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[. 
     
    4667  2) Defines a coastal band on ocean in the ocean model. The width of this band is parametrized. 
    4768 
    48   3) An atmosphere point of the coastal bans is link to an ocean point in the coastal band if the distance between the two is less than {{{searchRadius}}}. 
     69  3) 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}}}. 
    4970 
    50 * '''CalvingWeights.py'''. Python code to generates weights for calving. 
    51   1) The atmosphere model should integrate the calving on specific region. Presently the region are three latitudinal bands with limites 90°S/40°S/50°N/90°N 
     71* '''!CalvingWeights.py'''. Python code to generates weights for calving. Launched by {{{CreateWeights.bash}}}. 
    5272 
    53  2) The weights distribute the calving over the corresponding latitudinal bands. By default, the distribution is uniform. 
     73  1) 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. 
    5474 
    55  3) For the most southern band, is is possible to use a geographical distributio,n read in a file. 
     75 2) The weights distribute the calving in the ocean in the corresponding latitudinal bands. By default, the distribution is uniform. 
     76 
     77 3) 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. 
    5678 
    5779== Grids == 
    58 * [tuv]orc. ORCA grid at [tuv] points. Masked on land, with area equal to grid box surface 
    59 * tlmd. LMD rectilinear grid at scalar (physics) point. Masked on land, with area equal to grid box surface. 
    60 * tico. LMD icosahedron grid at scalar (physics) point. Masked on land, with area equal to grid box surface. 
    61 * olmd. LMD rectilinear grid at scalar (physics) point. Not masked,  with areas equal to 1. 
    62 * oico. LMD icosahedron grid at scalar (physics) point. Not masked,  with areas equal to 1. 
    63 * corc. ORCA grid at t point. Masked on land, duplicated (from periodicity) point masked, with area equal to grid box surface. 
    64 * corc. ORCA grid at t point. Masked on land, duplicated (from periodicity) point masked, with area equal 1. 
     80* ''[tuv]orc''. ORCA grid at ''[TUV]'' points. Masked on land, with area equal to grid box surface. 
     81* ''tlmd''. LMD rectilinear grid at scalar (physics) point. Masked on land, with area equal to grid box surface. 
     82* ''tico''. LMD icosahedron grid at scalar (physics) point. Masked on land, with area equal to grid box surface. 
     83* ''olmd''. LMD rectilinear grid at scalar (physics) point. Not masked,  with areas equal to 1. 
     84* ''oico''. LMD icosahedron grid at scalar (physics) point. Not masked,  with areas equal to 1. 
     85* ''corc''. ORCA grid at ''T'' point. Masked on land, duplicated (from periodicity) point masked, with area equal to grid box surface. 
     86* ''oorc''. ORCA grid at ''T'' point. Masked on land, duplicated (from periodicity) point masked, with area equal 1. 
     87 
     88== Generating initial grid file == 
     89 
     90''' Generating icosahedral grid in double precision using XIOS:''' 
     91 
     92Here are the main changes: 
     93 
     94 * File {{{context_lmdz.xml}}} : 
     95 
     96{{{ 
     97..... 
     98 <domain_definition>  
     99     <domain id="dom_glo" data_dim="2" /> 
     100     <domain id="dom_glo_p8"  domain_ref="dom_glo"  prec="8" / < 
     101     <domain id="greordered"  domain_ref="dom_glo"> 
     102     <reorder_domain invert_lat="true" shift_lon_fraction="0  
     103    </domain>  
     104 </domain_definition> 
     105 
     106... 
     107 
     108 <grid_definition> 
     109..... 
     110     <grid id="grid_glo"> 
     111        <domain domain_ref="dom_glo" />  
     112     </grid>  
     113  
     114     <grid id="grid_glo_p8">  
     115        <domain domain_ref="dom_glo_p8" />   
     116     </grid> 
     117..... 
     118 
     119}}} 
     120 
     121 
     122 * File {{{field_def_lmdz.xml}}} : 
     123 
     124 
     125{{{ 
     126<field_definition level="1" prec="4" operation="average" freq_op="1ts" enabled=".true." default_value="9.96921e+36" domain_ref="dom_glo"> 
     127    <field_group id="fields_2D_p8" grid_ref="grid_glo_p8" prec="8">  
     128      <field id="aire_p8" field_ref="aire" long_name="Grid area p8" unit="-"    /> 
     129      <field id="fract_oce_p8" field_ref="fract_oce" long_name="Fraction oce p8"   unit="1" />  
     130      <field id="fract_sic_p8" field_ref="fract_sic"   long_name="Fraction sic p8"   unit="1" />  
     131      <field id="fract_oce_plus_sic_p8" long_name="Fraction oce plus sic p8"   unit="1" />  
     132      <field id="mask_oce_plus_sic_p8" long_name="Masque oce plus sic p8"  unit="1" />  
     133    </field_group> 
     134[...] 
     135</field_definition> 
     136 
     137}}} 
     138 
     139 
     140 * File file_def_histmth_lmdz.xml: (this can also be written in file_def_histday_lmdz.xml) 
     141 
     142{{{ 
     143<file_definition>  
     144    <file_group id="defile">  
     145        <file id="grid_p8" name="grid_p8" output_freq="1d" sync_freq="10d" output_level="2" enabled="true" timeseries="none" time_counter="none">  
     146          <field_group grid_ref="grid_glo_p8" ts_enabled="true" freq_op="1d" expr="@this">   
     147              <field field_ref="aire_p8" level="1" operation="once"  />  
     148              <field field_ref="fract_oce_p8" level="1" operation="once" />  
     149              <field field_ref="fract_sic_p8" level="1" operation="once" />   
     150          </field_group>                                
     151                  
     152          <field_group grid_ref="grid_glo_p8" ts_enabled="true" freq_op="1d" >   
     153              <field field_ref="fract_oce_plus_sic_p8"    level="1" > fract_oce + fract_sic </field>    
     154              <field field_ref="mask_oce_plus_sic_p8"    level="1" > ((fract_oce + fract_sic) &gt; 0) ? 1 : 0 </field>  
     155          </field_group>  
     156        </file> 
     157.......... 
     158}}}