aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftc2d.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/ftc2d.f
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/fitsio/ftc2d.f')
-rw-r--r--pkg/tbtables/fitsio/ftc2d.f38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkg/tbtables/fitsio/ftc2d.f b/pkg/tbtables/fitsio/ftc2d.f
new file mode 100644
index 00000000..e8527312
--- /dev/null
+++ b/pkg/tbtables/fitsio/ftc2d.f
@@ -0,0 +1,38 @@
+C----------------------------------------------------------------------
+ subroutine ftc2d(cval,dval,status)
+C convert a character string to a double precision value
+C perform datatype conversion, if required
+
+ character*(*) cval
+ integer ival,status
+ character*1 dtype
+ logical lval
+ character*16 sval
+ double precision dval
+
+
+C convert string to its intrinsic data type
+ call ftc2x(cval,dtype,ival,lval,sval,dval,status)
+ if (status .gt. 0)return
+
+ if (dtype .eq. 'F')then
+C no datatype conversion required, so just return
+ else if (dtype .eq. 'I')then
+C convert from integer to double precision
+ dval=ival
+ else if (dtype .eq. 'L')then
+C need to convert from logical to double precision
+ if (lval)then
+ dval=1.
+ else
+ dval=0.
+ end if
+ else if (dtype .eq. 'C')then
+C can't convert a string to double precision, so return error
+ dval=0
+ status=406
+ sval=cval
+ call ftpmsg('Error in FTC2D evaluating this string '//
+ & 'as a double value: '//sval)
+ end if
+ end