[ncl-talk] setfileoption("h5" ...

Laura Fowler laura at ucar.edu
Wed May 23 13:45:22 MDT 2018


Hi Dave:
Just scp the same file on cheyenne for Dennis now that cheyenne is
back up. Looks like the issue I have is using ncl/6.3.0 instead of
ncl/6.4.0.

Cheers,
Laura



On Wed, May 23, 2018 at 12:51 PM, David Brown <dbrown at ucar.edu> wrote:
> To confirm Dennis' suspicion that this file is invalid, h5dump also fails on
> this file:
>
> $ h5dump 3A-MO.GPM.DPR.V2-20170217.20151201-S000000-E235959.12.V05A.HDF5
> h5dump error: unable to open file
> "3A-MO.GPM.DPR.V2-20170217.20151201-S000000-E235959.12.V05A.HDF5"
>
> The reason NCL gives a NetCDF library error message is that it first checks
> to see whether the file is HDF5. When that fails it tries to open it as a
> NetCDF file, which results in an error message from the NetCDF library.
>  -dave
>
>
> On Wed, May 23, 2018 at 11:12 AM, Dennis Shea <shea at ucar.edu> wrote:
>>
>> Hi Laura
>>
>> I may be wrong about NCL's standard variable & file structures but I am
>> pretty sure it is based on the classic netCDF-3 file and variable models.
>>
>> [a]
>> There is no concept of multiple levels of data. netCDF-3 files are 'flat.'
>> To accommodate this 'flat' nature, all variable names must be unique.
>>
>> [b]
>> HDF5/netCDF4 allow multiple levels [eg: 'groups'].  A variable [eg: FOO]
>> can exist in several groups with the same name and refer to completely
>> different quantities.
>>
>> ---
>>
>> From setfileoption
>>
>> "In version 6.1.1, this option only has an effect for classic model NetCDF
>> files (including NetCDF4 classic files). But other than the difference in
>> print output, there should be no difference in the way classic model NetCDF
>> is read or written, regardless of the file structure.
>>
>> However, beginning with version 6.2.0, this option will work for HDF-EOS5
>> and shapefiles. Choosing the "Advanced" file structure will allow the user
>> to view these file formats using a representation closer to the structure
>> implied by the native format. Conversely, the "Standard" structure will
>> remain available to let you to view the contents as you alway have; in other
>> words backwards compatibility is maintained. Eventually other supported
>> formats that can make ues of the advanced features, including HDF4 and
>> HDFEOS2, may also be enabled to use the "Advanced" file structure.
>>
>> [Further ...]
>>
>> Like full model NetCDF4, HDF5 will be implemented using the "Advanced"
>> file structure only."
>>
>> The above should read:
>>
>> Like full model NetCDF4, HDF5 will be automatically implemented using the
>> "Advanced" file structure only."
>>
>> &&&&&&&&&&&&&
>>
>> There is a GPM example at:
>>
>> https://www.ncl.ucar.edu/Applications/HiResPrc.shtml
>>
>> gpm_1.ncl
>>
>> &&&&&&&&&&&&&
>>
>> I think there is something wrong with the file you ftp'd:
>>
>> %> ncl_filedump
>> 3A-MO.GPM.DPR.V2-20170217.20151201-S000000-E235959.12.V05A.HDF5
>>
>>  Copyright (C) 1995-2017 - All Rights Reserved
>>  University Corporation for Atmospheric Research
>>  NCAR Command Language Version 6.5.0 -29Mar2018_0148
>>  The use of this software is governed by a License Agreement.
>>  See http://www.ncl.ucar.edu/ for more details.
>> Assertion failed: (0), function NC4_open, file nc4file.c, line 2874.
>> Abort
>>
>> -----
>>
>> %> ncdump -k
>> 3A-MO.GPM.DPR.V2-20170217.20151201-S000000-E235959.12.V05A.HDF5
>>
>> Assertion failed: (0), function NC4_open, file nc4file.c, line 2874.
>>
>> -----
>>
>> To illustrate that 'ncdump -k'  works, I have used it on a  different GPM
>> file:
>>
>> %> ncdump -k 3B-MO.MS.MRG.3IMERG.20140312-S000000-E235959.03.V03D.HDF5
>>
>> netCDF-4
>>
>> -----
>> For NCL-core developres, the file is at:
>>
>> /glade/p/ncldev/data/gpm
>>
>>
>>
>>
>> On Tue, May 22, 2018 at 2:19 PM, Laura Fowler <laura at ucar.edu> wrote:
>>>
>>> Hello:
>>> Just a couple of quick questions:
>>>
>>>
>>> 1. I am reading an HDF5 file containing GPM data and I was wondering
>>> if there was a description of the command:
>>> setfileoption("h5","FileStructure","Advanced")
>>>
>>> In the online documentation, I found that setfileoption is described
>>> for netCDF and GRIB, but not for HDF5?
>>>
>>>
>>> 2. I read the HDF5 file and define the group g2 as:
>>>
>>> g2 = f=>/Grids/G2
>>> mean   = g2->precipRateNearSurfaceUnconditional
>>> .
>>> .
>>> .
>>>
>>> After I plot the variable mean, I am trying to open an other group g2 as:
>>> ichn = 3
>>> g2 = f=>/Grids/G2/precipRateNearSurface
>>> mean  = g2->mean(:,ichn,:,:)
>>>
>>> Then, I get the error message:
>>> fatal:["Execute.c":132]:variable (mean) is not in file
>>> (3A-MO.GPM.DPR.V2-20170217.20151201-S000000-E235959.12.V05A.HDF5)
>>> fatal:["Execute.c":6316]:variable (mean) is not in file (g2)
>>> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 95 in
>>> file read.ncl
>>>
>>>
>>> If I add the 2 lines:
>>> delete(mean)
>>> delete(g2)
>>>
>>> then I get the following error:
>>> fatal:file (g2) isn't defined
>>>
>>>
>>> Is there a way to reuse g2 for the second group? I thought that
>>> deleting it first would work but it does not?
>>>
>>> Thanks,
>>> Laura
>>>
>>>
>>>
>>> --
>>>
>>> !-------------------------------------------------------------------------------------------------------------
>>> Laura D. Fowler
>>> Mesoscale and Microscale Meteorology Division (MMM)
>>> National Center for Atmospheric Research
>>> P.O. Box 3000, Boulder CO 80307-3000
>>>
>>> e-mail: laura at ucar.edu
>>> phone: 303-497-1628
>>>
>>>
>>> !-------------------------------------------------------------------------------------------------------------
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>



-- 
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler
Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000

e-mail: laura at ucar.edu
phone: 303-497-1628

!-------------------------------------------------------------------------------------------------------------


More information about the ncl-talk mailing list