[ncl-talk] Failing to open WRF file
Rick Brownrigg
brownrig at ucar.edu
Fri Aug 6 09:33:36 MDT 2021
I'm not sure what to advise. There's nothing wrong with the statement
"a->XLAT(:,:)". The code is complaining about the file-variable "a". Prior
to line #21 is this statement: "T = wrf_user_getvar(a,"T2",-1)" which
references filevar a. I take it there are no errors from that line, and if
you were to print(T) everything looks OK? If so, does lat2d =
wrf_get_var(a, "XLAT", -1) work?
Wish I could be of more help...
Rick
On Fri, Aug 6, 2021 at 9:04 AM Zilore Mumba <zmumba at gmail.com> wrote:
> Rick, I have 24 files, hourly for one day. Apparently every day there are
> two or three files which are current out of the WRF output. nco shows the
> same corrupt files. ncdump on the corrupt files gives a number of major and
> minor errors.
>
> HDF5-DIAG: Error detected in HDF5 (1.10.4) thread 140519944219520:
> #000: H5G.c line 470 in H5Gopen2(): unable to open group
> major: Symbol table
> minor: Can't open object
> #001: H5Gint.c line 323 in H5G__open_name(): can't get object type
> major: Symbol table
> minor: Can't get value
> .........................................................
>
> When I run my script with the two corrupt files removed I get
>
> fatal:(a) not reference to a valid file
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 21 in
> file 20_PlotT2mMinMax.ncl
>
> and line 21 in my script is lat2d = a->XLAT(:,:)
>
> On Fri, Aug 6, 2021 at 4:16 PM Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi Zilore,
>>
>> I looked into the code at where that "not reference to a valid file"
>> error originates. It would seem that the file is somehow corrupt, although
>> I don't understand how or why. Are you able to open it with some other
>> tool, such as "ncdump"? Can you simply discard it from your analysis? If
>> it's not too large and you can send it to me, I will take a look, although
>> obviously that won't change the outcome if it is indeed corrupt.
>>
>> Rick
>>
>> On Fri, Aug 6, 2021 at 2:57 AM Zilore Mumba via ncl-talk <
>> ncl-talk at mailman.ucar.edu> wrote:
>>
>>> Hello,
>>> I need help opening a WRF output file. The code I am using is below
>>> ;Open input file.
>>> ;************************
>>> DATADir = "../DATA/"
>>> FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d01* ")
>>> numFILES = dimsizes(FILES)
>>> ;print(FILES)
>>> ;exit
>>>
>>> ;a = addfiles(FILES+".nc","r")
>>>
>>> a = addfiles( DATADir+"wrfout_d01_2021-08-03_00:00:00.nc","r")
>>>
>>> T = wrf_user_getvar(a,"T2",-1)
>>> T = T-273.15
>>> wrf_smooth_2d(T, 3) ; smooth T
>>> ;printVarSummary(T)
>>> ;exit
>>>
>>> lat2d = a->XLAT(:,:)
>>> lon2d = a->XLONG(:,:)
>>>
>>> lat2d = lat2d(:,0) ; create classic 1D coordinate
>>> arrays
>>> lon2d = lon2d(0,:)
>>>
>>> lat at units= "degrees_north"
>>> lon at units= "degrees_east"
>>> lat!0 = "lat"
>>> lon!0 = "lon"
>>> lat&lat = lat
>>> lon&lon = lon
>>>
>>> printVarSummary(lat)
>>> printVarSummary(lon)
>>> exit
>>> When I try to open one file, I get the error
>>>
>>> fatal:(a) not reference to a valid file
>>> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 21 in
>>> file 20_PlotT2mMinMax.ncl
>>> ******************************
>>> When I try to open many files with addfiles, there is one file which
>>> cannot be read, but the others are read and I get.
>>> warning:_NclOpenFile: cannot open file <../DATA/wrfout_d01_2021-08-03_00:
>>> 00.nc>; No such file or directory
>>>
>>> warning:isfilevar: undefined file returning missing value
>>> fatal:The result of the conditional expression yields a missing value.
>>> NCL can not determine branch, see ismissing function
>>> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 108 in
>>> file /usr/local/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>
>>> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 1986 in
>>> file /usr/local/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>>>
>>> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 15 in
>>> file 20_PlotT2mMinMax.ncl
>>>
>>> Print(FILES) works ok
>>> printVarSummary(T) works ok
>>> printVarSummary(lat) and printVarSummary(lon) do not work.
>>>
>>> How do I extract XLAT, XLONG?
>>> Help will be appreciated.
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at mailman.ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210806/0ee0006a/attachment.html>
More information about the ncl-talk
mailing list