Changeset 261 for trunk/MESOSCALE_DEV


Ignore:
Timestamp:
Aug 4, 2011, 8:39:55 PM (13 years ago)
Author:
aslmd
Message:

MESOSCALE: user manual. a decent complete version. needs to be read again. also moved python graphical scripts to /home/aymeric/Science/MODELESMESOSCALELMD_MM_MARS/SRC/PYTHON so that it is available to users (and not only developers)

Location:
trunk/MESOSCALE_DEV/MANUAL/SRC
Files:
2 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE_DEV/MANUAL/SRC/advance.tex

    r258 r261  
    124124%%             mars = 11  ---> cycle de l'eau + poussieres [1+3] [NOUVELLE PHYS seulement]
    125125%% LES LES
     126
     127
     128\clearemptydoublepage
  • trunk/MESOSCALE_DEV/MANUAL/SRC/faq.tex

    r257 r261  
    3535\begin{finger}
    3636\item Try to lower the number of grid points (either horizontal or vertical) or consider using parallel computations where computations over the model grid will be split over several processors.
     37\end{finger}
     38
     39\sk
     40\noindent \textbf{I am afraid I explored a given compilation directory in \ttt{\$MMM} (say \ttt{g95\_32\_single} and broke something, e.g. deleted some links or break some links. The model does not compile anymore.}
     41\begin{finger}
     42\item Delete the corresponding compilation directory. Since it is mostly filled with symbolic links, you will only lose previously the compiled executables and the (possibly modified) \ttt{Registry.EM}. Save those files prior to deletion of the compilation directory if you would like to keep those. Then run again \ttt{makemeso} for the same combination of compiler/system and a new clean version of the compilation directory will reappear, while the model executables are recompiled from scratch.
     43\end{finger}
     44
     45\sk
     46\noindent \textbf{I update the model's sources through \ttt{svn update} and the compilation failed with a new version}
     47\begin{finger}
     48\item It rarely happens that we move, create or delete some files in \ttt{\$MMM/SRC} while developing new capabilities or bug fixes for the model -- and commit the changes to the reference version of the model. Please apply the solution proposed in the previous point and the model would be able to compile. The need to do so can be anticipated by having a look to commit log through the command \ttt{svn log}.
    3749\end{finger}
    3850
     
    8193\end{finger}
    8294
    83 \sk
     95\mk
    8496\section{Runtime}
    8597
     
    95107\item Please check all outputs from \ttt{wrf.exe}: information log and \ttt{wrfout*} files. It is usually possible to find hints about the problem(s) which make the model become unstable or crash. Sometimes it is just one file that is missing. If \ttt{cfl} warnings are reported in information log, it is probably a good idea to lower the timestep, but this will not fix the problem all the time especially if there are wrong settings and subsequent physical inconsistencies. If everything looks fine in the information log, try to lower \ttt{history\_interval} to $1$ in \ttt{namelist.input} so that much frequent outputs can be obtained in the \ttt{wrfout*} files and the problem can be further diagnosed through analyzing simulated meteorological fields.
    96108\end{finger}
     109
     110\clearemptydoublepage
  • trunk/MESOSCALE_DEV/MANUAL/SRC/guide.tex

    r257 r261  
    120120%\mk
    121121%\section{Examples of parameter files}
     122
     123\clearemptydoublepage
  • trunk/MESOSCALE_DEV/MANUAL/SRC/installation.tex

    r245 r261  
    1 \chapter{Installing the model}
     1\chapter{Installing the model}\label{install}
    22
    33\vk
  • trunk/MESOSCALE_DEV/MANUAL/SRC/postproc.tex

    r258 r261  
    11\chapter{Post-processing}\label{postproc}
    22
     3\vk
     4In this chapter, the user is introduced to the principles of choosing the outputs from the LMD Martian Mesoscale Model. Elements about post-processing are also proposed here, although it is obviously left to the user to choose and develop its own tools to analyzing the results of LMD Martian Mesoscale Model computations.
    35
    4 %\mk
    5 %\section{Controlling which fields to output}
     6\mk
     7\section{Controlling which fields to output in \ttt{wrfout} files}
    68
    7 %\scriptsize
    8 %\codesource{Registry.EM.extract}
    9 %\normalsize
    10 %
    11 %ne pas déclarer un 2D en 3D et cioce versa
    12 %FAIRE registry.bash UNEFOISFINI
     9\sk
     10All non-local variables communicated within subroutines and functions in the WRF dynamical core are declared in a text file named \ttt{Registry.EM} located in \ttt{\$MMM/SRC/WRFV2/Registry}. In this file, each useful variable is declared through a one-line instance organized as follows:
     11\scriptsize
     12\begin{verbatim}
     13state  real  PSFC  ij  misc  1  -  i01rh  "PSFC"  "SFC PRESSURE"  "Pa"
     14\end{verbatim}
     15\normalsize
     16The fields which appears in \ttt{wrfout*} output files feature an \ttt{h} (which stands for history) in the 8th column. If you do not want the field to appear in \ttt{wrfout*} files, simply remove the letter \ttt{h} from the group of letters in the 8th column. If you want the field to appear in \ttt{wrfout*} files, simply add the letter \ttt{h} in the group of letters in the 8th column. 
    1317
    14 %\mk
    15 %\section{Interpolating outputs on altitude and pressure levels}\label{postproc}
    16 %\ttt{api}
     18\sk
     19It is also possible to output fields which are present only in the physical computations, i.e. appearing in \ttt{\$MMM/SRC/WRFV2/mars\_lmd/libf/phymars/physiq.F}. The method is simple. Assume you would like to output in the \ttt{wrfout*} files a 3D field named \ttt{zdtnirco2} and a 2D field named \ttt{qsurfice} in \ttt{physiq.F} with the new names \ttt{HR\_NIR} and \ttt{QSURFICE}. All you have to do is add the following lines to \ttt{Registry.EM} (see also examples around lines \ttt{75-120}. For 2D [3D] files the 4th column must be \ttt{ij} [\ttt{ikj}] and the 12th column \ttt{\#SAVEMARS2} [\ttt{\#SAVEMARS3}].
     20\scriptsize
     21\begin{verbatim}
     22state  real  HR_NIR  ikj  misc  1  -  rhd  "HR_NIR"  "HEATING RATE nirco2"  "K/s"  #SAVEMARS3  zdtnirco2
     23state  real  QSURFICE  ij  misc  1  -  rhd  "QSURFICE"  "WATER ICE AT SURFACE"  "kg m-2"  #SAVEMARS2  qsurfice
     24\end{verbatim}
     25\normalsize
    1726
    18 %\mk
    19 %\section{Generating maps for winds and meteorological fields}\label{plots}
     27\sk
     28Each change in \ttt{Registry.EM} must be followed by a complete recompilation because the model variables have changed. If you use \ttt{makemeso}, please answer \ttt{y} to the question \scriptsize \ttt{Did you modify anything in the Registry or clean ?} \normalsize. If you use \ttt{runmeso}, please use it with option \ttt{-r} to force recompiling with a new/updated list of variables.
    2029
    21 %\ttt{python}
    22 %\ttt{idl} ?
     30\sk
     31\begin{finger}
     32\item IMPORTANT: Each compilation directory \ttt{your\_compdir} in \ttt{\$MMM} (e.g. \ttt{g95\_32\_single}) has its own copy of \ttt{Registry.EM} in \ttt{your\_compdir/WRFV2/Registry}. This is the file that has to be modified. The file \ttt{\$MMM/SRC/WRFV2/Registry/Registry.EM} should not be modified: it is the reference file that is copied when the compilation directory is built by the \ttt{copy\_model} script (cf. section~\ref{sc:makemeso}).
     33\end{finger}
     34
     35\mk
     36\section{Interpolating outputs on altitude and pressure levels}
     37
     38\sk
     39The fields output in \ttt{wrfout*} files are given for each grid point and model levels. A vertical interpolation has to be performed to get those fields either in altitude or pressure levels. In addition, perturbation potential temperature \ttt{T}, x-component wind \ttt{U} and y-component \ttt{V} are output instead of the more informative (meteorogically-speaking) temperature \ttt{tk}, zonal wind \ttt{Um} and meridional wind \ttt{Vm}. This is why we developed a program named \ttt{api} (Altitude and Pressure Interpolator) which performs the tasks to convert the netCDF \ttt{wrfout*} files into another netCDF file featuring useful fields for making plots and analyzing the Martian mesoscale meteorology more easily than raw \ttt{wrfout*} files.
     40
     41\sk
     42The useful source files are located in \ttt{\$MMM/SRC/POSTPROC/}. The program \ttt{api.F90} has to be compiled with the \ttt{comp\_api} command (which must be edited first to uncomment the line corresponding to the Fortran compiler you are used to). Then the user has to fill in the parameter file \ttt{namelist.api} (a commented example is given below, but many examples can be found in \ttt{\$MMM/SRC/POSTPROC/}) before launching the interpolator through the command \ttt{api}. The calculations might be long if you are asking for many fields and many interpolation levels. In the example below, temperature, meteorological winds and vertical velocity will be interpolated at~$50$~m above the local surface. The results are output in a netCDF file having the same name as the input \ttt{wrfout*} files, with an additional suffix which depends on the chosen interpolation method.
     43
     44\scriptsize
     45\codesource{namelist.api}
     46\normalsize
     47
     48\mk
     49\section{Generating maps for winds and meteorological fields}\label{plots}
     50
     51\sk
     52\subsection{General remarks}
     53
     54\sk
     55This section does not replace the need for you to develop your own plotting tools to suit your needs, which should be not too difficult. The model outputs, as well as the results of \ttt{api} interpolations, are written using the netCDF format which can be read by most software which features graphical capabilities. For a quick inspection of model results (especially for checking model outputs while the model is running), we recommend using \ttt{ncview}; for simple manipulations of netCDF files (e.g. concatenation, difference, extraction, \ldots), we recommend using commands from the \ttt{nco} package (see chapter~\ref{install} for website links). Graphical routines based on \ttt{idl} (most graphics in the published papers to date about the LMD Martian Mesoscale Model makes use of this software), \ttt{ferret} and \ttt{grads} can be made available upon request (as is, i.e. undocumented yet commented scripts). Successful reading/plotting of the LMD Martian Mesoscale Model outputs on \ttt{matlab}, \ttt{octave}, \ttt{idv} have also been reported to us. It is also possible to import the model's outputs to Geographical Information System (GIS) such as \ttt{arcgis}. Note that \ttt{idl}, \ttt{matlab} and \ttt{arcgis} are commercial applications.
     56
     57\sk
     58\subsection{Python scripts}
     59
     60\sk
     61Powerful scripts based on \ttt{python+numpy+matplotlib} have been recently developed to obtain plots from the mesoscale model outputs. All figures in this user manual are based on these scripts. Those scripts can be found in \ttt{\$MMM/SRC/PYTHON}: \ttt{domain.py} and \ttt{winds.py} (more scripts will be added in the future). It is required that \ttt{python} and numerical+graphical librairies (\ttt{numpy}, \ttt{scipy}, \ttt{matplotlib}, \ttt{basemap}, \ttt{netcdf} are installed on your system. Perhaps the simplest way to do so is to install the user-friendly \ttt{epd} complete python distribution (cf. link in chapter~\ref{install}). One of the advantages of an approach using \ttt{python}, apart from its open-source philosophy and the abundant online documentation, is that in a common framework it allows for scripting with various options, integrating Fortran routines, manipulating arrays, making plots with various map projections. This is exemplified by the \ttt{winds.py} script we developed: it can perform interpolation with \ttt{api} for the level requested by the user, then generate a map, all that in one simple command line. For instance, Figures~\ref{arsia} in chapter~\ref{compile} has been generated by the following two commands:
     62
     63\scriptsize
     64\begin{verbatim}
     65domain.py -f wrfout_d01_2024-01-17_02:00:00
     66winds.py -f wrfout_d01_2024-01-17_02:00:00 -i 4 -l 0.01 -v HGT -n -1 -m -1500. -M 20000. -s 2
     67\end{verbatim}
     68\normalsize
     69
     70Many options can be used in our \ttt{python} scripts. The example of command \ttt{winds.py} at the time of writing is listed below; this information can be obtained by typing \ttt{winds.py -h}. This script can also be easily edited to suit your needs if the option you would need does not exist.
     71
     72\scriptsize
     73\codesource{winds.py.help}
     74\normalsize
     75
     76\begin{finger}
     77\item Please ensure that you have the rights to execute \ttt{domain.py} and \ttt{winds.py} (otherwise use the \ttt{chmod} command). It is also necessary to set the following environment variables to ensure the commands \ttt{winds.py} or \ttt{domain.py} would execute in any working directory
     78\begin{verbatim}
     79PYTHONPATH=$MMM/SRC/PYTHON/
     80export PYTHONPATH
     81PATH=$PYTHONPATH:$PATH
     82\end{verbatim}
     83\item The option \ttt{-i} in \ttt{winds.py} make use of the Fortran routine \ttt{api.F90} (and the routine \ttt{time.F} is also needed). This routine has to be converted to a \ttt{python} command using \ttt{f2py}. Please execute the script amongst \ttt{api\_g95.sh}, \ttt{api\_ifort.sh}, \ttt{api\_pgf90.sh} which corresponds to the Fortran compiler installed on your system. Check for errors/warnings in the log files and ensure that the two files \ttt{api.so} and \ttt{timestuff.so} are generated.
     84\end{finger}
     85
     86\clearemptydoublepage
  • trunk/MESOSCALE_DEV/MANUAL/SRC/user_manual.tex

    r258 r261  
    4040%Institut Pierre Simon Laplace\\
    4141Universit\'e Pierre et Marie Curie, Paris, France\\
     42\mbox{}\\
     43\large \today \normalsize
    4244\end{center}
    4345\end{titlepage}
     
    9496\include{guide}
    9597\include{advance}
    96 %\include{postproc}
     98\include{postproc}
    9799\include{faq}
    98100
Note: See TracChangeset for help on using the changeset viewer.