diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /lib/superfox/julian.f90 | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'lib/superfox/julian.f90')
| -rwxr-xr-x | lib/superfox/julian.f90 | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/lib/superfox/julian.f90 b/lib/superfox/julian.f90 index 002167fc..8d8b7411 100755 --- a/lib/superfox/julian.f90 +++ b/lib/superfox/julian.f90 @@ -1,39 +1,39 @@ -module julian - -contains - - integer*8 function itime8() - - implicit integer (a-z) -! 1 2 3 4 5 6 7 - integer it(8) !y m d nmin h m s - integer*8 secday - data secday/86400/ - - call date_and_time(values=it) - iyr=it(1) - imo=it(2) - iday=it(3) - days=JD(iyr,imo,iday) - 2440588 !Days since epoch Jan 1, 1970 - ih=it(5) - im=it(6)-it(4) !it(4) corrects for time zone - is=it(7) - nsec=3600*ih + 60*im + is - itime8=days*secday + nsec - - return - end function itime8 - - integer function JD(I,J,K) - -! Return Julian Date for I=year, J=month, K=day -! Reference: Fliegel and Van Flandern, Comm. ACM 11, 10, 1968 - - JD = K - 32075 + 1461*(I + 4800 + (J - 14)/12)/4 & - + 367*(J - 2 - (J - 14)/12*12)/12 - 3 & - *((I + 4900 + (J - 14)/12)/100)/4 - - return - end function JD - -end module julian +module julian
+
+contains
+
+ integer*8 function itime8()
+
+ implicit integer (a-z)
+! 1 2 3 4 5 6 7
+ integer it(8) !y m d nmin h m s
+ integer*8 secday
+ data secday/86400/
+
+ call date_and_time(values=it)
+ iyr=it(1)
+ imo=it(2)
+ iday=it(3)
+ days=JD(iyr,imo,iday) - 2440588 !Days since epoch Jan 1, 1970
+ ih=it(5)
+ im=it(6)-it(4) !it(4) corrects for time zone
+ is=it(7)
+ nsec=3600*ih + 60*im + is
+ itime8=days*secday + nsec
+
+ return
+ end function itime8
+
+ integer function JD(I,J,K)
+
+! Return Julian Date for I=year, J=month, K=day
+! Reference: Fliegel and Van Flandern, Comm. ACM 11, 10, 1968
+
+ JD = K - 32075 + 1461*(I + 4800 + (J - 14)/12)/4 &
+ + 367*(J - 2 - (J - 14)/12*12)/12 - 3 &
+ *((I + 4900 + (J - 14)/12)/100)/4
+
+ return
+ end function JD
+
+end module julian
|
