/[MITgcm]/MITgcm/pkg/cal/cal_toseconds.F
ViewVC logotype

Annotation of /MITgcm/pkg/cal/cal_toseconds.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Thu Dec 19 13:12:42 2002 UTC (21 years, 6 months ago) by cheisey
Branch: MAIN
CVS Tags: checkpoint47e_post, checkpoint50c_post, checkpoint48e_post, checkpoint50c_pre, checkpoint48i_post, checkpoint51, checkpoint50, checkpoint50d_post, checkpoint50b_pre, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint48d_pre, checkpoint47i_post, checkpoint48d_post, checkpoint48f_post, checkpoint48h_post, checkpoint51b_pre, checkpoint47g_post, checkpoint48a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint47j_post, branch-exfmods-tag, checkpoint48c_post, checkpoint51b_post, checkpoint51c_post, checkpoint50g_post, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint47f_post, checkpoint50e_post, checkpoint50d_pre, checkpoint51e_post, checkpoint48, checkpoint49, checkpoint51f_pre, checkpoint48g_post, checkpoint47h_post, checkpoint50b_post, checkpoint51a_post
Branch point for: branch-exfmods-curt
Changes since 1.1: +6 -3 lines
Making a change so that the cal package works
with model units and exf package.

1 cheisey 1.2 C $Header: /u/u0/gcmpack/MITgcm/pkg/cal/cal_toseconds.F,v 1.1 2001/05/14 22:07:27 heimbach Exp $
2 heimbach 1.1
3     #include "CAL_CPPOPTIONS.h"
4    
5     subroutine cal_ToSeconds(
6     I date,
7     O timeint,
8     I mythid
9     & )
10    
11     c ==================================================================
12     c SUBROUTINE cal_ToSeconds
13     c ==================================================================
14     c
15     c o Given a time interval as a date array return the number of
16     c seconds in that time interval.
17     c
18     c If one wanted to use calendar dates in this routine, then
19     c the date should be after the calendar's refdate and timeint
20     c would be the number of seconds that have elapsed since the
21     c refdate. Of course this can also be done by first calling
22     c sub cal_TimePassed and the calling this routine with the
23     c resulting time interval array.
24     c
25     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
26     c
27     c changed: Christian Eckert eckert@mit.edu 29-Dec-1999
28     c
29     c - restructured the original version in order to have a
30     c better interface to the MITgcmUV.
31     c
32     c Christian Eckert eckert@mit.edu 03-Feb-2000
33     c
34     c - Introduced new routine and function names, cal_<NAME>,
35     c for verion 0.1.3.
36     c
37     c ==================================================================
38     c SUBROUTINE cal_ToSeconds
39     c ==================================================================
40    
41     implicit none
42    
43     c == global variables ==
44    
45     #include "cal.h"
46    
47     c == routine arguments ==
48    
49     integer date(4)
50     _RL timeint
51     integer mythid
52    
53     c == local variables ==
54    
55     integer fac
56     integer ndays
57     integer nsecs
58     integer hhmmss
59     integer check_sign_1
60     integer check_sign_2
61     integer ierr
62    
63     c == end of interface ==
64 cheisey 1.2 c print *,'cal_toseconds: date',date
65     c print *,'cal_toseconds: timeint',timeint
66 heimbach 1.1
67     check_sign_1 = sign(1,date(1))
68     check_sign_2 = sign(1,date(2))
69 cheisey 1.2 if (((date(4) .eq. -1) .and.
70 heimbach 1.1 & (date(3) .eq. 0) .and.
71 cheisey 1.2 & (check_sign_1*check_sign_2 .ge. 0)) .or.
72     & usingModelCalendar) then
73 heimbach 1.1 if ((date(1) .lt. 0) .or.
74     & (date(2) .lt. 0)) then
75     ndays = -date(1)
76     hhmmss = -date(2)
77     fac = -1
78     else
79     ndays = date(1)
80     hhmmss = date(2)
81     fac = 1
82     endif
83     nsecs = ndays*secondsperday +
84     & (hhmmss/10000)*secondsperhour +
85     & mod(hhmmss/100,100)*secondsperminute +
86     & mod(hhmmss,100)
87     timeint = fac*nsecs
88     else
89    
90     ierr = 1001
91     call cal_PrintError( ierr, mythid )
92     stop ' stopped in cal_ToSeconds.'
93    
94     endif
95    
96     return
97     end

  ViewVC Help
Powered by ViewVC 1.1.22