~ubuntu-branches/ubuntu/wily/splash/wily

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
!-----------------------------------------------------------------------
!  giza - a scientific plotting library built on cairo
!
!  Copyright (c) 2010      James Wetter and Daniel Price
!  Copyright (c) 2010-2012 Daniel Price
!
!  This library is free software; and you are welcome to redistribute
!  it under the terms of the GNU General Public License
!  (GPL, see LICENSE file for details) and the provision that
!   this notice remains intact. If you modify this file, please
!  note section 2a) of the GPLv2 states that:
!
!   a) You must cause the modified files to carry prominent notices
!      stating that you changed the files and the date of any change.
!
!  This software is distributed "AS IS", with ABSOLUTELY NO WARRANTY.
!  See the GPL for specific language governing rights and limitations.
!
!  The Original code is the giza plotting library.
!
!  Contributor(s):
!       James Wetter <wetter.j@gmail.com>
!       Daniel Price <daniel.price@monash.edu> (main contact)
!
!-----------------------------------------------------------------------
!---------------------------------------------------------
!  This file can be used to build a PGPLOT-compatible
!  interface to giza (implements the full public API
!  for PGPLOT), so old PGPLOT-based programs do not need
!  to be recompiled to use giza.
!
!  We have implemented the last public version of PGPLOT
!  as available from the PGPLOT web page.
!---------------------------------------------------------

!------------------------------------------------------------------------
! This is a utility module containing routines for converting
! various things from giza-style to pgplot-style where necessary
!------------------------------------------------------------------------
module gizapgplot
 implicit none
 !--Settings unique to PGPLOT
 integer, public :: pgfont = 1

contains
!------------------------------------------------------------
! Function to convert PGPLOT units value to giza units value
!------------------------------------------------------------
 integer function units_giza(pgplotunits)
  use giza, only:giza_units_normalized,giza_units_inches, &
                 giza_units_mm,giza_units_device,giza_units_world,&
                 giza_units_pixels
  implicit none
  integer, intent(in) :: pgplotunits
  
  select case(pgplotunits)
  case(0)
     units_giza = giza_units_normalized
  case(1)
     units_giza = giza_units_inches
  case(2)
     units_giza = giza_units_mm
  case(3)
     units_giza = giza_units_pixels
  case(4)
     units_giza = giza_units_world
  case default  ! giza will give an error
     units_giza = pgplotunits
  end select

 end function units_giza

!----------------------------------------------------------------
! Routine to convert PGPLOT "trans" array to giza "affine" array
!----------------------------------------------------------------
 subroutine convert_tr_to_affine(tr,affine)
  implicit none
  real, dimension(6), intent(in)  :: tr
  real, dimension(6), intent(out) :: affine

  affine(1) = TR(2)
  affine(2) = TR(5)
  affine(3) = TR(3)
  affine(4) = TR(6)
  affine(5) = TR(1) + 0.5 * TR(2)
  affine(6) = TR(4) + 0.5 * TR(6)

 end subroutine convert_tr_to_affine

end module gizapgplot

!------------------------------------------------------------------------
! Module: PGARRO -- draw an arrow
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGARRO (X1, Y1, X2, Y2)
 use giza, only:giza_arrow
 implicit none
 real, intent(in) :: X1, Y1, X2, Y2

 call giza_arrow(X1, Y1, X2, Y2)

end subroutine pgarro

!------------------------------------------------------------------------
! Module: PGASK -- control new page prompting
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGASK (FLAG)
 use giza, only:giza_start_prompting, giza_stop_prompting
 implicit none
 logical, intent(in) :: FLAG

 if (FLAG) then
   call giza_start_prompting
 else
   call giza_stop_prompting
 end if

end subroutine PGASK

!------------------------------------------------------------------------
! Module: PGAXIS -- draw an axis
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGAXIS (OPT, X1, Y1, X2, Y2, V1, V2, STEP, NSUB, DMAJL, DMAJR, FMIN, DISP, ORIENT)
 implicit none
 character*(*), intent(in) :: OPT
 real, intent(in) :: X1, Y1, X2, Y2, V1, V2, STEP, DMAJL, DMAJR, FMIN, DISP
 real, intent(in) :: ORIENT
 integer, intent(in) :: NSUB

end subroutine PGAXIS

!------------------------------------------------------------------------
! Module: PGBAND -- read cursor position, with anchor
! Status: IMPLEMENTED
!------------------------------------------------------------------------
integer function PGBAND (MODE, POSN, XREF, YREF, X, Y, CH)
 use giza, only:giza_band
 implicit none
 integer, intent(in) :: MODE, POSN
 real, intent(in)    :: XREF, YREF
 real, intent(inout) :: X, Y
 character*(*), intent(out) :: CH
 integer :: ierr

 ierr = giza_band(MODE, POSN, XREF, YREF, X, Y, CH)

 !--PGBAND returns 1 on successful completion
 if (ierr.eq.0) then
    PGBAND = 1
 else
    PGBAND = 0
 endif

end function PGBAND

!------------------------------------------------------------------------
! Module: PGBBUF -- begin batch of output (buffer)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGBBUF
 use giza, only:giza_begin_buffer
 implicit none
 
 call giza_begin_buffer()

end subroutine PGBBUF

!------------------------------------------------------------------------
! Module: PGBEG -- open a graphics device
! Status: IMPLEMENTED
!------------------------------------------------------------------------
integer function PGBEG (UNIT, FILE, NXSUB, NYSUB)
 implicit none
 integer,       intent(in) :: UNIT
 character*(*), intent(in) :: FILE
 integer,       intent(in) :: NXSUB, NYSUB
 integer, external :: PGOPEN

 PGBEG = PGOPEN(FILE)
 if (PGBEG > 0 .and. (NXSUB.GT.1 .or. NYSUB.GT.1)) then
    call PGSUBP(NXSUB, NYSUB)
 endif

end function PGBEG

!------------------------------------------------------------------------
! Module: PGBIN -- histogram of binned data
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGBIN (NBIN, X, DATA, CENTER)
 use giza, only:giza_histogram_binned
 implicit none
 integer, intent(in) :: NBIN
 real,    intent(in) :: X(*), DATA(*)
 logical, intent(in) :: CENTER
 integer :: iflag

 if (CENTER) then
    iflag = 1
 else
    iflag = 0
 endif 

 call giza_histogram_binned(NBIN, X, DATA, iflag)

end subroutine PGBIN

!------------------------------------------------------------------------
! Module: PGBOX -- draw labeled frame around viewport
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGBOX (XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)
 use giza, only:giza_box
 implicit none
 character*(*), intent(in) :: XOPT, YOPT
 real,          intent(in) :: XTICK, YTICK
 integer,       intent(in) :: NXSUB, NYSUB

 call giza_box(XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)

end subroutine PGBOX

