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

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

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

revision 1.2 by cheisey, Thu Dec 19 13:12:42 2002 UTC revision 1.3 by dimitri, Tue Sep 23 04:34:25 2003 UTC
# Line 19  c       If one wanted to use calendar da Line 19  c       If one wanted to use calendar da
19  c       the date should be after the calendar's refdate and timeint  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  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  c       refdate. Of course this can also be done by first calling
22  c       sub cal_TimePassed and the calling this routine with the  c       sub cal_TimePassed and then calling this routine with the
23  c       resulting time interval array.  c       resulting time interval array.
24  c                c              
25  c     started: Christian Eckert eckert@mit.edu  30-Jun-1999  c     started: Christian Eckert eckert@mit.edu  30-Jun-1999
# Line 34  c Line 34  c
34  c              - Introduced new routine and function names, cal_<NAME>,  c              - Introduced new routine and function names, cal_<NAME>,
35  c                for verion 0.1.3.  c                for verion 0.1.3.
36  c  c
37    c              21-Sep-2003: fixed check_sign logic to work with
38    c              negative intervals (menemenlis@jpl.nasa.gov)
39    c
40  c     ==================================================================  c     ==================================================================
41  c     SUBROUTINE cal_ToSeconds  c     SUBROUTINE cal_ToSeconds
42  c     ==================================================================  c     ==================================================================
# Line 56  c     == local variables == Line 59  c     == local variables ==
59        integer ndays        integer ndays
60        integer nsecs        integer nsecs
61        integer hhmmss        integer hhmmss
       integer check_sign_1  
       integer check_sign_2  
62        integer ierr        integer ierr
63          _RL check_sign
64    
65  c     == end of interface ==  c     == end of interface ==
66  c     print *,'cal_toseconds: date',date  c     print *,'cal_toseconds: date',date
67  c     print *,'cal_toseconds: timeint',timeint  c     print *,'cal_toseconds: timeint',timeint
68    
69        check_sign_1 = sign(1,date(1))        check_sign = sign(1,dble(date(1))*dble(date(2)))
       check_sign_2 = sign(1,date(2))  
70        if (((date(4) .eq. -1) .and.        if (((date(4) .eq. -1) .and.
71       &    (date(3) .eq.  0) .and.       &    (date(3) .eq.  0) .and.
72       &    (check_sign_1*check_sign_2 .ge. 0)) .or.       &    (check_sign .ge. 0)) .or.
73       &    usingModelCalendar) then       &    usingModelCalendar) then
74          if ((date(1) .lt. 0) .or.          if ((date(1) .lt. 0) .or.
75       &      (date(2) .lt. 0)) then       &      (date(2) .lt. 0)) then

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22