<div dir="ltr"><div class="gmail_default" style="font-size:small"><div class="gmail_default" style="font-size:small">Dear NCL users,</div><div class="gmail_default" style="font-size:small">
I wanted to convert number of OLR hdf(.h5) files to netcdf
files and to get it done i used the following script and facing error at
the line marked in the following script. I could not make out how to
solve it. Please help me in solving out it. Thanks in advance.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">=================================================================</div><div class="gmail_default"><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" </div><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" </div><div class="gmail_default">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" </div><div class="gmail_default">;************************************************</div><div class="gmail_default"> begin</div><div class="gmail_default"> diri = "./"</div><div class="gmail_default"> diro = "./"</div><div class="gmail_default"><br></div><div class="gmail_default"> fili = systemfunc("cd "+diri+" ; ls *.h5")</div><div class="gmail_default"> nfil = dimsizes(fili)</div><div class="gmail_default"> print("nfil="+nfil)</div><div class="gmail_default"><br></div><div class="gmail_default"> do nf=0,nfil-1</div><div class="gmail_default"> print("===========================") </div><div class="gmail_default"> f = addfile(diri+fili(nf), "r")</div><div class="gmail_default"> </div><div class="gmail_default"> print("---")</div><div class="gmail_default"> fbase = str_get_field(fili(nf),1,".")</div><div class="gmail_default"> print("fbase="+fbase)</div><div class="gmail_default"><br></div><div class="gmail_default"> diro = "./"</div><div class="gmail_default"> filo = fbase+".nc"</div><div class="gmail_default"> ptho = diro+filo</div><div class="gmail_default"> </div><div class="gmail_default"> system("/bin/rm -f "+ptho) ; remove any pre-existing file</div><div class="gmail_default"> ncdf = addfile(ptho ,"c") ; open output netCDF file</div><div class="gmail_default"><br></div><div class="gmail_default"> ; create global attributes of the file</div><div class="gmail_default"> fAtt = True ; assign file attributes</div><div class="gmail_default"> fAtt@title = "NCL: H5 to netCDF" </div><div class="gmail_default"> fAtt@source = "MOSDAC: Meteorological & Oceanographic Satellite Data Archival Center (India)"</div><div class="gmail_default"> fAtt@source_file = fili(nf)</div><div class="gmail_default"> fAtt@Conventions = "None" </div><div class="gmail_default"> fAtt@creation_date = systemfunc ("date") </div><div class="gmail_default"> fileattdef( ncdf, fAtt ) ; copy file attributes </div><div class="gmail_default"> </div><div class="gmail_default"> <b>ncdf->OLR = OLR1 <============== This is where error is occuring</b></div><div class="gmail_default"> end do</div><div class="gmail_default"> end</div><div class="gmail_default">=====================================</div><div class="gmail_default"><b>Error message as follows:</b></div><div class="gmail_default"><br></div></div><div class="gmail_default">(0)<span style="white-space:pre-wrap">        </span>nfil=31</div><div class="gmail_default">(0)<span style="white-space:pre-wrap">        </span>===========================</div><div class="gmail_default">(0)<span style="white-space:pre-wrap">        </span>---</div><div class="gmail_default">(0)<span style="white-space:pre-wrap">        </span>fbase=K1VHR_05OCT2013_DAILY_L03_OLR</div><div class="gmail_default">fatal:Variable (OLR1) is undefined</div><div class="gmail_default">fatal:["Execute.c":7743]:Execute: Error occurred at or near line 41 in file nfiles_conversion_h5_to_nc.ncl</div></div></div>