source: trunk/LMDZ.COMMON/libf/evolution/deftank/README @ 3959

Last change on this file since 3959 was 3958, checked in by jbclement, 3 months ago

PEM:
Checking if a PCM run length is one Martian year + Changing instruction from "run" to "year" to be clearer.
JBC

File size: 8.5 KB
RevLine 
[3858]1   *    .          .   +     .    *        .  +      .    .       .     
2            +         _______  ________  ____    ____      *           +
3  +   .        *     |_   __ \|_   __  ||_   \  /   _|          .       *
4           .     .     | |__) | | |_ \_|  |   \/   |  *        *      . 
5        .              |  ___/  |  _| _   | |\  /| |      .        .     
6 .  *          *      _| |_    _| |__/ | _| |_\/_| |_                  *
7             +       |_____|  |________||_____||_____|   +     .         
8   .      *          .   *       .   +       *          .        +      .
9
10   
[3861]11This folder contains all the files needed to run and work with the Planetary Evolution Model (PEM).
[2963]12
[3861]13Information:
14------------
15For further explanations about the PEM, see following website: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/PEM_(Planetary_Evolution_Model).
16
17Installation:
18-------------
19The PEM can be downloaded alongside the "LMDZ.COMMON" repository of your trunk. The Fortran code is in the following directory: "trunk/LMDZ.COMMON/libf/evolution/". The two PEM programs are "pem.F90" and "reshape_XIOS_output.F90".
20
21Compilation:
22------------
23To compile the PEM, in "LMDZ.COMMON", do: ./makelmdz_fcm -arch [local] -p [planet] -d [dimensions] -j 8 pem
[3938]24Options with example:
[3861]25    1) [local]     : root name of arch files, assuming that they have been set up for your configuration;
[3938]26    2) [planet]    : mars to use the Mars planet physics package;
27    3) [dimensions]: 64x48x54 to define the grid you want to use  (longitude x latitude x atmospheric layers).
[3861]28To run the PEM, you need a dedicated reshaping tool with consistent options. To compile it, in "LMDZ_COMMON", do: ./makelmdz_fcm -arch [local] -p [planet] -d [dimensions] -j 8 reshape_XIOS_output
[3958]29To run the PEM, you also need a PCM working with XIOS and consistent options. To compile it, in "LMDZ.COMMON", do: ./makelmdz_fcm -arch [local] -p [planet] -parallel mpi_omp -io xios -d [dimensions] -j 8 gcm
[3861]30After compilation, the executable file can be found in the "bin" sub-directory.
31
32Usage:
33------
[3938]34To run a PEM simulation, do: ./launchPEM.sh [options]
35Options:
36    1) None: to start a simulation from scratch;
37    2) 're': to relaunch a simulation from a starting point (interactive prompt).
[3861]38
[3938]39The Bash file ''launchPEM.sh'' is the master script to launch the PEM chained simulation. It checks if necessary files and required options for your simulation are ok.
40
[3861]41Requirements:
42-------------
[3938]43To run the PEM, you can create a folder in which you need the following files:
44    > your executable files for the PCM, the PEM and the reshaping tool with consistent options;
45    > the xml files for XIOS which can be found in the PCM deftank folder: "iodef.xml", "context_lmdz_physics.xml", "file_def_physics_mars.xml" and "field_def_physics_mars.xml";
46    > the def files you want to run the PCM: "run.def", "callphys.def", "traceur.def", etc.
[3861]47      /!\ Do not forget to rename the PCM "run.def" into "run_PCM.def";
[3938]48    > the starting files you want to run the PCM: "startfi.nc", "start.nc"/"start1D.txt"/profiles;
49    > the necessary PEM files: "launchPEM.sh", "lib_launchPEM.sh", "PCMrun.job", "PEMrun.job", "run_PEM.def" and "obl_ecc_lsp.asc";
50    > the optional PEM files: "diagpem.def" to define the PEM variables to be ouputted and "startpem.nc" to set the initial state of the PEM.
[3861]51
[3938]52The PEM files can be found in the deftank folder.
53
54Before a simulation, you have to set up some parameters/options in:
55    > "launchPEM.sh";
56    > "PCMrun.job";
57    > "PEMrun.job";
58    > def files, especially for "run_PEM.def", "run_PCM.def", "callphys.def".
59In addition, the user has to provide a "startfi.nc" whose orbital parameters are consistent with the initial date set in "run_PEM.def". The script "inipem_orbit.sh" can do it automatically with "obl_ecc_lsp.asc".
60
[3861]61Outputs:
62--------
63The PEM simulation generates the following files:
[3938]64    > the usual outputs of the PCM: "restartfi.nc", "restart.nc", "diagfi.nc", etc;
65    > the XIOS outputs of the PCM, then reshaped: "Xdiurnalave.nc"/"data2reshape*.nc"/"data_PCM_Y*.nc";
66    > the outputs of the chained simulation: "launchPEM.log", "info_PEM.txt" and possibly "kill_launchPEM.sh";
67    > the usual outputs of the PEM: "restartfi.nc", "restart.nc"/"restart1D.txt" and "diagpem.nc".
[3861]68During the simulation, the PCM/PEM run files are renamed conveniently and stored in the sub-directories "logs" (log files), "starts" (starting files) and "diags" (diagnostic files).
69If you run a simulation by submitting jobs, the script "kill_launchPEM.sh" is automatically generated. It can be used to kill in the queue of the job scheduler the jobs related to your chained simulation.
70
71Deftank files:
72--------------
[3349]73# launchPEM.sh:
[3096]74  Bash script file to launch the chained simulation of PEM and PCM runs.
[3038]75  The user has to specify:
[3861]76      > n_mars_years, n_earth_years -> the number of Mars/Earth years to be simulated in total (> 0);
[3958]77      > nPCM_ini -> the number of initial PCM years (>= 2);
78      > nPCM -> the number of PCM years between each PEM run (>= 2, usually 2);
79      > counting -> the counting method for the number of years to be simulated (0 = "only PEM years count"; any other values = "PCM years are taken into account"). The former option is the usual one;
[3861]80      > mode -> the launching mode (0 = "processing scripts"; any other values = "submitting jobs"). The former option is usually used to process the script on a local machine while the latter is used to submit jobs on a supercomputer with SLURM or PBS/TORQUE.
[3349]81  The script can take an argument:
[3938]82      1) None: to start a simulation from scratch;
83      2) 're': to relaunch a simulation from a starting point (interactive prompt).
[2963]84
[3349]85# liblaunchPEM.sh:
86  Library of bash functions used by the PEM launching script "launchPEM.sh".
87
[3394]88# PCMrun.job:
[3938]89  Bash script file to submit a PCM job (with SLURM or PBS/TORQUE).
90  The user has to specify:
91      > The headers correspond to the ADASTRA supercomputer and should be changed for other machines and job schedulers. In case of "processing scripts" launching mode, the headers are naturally omitted.
92      > The path to source the arch file should be adapted to the machine.
93      > The name of the PCM executable file should be adapted.
94      > The execution command should also be adapted according to the set-up.
[2963]95
[3394]96# PEMrun.job:
[3938]97  Bash script file to submit PEM job (with SLURM or PBS/TORQUE).
98  The user has to specify:
99      > The headers correspond to the ADASTRA supercomputer and should be changed for other machines and job schedulers. In case of "processing scripts" launching mode, the headers are naturally omitted.
100      > The path to source the arch file should be adapted to the machine.
101      > The name of the PEM and Reshaping executable files should be adapted.
102      > The PEM executable can have an optional argument which should be specified according to the set-up ("--auto-exit" for SLURM and PBS/TORQUE | "" when the script is not run as a job).
[3349]103
[3038]104# run_PEM.def
105  All the possible parameters to define a PEM run (read in "conf_pem.F90").
[3096]106  It needs to be included in "run_PCM.def" with "INCLUDEDEF=run_PEM.def".
[2963]107
[3858]108# obl_ecc_lsp.asc [default], obl_ecc_lsp_pos.asc [future years]
109  Files describing orbital parameters for Mars from Laskar's data. It contains the Earth year (kyr) and the corresponding obliquity (°), eccentricity and Ls of perihelion (°).
[3038]110
111# modify_startfi_orbit.sh:
[3861]112  Bash script file to modify orbital parameters in the file "startfi.nc". They should be consistent with Laskar's data in "obl_ecc_lsp.asc" at the same date if orbital parameters are meant to vary during the simulation. See also "inipem_orbit.sh".
[3038]113
[3349]114# modify_startfi_var.sh:
115  Bash script file to modify the value of a variable in a file "startfi.nc".
116
117# inipem_orbit.sh:
[3861]118  Bash script file to set the orbital parameters of a file "startfi.nc" from Laskar's data contained in "obl_ecc_lsp.asc" according to the initial date 'year_earth_bp_ini' defined in "run_PEM.def". See also "modify_startfi_orbit.sh".
[3349]119
[3883]120# concat_pem.py:
121  Python script file to concatenate the NetCDF files of the PEM along the dimension 'Time' into one NetCDF file. 'Time' is re-indexed by increment.
[3088]122
[3351]123# clean.sh:
[3579]124  Bash script file to clean the folder after a PEM simulation and reset the initial starting files to prepare a new simulation.
[3351]125
[3460]126# multiple_exec.sh:
[3579]127  Bash script file to execute multiple scripts in subdirectories. It is useful to launch multiple simulations at once.
[3460]128
129# visu_layering.py:
[3349]130  Python script file to output the stratification data from the "startpem.nc" files.
131
[3460]132# visu_evol_layering.py:
133  Python script file to output the stratification data over time from the "startpem.nc" files.
Note: See TracBrowser for help on using the repository browser.