elapse.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\utils\bief\elapse.f
00002 !
00047                      SUBROUTINE ELAPSE
00048 !                    *****************
00049 !
00050      &(TDEB,TFIN)
00051 !
00052 !***********************************************************************
00053 ! BIEF   V6P1                                   21/08/2010
00054 !***********************************************************************
00055 !
00056 !
00057 !
00058 !
00059 !
00060 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00061 !| TDEB           |-->| TIME OF BEGINNING
00062 !| TFIN           |-->| TIME OF END
00063 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00064 !
00065       IMPLICIT NONE
00066       INTEGER LNG,LU
00067       COMMON/INFO/LNG,LU
00068 !
00069 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00070 !
00071       INTEGER, INTENT(IN) :: TDEB(8),TFIN(8)
00072 !
00073 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00074 !
00075       INTEGER YEAR,MONTH,DAY,NDAY,J1,J2,HOURS,MINUTES
00076       INTEGER GREG,Y,M
00077       DOUBLE PRECISION TD,TF,TT
00078 !
00079       INTRINSIC INT
00080 !
00081       PARAMETER (GREG=15+31*(10+12*1582))
00082 !
00083 !-----------------------------------------------------------------------
00084 !
00085 !     COMPUTES THE NUMBER OF DAYS (USES THE JULIAN DAY SYSTEM)
00086 !
00087       YEAR=TDEB(1)
00088       MONTH=TDEB(2)
00089       DAY=TDEB(3)
00090       IF(MONTH.GT.2) THEN
00091         Y=YEAR
00092         M=MONTH+1
00093       ELSE
00094         Y=YEAR-1
00095         M=MONTH+13
00096       ENDIF
00097 !
00098       J1=INT(365.25D0*Y)+INT(30.6001D0*M)+DAY+1720995
00099       IF(DAY+31*(MONTH+12*YEAR).GE.GREG) THEN
00100         J1=J1+2-INT(0.01D0*Y)+INT(0.25D0*INT(0.01D0*Y))
00101       ENDIF
00102 !
00103       YEAR=TFIN(1)
00104       MONTH=TFIN(2)
00105       DAY=TFIN(3)
00106       IF(MONTH.GT.2) THEN
00107         Y=YEAR
00108         M=MONTH+1
00109       ELSE
00110         Y=YEAR-1
00111         M=MONTH+13
00112       ENDIF
00113 !
00114       J2=INT(365.25D0*Y)+INT(30.6001D0*M)+DAY+1720995
00115       IF(DAY+31*(MONTH+12*YEAR).GE.GREG) THEN
00116         J2=J2+2-INT(0.01D0*Y)+INT(0.25D0*INT(0.01D0*Y))
00117       ENDIF
00118 !
00119       NDAY=J2-J1
00120 !
00121       TD = 3600.D0*TDEB(5) + 60.D0*TDEB(6) + TDEB(7)
00122       TF = 3600.D0*TFIN(5) + 60.D0*TFIN(6) + TFIN(7)
00123       IF(TF.LT.TD) THEN
00124         NDAY=NDAY-1
00125         TF=TF+86400.D0
00126       ENDIF
00127       TT=TF-TD
00128       HOURS=INT(TT/3600.D0)
00129       TT=TT-3600.D0*HOURS
00130       MINUTES=INT(TT/60.D0)
00131       TT=TT-60.D0*MINUTES
00132 !
00133 !---------------------------------------------------------------------
00134 !
00135       IF(LNG.EQ.1) THEN
00136 !
00137       WRITE(LU,*)   'DUREE DU CALCUL : '
00138       IF(NDAY.GT.0) THEN
00139         WRITE(LU,*) '                  ',NDAY,' JOURS'
00140       ENDIF
00141       IF(HOURS.GT.0) THEN
00142         WRITE(LU,*) '                  ',HOURS,' HEURES'
00143       ENDIF
00144       IF(MINUTES.GT.0) THEN
00145         WRITE(LU,*) '                  ',MINUTES,' MINUTES'
00146       ENDIF
00147       WRITE(LU,*)   '                  ',INT(TT),' SECONDES'
00148 !
00149       ELSE
00150 !
00151       WRITE(LU,*)   'ELAPSE TIME : '
00152       IF(NDAY.GT.0) THEN
00153         WRITE(LU,*) '                  ',NDAY,' DAYS'
00154       ENDIF
00155       IF(HOURS.GT.0) THEN
00156         WRITE(LU,*) '                  ',HOURS,' HOURS'
00157       ENDIF
00158       IF(MINUTES.GT.0) THEN
00159         WRITE(LU,*) '                  ',MINUTES,' MINUTES'
00160       ENDIF
00161       WRITE(LU,*)   '                  ',INT(TT),' SECONDS'
00162 !
00163       ENDIF
00164 !
00165 !---------------------------------------------------------------------
00166 !
00167       RETURN
00168       END

Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using doxygen 1.7.0