aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftc2rr.f
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/tbtables/fitsio/ftc2rr.f
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/fitsio/ftc2rr.f')
-rw-r--r--pkg/tbtables/fitsio/ftc2rr.f39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkg/tbtables/fitsio/ftc2rr.f b/pkg/tbtables/fitsio/ftc2rr.f
new file mode 100644
index 00000000..8f11286e
--- /dev/null
+++ b/pkg/tbtables/fitsio/ftc2rr.f
@@ -0,0 +1,39 @@
+C----------------------------------------------------------------------
+ subroutine ftc2rr(cval,val,status)
+
+C convert a character string to a real value
+C (assumes that the input string is left justified)
+C cval c input character string to be converted
+C val r output value
+C status i output error status (0 = OK)
+
+ character*(*) cval
+ real val
+ integer status,nleng
+ character iform*8,sval*16
+
+ if (status .gt. 0)return
+
+ if (cval .eq. ' ')go to 900
+
+C find length of the input real character string
+ nleng=index(cval,' ')-1
+ if (nleng .eq. -1)nleng=len(cval)
+
+C construct the format statement to read the character string
+ if (nleng .le. 9)then
+ write(iform,1000)nleng
+1000 format('(F',I1,'.0)')
+ else
+ write(iform,1001)nleng
+1001 format('(F',I2,'.0)')
+ end if
+
+ read(cval,iform,err=900)val
+ return
+
+900 status=408
+ sval=cval
+ call ftpmsg('Error in FTC2RR evaluating this string '//
+ & 'as a real: '//sval)
+ end