1C*PGCLOS -- close the selected graphics device
2C%void cpgclos(void);
3C+
4      SUBROUTINE PGCLOS
5C
6C Close the currently selected graphics device. After the device has
7C been closed, either another open device must be selected with PGSLCT
8C or another device must be opened with PGOPEN before any further
9C plotting can be done. If the call to PGCLOS is omitted, some or all
10C of the plot may be lost.
11C
12C [This routine was added to PGPLOT in Version 5.1.0. Older programs
13C use PGEND instead.]
14C
15C Arguments: none
16C--
17C 22-Dec-1995 - new routine, derived from the old PGEND.
18C-----------------------------------------------------------------------
19      INCLUDE 'pgplot.inc'
20      CHARACTER*16 DEFSTR
21      LOGICAL PGNOTO
22C
23      IF (.NOT.PGNOTO('PGCLOS')) THEN
24         CALL GRTERM
25         IF (PGPRMP(PGID)) THEN
26            CALL GRQCAP(DEFSTR)
27            IF (DEFSTR(8:8).EQ.'V') CALL GRPROM
28         END IF
29         CALL GRCLOS
30         PGDEVS(PGID) = 0
31         PGID = 0
32      END IF
33C     WRITE (*,*) 'PGCLOS', PGID, ':', PGDEVS
34      END
35