1 |
C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/cal/cal_numints.F,v 1.4 2001/02/02 16:57:22 heimbach Exp $ |
2 |
|
3 |
#include "CAL_CPPOPTIONS.h" |
4 |
|
5 |
integer function cal_NumInts( |
6 |
I date_a, |
7 |
I date_b, |
8 |
I timeint, |
9 |
I mythid |
10 |
& ) |
11 |
|
12 |
c ================================================================== |
13 |
c SUBROUTINE cal_NumInts |
14 |
c ================================================================== |
15 |
c |
16 |
c o Determine the number of time intervals of size timeint between |
17 |
c date_a and date_b. |
18 |
c |
19 |
c Note: date_a and date_b should also be checked. |
20 |
c treat case ((passed(1) .ne. 0) .and. (timeint(1) .ne. 0)) |
21 |
c |
22 |
c started: Christian Eckert eckert@mit.edu |
23 |
c |
24 |
c - Introduced to version 0.1.4 |
25 |
c |
26 |
c changed: |
27 |
c |
28 |
c |
29 |
c ================================================================== |
30 |
c SUBROUTINE cal_NumInts |
31 |
c ================================================================== |
32 |
|
33 |
implicit none |
34 |
|
35 |
c == global variables == |
36 |
|
37 |
#include "cal.h" |
38 |
|
39 |
c == routine arguments == |
40 |
|
41 |
integer date_a(4) |
42 |
integer date_b(4) |
43 |
integer timeint(4) |
44 |
integer mythid |
45 |
|
46 |
c == local variables == |
47 |
|
48 |
_RL timeintsecs |
49 |
integer passed(4) |
50 |
_RL passedsecs |
51 |
integer ierr |
52 |
|
53 |
c == end of interface == |
54 |
|
55 |
if ( timeint(4) .eq. -1 ) then |
56 |
call cal_TimePassed( date_a, date_b, passed, mythid ) |
57 |
|
58 |
call cal_ToSeconds( passed, passedsecs, mythid ) |
59 |
call cal_ToSeconds( timeint, timeintsecs, mythid ) |
60 |
|
61 |
cal_NumInts = abs( passedsecs/timeintsecs ) |
62 |
else |
63 |
ierr = 2501 |
64 |
call cal_PrintError( ierr, mythid ) |
65 |
stop ' stopped in cal_NumInts.' |
66 |
endif |
67 |
|
68 |
return |
69 |
end |