load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ; Read file. file_name = "2A25.20090515.65505.7.HDF" hdf4_file=addfile(file_name, "r") ; Print metadata information. print(hdf4_file) ; Read lat/lon data. longitude=hdf4_file->Longitude latitude=hdf4_file->Latitude ; Correct units to follow the CF conventions. ; In the HDF4 file, the attribute values are "degrees". longitude@units = "degrees_east" latitude@units = "degrees_north" ; Read data for plot. RF = hdf4_file->rain RF@lon2d = longitude RF@lat2d = latitude ;RF@_FillValue = -8888 printVarSummary(RF) printMinMax(RF,True) asciiwrite("RF.txt",RF) Rf = short2flt(RF) Rf@_FillValue = -999900 printVarSummary(Rf) printMinMax(Rf,True) asciiwrite("Rf.txt",Rf) ; print(Rf@_FillValue) XWKS = gsn_open_wks("png","test") gsn_define_colormap(XWKS,"wh-bl-gr-ye-re") res = True ; plot mods desired res@cnFillOn = True ; enable contour fill plot = gsn_csm_contour_map_ce(XWKS,Rf(:,:,2),res) end