load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" begin type = "png" wksname = "GPM" wks = gsn_open_wks(type,wksname) ;---Open file filename = "3B-HHR.MS.MRG.3IMERG.20150624-S000000-E002959.0000.V03D.HDF5.nc" iFile = addfile(filename,"r") ;---Read data. Note that it is lon x lat, so we must transpose it to be lat x lon gpmPre = transpose(iFile->precipitationCal) printVarSummary(gpmPre) printMinMax(gpmPre,0) print("Your data contains " + num(.not.ismissing(gpmPre)) + " valid values.") print("Your data contains " + num(ismissing(gpmPre)) + " missing values.") ;;;;;;;;;;set the resource plot;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; res = True res@gsnAddCyclic = False res@mpFillOn = False res@mpOutlineOn = True res@mpOutlineBoundarySets = "National" ; turn on country boundaries res@cnFillOn = True res@cnFillPalette = "precip3_16lev" res@cnFillMode = "RasterFill" res@cnLinesOn = False res@cnLineLabelsOn = False res@cnInfoLabelOn = False ; set false will not set an information label res@cnLevelSelectionMode = "ExplicitLevels" res@cnLevels = (/0.1,0.5,1,2.5,5,10,12,15,20,25,30,35,40,45,50/) ; "mm/hr" res@pmTickMarkDisplayMode = "Always" ; nicer looking map tickmarks res@gsnLeftString = "Precipitation" ; res@cnLevelSelectionMode = "ManualLevels" ; res@cnMinLevelValF = 1 ; res@cnMaxLevelValF = 200 ; res@cnLevelSpacingF = 5 res@lbBoxLinesOn = False ; Label bar ;---Zoom in on region of interest res@mpMinLatF = min(gpmPre&lat) res@mpMaxLatF = max(gpmPre&lat) res@mpMinLonF = min(gpmPre&lon) res@mpMaxLonF = max(gpmPre&lon) plot = gsn_csm_contour_map(wks,gpmPre, res) end