SUBROUTINE GCON C C Copy a global context from an image header C to a context file. This is the reverse of PCON. C C Richard Hook, March 1999 C IMPLICIT NONE INTEGER MAXEN,MAXIM,NEN,ID PARAMETER (MAXEN=20000,MAXIM=1000) INTEGER A(MAXIM,MAXEN),ISTAT CHARACTER*80 CONTAB,IMAGE C Get the name of the context table CALL UCLGST('contab',CONTAB,ISTAT) C Get the name of the image containing the context CALL UCLGST('image',IMAGE,ISTAT) C Open the image with read access CALL UIMOPN(IMAGE,1,ID,ISTAT) IF(ISTAT.NE.0) THEN CALL UMSPUT('! Unable to open image file',1,0,ISTAT) GO TO 99 ENDIF C Read the context table from the header CALL GTCOIN(ID,A,MAXIM,MAXEN,NEN,ISTAT) IF(ISTAT.NE.0) THEN CALL UMSPUT('! Unable to read context from header', : 1,0,ISTAT) GO TO 88 ENDIF C Write the context to the context file CALL PTGLCO(CONTAB,A,MAXIM,MAXEN,NEN,ISTAT) IF(ISTAT.NE.0) THEN CALL UMSPUT('! Unable to write context to file', : 1,0,ISTAT) ENDIF 88 CONTINUE C Close the image CALL UIMCLO(ID,ISTAT) 99 CONTINUE RETURN END