Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:38:17 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d694d255c8 Jean*0001 #include "CAL_OPTIONS.h"
                0002 
                0003       SUBROUTINE CAL_TIME2DUMP(
c36c77a53c Jean*0004      I                          phase, freq, step,
d694d255c8 Jean*0005      U                          time2write,
                0006      I                          myTime, myIter, myThid )
                0007 
                0008 c     ==================================================================
                0009 C--   Convert approximate months (30-31 days) and years (360-372 days)
                0010 C     to exact calendar months and years.
                0011 c     ==================================================================
                0012 
                0013       IMPLICIT NONE
                0014 
                0015 c     == global variables ==
                0016 
                0017 #include "cal.h"
                0018 
                0019 c     == routine arguments ==
c36c77a53c Jean*0020       _RL     phase, freq, step
d694d255c8 Jean*0021       LOGICAL time2write
                0022       _RL     myTime
                0023       INTEGER myIter
                0024       INTEGER myThid
                0025 
                0026 c     == local variables ==
                0027       INTEGER thisDate(4), prevDate(4)
c36c77a53c Jean*0028       _RL posFreq
dc0c7988e6 Jean*0029       _RL shTime, prTime
d694d255c8 Jean*0030 
fdaaa7bd24 Jean*0031       IF ( calendarDumps .AND. freq .NE. 0. ) THEN
                0032 C-     Same as in FCT DIFF_PHASE_MULTIPLE:
                0033 c      IF ( myTime+step .GE. phase+baseTime ) THEN
                0034 C-     should compare to phase+baseTime (above), but would need PARAMS.h ;
                0035 C      choose to disable this condition for negative time:
                0036        IF ( myTime+step.GE.phase .OR. myTime.LT.0. ) THEN
c36c77a53c Jean*0037         posFreq = ABS(freq)
d694d255c8 Jean*0038 C-    First determine calendar dates for this and previous time step.
dc0c7988e6 Jean*0039         shTime = myTime - phase
                0040         prTime = shTime - step
                0041         CALL CAL_GETDATE( myIter, shTime, thisDate, myThid )
                0042         CALL CAL_GETDATE( myIter, prTime, prevDate, myThid )
d694d255c8 Jean*0043 C-    Monthly Freq:
c36c77a53c Jean*0044         IF ( posFreq.GE.2592000. .AND. posFreq.LE.2678400. ) THEN
d694d255c8 Jean*0045            time2write = .FALSE.
                0046            IF ( (thisdate(1)-prevdate(1)).GT.50 )   time2write=.TRUE.
                0047         ENDIF
                0048 C-    Yearly  Freq:
c36c77a53c Jean*0049         IF ( posFreq.GE.31104000. .AND. posFreq.LE.31968000. ) THEN
d694d255c8 Jean*0050            time2write = .FALSE.
                0051            IF ( (thisdate(1)-prevdate(1)).GT.5000 ) time2write=.TRUE.
                0052         ENDIF
fdaaa7bd24 Jean*0053        ENDIF
d694d255c8 Jean*0054       ENDIF
                0055 
                0056       RETURN
                0057       END