Changeset 2206 for trunk/LMDZ.MARS/doc


Ignore:
Timestamp:
Jan 7, 2020, 3:55:33 PM (5 years ago)
Author:
adelavois
Message:

Mars GCM:
Correction of Mars GCM utility:

Variables declaration changed in order to be compiled with ifort (modification of r2204)

Manual User Update:

Old stuff removed from part4: Running the model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/doc/run.tex

    r1954 r2206  
    9494
    9595\section{Installing the model}
    96 There are two distinct ways of installing/compiling the model:
    97 One (nowdays depreciated) using scripts in the {\tt LMDZ.MARS}
    98 directory, and the other (encouraged because one can then also
    99 run the model on parallel computers) in the {\tt LMDZ.COMMON} directory
    100 
    101 \subsection{Settings in LMDZ.MARS (depreciated)}
    102 \begin{description}
    103 %\item {\bf -} Copy the basic model directory LMDZ.MARS to your account
    104 %(the contents of this directory are described in chapter \ref{loc:contenu}).
    105 
    106 \item {\bf -} Set some environment variables needed for the compilation
    107        of the model (it is also possible to set the environment
    108        variables in the {\tt makegcm} script, as explained below):
    109   \begin{description}
    110   \item {\bf LMDGCM} : Path to the directory where you have put the model
    111   (full path).\\
    112   If using Csh:
    113   \begin{verbatim}
    114   setenv  LMDGCM /where/you/put/the/model/LMDZ.MARS
    115   \end{verbatim}
    116   If using Bash:
    117   \begin{verbatim}
    118   export  LMDGCM=/where/you/put/the/model/LMDZ.MARS
    119   \end{verbatim} 
    120   \item {\bf LIBOGCM} : Path to the directory
    121   ({\tt libo} for example) where intermediate objects will be stored
    122   during the compilation of the model with the {\tt makegcm} script
    123   (if that directory does not
    124   exist then {\tt makegcm} will create it).\\
    125   If using Csh:
    126   \begin{verbatim}
    127   setenv  LIBOGCM /where/you/want/objects/to/go/libo
    128   \end{verbatim}
    129   If using Bash:
    130   \begin{verbatim}
    131   export  LIBOGCM=/where/you/want/objects/to/go/libo
    132   \end{verbatim}
    133   \end{description}
    134 
    135 \item {\bf -} Knowing where your NetCDF library is installed,
    136  set environment variables  {\bf NCDFINC} and {\bf NCDFLIB}:
    137 
    138   \begin{description}
    139   \item Once the NetCDF library has been compiled (or downloaded),
    140   you should have access to the library {\tt libnetcdf.a} itself,
    141   the various files ({\tt netcdf.inc}, {\tt netcdf.mod}, ...)
    142   to include in programs, and basic NetCDF software ({\it ncdump}
    143   and {\it ncgen}).
    144 
    145   \item To ensure that during compilation, the model can find the
    146   NetCDF library and include files,
    147   you must declare environment variables {\bf NCDFLIB} and {\bf NCDFINC}
    148   (again, it is also possible to set these environment
    149       variables in the {\tt makegcm} script, as explained below).
    150 
    151   \item {\bf NCDFLIB} must contain the path to the directory containing
    152    the object library {\tt libnetcdf.a}
    153    and {\bf NCDFINC} must contain the path to the directory containing
    154    the include files ({\tt netcdf.inc},...)\\
    155   If using Csh:
    156   \begin{verbatim}
    157   setenv NCDFINC /wherever/is/netcdf/include
    158   setenv NCDFLIB /wherever/is/netcdf/lib
    159   \end{verbatim}
    160   If using Bash:
    161   \begin{verbatim}
    162   export NCDFINC=/wherever/is/netcdf/include
    163   export NCDFLIB=/wherever/is/netcdf/lib
    164   \end{verbatim}
    165   \end{description}
    166 
    167 \item {\bf -} Go to your {\tt LMDZ.MARS} and adapt the {\tt makegcm}
    168   script to fit your needs:
    169   \begin{itemize}
    170   \item Examples of {\tt makegcm} scripts, adapted for different compilers
    171   (pgf90, g95, gfortran and ifort) are provided (files {\tt makegcm},
    172   {\tt makegcm\_g95}, {\tt makegcm\_gfortran}, {\tt makegcm\_ifort}) copy or
    173   rename the relevant one as {\tt makegcm} in the same directory.
    174   \item As mentionned above, you may edit the script to hard code
    175   values of {\tt LMDGCM}, {\tt LIBOGCM}, {\tt NCDFINC} and {\tt NCDFLIB}
    176   instead of relying on the use of environment variables (see the commented out
    177   examples in the scripts at lignes 20-30). Note that since the {\tt
    178   makegcm} is a Csh script, Csh syntax must be used there.
    179   \end{itemize}
    180 
    181 \end{description}
    182 
    183 \subsection{Settings in LMDZ.COMMON (advised)}
     96Scripts for installation/compilation for the model are in the {\tt LMDZ.COMMON} directory
     97These scripts can also run the model on parallel computers.
    18498
    18599You should first compile the IOIPSL library which is used\footnote{It is in fact for now possible to run the GCM without the IOIPSL library but this requires adding the {\tt -io noioipsl} to the {\tt makelmdz\_fcm} command line, and might no longer be possible in the future.} by the GCM. To do this go to the {\tt LMDZ.COMMON/ioipsl} directory. There are a number of example scripts (depending on machines and compiler suites to use) to run to download and install the ioipsl library. As an illustrative example we detail here using the {\tt install\_ioipsl\_gfortran.bash} script:
     
    192106\section{Compiling the model}
    193107\label{sc:compile}
    194 \subsection{Compiling in LMDZ.MARS (depreciated)}
    195 \noindent As explained above, compiling the model is done
    196 using the {\tt makegcm} script and providing it with the appropriate
    197 options:
    198 \begin{itemize}
    199 \item Example 1: Compiling the Martian model at grid resolution 64x48x25
    200 for example, type (in compliance with the manual for the makegcm function
    201 given in section~\ref{sc:compil1})
    202 
    203 \begin{verbatim}
    204 makegcm -d 64x48x25 -p mars gcm
    205 \end{verbatim}
    206 
    207 \noindent
    208 You will find executable {\bf gcm.e} (the compiled model) in the directory
    209 where you ran the makegcm command.
    210 
    211 %{\bf -} Example 2: Compiling the Martian model with 3 tracers
    212 %(e.g. CO2, water vapour and ice to simulate the water cycle):
    213 %\begin{verbatim}
    214 %makegcm -d 64x48x25 -t 2 -p mars gcm
    215 %\end{verbatim}
    216 
    217 \item Example 2:
    218 Compiling the the Martian model with your choice of
    219 compiler options, e.g. to check for array overflow
    220 (useful for debugging: warning, the model is then much slower!):
    221 \begin{verbatim}
    222 makegcm -d 64x48x25 -p mars -O "-C" gcm
    223 \end{verbatim}
    224 Note that the {\tt makegcm} script also has a "debug" option which
    225 includes a collection of adequate debugging options. To use it,
    226 simply add the {\tt -debug} option:
    227 \begin{verbatim}
    228 makegcm -d 64x48x25 -p mars -debug gcm
    229 \end{verbatim}
    230 \end{itemize}
    231 
    232 \subsection{Compiling in LMDZ.COMMON (advised)}
    233108The Bash script {\tt makelmdz\_fcm} is used to compile the model.
    234109It needs not be modified or adapted to your settings, as all
     
    243118with the name used for your own arch files), and multiple options:
    244119\begin{itemize}
    245 \item Example 1: Compiling the Martian model at grid resolution 64x48x32
    246 \begin{verbatim}
    247 makelmdz_fcm -arch linux-ifort -d 64x48x29 -p mars gcm
    248 \end{verbatim}
    249 The executable, {\tt gcm\_64x48x29\_phymars\_seq.e} in the present case,
    250 will be generated in the {\tt bin} subdirectory.
     120\item Example 1: Compiling the Martian model at grid resolution 64x48x49
     121\begin{verbatim}
     122makelmdz_fcm -arch linux-ifort -d 64x48x49 -p mars gcm
     123\end{verbatim}
    251124\item Example 2: Compiling as above but in "debug" mode
    252125\begin{verbatim}
    253 makelmdz_fcm -arch linux-ifort -d 64x48x29 -p mars -debug gcm
     126makelmdz_fcm -arch linux-ifort -d 64x48x49 -p mars -debug gcm
    254127\end{verbatim}
    255128\item Example 3: Compiling the model to run in parallel (MPI) mode:
    256129\begin{verbatim}
    257 makelmdz_fcm -arch linux-ifort -parallel mpi -d 64x48x29 -p mars gcm
    258 \end{verbatim}
     130makelmdz_fcm -arch linux-ifort -parallel mpi -d 64x48x49 -p mars gcm
     131\end{verbatim}
     132This option is different from the -j option that determines the number of cores when compilation is run in parallel mode.
    259133\item For an overview of all available options:
    260134\begin{verbatim}
     
    323197\end{verbatim}
    324198
    325 
    326199You might also want to keep all messages and diagnotics written to standard
    327200output (i.e. the screen). You should then redirect the standard output
     
    330203gcm.e > gcm.out 2>&1
    331204\end{verbatim}
     205
     206If you want to use parallel mode (as MPI for instance), you should specify it as follow:
     207\begin{verbatim}
     208mpirun gcm.e > gcm.out 2>&1
     209\end{verbatim}
     210NB: The definition of parallel parameters, such as number of cores, is dependant on the machine used.
     211You should find examples of scripts within other simulations or machine user guides.
    332212
    333213
Note: See TracChangeset for help on using the changeset viewer.