;---------------------------------------------------------------------- ; Main code ;---------------------------------------------------------------------- ; aphro_1.ncl ; ; Concepts illustrated: ; - Reading an APHRODITE netCDF file ; - Plot a user specified date ;---------------------------------------------------------------------- ; the following 'load *' are NOT needed from NCL 6.2.0 onward ;---------------------------------------------------------------------- ;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" ;************************************************************** ; User Input ;*************************************************************** diri = "/home/x_292026/taghizade@132/97_1_17/8_EraInterim_nclsum/" fili = "8_ERAI_Prec_2015_20180615_00_12_24_ncl.nc4" ymdPlot = 20151029 pltDir = "./" pltName = "20151029EImononcl";"aphro" pltType = "png" ; send graphics to PNG file pltTitle = "GPM: "+ymdPlot;"APHRO: "+ymdPlot ;*************************************************************** ; End User Input ;*************************************************************** f = addfile (diri+fili, "r") tp = f->TP ;precipitationCal(lat | :, lon | :) ; (lon,lat) (0,1,2) ; tp@long_name = "" printMinMax(tp,0) ; tp!0="time" ; tp!1="lat" ; tp!2="lon" ; tp&lat@units="degrees_north" ; tp&lon@units="degrees_east" print("--------") printVarSummary(tp) ymdh_erai = cd_calendar(tp&time, -3) ; -3: The values returned will be in the format YYYYMMDDHH print("==================================") ;************************************************ ; Create plot ;************************************************ wks = gsn_open_wks(pltType, pltDir+pltName) res = True ; plot mods desired res@gsnMaximize = True ; make ps/eps/pdf large [no effect x11] res@mpFillOn = False res@mpOutlineBoundarySets = "National" res@tiMainString = "Explicitly invoked LowRes DB" res@mpDataSetName = "Earth..4" ; 1 through 4 res@gsnFrame = False res@cnFillOn = True ; turn on color fill res@cnLinesOn = False ; turn of contour lines res@cnLineLabelsOn = False ; Turn off contour lines res@cnFillMode = "RasterFill" res@cnRasterSmoothingOn = True res@gsnAddCyclic = False ; data is regional res@tmXBLabelFontHeightF = 0.012 res@tmYLLabelFontHeightF = 0.012 res@pmLabelBarOrthogonalPosF = 0.078 res@mpMinLatF = min(tp&latitude)-1;min(tp&latitude) res@mpMaxLatF = max(tp&latitude)+1;max(tp&latitude) res@mpMinLonF = min(tp&longitude)-1;min(tp&longitude) res@mpMaxLonF = max(tp&longitude)+1;max(tp&longitude) res@mpCenterLonF = 0.5*(res@mpMinLonF + res@mpMaxLonF) res@tiMainString = "";"GPM Level 3 IMERG Early Daily 0.1 x 0.1 degree Precipitation";"APHRODITE: RU: "+ymdPlot res@gsnRightString = "";" res@gsnCenterString = "ERA-Interim" res@gsnStringFontHeightF = 0.013 res@cnFillPalette = "BlAqGrYeOrReVi200";(::-1) ;reverse the color map res@lbBoxEndCapStyle = "TriangleBothEnds" res@pmLabelBarHeightF = 0.05 res@lbLabelFontHeightF = 0.012 nt := ind(ymdh_erai(:).eq."2015102900") plot = gsn_csm_contour_map(wks,tp(nt,:,:)*1000, res) draw(plot) frame(wks)