Difference between revisions of "DYNAMICO with LMDZ physics"
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | This page describes the compilation procedure for the coupling between [[the DYNAMICO dynamical core]] and the PCM LMDZ.* physics packages. | ||
+ | It describes the directory structure of the ICOSA_LMDZ directory which contains the interface. | ||
Please read the [[The DYNAMICO dynamical core|DYNAMICO installation process first]]. | Please read the [[The DYNAMICO dynamical core|DYNAMICO installation process first]]. | ||
− | == Compiling DYNAMICO with a LMDZ physics package == | + | == The ''ICOSA_LMDZ'' directory == |
+ | |||
+ | Once downloaded from the svn server, the ''ICOSA_LMDZ'' directory contents should be: | ||
+ | <pre> | ||
+ | arch bld.cfg build clean compile_adastra-gnu compile_irene-amd make_icosa_lmdz src xml | ||
+ | </pre> | ||
+ | Where the noteworthy elements are: | ||
+ | * The <font color="green">make_icosa_lmdz</font> script, which is the master script to use to compile all components (DYNAMICO, physics package, the interface between the two and the IOIPSL and XIOS libraries). | ||
+ | To list available options, run "make_icosa_lmdz -h", which should return something like: | ||
+ | <pre> | ||
+ | Usage : | ||
+ | make_icosa_lmdz [options] -arch arch_name -p phys | ||
+ | [-h] : help | ||
+ | [-prod / -dev / -debug] : compilation mode: production (default) / developpement / debug . | ||
+ | [-full] : recompile all code from scratch | ||
+ | [-nodeps] : do not build dependencies (XIOS and IOIPSL libraries) | ||
+ | -arch arch_name : target architecture | ||
+ | [-arch_path path] : relative PATH to directory containing multi-model | ||
+ | path and environment arch files | ||
+ | -p phys : physics package (e.g. std , venus , mars, ...) | ||
+ | [-p_opt "options"] : additional options for physics package | ||
+ | [-parallel type] : parallelism (none|mpi|omp|mpi_omp) | ||
+ | [-with_xios] : compile and link with XIOS (default) | ||
+ | [-job num] : speed up compilation by using num simulateneous | ||
+ | compilation steps (when possible) | ||
+ | </pre> | ||
+ | Upon successful completion of the compilation step the <font color="blue">bin</font> subdirectory will contain the executable <font color="green">icosa_lmdz.exe</font> | ||
+ | * Example scripts <font color="green">compile_adastra-gnu</font> and <font color="green">compile_irene-amd</font> which are wrappers to the <font color="green">make_icosa_lmdz</font> script with a set of given options. The general idea here is that a user would likewise write his/her own wrapper script. | ||
+ | * The ''arch'' directory which contains architecture files used by the <font color="green">make_icosa_lmdz</font> script | ||
+ | * The ''src'' directory which contains the source code for the interface | ||
+ | * The ''xml'' directory which contains an example of the <font color="gray">iodef.xml</font> file to use, along with related instructions to combining it with other xml file gathered from DYNAMICO and physics packages | ||
+ | |||
+ | == The ''src'' subdirectory == | ||
+ | This directory contains the source code for the interface, along with subdirectories related to each of the physics packages (currently Generic, Mars and Venus). More general code, i.e. which apply to all the physics packages, such as plugins for the vertical discretization or dissipation factors are located at this level. In practice that directory currently contains: | ||
+ | <pre> | ||
+ | distrib_icosa_lmdz.f90 phymars phyvenus | ||
+ | disvert_icosa_lmdz.f90 phypluto vert_prof_dissip_icosa_lmdz.f90 | ||
+ | icosa_lmdz.f90 phystd wrapper.f90 | ||
+ | </pre> | ||
+ | where | ||
+ | * icosa_lmdz.f90 is the main program which is in fact quite minimal as it only needs to set-up pointers for plugin routines and call DYNAMICO's ''icosa_init'' routine | ||
+ | * distrib_icosa_lmdz.f90 and wrapper.f90 are quite technical routines handling the parallelism and correspondances between physics and dynamics grids | ||
+ | * disvert_icosa_lmdz.f90 is the plugin (inherited from LMDZ.COMMON and follows the vertical coordinate and associated discretization choices made there) | ||
+ | * vert_prof_dissip_icosa_lmdz.f90 is the plugin (inherited from LMDZ.COMMON) to set the multiplicative coefficient along the vertical for lateral dissipation | ||
+ | |||
+ | === The ''src/phy*'' subdirectories === | ||
+ | These contain the interface to call the main physics driver from the Mars (''phymars''), Pluto (''phypluto''), Generic (''phystd'') or Venus (''phyvenus'') physics packages | ||
+ | |||
+ | == Compiling DYNAMICO with a PCM LMDZ.* physics package == | ||
Once you have downloaded DYNAMICO into the '''ICOSAGCM/''' folder, go to the [[ICOSA LMDZ directory layout and contents|ICOSA_LMDZ folder]] and compile there using one of the compile example files: | Once you have downloaded DYNAMICO into the '''ICOSAGCM/''' folder, go to the [[ICOSA LMDZ directory layout and contents|ICOSA_LMDZ folder]] and compile there using one of the compile example files: | ||
Line 19: | Line 69: | ||
# Gas Giants/generic: | # Gas Giants/generic: | ||
− | make_icosa_lmdz -p std -p_opt "-b 17x23" -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full | + | make_icosa_lmdz -p std -p_opt "-b 17x23" -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps |
# Venus: | # Venus: | ||
− | #make_icosa_lmdz -p venus -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full | + | #make_icosa_lmdz -p venus -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps |
# Mars: | # Mars: | ||
− | # make_icosa_lmdz -p mars -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full | + | # make_icosa_lmdz -p mars -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps |
# Pluto: | # Pluto: | ||
− | # make_icosa_lmdz -p pluto -p_opt "-b 17x23" -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full | + | # make_icosa_lmdz -p pluto -p_opt "-b 17x23" -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 41: | Line 91: | ||
and then link everything in the '''ICOSA_LMDZ/bin''' folder, under the name of the executable '''icosa_lmdz.exe'''. | and then link everything in the '''ICOSA_LMDZ/bin''' folder, under the name of the executable '''icosa_lmdz.exe'''. | ||
− | If you use the ''' -nodeps''' option, XIOS and IOIPSL will *not* be compiled. | + | If you use the ''' -nodeps''' option, XIOS and IOIPSL will *not* be compiled (you should therefore follow the corresponding pages for their installation). |
The script should stop at each step of the compilation if it fails (for example the compilation of the physics package). | The script should stop at each step of the compilation if it fails (for example the compilation of the physics package). | ||
Line 68: | Line 118: | ||
And you can set the '''new_path''' found (without '''netcdf_par.h''') like this: | And you can set the '''new_path''' found (without '''netcdf_par.h''') like this: | ||
<pre> | <pre> | ||
− | NETCDF_INCDIR=" | + | NETCDF_INCDIR="-Inew_path" |
+ | </pre> | ||
+ | You should probably do this for the lib too: | ||
+ | <pre> | ||
+ | NETCDF_LIBDIR="-L/path/to/libnetcdf_mpi.so" | ||
</pre> | </pre> | ||
Line 74: | Line 128: | ||
You will now need to find the <font color="green">.xml</font> files specific to your physics package, hopefully found in the <font color="green">deftank/</font> folder of each package (for example LMDZ.PLUTO/deftank/dynamico). | You will now need to find the <font color="green">.xml</font> files specific to your physics package, hopefully found in the <font color="green">deftank/</font> folder of each package (for example LMDZ.PLUTO/deftank/dynamico). | ||
+ | |||
+ | To transform an initial state ([[The start.nc and startfi.nc input files|start.nc and startfi.nc]]) from LMDZ.* physics (lat x lon grid) to a [[dynamico]] initial state (icosahedral grid), please follow the tutorial here: [[LMDZ to DYNAMICO start files]]. | ||
Please refer to | Please refer to | ||
Line 89: | Line 145: | ||
[[Category:DYNAMICO]] | [[Category:DYNAMICO]] | ||
[[Category:Generic-DYNAMICO]] | [[Category:Generic-DYNAMICO]] | ||
+ | [[Category:Mars-DYNAMICO]] | ||
+ | [[Category:Venus-DYNAMICO]] | ||
+ | [[Category:Pluto-DYNAMICO]] |
Latest revision as of 14:28, 19 December 2024
This page describes the compilation procedure for the coupling between the DYNAMICO dynamical core and the PCM LMDZ.* physics packages. It describes the directory structure of the ICOSA_LMDZ directory which contains the interface. Please read the DYNAMICO installation process first.
Contents
The ICOSA_LMDZ directory
Once downloaded from the svn server, the ICOSA_LMDZ directory contents should be:
arch bld.cfg build clean compile_adastra-gnu compile_irene-amd make_icosa_lmdz src xml
Where the noteworthy elements are:
- The make_icosa_lmdz script, which is the master script to use to compile all components (DYNAMICO, physics package, the interface between the two and the IOIPSL and XIOS libraries).
To list available options, run "make_icosa_lmdz -h", which should return something like:
Usage : make_icosa_lmdz [options] -arch arch_name -p phys [-h] : help [-prod / -dev / -debug] : compilation mode: production (default) / developpement / debug . [-full] : recompile all code from scratch [-nodeps] : do not build dependencies (XIOS and IOIPSL libraries) -arch arch_name : target architecture [-arch_path path] : relative PATH to directory containing multi-model path and environment arch files -p phys : physics package (e.g. std , venus , mars, ...) [-p_opt "options"] : additional options for physics package [-parallel type] : parallelism (none|mpi|omp|mpi_omp) [-with_xios] : compile and link with XIOS (default) [-job num] : speed up compilation by using num simulateneous compilation steps (when possible)
Upon successful completion of the compilation step the bin subdirectory will contain the executable icosa_lmdz.exe
- Example scripts compile_adastra-gnu and compile_irene-amd which are wrappers to the make_icosa_lmdz script with a set of given options. The general idea here is that a user would likewise write his/her own wrapper script.
- The arch directory which contains architecture files used by the make_icosa_lmdz script
- The src directory which contains the source code for the interface
- The xml directory which contains an example of the iodef.xml file to use, along with related instructions to combining it with other xml file gathered from DYNAMICO and physics packages
The src subdirectory
This directory contains the source code for the interface, along with subdirectories related to each of the physics packages (currently Generic, Mars and Venus). More general code, i.e. which apply to all the physics packages, such as plugins for the vertical discretization or dissipation factors are located at this level. In practice that directory currently contains:
distrib_icosa_lmdz.f90 phymars phyvenus disvert_icosa_lmdz.f90 phypluto vert_prof_dissip_icosa_lmdz.f90 icosa_lmdz.f90 phystd wrapper.f90
where
- icosa_lmdz.f90 is the main program which is in fact quite minimal as it only needs to set-up pointers for plugin routines and call DYNAMICO's icosa_init routine
- distrib_icosa_lmdz.f90 and wrapper.f90 are quite technical routines handling the parallelism and correspondances between physics and dynamics grids
- disvert_icosa_lmdz.f90 is the plugin (inherited from LMDZ.COMMON and follows the vertical coordinate and associated discretization choices made there)
- vert_prof_dissip_icosa_lmdz.f90 is the plugin (inherited from LMDZ.COMMON) to set the multiplicative coefficient along the vertical for lateral dissipation
The src/phy* subdirectories
These contain the interface to call the main physics driver from the Mars (phymars), Pluto (phypluto), Generic (phystd) or Venus (phyvenus) physics packages
Compiling DYNAMICO with a PCM LMDZ.* physics package
Once you have downloaded DYNAMICO into the ICOSAGCM/ folder, go to the ICOSA_LMDZ folder and compile there using one of the compile example files:
- compile_adastra-gnu
- compile_irene-amd
It might be wise to make a copy, i.e.:
cp compile_adastra-gnu compile
You can then edit the file to match your architecture (the arch parameter). The file should look like this:
arch=ifort_MESOIPSL # change according to your arch file
# Gas Giants/generic:
make_icosa_lmdz -p std -p_opt "-b 17x23" -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps
# Venus:
#make_icosa_lmdz -p venus -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps
# Mars:
# make_icosa_lmdz -p mars -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps
# Pluto:
# make_icosa_lmdz -p pluto -p_opt "-b 17x23" -parallel mpi -arch ${arch} -arch_path ../ARCH -job 8 -full -nodeps
You can change the options such as the parallel version you will use (-parallel mpi or mpi_omp) and the parameters for the physics package (with the -p_opt options (for example -b 17x23 to specify a spectral resolution), these are the option of The makelmdz fcm GCM Compilation Script).
Using the -full option, the script make_icosa_lmdz will recompile from scratch:
and then link everything in the ICOSA_LMDZ/bin folder, under the name of the executable icosa_lmdz.exe.
If you use the -nodeps option, XIOS and IOIPSL will *not* be compiled (you should therefore follow the corresponding pages for their installation).
The script should stop at each step of the compilation if it fails (for example the compilation of the physics package).
You can also compile each step on its own and remove the -full option (you can keep the -nodeps option) (please click on each package name for explanations on how to install it).
Known issues
If you obtain an error of the type:
XIOS/src/io/netcdf.hpp:20:12: fatal error: netcdf_par.h: Aucun fichier ou dossier de ce nom 20 | # include <netcdf_par.h> | ^~~~~~~~~~~~~~ compilation terminated.
This is due to the parallel version of netcdf not being recognized by the compilation module, typically for XIOS. In that case, please open the arch.path file used by the module and change the path pointing to netcdf_par.h. The default path should look like this:
NETCDF_INCDIR="$(nc-config --cflags) $(nf-config --fflags) -I/usr/lib/x86_64-linux-gnu/netcdf/mpi/include"
You can find the path where netcdf_par.h is located via:
locate netcdf_par.h
And you can set the new_path found (without netcdf_par.h) like this:
NETCDF_INCDIR="-Inew_path"
You should probably do this for the lib too:
NETCDF_LIBDIR="-L/path/to/libnetcdf_mpi.so"
Running DYNAMICO with a physics package
You will now need to find the .xml files specific to your physics package, hopefully found in the deftank/ folder of each package (for example LMDZ.PLUTO/deftank/dynamico).
To transform an initial state (start.nc and startfi.nc) from LMDZ.* physics (lat x lon grid) to a dynamico initial state (icosahedral grid), please follow the tutorial here: LMDZ to DYNAMICO start files.
Please refer to
for the specific details over each physics package.