<div dir="ltr">If you examine the file via:<div><br></div><div>%> ncl_filedump MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf | less</div><div><br></div><div>You will see that it is a HDF-EOS2 file.</div><div><br></div><div>I</div><div>
<p class=""><span class="">Variable: f</span></p><p class="">Type: file</p><p class="">filename: MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101</p>
<p class=""><span class="">path: MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf</span></p>
<p class=""><span class=""> file global attributes:</span></p>
<p class=""><span class=""> HDFEOSVersion : HDFEOS_V2.14</span></p>
<p class=""><span class=""> StructMetadata_0 : GROUP=SwathStructure</span></p>
<p class=""><span class="">END_GROUP=SwathStructure</span></p>
<p class=""><span class="">GROUP=GridStructure</span></p>
<p class=""><span class=""> GROUP=GRID_1</span></p>
<p class=""><span class=""> GridName="EOSGRID"</span></p>
<p class=""><span class=""> XDim=540</span></p>
<p class=""><span class=""> YDim=361</span></p><p class=""><span class="">[SNIP]</span></p><p class=""><span class=""><br></span></p><p class=""><span class="">====================</span></p><div>It is best to attach a .he2 (or .hdfeos) to the file in the command line. You need *not* rename the file. </div><p class=""><span class="">%> ncl_filedump MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf.he2 | less<br></span></p><p class=""><span class=""><br></span></p><p class=""><span class="">===================</span></p><p class=""><span class="">To make a netCDF, use the .he2 extension to the file name in the command line.</span></p><p class=""><span class=""><br></span></p><p class=""><span class="">%> </span>ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf.he2</p><p class=""><br></p><p class="">Good Luck</p>
</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 3:33 AM, Marit Marsh Stromberg <span dir="ltr"><<a href="mailto:mmarsh04@mail.bbk.ac.uk" target="_blank">mmarsh04@mail.bbk.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>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. <a href="http://www.ncl.ucar.edu/Support/talk_archives/2013/3087.html" target="_blank">http://www.ncl.ucar.edu/Support/talk_archives/2013/3087.html</a>) 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?</div><div>I have attached a link so that the file I want to convert can be downloaded.</div><div><br></div><div>Kind regards,</div><div>Marit Marsh Stromberg</div><div><br></div><div>The code I am running and the error message I get:</div><div><div>$ ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf</div><div>if: Expression Syntax.</div></div><div><br></div><div>My computer and ncl version info:</div><div><div><div><div><div>$ ncl -V</div><div>6.3.0</div></div></div></div><div>The NCL binary I downloaded was <a href="https://www.earthsystemgrid.org/download/fileDownload.htm?logicalFileId=81feecd3-cd9b-11e4-bb80-00c0f03d5b7c" style="font-size:13px;font-family:arial;line-height:16.0029983520508px;background-color:rgb(242,242,242)" target="_blank">ncl_ncarg-6.3.0.MacOS_10.8_64bit_nodap_gcc471.tar.gz</a></div><div><br></div><div>$ uname -a</div><div>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</div></div><div><br></div><div>Mac OS X Version 10.8.5</div><div><br></div><div>What I have tried so far, as suggested in reply on this email list before:</div><div>* to add .he5 as file ending (as suggested in <a href="http://www.ncl.ucar.edu/Support/talk_archives/2013/3093.html" target="_blank">http://www.ncl.ucar.edu/Support/talk_archives/2013/3093.html</a>):<br></div><div><div>$ ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf.he5</div><div>if: Expression Syntax.</div></div><div><br></div><div>* To do a file dump (ncl_filedump) - which I am able to do. (as suggested in <a href="http://www.ncl.ucar.edu/Support/talk_archives/2013/3167.html" target="_blank">http://www.ncl.ucar.edu/Support/talk_archives/2013/3167.html</a>)</div><div><br></div><div>* Running the command prefixed by 'csh -xv' (as suggested in <a href="http://www.ncl.ucar.edu/Support/talk_archives/2013/3208.html" target="_blank">http://www.ncl.ucar.edu/Support/talk_archives/2013/3208.html</a>)</div><div>This gives:</div><div><div>$ csh -xv ncl_convert2nc MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf</div><div>ncl_convert2nc: No such file or directory.</div></div><div>However, running</div><div><div>$ which ncl_convert2nc</div><div>/usr/local/ncl-6.3.0/bin/ncl_convert2nc</div></div><div>shows it should be there.</div><div><br><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/a/mail.bbk.ac.uk/file/d/0B5nVy-cTj_CkUzQ3SUxoMi1IN0E/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">MERRA200.prod.assim.tavg1_2d_slv_Nx.20000101.hdf</span></a></div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>