1 |
gforget |
1.4 |
C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_printdate.F,v 1.3 2004/03/04 19:34:21 heimbach Exp $ |
2 |
edhill |
1.2 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
edhill |
1.2 |
#include "CAL_OPTIONS.h" |
5 |
heimbach |
1.1 |
|
6 |
|
|
subroutine cal_PrintDate( |
7 |
|
|
I caldate, |
8 |
|
|
I mythid |
9 |
|
|
& ) |
10 |
|
|
|
11 |
|
|
c ================================================================== |
12 |
|
|
c SUBROUTINE cal_PrintDate |
13 |
|
|
c ================================================================== |
14 |
|
|
c |
15 |
|
|
c o Print a calendar date. |
16 |
|
|
c |
17 |
|
|
c Purpose: Print a date as used by the calendar tool in some nice |
18 |
heimbach |
1.3 |
c format by using the MITgcmuvs print routine |
19 |
heimbach |
1.1 |
c |
20 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
21 |
|
|
c |
22 |
|
|
c changed: Christian Eckert eckert@mit.edu 19-Jan-2000 |
23 |
|
|
c |
24 |
|
|
c - inserted print statements |
25 |
|
|
c |
26 |
|
|
c Christian Eckert eckert@mit.edu 03-Feb-2000 |
27 |
|
|
c |
28 |
|
|
c - Introduced new routine and function names, cal_<NAME>, |
29 |
|
|
c for verion 0.1.3. |
30 |
|
|
c |
31 |
|
|
c ================================================================== |
32 |
|
|
c SUBROUTINE cal_PrintDate |
33 |
|
|
c ================================================================== |
34 |
|
|
|
35 |
|
|
implicit none |
36 |
|
|
|
37 |
|
|
c == global variables == |
38 |
|
|
|
39 |
|
|
#include "EEPARAMS.h" |
40 |
|
|
|
41 |
|
|
c == routine arguments == |
42 |
|
|
|
43 |
|
|
c caldate - date in the format used by the calendar tool. |
44 |
|
|
c mythid - thread number for this instance of the routine. |
45 |
|
|
|
46 |
|
|
integer caldate(4) |
47 |
|
|
integer mythid |
48 |
|
|
|
49 |
|
|
c == local variables == |
50 |
|
|
|
51 |
gforget |
1.4 |
integer ierr, ioUnit |
52 |
|
|
character*(max_len_mbuf) msgbuf |
53 |
heimbach |
1.1 |
|
54 |
|
|
c == end of interface == |
55 |
|
|
|
56 |
gforget |
1.4 |
ioUnit=standardMessageUnit |
57 |
|
|
|
58 |
heimbach |
1.1 |
if ( caldate(4) .gt. 0 ) then |
59 |
|
|
c Print the calendar date. |
60 |
gforget |
1.4 |
write(msgBuf,'(i10,i8,i3,i4)') caldate(1), caldate(2), |
61 |
|
|
& caldate(3), caldate(4) |
62 |
|
|
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid ) |
63 |
heimbach |
1.1 |
|
64 |
|
|
else if ( caldate(4) .eq. -1 ) then |
65 |
|
|
c Print the time interval. |
66 |
gforget |
1.4 |
write(msgBuf,'(i10,i8,i3,i4)') caldate(1), caldate(2), |
67 |
|
|
& caldate(3), caldate(4) |
68 |
|
|
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid ) |
69 |
heimbach |
1.1 |
|
70 |
|
|
else |
71 |
|
|
|
72 |
|
|
ierr = 2001 |
73 |
|
|
call cal_PrintError( ierr, mythid ) |
74 |
|
|
stop ' stopped in cal_PrintDate.' |
75 |
|
|
|
76 |
|
|
endif |
77 |
|
|
|
78 |
|
|
return |
79 |
|
|
end |