1c
2c     Functions in the FORTRAN interface
3
4      integer nccre, ncopn, ncddef, ncdid, ncvdef, ncvid, nctlen
5      integer ncsfil
6      external nccre, ncopn, ncddef, ncdid, ncvdef, ncvid, nctlen
7      external ncsfil
8
9      integer NCRDWR,NCCREAT,NCEXCL,NCINDEF,NCNSYNC,NCHSYNC
10      integer NCNDIRTY,NCHDIRTY,NCLINK,NCNOWRIT,NCWRITE
11      integer NCCLOB,NCNOCLOB,NCGLOBAL,NCFILL,NCNOFILL
12      integer MAXNCOP,MAXNCDIM,MAXNCATT,MAXNCVAR
13      integer MAXNCNAM,MAXVDIMS,NCNOERR,NCEBADID
14      integer NCENFILE,NCEEXIST,NCEINVAL,NCEPERM,NCENOTIN
15      integer NCEINDEF,NCECOORD,NCEMAXDS,NCENAME
16      integer NCENOATT,NCEMAXAT,NCEBADTY,NCEBADD, NCESTS
17      integer NCEUNLIM,NCEMAXVS,NCENOTVR,NCEGLOB,NCENOTNC
18      integer NCFOOBAR,NCSYSERR,NCFATAL,NCVERBOS, NCENTOOL
19
20      integer NCBYTE,NCCHAR,NCSHORT,NCLONG,NCFLOAT,NCDOUBLE
21
22      parameter(NCBYTE = 1)
23      parameter(NCCHAR = 2)
24      parameter(NCSHORT = 3)
25      parameter(NCLONG = 4)
26      parameter(NCFLOAT = 5)
27      parameter(NCDOUBLE = 6)
28
29c
30c     masks for the struct NC flag field; passed in as 'mode' arg to
31c     nccreate and ncopen.
32c
33
34c     read/write, 0 => readonly
35      parameter(NCRDWR = 1)
36c     in create phase, cleared by ncendef
37      parameter(NCCREAT = 2)
38c     on create destroy existing file
39      parameter(NCEXCL = 4)
40c     in define mode, cleared by ncendef
41      parameter(NCINDEF = 8)
42c     synchronise numrecs on change (X'10')
43      parameter(NCNSYNC = 16)
44c     synchronise whole header on change (X'20')
45      parameter(NCHSYNC = 32)
46c     numrecs has changed (X'40')
47      parameter(NCNDIRTY = 64)
48c     header info has changed (X'80')
49      parameter(NCHDIRTY = 128)
50c     prefill vars on endef and increase of record, the default behavior
51      parameter(NCFILL = 0)
52c     don't fill vars on endef and increase of record (X'100')
53      parameter(NCNOFILL = 256)
54c     isa link (X'8000')
55      parameter(NCLINK = 32768)
56
57c
58c     'mode' arguments for nccreate and ncopen
59c
60
61      parameter(NCNOWRIT = 0)
62      parameter(NCWRITE = NCRDWR)
63      parameter(NCCLOB = 11)
64      parameter(NCNOCLOB = 15)
65c
66c     'size' argument to ncdimdef for an unlimited dimension
67c
68      LONG_INT NCUNLIM
69      parameter(NCUNLIM = 0)
70
71c
72c     attribute id to put/get a global attribute
73c
74      parameter(NCGLOBAL  = 0)
75c
76c     Advisory Maximums
77c
78      parameter(MAXNCOP = 32)
79      parameter(MAXNCDIM = 32)
80      parameter(MAXNCATT = 512)
81      parameter(MAXNCVAR = 512)
82c     Not enforced
83      parameter(MAXNCNAM = 128)
84      parameter(MAXVDIMS = MAXNCDIM)
85
86
87c
88c     The netcdf data types
89c
90
91c
92c     Global netcdf error status variable
93c     Initialized in error.c
94c
95
96c     No Error
97      parameter(NCNOERR = 0)
98c     Not a netcdf id
99      parameter(NCEBADID = 1)
100c     Too many netcdfs open
101      parameter(NCENFILE = 2)
102c     netcdf file exists && NCNOCLOB
103      parameter(NCEEXIST = 3)
104c     Invalid Argument
105      parameter(NCEINVAL = 4)
106c     Write to read only
107      parameter(NCEPERM = 5)
108c     Operation not allowed in data mode
109      parameter(NCENOTIN = 6)
110c     Operation not allowed in define mode
111      parameter(NCEINDEF = 7)
112c     Coordinates out of Domain
113      parameter(NCECOORD = 8)
114c     MAXNCDIMS exceeded
115      parameter(NCEMAXDS = 9)
116c     String match to name in use
117      parameter(NCENAME = 10)
118c     Attribute not found
119      parameter(NCENOATT = 11)
120c     MAXNCATTRS exceeded
121      parameter(NCEMAXAT = 12)
122c     Not a netcdf data type
123      parameter(NCEBADTY = 13)
124c     Invalid dimension id
125      parameter(NCEBADD = 14)
126c     NCUNLIMITED in the wrong index
127      parameter(NCEUNLIM = 15)
128c     MAXNCVARS exceeded
129      parameter(NCEMAXVS = 16)
130c     Variable not found
131      parameter(NCENOTVR = 17)
132c     Action prohibited on NCGLOBAL varid
133      parameter(NCEGLOB = 18)
134c     Not a netcdf file
135      parameter(NCENOTNC = 19)
136      parameter(NCESTS = 20)
137      parameter (NCENTOOL = 21)
138      parameter(NCFOOBAR = 32)
139      parameter(NCSYSERR = -1)
140
141
142c
143c     Global options variable. Used to determine behavior of error handler.
144c     Initialized in lerror.c
145c
146      parameter(NCFATAL = 1)
147      parameter(NCVERBOS = 2)
148