[Thread Prev][Thread Next][Index]

Re: [ferret_users] combination of file and variable check crashes Ferret



Thanks Marco,
I'm off-line and can't try this today, but having an example script and dataset will let me tell whether this is correct  in the current Ferret release.

Another option for determining whether a variable is in a dataset is to use the netCDF attribute handling syntax to get a list of the variable names in the current dataset:

yes? use b.nc
yes? let varnames = ..varnames
yes? let has_var = IS_ELEMENT_OF_STR (varnames, "aa")

There is also a non-case-sensitive version, IS_ELEMENT_OF_STR_N


On Fri, Oct 2, 2015 at 3:13 AM, Marco van Hulten <marco.van-hulten@xxxxxxxxxxxx> wrote:
This is the most minimal example I can think of in which I can
reproduce the error:

yes? let isFile = spawn( "test -e a.nc; echo $?" )
yes? use b.nc
yes? say `aa[d=b.nc],return=isReady`
At line 89 of file depend_stat_var_sub.F
Fortran runtime error: Array reference out of bounds for array 'uvar_text', lower bound of dimension 1 exceeded (0 < 1)

So I invoke bash here: same problem as with the test_opendap() function.

If I use b.nc also in the first line, there is no error.

The goal I have in the end is to add a variable (e.g. with ncks) from
one file to another file, if the first file exists and if the variable
exists.

Marco


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement