aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftgnst.f
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/tbtables/fitsio/ftgnst.f
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/tbtables/fitsio/ftgnst.f')
-rw-r--r--pkg/tbtables/fitsio/ftgnst.f70
1 files changed, 70 insertions, 0 deletions
diff --git a/pkg/tbtables/fitsio/ftgnst.f b/pkg/tbtables/fitsio/ftgnst.f
new file mode 100644
index 00000000..0d9ed966
--- /dev/null
+++ b/pkg/tbtables/fitsio/ftgnst.f
@@ -0,0 +1,70 @@
+C--------------------------------------------------------------------------
+ subroutine ftgnst(iunit,value,lenval,comm,status)
+
+C get the next string keyword.
+C see if the next keyword in the header is the continuation
+C of a long string keyword, and if so, return the value string,
+C the number of characters in the string, and the associated comment
+C string.
+
+C value c returned value of the string continuation
+C lenval i number of non-blank characters in the continuation string
+C comm C value of the comment string, if any, in this keyword.
+
+ character*(*) value,comm
+ integer iunit,lenval,status
+
+ integer i,length,tstat,nkeys,nextky
+ character record*80, strval*70
+
+ if (status .gt. 0)return
+
+ tstat=status
+ value=' '
+ comm=' '
+ lenval=0
+
+C get current header position
+ call ftghps(iunit,nkeys,nextky,status)
+
+C get the next keyword record
+ if (nextky .le. nkeys)then
+ call ftgrec(iunit,nextky,record,status)
+ else
+C positioned at end of header, so there is no next keyword to read
+ return
+ end if
+
+C does this appear to be a continuation keyword (=blank keyword name
+C or CONTINUE)?
+ if (record(1:10) .ne. ' ' .and. record(1:10) .ne.
+ & 'CONTINUE ')return
+
+C return if record is blank
+ if (record .eq. ' ')return
+
+C set a dummy keyword name
+ record(1:10)='DUMMYKEY= '
+
+C parse the record to get the value string and comment
+ call ftpsvc(record,strval,comm,status)
+
+C convert character string to unquoted string
+ call ftc2s(strval,value,status)
+ if (status .gt. 0)then
+C this must not be a continuation card; reset status and messages
+ status=tstat
+ call ftcmsg
+ value=' '
+ comm=' '
+ return
+ end if
+
+ length=len(value)
+ do 10 i=length,1,-1
+ if (value(i:i) .ne. ' ')then
+ lenval=i
+ return
+ end if
+10 continue
+ end