aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftmnam.f
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tbtables/fitsio/ftmnam.f')
-rw-r--r--pkg/tbtables/fitsio/ftmnam.f34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkg/tbtables/fitsio/ftmnam.f b/pkg/tbtables/fitsio/ftmnam.f
new file mode 100644
index 00000000..02774a69
--- /dev/null
+++ b/pkg/tbtables/fitsio/ftmnam.f
@@ -0,0 +1,34 @@
+C--------------------------------------------------------------------------
+ subroutine ftmnam(ounit,oldkey,newkey,status)
+
+C modify (overwrite) the name of an existing keyword, preserving
+C the current value and comment fields
+C
+C ounit i fortran output unit number
+C oldkey c old keyword name ( 8 characters, cols. 1- 8)
+C newkey c new keyword name to be written
+C OUTPUT PARAMETERS:
+C status i output error status (0 = ok)
+C
+C written by Wm Pence, HEASARC/GSFC, Feb 1992
+
+ character*(*) oldkey,newkey
+ integer ounit,status
+ character card*80
+
+ if (status .gt. 0)return
+
+C find the old keyword string
+ call ftgcrd(ounit,oldkey,card,status)
+
+ card(1:8)=newkey
+
+C make sure new keyword name is in upper case
+ call ftupch(card(1:8))
+
+C test that keyword name contains only legal characters
+ call fttkey(card(1:8),status)
+
+C write the new keyword record
+ call ftmodr(ounit,card,status)
+ end