!------------------------------------------------------------------------
! Module: PGCIRC -- draw a circle, using fill-area attributes
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCIRC (XCENT, YCENT, RADIUS)
 use giza, only:giza_circle
 implicit none
 real, intent(in) :: XCENT, YCENT, RADIUS

 call giza_circle(XCENT,YCENT,RADIUS)

end subroutine PGCIRC
!------------------------------------------------------------------------
! Module: PGCLOS -- close the selected graphics device
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCLOS
 use giza, only:giza_close_device
 implicit none

 call giza_close_device

end subroutine PGCLOS

!------------------------------------------------------------------------
! Module: PGCONB -- contour map of a 2D data array, with blanking
! Status: PARTIALLY IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCONB (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR, BLANK)
 use giza,       only:giza_contour
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, I2, J1, J2, NC
 real,    intent(in) :: A(IDIM,JDIM), C(*), TR(6), BLANK
 real                :: affine(6)

 call convert_tr_to_affine(tr,affine)
 call giza_contour(idim,jdim,a,i1-1,i2-1,j1-1,j2-1,abs(nc),C,affine)

end subroutine PGCONB

!------------------------------------------------------------------------
! Module: PGCONF -- fill between two contours
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCONF (A, IDIM, JDIM, I1, I2, J1, J2, C1, C2, TR)
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, I2, J1, J2
 real,    intent(in) :: A(IDIM,JDIM), C1, C2, TR(6)

end subroutine PGCONF

!------------------------------------------------------------------------
! Module: PGCONL -- label contour map of a 2D data array 
! Status: PARTIALLY IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCONL (A, IDIM, JDIM, I1, I2, J1, J2, C, TR, LABEL, INTVAL, MININT)
 use giza,       only:giza_contour
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer,       intent(in) :: IDIM, JDIM, I1, J1, I2, J2, INTVAL, MININT
 real,          intent(in) :: A(IDIM,JDIM), C, TR(6)
 character*(*), intent(in) :: LABEL
 real                      :: affine(6)
 integer, parameter  :: nc = 1
 real, dimension(nc) :: cc
 
 cc(1) = C
 call convert_tr_to_affine(tr,affine)
 call giza_contour(idim,jdim,a,i1-1,i2-1,j1-1,j2-1,nc,cc,affine)

end subroutine PGCONL

!------------------------------------------------------------------------
! Module: PGCONS -- contour map of a 2D data array (fast algorithm)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCONS (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR)
 use giza,       only:giza_contour
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, I2, J1, J2, NC
 real,    intent(in) :: A(IDIM,JDIM), C(*), TR(6)
 real                :: affine(6)

 call convert_tr_to_affine(tr,affine)
 call giza_contour(idim,jdim,a,i1-1,i2-1,j1-1,j2-1,abs(nc),C,affine)

end subroutine PGCONS

!------------------------------------------------------------------------
! Module: PGCONT -- contour map of a 2D data array (contour-following)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCONT (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR)
 use giza,       only:giza_contour
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, J1, I2, J2, NC
 real,    intent(in) :: A(IDIM,JDIM), C(*), TR(6)
 real                :: affine(6)

 call convert_tr_to_affine(tr,affine)
 call giza_contour(idim,jdim,a,i1-1,i2-1,j1-1,j2-1,abs(nc),C,affine)

end subroutine PGCONT

!------------------------------------------------------------------------
! Module: PGCONX -- contour map of a 2D data array (non rectangular)
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCONX (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, PLOT)
 use giza,       only:giza_contour
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, J1, I2, J2, NC
 real,    intent(in) :: A(IDIM,JDIM), C(*)
 external :: PLOT

end subroutine PGCONX

!------------------------------------------------------------------------
! Module: PGCTAB -- install the color table to be used by PGIMAG
! Status: PARTIALLY IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGCTAB(L, R, G, B, NC, CONTRA, BRIGHT)
 use giza, only:giza_set_colour_table
 implicit none
 integer, intent(in) :: NC
 real,    intent(in) :: L(NC), R(NC), G(NC), B(NC), CONTRA, BRIGHT

 call giza_set_colour_table(L, R, G, B, NC, CONTRA, BRIGHT)

end subroutine PGCTAB

!------------------------------------------------------------------------
! Module: PGCURS -- read cursor position
! Status: IMPLEMENTED
!------------------------------------------------------------------------
integer function PGCURS (X, Y, CH)
 use giza, only:giza_get_key_press
 implicit none
 real,          intent(inout) :: X, Y
 character*(*), intent(out)   :: CH

 PGCURS = giza_get_key_press(X, Y, CH)

end function PGCURS

!------------------------------------------------------------------------
! Module: PGDRAW -- draw a line from the current pen position to a point
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGDRAW (X, Y)
 use giza, only:giza_draw
 implicit none
 real, intent(in) :: X, Y
 
 call giza_draw(X, Y)

end subroutine PGDRAW

!------------------------------------------------------------------------
! Module: PGEBUF -- end batch of output (buffer)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGEBUF
 use giza, only:giza_end_buffer
 implicit none
 
 call giza_end_buffer()
 
end subroutine PGEBUF

!------------------------------------------------------------------------
! Module: PGEND -- close all open graphics devices
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGEND
 use giza, only:giza_close_device
 implicit none
 
 call giza_close_device()
 
end subroutine PGEND

!------------------------------------------------------------------------
! Module: PGENV -- set window and viewport and draw labeled frame
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGENV (XMIN, XMAX, YMIN, YMAX, JUST, AXIS)
 use giza, only:giza_set_environment
 implicit none
 real,    intent(in) :: XMIN, XMAX, YMIN, YMAX
 integer, intent(in) :: JUST, AXIS

 call giza_set_environment(XMIN, XMAX, YMIN, YMAX, JUST, AXIS)

end subroutine PGENV

!------------------------------------------------------------------------
! Module: PGERAS -- erase all graphics from current page
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGERAS
 use giza, only:giza_draw_background
 implicit none
 
 call giza_draw_background()
 
end subroutine PGERAS

!------------------------------------------------------------------------
! Module: PGERR1 -- horizontal or vertical error bar
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGERR1 (DIR, X, Y, E, T)
 implicit none
 integer, intent(in) :: DIR
 real,    intent(in) :: X, Y, E
 real,    intent(in) :: T
 real, dimension(1) :: xi,yi,ei
  
 xi(1) = x
 yi(1) = y
 ei(1) = e
 call PGERRB(DIR,1,XI,YI,EI,T)

end subroutine PGERR1

!------------------------------------------------------------------------
! Module: PGERRB -- horizontal or vertical error bar
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGERRB (DIR, N, X, Y, E, T)
 use giza, only:giza_error_bars
 implicit none
 integer, intent(in) :: DIR, N
 real,    intent(in) :: X(*), Y(*), E(*)
 real,    intent(in) :: T

 call giza_error_bars(DIR, N, X, Y, E, T)

