/[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.1 - (hide annotations) (download)
Mon May 14 22:07:27 2001 UTC (23 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint46f_post, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, release1_p13, checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, checkpoint46l_pre, chkpt44d_post, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint44e_pre, release1_b1, checkpoint43, checkpoint47d_pre, release1_chkpt44d_post, checkpoint47a_post, checkpoint47d_post, icebear4, icebear3, icebear2, checkpoint46d_pre, checkpoint40pre2, release1-branch_tutorials, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint40pre4, checkpoint46a_post, checkpoint46j_post, checkpoint46k_post, chkpt44c_pre, checkpoint45a_post, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint44g_post, checkpoint46e_pre, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint44b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, release1_p12_pre, checkpoint39, ecco_c44_e22, ecco_c44_e25, checkpoint40pre5, chkpt44a_pre, checkpoint46i_post, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint46e_post, release1_beta1, checkpoint44b_pre, checkpoint42, checkpoint40, checkpoint41, checkpoint47, checkpoint44, checkpoint45, checkpoint46h_post, chkpt44c_post, checkpoint44f_pre, checkpoint46d_post, release1-branch_branchpoint
Branch point for: c24_e25_ice, release1_final, release1-branch, release1, ecco-branch, release1_50yr, release1_coupled
Added calendar package.
Not currently supported by mitgcm, i.e. disabled by default.

1 heimbach 1.1 C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/cal/cal_toseconds.F,v 1.4 2001/02/02 16:57:23 heimbach Exp $
2    
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    
65     check_sign_1 = sign(1,date(1))
66     check_sign_2 = sign(1,date(2))
67     if ((date(4) .eq. -1) .and.
68     & (date(3) .eq. 0) .and.
69     & (check_sign_1*check_sign_2 .ge. 0)) then
70     if ((date(1) .lt. 0) .or.
71     & (date(2) .lt. 0)) then
72     ndays = -date(1)
73     hhmmss = -date(2)
74     fac = -1
75     else
76     ndays = date(1)
77     hhmmss = date(2)
78     fac = 1
79     endif
80     nsecs = ndays*secondsperday +
81     & (hhmmss/10000)*secondsperhour +
82     & mod(hhmmss/100,100)*secondsperminute +
83     & mod(hhmmss,100)
84     timeint = fac*nsecs
85     else
86    
87     ierr = 1001
88     call cal_PrintError( ierr, mythid )
89     stop ' stopped in cal_ToSeconds.'
90    
91     endif
92    
93     return
94     end

  ViewVC Help
Powered by ViewVC 1.1.22