1 |
C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_printdate.F,v 1.2 2003/10/09 04:19:19 edhill Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CAL_OPTIONS.h" |
5 |
|
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 |
c format by using the MITgcmuvs print routine |
19 |
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 |
integer ierr |
52 |
ce character*(max_len_mbuf) msgbuf |
53 |
|
54 |
c == end of interface == |
55 |
|
56 |
if ( caldate(4) .gt. 0 ) then |
57 |
c Print the calendar date. |
58 |
print*,caldate |
59 |
ce write(*,'(i10,i8,i3,i4)') caldate(1), caldate(2), |
60 |
ce & caldate(3), caldate(4) |
61 |
|
62 |
else if ( caldate(4) .eq. -1 ) then |
63 |
c Print the time interval. |
64 |
print*,caldate |
65 |
ce write(*,'(i10,i8,i3,i4)') caldate(1), caldate(2), |
66 |
ce & caldate(3), caldate(4) |
67 |
|
68 |
else |
69 |
|
70 |
ierr = 2001 |
71 |
call cal_PrintError( ierr, mythid ) |
72 |
stop ' stopped in cal_PrintDate.' |
73 |
|
74 |
endif |
75 |
|
76 |
return |
77 |
end |