end subroutine PGERRB

!------------------------------------------------------------------------
! Module: PGERRX -- horizontal error bar
! Status: IMPLEMENTED
!------------------------------------------------------------------------

subroutine PGERRX (N, X1, X2, Y, T)
 use giza, only:giza_error_bars_x
 implicit none
 integer, intent(in) :: N
 real,    intent(in) :: X1(*), X2(*), Y(*)
 real,    intent(in) :: T

 call giza_error_bars_x(N, X1, X2, Y, T)

end subroutine PGERRX

!------------------------------------------------------------------------
! Module: PGERRY -- vertical error bar
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGERRY (N, X, Y1, Y2, T)
 use giza, only:giza_error_bars_y
 implicit none
 integer, intent(in) :: N
 real,    intent(in) :: X(*), Y1(*), Y2(*)
 real,    intent(in) :: T
 
 call giza_error_bars_y(N, X, Y1, Y2, T)

end subroutine PGERRY

!------------------------------------------------------------------------
! Module: PGETXT -- erase text from graphics display
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGETXT
 implicit none
end subroutine PGETXT

!------------------------------------------------------------------------
! Module: PGFUNT -- function defined by X = F(T), Y = G(T)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGFUNT (FX, FY, N, TMIN, TMAX, PGFLAG)
 use giza, only:giza_function_t
 implicit none
 real,    external   :: FX, FY
 integer, intent(in) :: N
 real,    intent(in) :: TMIN, TMAX
 integer, intent(in) :: PGFLAG

 call giza_function_t(FX, FY, N, TMIN, TMAX, PGFLAG)

end subroutine PGFUNT

!------------------------------------------------------------------------
! Module: PGFUNX -- function defined by Y = F(X)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGFUNX (FY, N, XMIN, XMAX, PGFLAG)
 use giza, only:giza_function_x
 implicit none
 real, external :: FY
 integer, intent(in) :: N
 real,    intent(in) :: XMIN, XMAX
 integer, intent(in) :: PGFLAG
 
 call giza_function_x(FY, N, XMIN, XMAX, PGFLAG)

end subroutine PGFUNX

!------------------------------------------------------------------------
! Module: PGFUNY -- function defined by X = F(Y)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGFUNY (FX, N, YMIN, YMAX, PGFLAG)
 use giza, only:giza_function_y
 implicit none
 real, external :: FX
 integer, intent(in) :: N
 real,    intent(in) :: YMIN, YMAX
 integer, intent(in) :: PGFLAG

 call giza_function_y(FX, N, YMIN, YMAX, PGFLAG)

end subroutine PGFUNY

!------------------------------------------------------------------------
! Module: PGGRAY -- gray-scale map of a 2D data array
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGGRAY (A, IDIM, JDIM, I1, I2, J1, J2, FG, BG, TR)
 use giza,       only:giza_render_gray,giza_extend_none
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, I2, J1, J2
 real,    intent(in) :: A(IDIM,JDIM), FG, BG, TR(6)
 real, dimension(6)  :: affine

 call convert_tr_to_affine(tr,affine)
 call giza_render_gray(idim,jdim,a,i1-1,i2-1,j1-1,j2-1,fg,bg,giza_extend_none,affine)

end subroutine PGGRAY

!------------------------------------------------------------------------
! Module: PGHI2D -- cross-sections through a 2D data array
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGHI2D (DATA, NXV, NYV, IX1, IX2, IY1, IY2, X, IOFF, BIAS, CENTER, YLIMS)
 implicit none
 integer, intent(in) :: NXV, NYV, IX1, IX2, IY1, IY2
 real,    intent(in) :: DATA(NXV,NYV)
 real,    intent(in) :: X(IX2-IX1+1), YLIMS(IX2-IX1+1)
 integer, intent(in) :: IOFF
 real,    intent(in) :: BIAS
 logical, intent(in) :: CENTER

end subroutine PGHI2D

!------------------------------------------------------------------------
! Module: PGHIST -- histogram of unbinned data
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGHIST(N, DATA, DATMIN, DATMAX, NBIN, PGFLAG)
 use giza, only:giza_histogram
 implicit none
 integer, intent(in) :: N
 real,    intent(in) :: DATA(*)
 real,    intent(in) :: DATMIN, DATMAX
 integer, intent(in) :: NBIN, PGFLAG

 call giza_histogram(N,DATA,DATMIN,DATMAX,NBIN,PGFLAG)

end subroutine PGHIST

!------------------------------------------------------------------------
! Module: PGIDEN -- write username, date, and time at bottom of plot
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGIDEN
 use giza, only:giza_print_id
 implicit none
 
 call giza_print_id()

end subroutine PGIDEN

!------------------------------------------------------------------------
! Module: PGIMAG -- color image from a 2D data array
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGIMAG (A, IDIM, JDIM, I1, I2, J1, J2, A1, A2, TR)
 use giza,       only:giza_render,giza_extend_none
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, I2, J1, J2
 real,    intent(in) :: A(IDIM,JDIM), A1, A2, TR(6)
 real                :: affine(6)

 call convert_tr_to_affine(tr,affine)
 call giza_render(idim,jdim,a,i1-1,i2-1,j1-1,j2-1,a1,a2,giza_extend_none,affine)

end subroutine PGIMAG

!------------------------------------------------------------------------
! Module: PGLAB -- write labels for x-axis, y-axis, and top of plot
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGLAB (XLBL, YLBL, TOPLBL)
 use giza, only:giza_label
 implicit none
 character*(*), intent(in) :: XLBL, YLBL, TOPLBL

 call giza_label(XLBL,YLBL,TOPLBL)

end subroutine PGLAB

!------------------------------------------------------------------------
! Module: PGLCUR -- draw a line using the cursor
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGLCUR (MAXPT, NPT, X, Y)
 use giza, only:giza_mark_line
 implicit none
 integer, intent(in) :: MAXPT
 integer, intent(inout) :: NPT
 real,    intent(inout) :: X(*), Y(*)

 call giza_mark_line(MAXPT, NPT, X, Y)

end subroutine PGLCUR

!------------------------------------------------------------------------
! Module: PGLDEV -- list available device types on standard output
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGLDEV
 use giza, only:giza_print_device_list
 implicit none
 
 call giza_print_device_list()

end subroutine PGLDEV

!------------------------------------------------------------------------
! Module: PGLEN -- find length of a string in a variety of units
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGLEN (UNITS, STRING, XL, YL)
 use gizapgplot, only:units_giza
 use giza,       only:giza_qtextlen
 implicit none
 real,          intent(out) :: XL, YL
 integer,       intent(in) :: UNITS
 character*(*), intent(in) :: STRING

 call giza_qtextlen(units_giza(UNITS),STRING,XL,YL)

