1 |
C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/cal/cal_intmonths.F,v 1.4 2001/02/02 16:57:22 heimbach Exp $ |
2 |
|
3 |
#include "CAL_CPPOPTIONS.h" |
4 |
|
5 |
integer function cal_IntMonths( |
6 |
I mythid |
7 |
& ) |
8 |
|
9 |
c ================================================================== |
10 |
c FUNCTION cal_IntMonths |
11 |
c ================================================================== |
12 |
c |
13 |
c o Return the number of calendar months that are affected by the |
14 |
c current model integration. |
15 |
c |
16 |
c |
17 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
18 |
c |
19 |
c changed: Christian Eckert eckert@mit.edu 29-Dec-1999 |
20 |
c |
21 |
c - restructured the original version in order to have a |
22 |
c better interface to the MITgcmUV. |
23 |
c |
24 |
c Christian Eckert eckert@mit.edu 03-Feb-2000 |
25 |
c |
26 |
c - Introduced new routine and function names, cal_<NAME>, |
27 |
c for verion 0.1.3. |
28 |
c |
29 |
c ================================================================== |
30 |
c FUNCTION cal_IntMonths |
31 |
c ================================================================== |
32 |
|
33 |
implicit none |
34 |
|
35 |
c == global variables == |
36 |
|
37 |
#include "cal.h" |
38 |
|
39 |
c == routine arguments == |
40 |
|
41 |
integer mythid |
42 |
|
43 |
c == local variables == |
44 |
|
45 |
integer endmonth |
46 |
integer startmonth |
47 |
integer endyear |
48 |
integer startyear |
49 |
|
50 |
c == end of interface == |
51 |
|
52 |
startmonth = mod(modelstartdate(1)/100,100) |
53 |
endmonth = mod( modelenddate(1)/100,100) |
54 |
startyear = modelstartdate(1)/10000 |
55 |
endyear = modelenddate(1)/10000 |
56 |
|
57 |
ce --> allow for previous iterations: niter0 ! |
58 |
ce in this case one would need some more information about the |
59 |
ce integration of the model, e.g. the global start and end dates. |
60 |
|
61 |
if ( startyear .ne. endyear ) then |
62 |
cal_IntMonths = (nmonthyear - startmonth + 1) + |
63 |
& nmonthyear*(endyear - startyear - 1) + |
64 |
& endmonth |
65 |
else |
66 |
cal_IntMonths = endmonth - startmonth + 1 |
67 |
endif |
68 |
|
69 |
if ( ( modelenddate(2) .eq. 0) .and. |
70 |
& ( mod(modelenddate(1),100) .eq. 1) ) then |
71 |
cal_IntMonths = cal_IntMonths - 1 |
72 |
endif |
73 |
|
74 |
return |
75 |
end |
76 |
|