1 |
heimbach |
1.1 |
C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/cal/cal_fulldate.F,v 1.4 2001/02/02 16:57:22 heimbach Exp $ |
2 |
|
|
|
3 |
|
|
#include "CAL_CPPOPTIONS.h" |
4 |
|
|
|
5 |
|
|
subroutine cal_FullDate( |
6 |
|
|
I yymmdd, |
7 |
|
|
I hhmmss, |
8 |
|
|
O date, |
9 |
|
|
I mythid |
10 |
|
|
& ) |
11 |
|
|
|
12 |
|
|
c ================================================================== |
13 |
|
|
c SUBROUTINE cal_FullDate |
14 |
|
|
c ================================================================== |
15 |
|
|
c |
16 |
|
|
c o Set a date array given the year, month, day, hour, minute, |
17 |
|
|
c and second. Check the input for errors. |
18 |
|
|
c |
19 |
|
|
c |
20 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
21 |
|
|
c |
22 |
|
|
c changed: Christian Eckert eckert@mit.edu 29-Dec-1999 |
23 |
|
|
c |
24 |
|
|
c - restructured the original version in order to have a |
25 |
|
|
c better interface to the MITgcmUV. |
26 |
|
|
c |
27 |
|
|
c Christian Eckert eckert@mit.edu 03-Feb-2000 |
28 |
|
|
c |
29 |
|
|
c - Introduced new routine and function names, cal_<NAME>, |
30 |
|
|
c for verion 0.1.3. |
31 |
|
|
c |
32 |
|
|
c ================================================================== |
33 |
|
|
c SUBROUTINE cal_FullDate |
34 |
|
|
c ================================================================== |
35 |
|
|
|
36 |
|
|
implicit none |
37 |
|
|
|
38 |
|
|
c == global variables == |
39 |
|
|
|
40 |
|
|
#include "cal.h" |
41 |
|
|
|
42 |
|
|
c == routine arguments == |
43 |
|
|
|
44 |
|
|
c mythid - thread number for this instance of the routine. |
45 |
|
|
|
46 |
|
|
integer yymmdd |
47 |
|
|
integer hhmmss |
48 |
|
|
integer date(4) |
49 |
|
|
integer mythid |
50 |
|
|
|
51 |
|
|
c == local variables == |
52 |
|
|
|
53 |
|
|
integer theyear |
54 |
|
|
integer numberofdays(4) |
55 |
|
|
integer calerr |
56 |
|
|
|
57 |
|
|
logical valid |
58 |
|
|
|
59 |
|
|
integer cal_IsLeap |
60 |
|
|
external cal_IsLeap |
61 |
|
|
|
62 |
|
|
c == end of interface == |
63 |
|
|
|
64 |
|
|
date(1) = yymmdd |
65 |
|
|
date(2) = hhmmss |
66 |
|
|
date(3) = 1 |
67 |
|
|
date(4) = 1 |
68 |
|
|
|
69 |
|
|
c Check the input for obvious errors. |
70 |
|
|
call cal_CheckDate( date, valid, calerr, mythid ) |
71 |
|
|
|
72 |
|
|
if (valid) then |
73 |
|
|
c Determine whether we are in a leap year or not. |
74 |
|
|
theyear = yymmdd/10000 |
75 |
|
|
date(3) = cal_IsLeap( theyear, mythid ) |
76 |
|
|
|
77 |
|
|
c Determine the day of the week. |
78 |
|
|
call cal_TimePassed( refdate, date, numberofdays, mythid ) |
79 |
|
|
date(4) = mod(numberofdays(1),7)+1 |
80 |
|
|
endif |
81 |
|
|
|
82 |
|
|
return |
83 |
|
|
end |