end subroutine PGLEN

!------------------------------------------------------------------------
! Module: PGLINE -- draw a polyline (curve defined by line-segments)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGLINE (N, XPTS, YPTS)
 use giza, only:giza_line
 implicit none
 integer, intent(in) :: N
 real,    intent(in) :: XPTS(*), YPTS(*)

 call giza_line(N,XPTS,YPTS)

end subroutine PGLINE

!------------------------------------------------------------------------
! Module: PGMOVE -- move pen (change current pen position)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGMOVE (X, Y)
 use giza, only:giza_move
 implicit none
 real, intent(in) :: X, Y

 call giza_move(X, Y)

end subroutine PGMOVE

!------------------------------------------------------------------------
! Module: PGMTXT -- write text at position relative to viewport
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGMTXT (SIDE, DISP, COORD, FJUST, TEXT)
 use giza, only:giza_annotate
 implicit none
 character*(*), intent(in) :: SIDE, TEXT
 real, intent(in) :: DISP, COORD, FJUST

 call giza_annotate(SIDE,DISP,COORD,FJUST,TEXT)

end subroutine PGMTXT

!------------------------------------------------------------------------
! Module: PGNCUR -- mark a set of points using the cursor
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGNCUR (MAXPT, NPT, X, Y, SYMBOL)
 use giza, only:giza_mark_points_ordered
 implicit none
 integer, intent(in)    :: MAXPT
 integer, intent(inout) :: NPT
 real,    intent(inout) :: X(*), Y(*)
 integer, intent(in)    :: SYMBOL

 call giza_mark_points_ordered(MAXPT, NPT, X, Y, SYMBOL)

end subroutine PGNCUR

!------------------------------------------------------------------------
! Module: PGNUMB -- convert a number into a plotable character string
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGNUMB (MM, PP, FORM, STRING, NC)
 use giza, only:giza_format_number
 implicit none
 integer,       intent(in)  :: MM, PP, FORM
 character*(*), intent(out) :: STRING
 integer,       intent(out) :: NC

 call giza_format_number(mm,pp,form,string)
 nc = len_trim(string)

end subroutine PGNUMB

!------------------------------------------------------------------------
! Module: PGOLIN -- mark a set of points using the cursor
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGOLIN (MAXPT, NPT, X, Y, SYMBOL)
 use giza, only:giza_mark_points
 implicit none
 integer, intent(in)    :: MAXPT
 integer, intent(inout) :: NPT
 real,    intent(inout) :: X(*), Y(*)
 integer, intent(in)    :: SYMBOL

 call giza_mark_points(maxpt,npt,x,y,symbol)

end subroutine PGOLIN

!------------------------------------------------------------------------
! Module: PGOPEN -- open a graphics device
! Status: IMPLEMENTED
!------------------------------------------------------------------------
integer function PGOPEN (DEVICE)
 use giza, only:giza_open_device,giza_set_colour_palette,giza_colour_palette_pgplot
! use giza, only:giza_open_device_size,giza_units_mm,giza_units_inches
 implicit none
 character*(*), intent(in) :: DEVICE

! print*,'giza units mm = ',giza_units_mm
! pgopen = giza_open_device_size(device,'giza',11.0,8.5,giza_units_inches)
 pgopen = giza_open_device(device,'giza')
 
 call giza_set_colour_palette(giza_colour_palette_pgplot)

end function PGOPEN

!------------------------------------------------------------------------
! Module: PGPAGE -- advance to new page
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPAGE
 use giza, only:giza_change_page
 implicit none
 
 call giza_change_page

end subroutine PGPAGE

!------------------------------------------------------------------------
! Module: PGPANL -- switch to a different panel on the view surface
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPANL(IX, IY)
 use giza, only:giza_set_panel
 implicit none
 integer, intent(in) :: IX, IY

 call giza_set_panel(IX, IY)

end subroutine PGPANL

!------------------------------------------------------------------------
! Module: PGPAP -- change the size of the view surface 
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPAP (WIDTH, ASPECT)
 use giza, only:giza_set_paper_size, giza_units_inches
 implicit none
 real, intent(in) :: WIDTH, ASPECT

 call giza_set_paper_size(giza_units_inches,WIDTH,WIDTH*ASPECT)

end subroutine PGPAP

!------------------------------------------------------------------------
! Module: PGPIXL -- draw pixels
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPIXL (IA, IDIM, JDIM, I1, I2, J1, J2, X1, X2, Y1, Y2)
 use giza, only:giza_draw_pixels,giza_extend_none
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, I2, J1, J2
 integer, intent(in) :: IA(IDIM,JDIM)
 real,    intent(in) :: X1, X2, Y1, Y2

 call giza_draw_pixels(IDIM, JDIM, IA, I1-1, I2-1, J1-1, J2-1, X1, X2, Y1, Y2,&
                       giza_extend_none)

end subroutine PGPIXL

!------------------------------------------------------------------------
! Module: PGPNTS -- draw several graph markers, not all the same
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPNTS (N, X, Y, SYMBOL, NS)
 implicit none
 integer, intent(in) :: N, NS
 real,    intent(in) :: X(*), Y(*)
 integer, intent(in) :: SYMBOL(*)

end subroutine PGPNTS

!------------------------------------------------------------------------
! Module: PGPOLY -- draw a polygon, using fill-area attributes
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPOLY (N, XPTS, YPTS)
 use giza, only:giza_polygon
 implicit none
 integer, intent(in) :: N
 real,    intent(in) :: XPTS(*), YPTS(*)

 call giza_polygon(N, XPTS, YPTS)

end subroutine PGPOLY

!------------------------------------------------------------------------
! Module: PGPT -- draw several graph markers
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPT (N, XPTS, YPTS, SYMBOL)
 use giza, only:giza_points
 implicit none
 integer, intent(in) :: N
 real,    intent(in) :: XPTS(*), YPTS(*)
 integer, intent(in) :: SYMBOL

 call giza_points(n,xpts,ypts,symbol)

end subroutine PGPT

!------------------------------------------------------------------------
! Module: PGPT1 -- draw one graph marker
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPT1 (XPT, YPT, SYMBOL)
 use giza, only:giza_single_point
 implicit none
 real,    intent(in) :: XPT, YPT
 integer, intent(in) :: SYMBOL

 call giza_single_point(xpt,ypt,symbol)

end subroutine PGPT1

!------------------------------------------------------------------------
! Module: PGPTXT -- write text at arbitrary position and angle
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPTXT (X, Y, ANGLE, FJUST, TEXT)
 use giza, only:giza_ptext
 implicit none
 real,          intent(in) :: X, Y, ANGLE, FJUST
 character*(*), intent(in) :: TEXT

 call giza_ptext(X, Y, ANGLE, FJUST, TEXT)

