58 elemental function hms(t)
65 real(
double),
intent(in) :: t
73 s = nint((t1-h-m/60.d0)*3600.d0)
85 write(
hms,
'(I2.2,2(A1,I2.2))') h,
':',m,
':',s
86 if(
deq0(t))
write(
hms,
'(A8)')
'--:--:--'
58 elemental function hms(t)
…
104 real(
double),
intent(in) :: t
107 character ::
hhms*(8)
111 m = int((t1-h)*60.d0)
112 s = nint((t1-h-m/60.d0)*3600.d0)
125 write(
hhms,
'(I1, 2(A1,I2.2))') h,
':',m,
':',s
127 write(
hhms,
'(I2.2,2(A1,I2.2))') h,
':',m,
':',s
144 real(
double),
intent(in) :: t
147 character ::
hms2*(9),hh*(2),mm*(2),ss*(2),sign
151 m = int((t1-h)*60.d0)
152 s = nint((t1-h-m/60.d0)*3600.d0)
155 if(
rv12(t).lt.0.d0) sign =
'-'
170 write(
hms2,
'(A1,A2,2(A1,A2))') sign,hh,
':',mm,
':',ss
193 real(
double),
intent(in) :: t
196 character ::
ums*(9),hh*(2),
mm*(2),ss*(2)
200 m = int((t1-h)*60.d0)
201 s = nint((t1-h-m/60.d0)*3600.d0)
217 write(
ums,
'(A2,2(A1,A2),A1)') hh,
'u',
mm,
'm',ss,
's'
218 if(
deq0(t))
write(
ums,
'(a9)')
'--u--m--s'
239 real(
double),
intent(in) :: t
242 character ::
hms_s*(10),hh*(2),
mm*(2),ss*(4)
246 m = int((t1-h)*60.d0)
247 s = (t1-h-m/60.d0)*3600.d0
249 if(s.ge.59.95d0)
then
262 if(s.lt.9.95d0)
write(ss,
'(A1,F3.1)')
'0',s
264 write(
hms_s,
'(2(A2,A1),A4)') hh,
':',
mm,
':',ss
265 if(
deq0(t))
write(
hms_s,
'(A10)')
'--:--:--.-'
286 real(
double),
intent(in) :: t
289 character ::
hms_sss*(12),hh*(2),
mm*(2),ss*(6)
293 m = int((t1-h)*60.d0)
294 s = (t1-h-m/60.d0)*3600.d0
296 if(s.ge.59.9995d0)
then
309 if(s.lt.9.9995d0)
write(ss,
'(A1,F5.3)')
'0',s
311 write(
hms_sss,
'(2(A2,A1),A6)') hh,
':',
mm,
':',ss
333 real(
double),
intent(in) :: t
342 if(m.ge.59.95d0)
then
348 write(
hmm,
'(I2.2,A1,F4.1)') h,
':',m
349 if(m.lt.9.95d0)
write(
hmm,
'(I2.2,A2,F3.1)') h,
':0',m
350 if(
deq0(t))
write(
hmm,
'(A7)')
'--:--.-'
371 real(
double),
intent(in) :: t
380 if(m.ge.59.95d0)
then
386 write(
umm,
'(I2.2,A1,F4.1,A1)') h,
'u',m,
'm'
387 if(m.lt.9.95d0)
write(
umm,
'(I2.2,A2,F3.1,A1)') h,
'u0',m,
'm'
388 if(
deq0(t))
write(
umm,
'(A8)')
'--u--.-m'
405 elemental function hm(time)
412 real(
double),
intent(in) :: time
419 mn = nint((ltime-hr)*60.d0)
425 if(hr.ge.24) hr = hr-24
427 write(
hm,
'(I2.2,A1,I2.2)') hr,
':',mn
428 if(
deq0(time))
write(
hm,
'(A5)')
'--:--'
405 elemental function hm(time)
…
448 real(
double),
intent(in) :: time
455 mn = (ltime-hr)*60.d0
457 if(mn.ge.59.9995d0)
then
461 if(hr.ge.24) hr = hr-24
463 write(
hm_mmm,
'(I2.2,A1,F6.3)') hr,
':',mn
464 if(mn.lt.9.9995d0)
write(
hm_mmm,
'(I2.2,A2,F5.3)') hr,
':0',mn
484 real(
double),
intent(in) :: t
491 m = nint((t1-h)*60.d0)
500 write(
hhm,
'(I1,A1,I2.2,A)') h,
':',m,
' '
502 write(
hhm,
'(I2.2,A1,I2.2)') h,
':',m
517 elemental function um(t)
524 real(
double),
intent(in) :: t
527 character ::
um*(6),hh*(2),
mm*(2)
531 m = nint((t1-h)*60.d0)
541 if(h.lt.10)
write(hh,
'(A1,I1)')
'0',h
542 if(m.lt.10)
write(
mm,
'(A1,I1)')
'0',m
544 write(
um,
'(2(A2,A1))') hh,
'u',
mm,
'm'
545 if(
deq0(t))
write(
um,
'(A6)')
'--u--m'
517 elemental function um(t)
…
566 real(
double),
intent(in) :: t
569 character ::
wum*(28),hh*(2),
mm*(2)
573 m = nint((t1-h)*60.d0)
583 if(h.lt.10)
write(hh,
'(A1,I1)')
'0',h
584 if(m.lt.10)
write(
mm,
'(A1,I1)')
'0',m
586 write(
wum,
'(2(A2,A12))') hh,
'<sup>u</sup>',
mm,
'<sup>m</sup>'
587 if(
deq0(t))
write(
wum,
'(A28)')
'--<sup>u</sup>--<sup>m</sup>'
607 real(
double),
intent(in) :: t
611 character ::
wumm*(30),hh*(2),
mm*(4)
617 if(m.ge.59.95d0)
then
625 if(m.lt.9.95)
write(
mm,
'(A1,F3.1)')
'0',m
627 write(
wumm,
'(A2,A12,A4,A12)') hh,
'<sup>u</sup>',
mm,
'<sup>m</sup>'
628 if(
deq0(t))
write(
wumm,
'(A30)')
'--<sup>u</sup>--.-<sup>m</sup>'
648 real(
double),
intent(in) :: t
651 character ::
wums*(42),hh*(2),
mm*(2),ss*(2)
655 m = int((t1-h)*60.d0)
656 s = nint((t1-h-m/60.d0)*3600.d0)
672 write(
wums,
'(3(A2,A12))') hh,
'<sup>u</sup>',
mm,
'<sup>m</sup>',ss,
'<sup>s</sup>'
673 if(
deq0(t))
write(
wums,
'(A42)')
'--<sup>u</sup>--<sup>m</sup>--<sup>s</sup>'
693 real(
double),
intent(in) :: t
696 character ::
wums_s*(44),hh*(2),
mm*(2),ss*(4)
700 m = int((t1-h)*60.d0)
701 s = (t1-h-m/60.d0)*3600.d0
703 if(s.ge.59.95d0)
then
716 if(s.lt.9.95d0)
write(ss,
'(A1,F3.1)')
'0',s
718 write(
wums_s,
'(2(A2,A12),A4,A12)') hh,
'<sup>u</sup>',
mm,
'<sup>m</sup>',ss,
'<sup>s</sup>'
719 if(
deq0(t))
write(
wums_s,
'(A44)')
'--<sup>u</sup>--<sup>m</sup>--.-<sup>s</sup>'
743 real(
double),
intent(in) :: t
746 character ::
hm2*(6),hh*(2),mm*(2),sign
754 if(
rv12(t).lt.0.d0) sign =
'-'
764 write(
hm2,
'(A1,A2,A1,A2)') sign,hh,
':',mm
785 real(
double),
intent(in) :: t
788 character ::
hdm*(5),hh*(2),
mm*(2)
792 m = nint((t1-h)*60.d0)
802 if(h.lt.10)
write(hh,
'(A1,I1)')
'0',h
803 if(m.lt.10)
write(
mm,
'(A1,I1)')
'0',m
805 write(
hdm,
'(A2,2(A1,A2))') hh,
'.',
mm
806 if(
deq0(t))
write(
hdm,
'(A5)')
'--.--'
822 real(
double),
intent(in) :: t
825 character ::
tms*(8),ss*(4)
829 s = (a-m/60.d0)*3600.d0
832 if(nint(s*10).lt.100)
write(ss,
'(A1,F3.1)')
'0',s
833 write(
tms,
'(I2.2,A1,A4,A1)') m,
'm',ss,
's'
848 real(
double),
intent(in) :: t
851 character ::
tms2*(9),ss*(4),sign
863 s = (a-m/60.d0)*3600.d0
866 if(s.lt.9.95d0)
write(ss,
'(A1,F3.1)')
'0',s
867 write(
tms2,
'(A1,I2.2,A1,A4,A1)') sign,m,
'm',ss,
's'
883 real(
double),
intent(in) :: t
886 character ::
tmsss2*(8),ss*(4),sign
898 s = (a-m/60.d0)*3600.d0
901 if(s.lt.9.95d0)
write(ss,
'(A1,F3.1)')
'0',s
902 write(
tmsss2,
'(A1,I1,A1,A4,A1)') sign,m,
'm',ss,
's'
Procedures to handle angles.
pure real(double) function rev(ang)
Returns angle in radians between 0 and 2pi.
pure real(double) function rv12(tm)
Returns time in hours between -12 and 12.
Provides all constants in the library, and routines to define them.
real(double), parameter, public h2r
Hours to radians.
real(double), parameter, public r2h
Radians to hours.
real(double), parameter, public mm
millimeter in cgs (cm)
Provides kinds and related constants/routines.
integer, parameter double
Double-precision float. Precision = 15, range = 307.
Procedures for numerical operations.
elemental logical function deq0(x0, eps)
Test whether a double-precision variable is equal to zero better than a given value (default: 2x mach...
Procedures to convert time to formatted text strings.
elemental character function, dimension(6) hm2(t)
Print time as string in +/-hh:mm, input in hours, between -12 and 12.
elemental character function, dimension(9) hm_mmm(time)
Print time as string in hh:mm.mmm, input in hours.
elemental character function, dimension(8) hhms(t)
Print time as hh:mm:ss string, input in hours; No special output for t=0.
elemental character function, dimension(6) um(t)
Print time as string in 01u23m, input in hours.
elemental character function, dimension(8) tmsss2(t)
Print time as m:ss.s string, input in hours, like tms2, but t<10 min(!)
elemental character function, dimension(8) tms(t)
Print time as mm:ss.s string, input in hours.
elemental character function, dimension(9) hms2(t)
Print time as string in hh:mm, input in hours, output between -12 and 12.
elemental character function, dimension(44) wums_s(t)
Print time as a Dutch HTML string in 11u22m33.4s, input in hours. HTML equivalent of hms_s()
elemental character function, dimension(5) hhm(t)
Print time as string in h:mm or hh:mm, input in hours; no special output for h=0.
elemental character function, dimension(9) ums(t)
Print time as 00u11m22s string, input in hours.
elemental character function, dimension(10) hms_s(t)
Print time as string in hms.s, input in hours.
elemental character function, dimension(5) hm(time)
Print time as string in hh:mm, input in hours.
elemental character function, dimension(42) wums(t)
Print time as 00u11m22s HTML string, input in hours.
elemental character function, dimension(5) hdm(t)
Print time as a nice string in hh.mm, so with a . in stead of : Input in hours.
elemental character function, dimension(28) wum(t)
Print time as string in 01u23m, input in hours, web version (HTML superscripts)
elemental character function, dimension(9) tms2(t)
Print time as mm:ss.s string, input in hours.
elemental character function, dimension(8) hms(t)
Print time as hh:mm:ss string, input in hours; Display '–:–:–' for t=0.
elemental character function, dimension(7) hmm(t)
Print time as string in hm.m, input in hours.
elemental character function, dimension(30) wumm(t)
Print time as string in 01u23.1m, input in hours, web version (HTML superscripts)
elemental character function, dimension(12) hms_sss(t)
Print time as string in hms.sss, input in hours.
elemental character function, dimension(8) umm(t)
Print time as string in 00u11.2m, input in hours.