[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #KQW-622959]: error to reopen netcdf file with fortran



> Full Name: Liancong Luo
> Email Address: address@hidden
> Organization: Waikato University
> Package Version:
> Operating System:
> Hardware:
> Description of problem:
>
> I opened the netcdf file, closed it and then problem with reopen the
> same nc file. However, if I remove the following code in "nc_test.f90",
> it is fine for reopening.
>
>
status=nf_inq_var(ncid,varid,varnam(i),vartyp(i),nvdims(i),vdims(I),nvatts(I))
>
> but I need this code for getting the variable names. Could u please
> tell me what the problem with reopening the nc file is?
>
> Thanks,
>
> Liancong
>
>

I suspect you don't really want arrays for the vartyp, nvdims, and nvatts
parameters. The only arrays are the name (character array) and the vdims array
(one element for each dimension of the variable - ex. 3 for a 3D variable).

The access violation you get is because you are trying to write somewhere in
memory that you do not have legal access to. (Shame on you! ;-)

This could also be caused by your vdims array being too small (less than the
dimensionality of the data).

Please let me know if this doesn't help.

Thanks!

Ed

Ticket Details
===================
Ticket ID: KQW-622959
Department: Support netCDF
Priority: Normal
Status: Closed