end subroutine PGPTXT

!------------------------------------------------------------------------
! Module: PGQAH -- inquire arrow-head style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQAH (FS, ANGLE, BARB)
 use giza, only:giza_get_arrow_style
 implicit none
 integer, intent(out) :: FS
 real,    intent(out) :: ANGLE, BARB

 call giza_get_arrow_style(FS, ANGLE, BARB)

end subroutine PGQAH

!------------------------------------------------------------------------
! Module: PGQCF -- inquire character font
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQCF (FONT)
 use gizapgplot, only:pgfont
 implicit none
 integer, intent(out) :: FONT

 !
 !--this is a setting for the PGPLOT frontend only
 !  (giza has much more general fonts than PGPLOT)
 !
 !  the value of pgfont is set by the call to PGSCF 
 !
 FONT = pgfont

end subroutine PGQCF

!------------------------------------------------------------------------
! Module: PGQCH -- inquire character height
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQCH (SIZE)
 use giza, only:giza_get_character_height
 implicit none
 real, intent(out) :: SIZE
 
 call giza_get_character_height(SIZE)

end subroutine PGQCH

!------------------------------------------------------------------------
! Module: PGQCI -- inquire color index
! Status: IMPLEMENTED
!------------------------------------------------------------------------

subroutine PGQCI (CI)
 use giza, only:giza_get_colour_index
 implicit none
 integer, intent(out) :: CI

 call giza_get_colour_index(CI)

end subroutine PGQCI

!------------------------------------------------------------------------
! Module: PGQCIR -- inquire color index range
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQCIR(ICILO, ICIHI)
 use giza, only:giza_get_colour_index_range
 implicit none
 integer, intent(out) :: ICILO, ICIHI

 call giza_get_colour_index_range(ICILO,ICIHI)

end subroutine PGQCIR

!------------------------------------------------------------------------
! Module: PGQCLP -- inquire clipping status
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQCLP(STATE)
 use giza, only:giza_get_clipping
 implicit none
 integer, intent(out) :: STATE
 
 call giza_get_clipping(STATE)

end subroutine PGQCLP

!------------------------------------------------------------------------
! Module: PGQCOL -- inquire color capability
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQCOL (CI1, CI2)
 use giza, only:giza_colour_index_min,giza_colour_index_max
 implicit none
 integer, intent(out) :: CI1, CI2

 CI1 = giza_colour_index_min
 CI2 = giza_colour_index_max

end subroutine PGQCOL

!------------------------------------------------------------------------
! Module: PGQCR  -- inquire color representation
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQCR (CI, CR, CG, CB)
 use giza, only:giza_get_colour_representation
 implicit none
 integer, intent(in)  :: CI
 real,    intent(out) :: CR, CG, CB

 call giza_get_colour_representation(CI, CR, CG, CB)

end subroutine PGQCR

!------------------------------------------------------------------------
! Module: PGQCS  -- inquire character height in a variety of units
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQCS(UNITS, XCH, YCH)
 use giza,       only:giza_get_character_size
 use gizapgplot, only:units_giza
 implicit none
 integer, intent(in)  :: UNITS
 real,    intent(out) :: XCH, YCH

 call giza_get_character_size(units_giza(UNITS), XCH, YCH)

end subroutine PGQCS

!------------------------------------------------------------------------
! Module: PGQDT -- inquire name of nth available device type
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQDT(N, TYPE, TLEN, DESCR, DLEN, INTER)
 implicit none
 integer, intent(in) :: N
 character*(*), intent(out) :: TYPE, DESCR
 integer, intent(out) :: TLEN, DLEN, INTER

end subroutine PGQDT

!------------------------------------------------------------------------
! Module: PGQFS -- inquire fill-area style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQFS (FS)
 use giza, only:giza_get_fill
 implicit none
 integer, intent(out) :: FS
 
 call giza_get_fill(FS)

end subroutine PGQFS

!------------------------------------------------------------------------
! Module: PGQHS -- inquire hatching style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQHS (ANGLE, SEPN, PHASE)
 use giza, only:giza_get_hatching_style
 implicit none
 real, intent(out) :: ANGLE, SEPN, PHASE

 call giza_get_hatching_style(ANGLE,SEPN,PHASE)

end subroutine PGQHS

!------------------------------------------------------------------------
! Module: PGQID -- inquire current device identifier
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQID (ID)
 use giza, only:giza_get_device_id
 implicit none
 integer, intent(out) :: ID

 call giza_get_device_id(ID)

end subroutine PGQID

!------------------------------------------------------------------------
! Module: PGQINF -- inquire PGPLOT general information
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQINF (ITEM, VALUE, LENGTH)
 use giza, only:giza_query_device,giza_version_string
 implicit none
 character*(*), intent(in) :: ITEM
 character*(*), intent(out) :: VALUE
 integer,       intent(out) :: LENGTH

 character(len=10) :: datestring,timestring

 select case(trim(item))
 case('VERSION','version')
    value = 'giza-'//trim(giza_version_string)
 case('STATE','state')
    call giza_query_device('state',value)
 case('USER','user')
    call giza_query_device('user',value)
 case('NOW','now')
    call date_and_time(datestring,timestring)
    value = datestring(7:8)//'-'//datestring(5:6)//'-'//datestring(1:4)// &
            ' '//timestring(1:2)//':'//timestring(3:4)
 case('DEVICE','device')
    call giza_query_device('device',value)
 case('FILE','file')
    call giza_query_device('file',value)
 case('TYPE','type')
    call giza_query_device('type',value)
 case('DEV/TYPE','dev/type')
    call giza_query_device('dev/type',value)
 case('HARDCOPY','hardcopy')
    call giza_query_device('hardcopy',value)
 case('TERMINAL','terminal')
    !--in giza the current device is never the terminal
    value = 'NO'
 case('CURSOR','cursor')
    call giza_query_device('cursor',value)
 case('SCROLL','scroll')
    !--no scroll capability in any current giza devices
    value = 'NO'
 case default
    value = ' '
 end select
 length = len_trim(value)

end subroutine PGQINF

!------------------------------------------------------------------------
! Module: PGQITF -- inquire image transfer function
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQITF (ITF)
 implicit none
 integer, intent(out) :: ITF

end subroutine PGQITF

!------------------------------------------------------------------------
! Module: PGQLS -- inquire line style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQLS (LS)
 use giza, only:giza_get_line_style
 implicit none
 integer, intent(out) :: LS
 
 call giza_get_line_style(LS)

end subroutine PGQLS

!------------------------------------------------------------------------
! Module: PGQLW -- inquire line width
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQLW (LW)
 use giza, only:giza_get_line_width
 implicit none
 integer, intent(out) :: LW
 real :: giza_lw
 
 call giza_get_line_width(giza_lw)
 LW = int(2.*giza_lw)

