LMDZ to DYNAMICO start files
This page explains how to convert a start.nc startfi.nc to a Dynamico There is a wiki page specific for Dynamico just in case: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_DYNAMICO_dynamical_core ).
The first step is to compile DYNAMICO using the LMDZ physics. Please refer to DYNAMICO with LMDZ physics for this step.
1. Get start.nc and startfi.nc from your simulation via newstart or the PCM.
2. Get an archive file using start2archive
- a) Compile start_archive.e using the following command. Replace architecture, dimensions and <your_physics> by your package (mars/pluto/...)
makelmdz_fcm -arch <architecture> -d <dimensions (lonxlatxalt)> -p <your_physics> start2archive
- b) run it:
start2archive.e
- c) Copy start archive to your new dynamico simulation folder
cp start_archive.nc dynamico_runs
- d) Convert the start archive to netCDF4
nccopy -k 4 start_archive.nc start_archive_nc4.nc
3. Create an initial conditions files for dynamico by running a dynamico simulation without an initial physics file (startphy_file=false).
- a) In run.def change the following variables (adapt to your case) : run_length=1500, etat_isothermal_temp=200, etat=isothermal and startphy_file=false
- b) Follow DYNAMICO with LMDZ physics, to compile icosa_lmdz.exe.
- c) run it:
icosa_lmdz.exe
- d) copy the files outputed by icosa_lmdz.exe
cp restartfi.nc startphy_icosa_ref.nc cp restart.nc start_icosa_ref.nc
4. Convert the LMDZ start files to the DYNAMCIO grid.
- a) Create a surface_nc4.nc based on your topography (could be a symbolic link). It may fail if the format is netCDF 3. You can convert the file with nc3tonc4 or nccopy -k 4.
- b) Compile the files in LMDZ.<YOUR_PHYSICS>/util/startarchive2icosa (where YOUR_PHYSICS is MARS/PLUTO/...) with the compile script, which will create start_archive2icosa and rearrange_startphy.
- c) Then, copy all the files in your simulation folder, but WARNING: there are some xml files that could overwrite your own files (like iodef.xml).
cp path/to/LMDZ.<YOUR_PHYSICS>/util/startarchive2icosa/* .
- d) run start_archive2icosa as a job (requires a lot of memory). Make sure that iodef.xml is the one from the startarchive2icosa folder.
sbatch job_start_archive_2icosa
- e) the script creates start_icosa_prefinalize.nc and startfi_prefinalize.nc. You will need to run a final script:
./icosa_finalize.bash
There could be an issue with the location of the LMDZ root folder. Please change the icosa_finalize.bash file accordingly. The script outputs startfi.nc and start_icosa.nc.
5. NOT NEEDED? update the tracer name in startfi for each tracer for example: ncrename -v ccn_number_surf,ccn_number startfi.nc.
6. Run Dynamico simulation
- a) change the iodef.xml to the one in deftank/dynamico
- b) in run.def, change the following variables:
etat0=start_file etat0_start_file_colocated=true