Hello,
I have a few questions about NetCDF Fortran behavior.
1) Unlimited dimension x Fixed dimension
In NetCDF v4.2.1.1, the following statements work:
integer :: ncid, dimid1, dimid2, varid1, varid2
call check( nf90_create("strings.nc", OR(NF90_NETCDF4,
NF90_CLOBBER), ncid) )
call check(nf90_def_dim(ncid, "testfixed", 10, dimid1))
call check(nf90_def_dim(ncid, "testinf", NF90_UNLIMITED, dimid2))
call check(nf90_def_var(ncid, "infvar", NF90_CHAR, (/ dimid2,
dimid1 /), varid2))
call check(nf90_put_var(ncid, varid2, "abcdef", (/ 1, 2 /)))
call check(nf90_put_var(ncid, varid2, "testasdfasdfasdfasdf"))
However, once I start using v4.3.2, I got this error with the exact same
code above:
** ERROR: NetCDF: Start+count exceeds dimension bound
This also seems to be present in the latest version (v4.3.3.1).
It's interesting to note that the reverse does not apply - Fixed
dimension x Unlimited dimension works on all versions.
The NetCDF-Fortran version is v4.2 with the v4.2.1.1 NetCDF library
version, and v4.4.2 for the other, more updated versions.
Is this normal behavior, or is this a regression of sorts?
2) Unlimited dimension x Unlimited dimension
I also tried this:
integer :: ncid, dimid1, dimid2, varid1, varid2, varid3, i
call check( nf90_create("strings.nc", OR(NF90_NETCDF4,
NF90_CLOBBER), ncid) )
call check(nf90_def_dim(ncid, "testfixed", 10, dimid1))
call check(nf90_def_dim(ncid, "testinf", NF90_UNLIMITED, dimid2))
call check(nf90_def_var(ncid, "infinf", NF90_CHAR, (/ dimid2,
dimid2 /), varid3))
do i = 1, 1000
call check(nf90_put_var(ncid, varid3, "test"))
end do
call check(nf90_put_var(ncid, varid3, (/ "testasdfasdfasdfasdf",
"testabcdefghijklmnop", "testqrstuvwxyz1234" /)))
...which does not work on either version. Would it be possible to have
this kind of behavior?
3) NF90_STRING (NC_STRING)
According to https://bugtracking.unidata.ucar.edu/browse/NCFORTRAN-29 it
seems that NF90_STRING is not implemented at the moment. Is this true? I
tried NF90_STRING before and always get:
ERROR: NetCDF: Start+count exceeds dimension bound
Note that I tested it with a newer version (NetCDF v4.3.2+), since the
older library (v4.2.1.1) had a bug with handling the NC_STRING type
(https://bugtracking.unidata.ucar.edu/browse/NCF-206).
Thanks in advance!
Best regards,
Albert