end subroutine PGQLW

!------------------------------------------------------------------------
! Module: PGQNDT -- inquire number of available device types
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQNDT(N)
 implicit none
 integer, intent(out) :: N
 
 N = 1

end subroutine PGQNDT

!------------------------------------------------------------------------
! Module: PGQPOS -- inquire current pen position
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQPOS (X, Y)
 use giza, only:giza_get_current_point
 implicit none
 real, intent(out) :: X, Y

 call giza_get_current_point(X, Y)

end subroutine PGQPOS

!------------------------------------------------------------------------
! Module: PGQTBG -- inquire text background color index
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQTBG (TBCI)
 use giza, only:giza_get_text_background
 implicit none
 integer, intent(out) :: TBCI
 
 call giza_get_text_background(TBCI)

end subroutine PGQTBG

!------------------------------------------------------------------------
! Module: PGQTXT -- find bounding box of text string
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQTXT (X, Y, ANGLE, FJUST, TEXT, XBOX, YBOX)
 use giza, only:giza_qtext
 implicit none
 real, intent(in) :: X, Y, ANGLE, FJUST
 character*(*), intent(in) :: TEXT
 real, intent(out) :: XBOX(4), YBOX(4)

 call giza_qtext(X, Y, ANGLE, FJUST, TEXT, XBOX, YBOX)

end subroutine PGQTXT

!------------------------------------------------------------------------
! Module: PGQVP -- inquire viewport size and position
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQVP (UNITS, X1, X2, Y1, Y2)
 use giza,       only:giza_get_viewport
 use gizapgplot, only:units_giza
 implicit none
 integer, intent(in) :: UNITS
 real,   intent(out) :: X1, X2, Y1, Y2

 call giza_get_viewport(units_giza(UNITS), X1, X2, Y1, Y2)

end subroutine PGQVP

!------------------------------------------------------------------------
! Module: PGQVSZ -- inquire size of view surface
! Status: IMPLEMENTED
!-----------------------------------------------------------------------
subroutine PGQVSZ (UNITS, X1, X2, Y1, Y2)
 use giza,       only:giza_get_paper_size
 use gizapgplot, only:units_giza
 implicit none
 integer, intent(in)  :: UNITS
 real,    intent(out) :: X1, X2, Y1, Y2
 
 X1 = 0.
 Y1 = 0.
 call giza_get_paper_size(units_giza(UNITS),X2,Y2)
 
end subroutine PGQVSZ

!------------------------------------------------------------------------
! Module: PGQWIN -- inquire window boundary coordinates
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGQWIN (X1, X2, Y1, Y2)
 use giza, only:giza_get_window
 implicit none
 real, intent(out) :: X1, X2, Y1, Y2

 call giza_get_window(X1, X2, Y1, Y2)

end subroutine PGQWIN

!------------------------------------------------------------------------
! Module: PGRECT -- draw a rectangle, using fill-area attributes
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGRECT (X1, X2, Y1, Y2)
 use giza, only:giza_rectangle
 implicit none
 real, intent(in) :: X1, X2, Y1, Y2

 call giza_rectangle(X1, X2, Y1, Y2)

end subroutine PGRECT

