1 |
\section{CAL: The calendar package |
\subsection{CAL: The calendar package |
2 |
\label{sectioncal}} |
\label{sectioncal}} |
3 |
\begin{rawhtml} |
\begin{rawhtml} |
4 |
<!-- CMIREDIR:sectioncal: --> |
<!-- CMIREDIR:sectioncal: --> |
5 |
\end{rawhtml} |
\end{rawhtml} |
6 |
|
|
7 |
\textit{Christian Eckert, MIT/EAPS, May-2000} |
Authors: Christian Eckert and Patrick Heimbach |
8 |
|
|
9 |
This calendar tool was originally intended to enable the use of |
This calendar tool was originally intended to enable the use of |
10 |
absolute dates (Gregorian Calendar dates) in the ocean general |
absolute dates (Gregorian Calendar dates) in MITgcm. There is, |
11 |
circulation model MITgcmuv. There is, however, a fair amount of |
however, a fair number of routines that can be used independently of |
12 |
routines that can be used independently of the MITgcmuv. After |
the main MITgcm executable. After some minor modifications the whole |
13 |
some minor modifications the whole package can be used either |
package can be used either as a stand-alone calendar or in connection |
14 |
as a stand-alone calendar or in connection with any dynamical |
with any dynamical model that needs calendar dates. Some |
15 |
model that needs calendar dates. Some straightforward extensions |
straightforward extensions are still pending e.g. the availability of |
16 |
are still pending e.g. the availability of the Julian Calendar, |
the Julian Calendar, to be able to resolve fractions of a second, and |
17 |
to be able to resolve fractions of a second, and to have a time- |
to have a time- step that is longer than one day. |
|
step that is longer than one day. |
|
18 |
|
|
19 |
\subsection{Basic assumptions for the calendar tool} |
\subsubsection{Basic assumptions for the calendar tool} |
20 |
|
|
21 |
It is assumed that the SMALLEST TIME INTERVAL to be resolved is |
It is assumed that the SMALLEST TIME INTERVAL to be resolved is |
22 |
ONE SECOND. |
ONE SECOND. |
28 |
Not each individual routine depends on these assumptions; there |
Not each individual routine depends on these assumptions; there |
29 |
are only a few places where they enter. |
are only a few places where they enter. |
30 |
|
|
31 |
\subsection{Format of calendar dates} |
\subsubsection{Format of calendar dates} |
32 |
|
|
33 |
In this calendar tool a complete date specification is defined |
In this calendar tool a complete date specification is defined |
34 |
as the following integer array: |
as the following integer array: |
61 |
c refdate(4) = 1 |
c refdate(4) = 1 |
62 |
\end{verbatim} |
\end{verbatim} |
63 |
|
|
64 |
\subsection{Calendar dates and time intervals} |
\subsubsection{Calendar dates and time intervals} |
65 |
|
|
66 |
Subtracting calendar dates yields time intervals. |
Subtracting calendar dates yields time intervals. |
67 |
Time intervals have the following format: |
Time intervals have the following format: |
79 |
calendar dates. Time intervals can be added to and be |
calendar dates. Time intervals can be added to and be |
80 |
subtracted from each other. |
subtracted from each other. |
81 |
|
|
82 |
\subsection{Using the calendar together with MITgcm} |
\subsubsection{Using the calendar together with MITgcm} |
83 |
|
|
84 |
Each routine has as an argument the thread number that it is |
Each routine has as an argument the thread number that it is |
85 |
belonging to, even if this number is not used in the routine |
belonging to, even if this number is not used in the routine |
127 |
than checkpoint 25 which do not have the global variable |
than checkpoint 25 which do not have the global variable |
128 |
*nEndIter*. |
*nEndIter*. |
129 |
|
|
130 |
\subsection{The individual calendars} |
\subsubsection{The individual calendars} |
131 |
|
|
132 |
\subsubsection{Simple model calendar} |
Simple model calendar: |
133 |
|
|
134 |
This calendar can be used by defining |
This calendar can be used by defining |
135 |
|
|
142 |
In this case a year is assumed to have 360 days. The |
In this case a year is assumed to have 360 days. The |
143 |
model year is divided into 12 months with 30 days each. |
model year is divided into 12 months with 30 days each. |
144 |
|
|
145 |
\subsubsection{Gregorian Calendar} |
Gregorian Calendar: |
146 |
|
|
147 |
This calendar can be used by defining |
This calendar can be used by defining |
148 |
|
|
152 |
|
|
153 |
in the calendar's data file "data.cal". |
in the calendar's data file "data.cal". |
154 |
|
|
155 |
\subsection{Short routine description} |
\subsubsection{Short routine description} |
156 |
|
|
157 |
{\footnotesize |
{\footnotesize |
158 |
\begin{verbatim} |
\begin{verbatim} |
159 |
c o cal_Init - Initialise the calendar. This is the interface |
c o cal_Init - Initialise the calendar. This is the interface |
160 |
c to the MITgcm. |
c to MITgcm. |
161 |
c |
c |
162 |
c o cal_Set - Sets the calendar according to the user |
c o cal_Set - Sets the calendar according to the user |
163 |
c specifications. |
c specifications. |
251 |
c raised by the calendar routines. |
c raised by the calendar routines. |
252 |
c |
c |
253 |
c o cal_PrintDate - Print a date array in some format suitable for |
c o cal_PrintDate - Print a date array in some format suitable for |
254 |
c the MITgcmuv's protocol output. |
c MITgcm's protocol output. |
255 |
c |
c |
256 |
c o cal_TimeStamp - Given the time and the iteration number return |
c o cal_TimeStamp - Given the time and the iteration number return |
257 |
c the date and print all the above numbers. |
c the date and print all the above numbers. |