[ncl-talk] convert hdf to nc using ncl_convert2nc gives error

Dennis Shea shea at ucar.edu
Thu Aug 27 08:51:59 MDT 2015


If you examine the file via:

%> ncl_filedump MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf | less

You will see that it is a HDF-EOS2 file.

I

Variable: f

Type: file

filename:       MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101

path:   MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf

   file global attributes:

      HDFEOSVersion : HDFEOS_V2.14

      StructMetadata_0 : GROUP=SwathStructure

END_GROUP=SwathStructure

GROUP=GridStructure

        GROUP=GRID_1

               GridName="EOSGRID"

                XDim=540

                YDim=361

[SNIP]


====================
It is best to attach a .he2 (or .hdfeos) to the file in the command line.
You need *not* rename the file.

%> ncl_filedump MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf.he2 | less


===================

To make a netCDF, use the .he2 extension to the file name in the command
line.


%> ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf.he2


Good Luck

On Thu, Aug 27, 2015 at 3:33 AM, Marit Marsh Stromberg <
mmarsh04 at mail.bbk.ac.uk> wrote:

> Hi,
> I am trying to convert a hdf file to netcdf format via ncl_convert2nc but
> get an error message "if:Expression Syntax" (see below for input and output
> message). This seem to have been a problem raised on this email list before
> (e.g. http://www.ncl.ucar.edu/Support/talk_archives/2013/3087.html) but
> following the email thread - and going through the proposed ways of solving
> the issue - the issue do not appear to have been solved (at least not
> posted on the mailing list). Does anybody have an idea on what the issue
> might be?
> I have attached a link so that the file I want to convert can be
> downloaded.
>
> Kind regards,
> Marit Marsh Stromberg
>
> The code I am running and the error message I get:
> $ ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf
> if: Expression Syntax.
>
> My computer and ncl version info:
> $ ncl -V
> 6.3.0
> The NCL binary I downloaded was
> ncl_​ncarg-​6.​3.​0.​MacOS_​10.​8_​64bit_​nodap_​gcc471.​tar.​gz
> <https://www.earthsystemgrid.org/download/fileDownload.htm?logicalFileId=81feecd3-cd9b-11e4-bb80-00c0f03d5b7c>
>
> $ uname -a
> Darwin DM-MacBook-Pro.local 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep
> 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
>
> Mac OS X Version 10.8.5
>
> What I have tried so far, as suggested in reply on this email list before:
> * to add .he5 as file ending (as suggested in
> http://www.ncl.ucar.edu/Support/talk_archives/2013/3093.html):
> $ ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf.he5
> if: Expression Syntax.
>
> * To do a file dump (ncl_filedump) - which I am able to do. (as suggested
> in http://www.ncl.ucar.edu/Support/talk_archives/2013/3167.html)
>
> * Running the command prefixed by 'csh -xv' (as suggested in
> http://www.ncl.ucar.edu/Support/talk_archives/2013/3208.html)
> This gives:
> $ csh -xv ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf
> ncl_convert2nc: No such file or directory.
> However, running
> $ which ncl_convert2nc
> /usr/local/ncl-6.3.0/bin/ncl_convert2nc
> shows it should be there.
>>  MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf
> <https://drive.google.com/a/mail.bbk.ac.uk/file/d/0B5nVy-cTj_CkUzQ3SUxoMi1IN0E/view?usp=drive_web>
>>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150827/2df5900a/attachment.html 


More information about the ncl-talk mailing list