!------------------------------------------------------------------------
! Module: PGRND -- find the smallest `round' number greater than x
! Status: IMPLEMENTED
!------------------------------------------------------------------------
real function PGRND (X, NSUB)
 use giza, only:giza_round
 implicit none
 real,    intent(in)  :: X
 integer, intent(out) :: NSUB

 PGRND = giza_round(X, NSUB)

end function PGRND

!------------------------------------------------------------------------
! Module: PGRNGE -- choose axis limits
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGRNGE (X1, X2, XLO, XHI)
 implicit none
 real, intent(in)  :: X1, X2
 real, intent(out) :: XLO, XHI
 real :: dx

 dx = X2-X1
 XLO = X1 - 0.1*dx
 XHI = X2 + 0.1*dx
 if (XLO.lt.0. .and. X1.ge.0.) XLO = 0.
 if (XHI.gt.0. .and. X2.le.0.) XHI = 0.

end subroutine PGRNGE

!------------------------------------------------------------------------
! Module: PGSAH -- set arrow-head style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSAH (FS, ANGLE, BARB)
 use giza, only:giza_set_arrow_style
 implicit none
 integer, intent(in) :: FS
 real,    intent(in) :: ANGLE, BARB

 call giza_set_arrow_style(FS, ANGLE, BARB)

end subroutine PGSAH

!------------------------------------------------------------------------
! Module: PGSAVE -- save PGPLOT attributes
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSAVE
 use giza, only:giza_save
 implicit none
 
 call giza_save()

end subroutine PGSAVE

!------------------------------------------------------------------------
! Module: PGUNSA -- restore PGPLOT attributes
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGUNSA
 use giza, only:giza_restore
 implicit none
 
 call giza_restore()

end subroutine PGUNSA

!------------------------------------------------------------------------
! Module: PGSCF -- set character font
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCF (FONT)
 use giza,       only:giza_set_font,giza_set_font_italic !,giza_set_font_bold
 use gizapgplot, only:pgfont
 implicit none
 integer, intent(in) :: FONT
 
 select case(FONT)
 case(4) 
    call giza_set_font('cursive')
 case(3) 
    call giza_set_font_italic('times')
 case(2)
    call giza_set_font('times')
 case default
    call giza_set_font('arial')
 end select
 !
 !--this is a setting for the PGPLOT frontend only
 !  (giza has much more general fonts than PGPLOT)
 !
 !  set pgfont so that query calls to PGQCF are successful 
 !
 pgfont = FONT

end subroutine PGSCF

!------------------------------------------------------------------------
! Module: PGSCH -- set character height
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCH (SIZE)
 use giza, only:giza_set_character_height
 implicit none
 real, intent(in) :: SIZE
 
 call giza_set_character_height(SIZE)

end subroutine PGSCH

!------------------------------------------------------------------------
! Module: PGSCI -- set color index
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCI (CI)
 use giza, only:giza_set_colour_index
 implicit none
 integer, intent(in) :: CI

 call giza_set_colour_index(CI)

end subroutine PGSCI

!------------------------------------------------------------------------
! Module: PGSCIR -- set color index range
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCIR(ICILO, ICIHI)
 use giza, only:giza_set_colour_index_range
 implicit none
 integer, intent(in) :: ICILO, ICIHI
 
 call giza_set_colour_index_range(ICILO,ICIHI)

end subroutine PGSCIR

!------------------------------------------------------------------------
! Module: PGSCLP -- enable or disable clipping at edge of viewport
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCLP(STATE)
 use giza, only:giza_set_clipping
 integer, intent(in) :: STATE

 call giza_set_clipping(STATE)

end subroutine PGSCLP

!------------------------------------------------------------------------
! Module: PGSCR -- set color representation
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCR (CI, CR, CG, CB)
 use giza, only:giza_set_colour_representation
 implicit none
 integer, intent(in) :: CI
 real,    intent(in) :: CR, CG, CB

 call giza_set_colour_representation(CI, CR, CG, CB)

end subroutine PGSCR

!------------------------------------------------------------------------
! Module: PGSCRL -- scroll window
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCRL (DX, DY)
 implicit none
 real, intent(in) :: DX, DY

end subroutine PGSCRL

!------------------------------------------------------------------------
! Module: PGSCRN -- set color representation by name
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSCRN(CI, NAME, IER)
 implicit none
 integer,       intent(in)  :: CI
 character*(*), intent(in)  :: NAME
 integer,       intent(out) :: IER

end subroutine PGSCRN

!------------------------------------------------------------------------
! Module: PGSFS -- set fill-area style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSFS (FS)
 use giza, only:giza_set_fill
 implicit none
 integer, intent(in) :: FS
 
 call giza_set_fill(FS)

end subroutine PGSFS

!------------------------------------------------------------------------
! Module: PGSHLS -- set color representation using HLS system
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSHLS (CI, CH, CL, CS)
 use giza, only:giza_set_colour_representation_hls
 implicit none
 integer, intent(in) :: CI
 real,    intent(in) :: CH, CL, CS
 
 call giza_set_colour_representation_hls(CI, CH, CL, CS)

end subroutine PGSHLS

!------------------------------------------------------------------------
! Module: PGSHS -- set hatching style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSHS (ANGLE, SEPN, PHASE)
 use giza, only:giza_set_hatching_style
 implicit none
 real, intent(in) :: ANGLE, SEPN, PHASE

 call giza_set_hatching_style(ANGLE,SEPN,PHASE)

end subroutine PGSHS

!------------------------------------------------------------------------
! Module: PGSITF -- set image transfer function
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSITF (ITF)
 implicit none
 integer, intent(in) :: ITF

end subroutine PGSITF

!------------------------------------------------------------------------
! Module: PGSLCT -- select an open graphics device
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSLCT(ID)
 use giza, only:giza_select_device
 integer, intent(in) :: ID
 integer :: ierr

 call giza_select_device(ID)

end subroutine PGSLCT

!------------------------------------------------------------------------
! Module: PGSLS -- set line style
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSLS (LS)
 use giza, only:giza_set_line_style,giza_ls_solid,giza_ls_short_dash, &
                giza_ls_long_dash, giza_ls_dot, giza_ls_dash_dot, &
                giza_ls_dash_dot_dot_dot
 implicit none
 integer, intent(in) :: LS
 
 select case(LS)
 case(1)
    call giza_set_line_style(giza_ls_solid) 
 case(2)
    call giza_set_line_style(giza_ls_short_dash)
 case(3)
    call giza_set_line_style(giza_ls_dash_dot)
 case(4)
    call giza_set_line_style(giza_ls_dot)
 case(5)
    call giza_set_line_style(giza_ls_dash_dot_dot_dot) 
 case(6) ! extension: we allow extra line styles beyond PGPLOT
    call giza_set_line_style(giza_ls_long_dash)
 case default
    call giza_set_line_style(giza_ls_solid)
 end select

end subroutine PGSLS

!------------------------------------------------------------------------
! Module: PGSLW -- set line width
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSLW (LW)
 use giza, only:giza_set_line_width
 implicit none
 integer, intent(in) :: LW
 
 call giza_set_line_width(0.5 + 0.5*LW)
 
end subroutine PGSLW

!------------------------------------------------------------------------
! Module: PGSTBG -- set text background color index
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSTBG (TBCI)
 use giza, only:giza_set_text_background
 implicit none
 integer, intent(in) :: TBCI
 
 call giza_set_text_background(TBCI)

end subroutine PGSTBG

!------------------------------------------------------------------------
! Module: PGSUBP -- subdivide view surface into panels
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSUBP (NXSUB, NYSUB)
 use giza, only:giza_subpanel
 implicit none
 integer, intent(in) :: NXSUB, NYSUB

 call giza_subpanel(NXSUB, NYSUB)

end subroutine PGSUBP

!------------------------------------------------------------------------
! Module: PGSVP -- set viewport (normalized device coordinates)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSVP (XLEFT, XRIGHT, YBOT, YTOP)
 use giza, only:giza_set_viewport
 implicit none
 real, intent(in) :: XLEFT, XRIGHT, YBOT, YTOP

 call giza_set_viewport(XLEFT, XRIGHT, YBOT, YTOP)

end subroutine PGSVP

!------------------------------------------------------------------------
! Module: PGSWIN -- set window
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGSWIN (X1, X2, Y1, Y2)
 use giza, only:giza_set_window
 implicit none
 real, intent(in) :: X1, X2, Y1, Y2

 call giza_set_window(X1, X2, Y1, Y2)

end subroutine PGSWIN

!------------------------------------------------------------------------
! Module: PGTBOX -- draw frame and write (DD) HH MM SS.S labelling
! Status: PARTIALLY IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGTBOX (XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)
 use giza, only:giza_box_time
 implicit none
 real,      intent(in) :: XTICK, YTICK
 integer,   intent(in) :: NXSUB, NYSUB
 character, intent(in) :: XOPT*(*), YOPT*(*)

 call giza_box_time(XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)

end subroutine PGTBOX

!------------------------------------------------------------------------
! Module: PGTEXT -- write text (horizontal, left-justified)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGTEXT (X, Y, TEXT)
 use giza, only:giza_text
 implicit none
 real,          intent(in) :: X, Y
 character*(*), intent(in) :: TEXT
 
 call giza_text(X, Y, TEXT)

end subroutine PGTEXT

!------------------------------------------------------------------------
! Module: PGTICK -- draw a single tick mark on an axis
! Status: NOT IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGTICK (X1, Y1, X2, Y2, V, TIKL, TIKR, DISP, ORIENT, STR)
 implicit none
 real, intent(in) :: X1, Y1, X2, Y2, V, TIKL, TIKR, DISP, ORIENT
 character*(*), intent(in) :: STR

end subroutine PGTICK

!------------------------------------------------------------------------
! Module: PGUPDT -- update display
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGUPDT
 use giza, only:giza_flush_buffer
 implicit none
 
 call giza_flush_buffer()

end subroutine PGUPDT

!------------------------------------------------------------------------
! Module: PGVECT -- vector map of a 2D data array, with blanking
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGVECT (A, B, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR, BLANK)
 use giza,       only:giza_vector
 use gizapgplot, only:convert_tr_to_affine
 implicit none
 integer, intent(in) :: IDIM, JDIM, I1, I2, J1, J2, NC
 real,    intent(in) :: A(IDIM,JDIM), B(IDIM, JDIM), TR(6), BLANK, C
 real                :: affine(6)

 call convert_tr_to_affine(tr,affine)
 call giza_vector(idim,jdim,a,b,i1-1,i2-1,j1-1,j2-1,c,nc,affine,blank)

end subroutine PGVECT

!------------------------------------------------------------------------
! Module: PGVSIZ -- set viewport (inches)
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGVSIZ (XLEFT, XRIGHT, YBOT, YTOP)
 use giza, only:giza_set_viewport_inches
 implicit none
 real, intent(in) :: XLEFT, XRIGHT, YBOT, YTOP

 call giza_set_viewport_inches(XLEFT, XRIGHT, YBOT, YTOP)

end subroutine PGVSIZ

!------------------------------------------------------------------------
! Module: PGVSTD -- set standard (default) viewport
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGVSTD
 use giza, only:giza_set_viewport_default
 implicit none
 
 call giza_set_viewport_default()

end subroutine PGVSTD

!------------------------------------------------------------------------
! Module: PGWEDG -- annotate an image plot with a wedge
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGWEDG(SIDE, DISP, WIDTH, FG, BG, LABEL)
 use giza, only:giza_colour_bar
 implicit none
 character *(*), intent(in) :: SIDE,LABEL
 real,           intent(in) :: DISP, WIDTH, FG, BG

 call giza_colour_bar(SIDE, DISP, WIDTH, FG, BG, LABEL)

end subroutine PGWEDG

!------------------------------------------------------------------------
! Module: PGWNAD -- set window and adjust viewport to same aspect ratio
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGWNAD (X1, X2, Y1, Y2)
 use giza, only:giza_set_window_equal_scale
 implicit none
 real, intent(in) :: X1, X2, Y1, Y2

 call giza_set_window_equal_scale(X1, X2, Y1, Y2)

end subroutine PGWNAD

!------------------------------------------------------------------------
! Module: PGADVANCE -- non-standard alias for PGPAGE
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGADVANCE
 implicit none
 
 call PGPAGE

end subroutine PGADVANCE

!------------------------------------------------------------------------
! Module: PGBEGIN -- non-standard alias for PGBEG
! Status: IMPLEMENTED
!------------------------------------------------------------------------
integer function PGBEGIN (UNIT, FILE, NXSUB, NYSUB)
 implicit none
 integer,       intent(in) :: UNIT
 character*(*), intent(in) :: FILE
 integer,       intent(in) :: NXSUB, NYSUB
 integer, external :: PGBEG

 PGBEGIN = PGBEG(UNIT,FILE,NXSUB,NYSUB)

end function PGBEGIN

!------------------------------------------------------------------------
! Module: PGCURSE -- non-standard alias for PGCURS
! Status: IMPLEMENTED
!------------------------------------------------------------------------
integer function PGCURSE (X, Y, CH)
 implicit none
 real,        intent(inout) :: X, Y
 character*1, intent(inout) :: CH
 integer, external :: PGCURS

 PGCURSE = PGCURS(X, Y, CH)

end function PGCURSE

!------------------------------------------------------------------------
! Module: PGLABEL -- non-standard alias for PGLAB
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGLABEL (XLBL, YLBL, TOPLBL)
 implicit none
 character*(*), intent(in) :: XLBL, YLBL, TOPLBL

 call PGLAB(XLBL, YLBL, TOPLBL)

end subroutine PGLABEL

!------------------------------------------------------------------------
! Module: PGMTEXT -- non-standard alias for PGMTXT
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGMTEXT (SIDE, DISP, COORD, FJUST, TEXT)
 implicit none
 character*(*), intent(in) :: SIDE, TEXT
 real,          intent(in) :: DISP, COORD, FJUST

 call PGMTXT(SIDE, DISP, COORD, FJUST, TEXT)

end subroutine PGMTEXT

!------------------------------------------------------------------------
! Module: PGNCURSE -- non-standard alias for PGNCUR
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGNCURSE (MAXPT, NPT, X, Y, SYMBOL)
 implicit none
 integer, intent(in)  :: MAXPT
 integer, intent(out) :: NPT
 real,    intent(out) :: X(*), Y(*)
 integer, intent(in)  :: SYMBOL

 CALL PGNCUR(MAXPT, NPT, X, Y, SYMBOL)

end subroutine PGNCURSE

!------------------------------------------------------------------------
! Module: PGPAPER -- non-standard alias for PGPAP
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPAPER (WIDTH, ASPECT)
 implicit none
 real, intent(in) :: WIDTH, ASPECT

 call PGPAP(WIDTH, ASPECT)

end subroutine PGPAPER

!------------------------------------------------------------------------
! Module: PGPOINT -- non-standard alias for PGPT
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPOINT (N, XPTS, YPTS, SYMBOL)
 implicit none
 integer, intent(in) :: N
 real,    intent(in) :: XPTS(*), YPTS(*)
 integer, intent(in) :: SYMBOL

 call PGPT(N, XPTS, YPTS, SYMBOL)

end subroutine PGPOINT

!------------------------------------------------------------------------
! Module: PGPTEXT -- non-standard alias for PGPTXT
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGPTEXT (X, Y, ANGLE, FJUST, TEXT)
 implicit none
 real, intent(in) :: X, Y, ANGLE, FJUST
 character*(*), intent(in) :: TEXT

 call PGPTXT(X, Y, ANGLE, FJUST, TEXT)

end subroutine PGPTEXT

!------------------------------------------------------------------------
! Module: PGVPORT -- non-standard alias for PGSVP
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGVPORT (XLEFT, XRIGHT, YBOT, YTOP)
 implicit none
 real, intent(in) :: XLEFT, XRIGHT, YBOT, YTOP

 call PGSVP(XLEFT, XRIGHT, YBOT, YTOP)

end subroutine PGVPORT

!------------------------------------------------------------------------
! Module: PGVSIZE -- non-standard alias for PGVSIZ
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGVSIZE (XLEFT, XRIGHT, YBOT, YTOP)
 implicit none
 real, intent(in) :: XLEFT, XRIGHT, YBOT, YTOP

 call PGVSIZ(XLEFT, XRIGHT, YBOT, YTOP)
 
end subroutine PGVSIZE

!------------------------------------------------------------------------
! Module: PGVSTAND -- non-standard alias for PGVSTD
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGVSTAND
 implicit none

 call PGVSTD

end subroutine PGVSTAND

!------------------------------------------------------------------------
! Module: PGWINDOW -- non-standard alias for PGSWIN
! Status: IMPLEMENTED
!------------------------------------------------------------------------
subroutine PGWINDOW (X1, X2, Y1, Y2)
 implicit none
 real, intent(in) :: X1, X2, Y1, Y2

 call PGSWIN(X1, X2, Y1, Y2)

end subroutine PGWINDOW