1*-----------------------------------------------------------------------
2*     COLOR TO TONE CONVERSION TABLE LOADING
3*-----------------------------------------------------------------------
4*     Copyright (C) 2000-2004 GFD Dennou Club. All rights reserved.
5*-----------------------------------------------------------------------
6      SUBROUTINE SZCLTN(ICPAT,MAXCLI)
7
8      INTEGER   ICPAT(*)
9
10      CHARACTER CFILE*80
11
12      EXTERNAL  IUFOPN
13
14      SAVE
15
16
17*     / INITIALIZE /
18
19      DO 10 I=1,MAXCLI
20        ICPAT(I)=-1
21   10 CONTINUE
22
23*     / OPEN TABLE FILE : MAYBE SYSTEM DEPENDENT /
24
25      CALL SWQFNM('CL2TN',CFILE)
26      IF (CFILE.EQ.' ') THEN
27        CALL MSGDMP('E','SZCLTN',
28     +       'COLOR TO TONE CONVERSION TABLE DOES NOT EXIST.')
29      END IF
30
31      IU=IUFOPN()
32      OPEN(IU,FILE=CFILE,FORM='FORMATTED')
33      REWIND(IU)
34
35*     / LOAD CONVERSION TABLE /
36
37   20 CONTINUE
38        READ(IU,*,IOSTAT=IOS) ICI,IPAT
39        IF (ICI.GT.MAXCLI .OR. ICI.LE.0) THEN
40          CALL MSGDMP('E','SZCLTN','COLOR INDEX IS INVALID')
41        END IF
42        ICPAT(ICI)=IPAT
43      IF (IOS.EQ.0) GO TO 20
44
45*     / CLOSE TABLE FILE /
46
47      CLOSE(IU)
48
49      END
50