507 |
% ../../../tools/genmake2 -mods=../code |
% ../../../tools/genmake2 -mods=../code |
508 |
\end{verbatim} |
\end{verbatim} |
509 |
The command line option tells {\em genmake} to override model source |
The command line option tells {\em genmake} to override model source |
510 |
code with any files in the directory {\em ./code/}. |
code with any files in the directory {\em ../code/}. |
511 |
|
|
512 |
On many systems, the {\em genmake2} program will be able to |
On many systems, the {\em genmake2} program will be able to |
513 |
automatically recognize the hardware, find compilers and other tools |
automatically recognize the hardware, find compilers and other tools |
514 |
within the user's path (``echo \$PATH''), and then choose an |
within the user's path (``echo \$PATH''), and then choose an |
515 |
appropriate set of options from the files contained in the {\em |
appropriate set of options from the files (``optfiles'') contained in |
516 |
tools/build\_options} directory. Under some circumstances, a user |
the {\em tools/build\_options} directory. Under some circumstances, a |
517 |
may have to create a new ``optfile'' in order to specify the exact |
user may have to create a new ``optfile'' in order to specify the |
518 |
combination of compiler, compiler flags, libraries, and other options |
exact combination of compiler, compiler flags, libraries, and other |
519 |
necessary to build a particular configuration of MITgcm. In such |
options necessary to build a particular configuration of MITgcm. In |
520 |
cases, it is generally helpful to read the existing ``optfiles'' and |
such cases, it is generally helpful to read the existing ``optfiles'' |
521 |
mimic their syntax. |
and mimic their syntax. |
522 |
|
|
523 |
Through the MITgcm-support list, the MITgcm developers are willing to |
Through the MITgcm-support list, the MITgcm developers are willing to |
524 |
provide help writing or modifing ``optfiles''. And we encourage users |
provide help writing or modifing ``optfiles''. And we encourage users |
542 |
upon which other files depend. The purpose of this is to reduce |
upon which other files depend. The purpose of this is to reduce |
543 |
re-compilation if and when you start to modify the code. The {\tt make |
re-compilation if and when you start to modify the code. The {\tt make |
544 |
depend} command also creates links from the model source to this |
depend} command also creates links from the model source to this |
545 |
directory. |
directory. It is important to note that the {\tt make depend} stage |
546 |
|
will occasionally produce warnings or errors since the dependency |
547 |
|
parsing tool is unable to find all of the necessary header files |
548 |
|
(\textit{eg.} \texttt{netcdf.inc}). In these circumstances, it is |
549 |
|
usually OK to ignore the warnings/errors and proceed to the next step. |
550 |
|
|
551 |
Next compile the code: |
Next compile the code: |
552 |
\begin{verbatim} |
\begin{verbatim} |
572 |
then an executable called \texttt{mitgcmuv} will now exist in the |
then an executable called \texttt{mitgcmuv} will now exist in the |
573 |
local directory. |
local directory. |
574 |
|
|
575 |
To run the model as a single process (ie. not in parallel) simply |
To run the model as a single process (\textit{ie.} not in parallel) |
576 |
type: |
simply type: |
577 |
\begin{verbatim} |
\begin{verbatim} |
578 |
% ./mitgcmuv |
% ./mitgcmuv |
579 |
\end{verbatim} |
\end{verbatim} |
587 |
\begin{verbatim} |
\begin{verbatim} |
588 |
% ./mitgcmuv > output.txt |
% ./mitgcmuv > output.txt |
589 |
\end{verbatim} |
\end{verbatim} |
590 |
|
In the event that the model encounters an error and stops, it is very |
591 |
|
helpful to include the last few line of this \texttt{output.txt} file |
592 |
|
along with the (\texttt{stderr}) error message within any bug reports. |
593 |
|
|
594 |
For the example experiments in {\em verification}, an example of the |
For the example experiments in {\em verification}, an example of the |
595 |
output is kept in {\em results/output.txt} for comparison. You can compare |
output is kept in {\em results/output.txt} for comparison. You can |
596 |
your {\em output.txt} with this one to check that the set-up works. |
compare your {\em output.txt} with the corresponding one for that |
597 |
|
experiment to check that the set-up works. |
598 |
|
|
599 |
|
|
600 |
|
|
601 |
\subsection{Output files} |
\subsection{Output files} |
602 |
|
|
603 |
The model produces various output files. At a minimum, the instantaneous |
The model produces various output files. Depending upon the I/O |
604 |
``state'' of the model is written out, which is made of the following files: |
package selected (either \texttt{mdsio} or \texttt{mnc} or both as |
605 |
|
determined by both the compile-time settings and the run-time flags in |
606 |
|
\texttt{data.pkg}), the following output may appear. |
607 |
|
|
608 |
|
|
609 |
|
\subsubsection{MDSIO output files} |
610 |
|
|
611 |
|
The ``traditional'' output files are generated by the \texttt{mdsio} |
612 |
|
package. At a minimum, the instantaneous ``state'' of the model is |
613 |
|
written out, which is made of the following files: |
614 |
|
|
615 |
\begin{itemize} |
\begin{itemize} |
616 |
\item \textit{U.00000nIter} - zonal component of velocity field (m/s and $> |
\item \textit{U.00000nIter} - zonal component of velocity field (m/s and $> |
658 |
used to restart the model but are overwritten every other time they are |
used to restart the model but are overwritten every other time they are |
659 |
output to save disk space during long integrations. |
output to save disk space during long integrations. |
660 |
|
|
661 |
|
|
662 |
|
|
663 |
|
\subsubsection{MNC output files} |
664 |
|
|
665 |
|
Unlike the \texttt{mdsio} output, the \texttt{mnc}--generated output |
666 |
|
is usually (though not necessarily) placed within a subdirectory with |
667 |
|
a name such as \texttt{mnc\_test\_\${DATE}\_\${SEQ}}. The files |
668 |
|
within this subdirectory are all in the ``self-describing'' netCDF |
669 |
|
format and can thus be browsed and/or plotted using tools such as: |
670 |
|
\begin{itemize} |
671 |
|
\item At a minimum, the \texttt{ncdump} utility is typically included |
672 |
|
with every netCDF install: |
673 |
|
\begin{rawhtml} <A href="http://www.unidata.ucar.edu/packages/netcdf/"> \end{rawhtml} |
674 |
|
\begin{verbatim} |
675 |
|
http://www.unidata.ucar.edu/packages/netcdf/ |
676 |
|
\end{verbatim} |
677 |
|
\begin{rawhtml} </A> \end{rawhtml} |
678 |
|
|
679 |
|
\item The \texttt{ncview} utility is a very convenient and quick way |
680 |
|
to plot netCDF data and it runs on most OSes: |
681 |
|
\begin{rawhtml} <A href="http://meteora.ucsd.edu/~pierce/ncview_home_page.html"> \end{rawhtml} |
682 |
|
\begin{verbatim} |
683 |
|
http://meteora.ucsd.edu/~pierce/ncview_home_page.html |
684 |
|
\end{verbatim} |
685 |
|
\begin{rawhtml} </A> \end{rawhtml} |
686 |
|
|
687 |
|
\item MatLAB(c) and other common post-processing environments provide |
688 |
|
various netCDF interfaces including: |
689 |
|
\begin{rawhtml} <A href="http://woodshole.er.usgs.gov/staffpages/cdenham/public_html/MexCDF/nc4ml5.html"> \end{rawhtml} |
690 |
|
\begin{verbatim} |
691 |
|
http://woodshole.er.usgs.gov/staffpages/cdenham/public_html/MexCDF/nc4ml5.html |
692 |
|
\end{verbatim} |
693 |
|
\begin{rawhtml} </A> \end{rawhtml} |
694 |
|
|
695 |
|
\end{itemize} |
696 |
|
|
697 |
|
|
698 |
\subsection{Looking at the output} |
\subsection{Looking at the output} |
699 |
|
|
700 |
All the model data are written according to a ``meta/data'' file format. |
The ``traditional'' or mdsio model data are written according to a |
701 |
Each variable is associated with two files with suffix names \textit{.data} |
``meta/data'' file format. Each variable is associated with two files |
702 |
and \textit{.meta}. The \textit{.data} file contains the data written in |
with suffix names \textit{.data} and \textit{.meta}. The |
703 |
binary form (big\_endian by default). The \textit{.meta} file is a |
\textit{.data} file contains the data written in binary form |
704 |
``header'' file that contains information about the size and the structure |
(big\_endian by default). The \textit{.meta} file is a ``header'' file |
705 |
of the \textit{.data} file. This way of organizing the output is |
that contains information about the size and the structure of the |
706 |
particularly useful when running multi-processors calculations. The base |
\textit{.data} file. This way of organizing the output is particularly |
707 |
version of the model includes a few matlab utilities to read output files |
useful when running multi-processors calculations. The base version of |
708 |
written in this format. The matlab scripts are located in the directory |
the model includes a few matlab utilities to read output files written |
709 |
\textit{utils/matlab} under the root tree. The script \textit{rdmds.m} reads |
in this format. The matlab scripts are located in the directory |
710 |
the data. Look at the comments inside the script to see how to use it. |
\textit{utils/matlab} under the root tree. The script \textit{rdmds.m} |
711 |
|
reads the data. Look at the comments inside the script to see how to |
712 |
|
use it. |
713 |
|
|
714 |
Some examples of reading and visualizing some output in {\em Matlab}: |
Some examples of reading and visualizing some output in {\em Matlab}: |
715 |
\begin{verbatim} |
\begin{verbatim} |
726 |
>> for n=1:11; imagesc(eta(:,:,n)');axis ij;colorbar;pause(.5);end |
>> for n=1:11; imagesc(eta(:,:,n)');axis ij;colorbar;pause(.5);end |
727 |
\end{verbatim} |
\end{verbatim} |
728 |
|
|
729 |
|
Similar scripts for netCDF output (\texttt{rdmnc.m}) are available. |