12 subroutine nf95_open(path, mode, ncid, chunksize, ncerr)
14 use netcdf
, only: nf90_open
16 character(len=*),
intent(in):: path
17 integer,
intent(in):: mode
18 integer,
intent(out):: ncid
19 integer,
intent(inout),
optional:: chunksize
20 integer,
intent(out),
optional:: ncerr
27 ncerr_not_opt = nf90_open(path, mode, ncid, chunksize)
28 if (
present(ncerr))
then
31 call handle_err(
"nf95_open " // path, ncerr_not_opt)
40 use netcdf
, only: nf90_inq_dimid
42 integer,
intent(in) :: ncid
43 character (len = *),
intent(in) :: name
44 integer,
intent(out) :: dimid
45 integer,
intent(out),
optional:: ncerr
52 ncerr_not_opt = nf90_inq_dimid(ncid, name, dimid)
53 if (
present(ncerr))
then
56 call handle_err(
"nf95_inq_dimid " // name, ncerr_not_opt, ncid)
65 use netcdf
, only: nf90_inquire_dimension
67 integer,
intent( in) :: ncid, dimid
68 character (len = *),
optional,
intent(out) :: name
69 integer,
optional,
intent(out) :: nclen
70 integer,
intent(out),
optional:: ncerr
77 ncerr_not_opt = nf90_inquire_dimension(ncid, dimid, name, nclen)
78 if (
present(ncerr))
then
81 call handle_err(
"nf95_inquire_dimension", ncerr_not_opt, ncid)
90 use netcdf
, only: nf90_inq_varid
92 integer,
intent(in) :: ncid
93 character(len=*),
intent(in):: name
94 integer,
intent(out) :: varid
95 integer,
intent(out),
optional:: ncerr
102 ncerr_not_opt = nf90_inq_varid(ncid, name, varid)
103 if (
present(ncerr))
then
104 ncerr = ncerr_not_opt
106 call handle_err(
"nf95_inq_varid, name = " // name, ncerr_not_opt, ncid)
123 use netcdf
, only: nf90_inquire_variable, nf90_max_var_dims
125 integer,
intent(in):: ncid, varid
126 character(len = *),
optional,
intent(out):: name
127 integer,
optional,
intent(out) :: xtype, ndims
128 integer,
dimension(:),
optional,
pointer :: dimids
129 integer,
optional,
intent(out) :: nAtts
130 integer,
intent(out),
optional :: ncerr
133 integer ncerr_not_opt
134 integer dimids_local(nf90_max_var_dims)
135 integer ndims_not_opt
139 if (
present(dimids))
then
140 ncerr_not_opt = nf90_inquire_variable(ncid, varid, name, xtype, &
141 ndims_not_opt, dimids_local, natts)
142 allocate(dimids(ndims_not_opt))
143 dimids = dimids_local(:ndims_not_opt)
144 if (
present(ndims)) ndims = ndims_not_opt
146 ncerr_not_opt = nf90_inquire_variable(ncid, varid, name, xtype, ndims, &
150 if (
present(ncerr))
then
151 ncerr = ncerr_not_opt
153 call handle_err(
"nf95_inquire_variable", ncerr_not_opt, ncid, varid)
160 subroutine nf95_create(path, cmode, ncid, initialsize, chunksize, ncerr)
162 use netcdf
, only: nf90_create
164 character (len = *),
intent(in ) :: path
165 integer,
intent(in ) :: cmode
166 integer,
intent( out) :: ncid
167 integer,
optional,
intent(in ) :: initialsize
168 integer,
optional,
intent(inout) :: chunksize
169 integer,
intent(out),
optional :: ncerr
172 integer ncerr_not_opt
176 ncerr_not_opt = nf90_create(path, cmode, ncid, initialsize, chunksize)
177 if (
present(ncerr))
then
178 ncerr = ncerr_not_opt
180 call handle_err(
"nf95_create " // path, ncerr_not_opt)
187 subroutine nf95_def_dim(ncid, name, nclen, dimid, ncerr)
189 use netcdf
, only: nf90_def_dim
191 integer,
intent( in) :: ncid
192 character (len = *),
intent( in) :: name
193 integer,
intent( in) :: nclen
194 integer,
intent(out) :: dimid
195 integer,
intent(out),
optional :: ncerr
198 integer ncerr_not_opt
202 ncerr_not_opt = nf90_def_dim(ncid, name, nclen, dimid)
203 if (
present(ncerr))
then
204 ncerr = ncerr_not_opt
206 call handle_err(
"nf95_def_dim " // name, ncerr_not_opt, ncid)
215 use netcdf
, only: nf90_redef
217 integer,
intent( in) :: ncid
218 integer,
intent(out),
optional :: ncerr
221 integer ncerr_not_opt
225 ncerr_not_opt = nf90_redef(ncid)
226 if (
present(ncerr))
then
227 ncerr = ncerr_not_opt
229 call handle_err(
"nf95_redef", ncerr_not_opt, ncid)
236 subroutine nf95_enddef(ncid, h_minfree, v_align, v_minfree, r_align, ncerr)
238 use netcdf
, only: nf90_enddef
240 integer,
intent( in) :: ncid
241 integer,
optional,
intent( in) :: h_minfree, v_align, v_minfree, r_align
242 integer,
intent(out),
optional :: ncerr
245 integer ncerr_not_opt
249 ncerr_not_opt = nf90_enddef(ncid, h_minfree, v_align, v_minfree, r_align)
250 if (
present(ncerr))
then
251 ncerr = ncerr_not_opt
253 call handle_err(
"nf95_enddef", ncerr_not_opt, ncid)
262 use netcdf
, only: nf90_close
264 integer,
intent( in) :: ncid
265 integer,
intent(out),
optional :: ncerr
268 integer ncerr_not_opt
272 ncerr_not_opt = nf90_close(ncid)
273 if (
present(ncerr))
then
274 ncerr = ncerr_not_opt
283 subroutine nf95_copy_att(ncid_in, varid_in, name, ncid_out, varid_out, ncerr)
285 use netcdf
, only: nf90_copy_att
287 integer,
intent( in):: ncid_in, varid_in
288 character(len=*),
intent( in):: name
289 integer,
intent( in):: ncid_out, varid_out
290 integer,
intent(out),
optional:: ncerr
293 integer ncerr_not_opt
297 ncerr_not_opt = nf90_copy_att(ncid_in, varid_in, name, ncid_out, varid_out)
298 if (
present(ncerr))
then
299 ncerr = ncerr_not_opt
301 call handle_err(
"nf95_copy_att " // name, ncerr_not_opt, ncid_out)
311 use netcdf
, only: nf90_inquire_attribute
313 integer,
intent( in) :: ncid, varid
314 character (len = *),
intent( in) :: name
315 integer,
intent(out),
optional :: xtype, nclen, attnum
316 integer,
intent(out),
optional:: ncerr
319 integer ncerr_not_opt
323 ncerr_not_opt = nf90_inquire_attribute(ncid, varid, name, xtype, nclen, &
325 if (
present(ncerr))
then
326 ncerr = ncerr_not_opt
328 call handle_err(
"nf95_inquire_attribute " // name, ncerr_not_opt, &
336 subroutine nf95_inquire(ncid, nDimensions, nVariables, nAttributes, &
337 unlimiteddimid, formatnum,
ncerr)
339 use netcdf
, only: nf90_inquire
341 integer,
intent( in) :: ncid
342 integer,
optional,
intent(out) :: nDimensions, nVariables, nAttributes
343 integer,
optional,
intent(out) :: unlimitedDimId, formatNum
344 integer,
intent(out),
optional:: ncerr
347 integer ncerr_not_opt
351 ncerr_not_opt = nf90_inquire(ncid, ndimensions, nvariables, nattributes, &
352 unlimiteddimid, formatnum)
353 if (
present(ncerr))
then
354 ncerr = ncerr_not_opt
356 call handle_err(
"nf95_inquire", ncerr_not_opt, ncid)
subroutine handle_err(status)
subroutine nf95_inquire_variable(ncid, varid, name, xtype, ndims, dimids, nAtts, ncerr)
subroutine nf95_inquire_dimension(ncid, dimid, name, nclen, ncerr)
subroutine nf95_inquire(ncid, nDimensions, nVariables, nAttributes, unlimitedDimId, formatNum, ncerr)
subroutine nf95_redef(ncid, ncerr)
subroutine nf95_open(path, mode, ncid, chunksize, ncerr)
subroutine nf95_copy_att(ncid_in, varid_in, name, ncid_out, varid_out, ncerr)
subroutine nf95_inquire_attribute(ncid, varid, name, xtype, nclen, attnum, ncerr)
subroutine nf95_inq_dimid(ncid, name, dimid, ncerr)
subroutine ncerr(ncres, fnam)
subroutine nf95_def_dim(ncid, name, nclen, dimid, ncerr)
subroutine nf95_close(ncid, ncerr)
subroutine nf95_inq_varid(ncid, name, varid, ncerr)
subroutine nf95_enddef(ncid, h_minfree, v_align, v_minfree, r_align, ncerr)
subroutine nf95_create(path, cmode, ncid, initialsize, chunksize, ncerr)