; --------------------------------------------------------------------------- ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Program Name: change_qpe.ncl ; ; ; ; National Water Model (NWM) WRF-hydro forcing engine is developed by ; ; National Center for Atmospheric Research (NCAR), under the sponsorship ; ; of National Water Center (NWC). ; ; ; ; Team Members: ; ; NCAR Staff: Linlin Pan, Wei Yu, and David Gochis ; ; NWC/OWP Staff: Brian Cosgrove, Zhengtao Cui, Cham Pham, and James Taft ; ; ; ; This is a ncl program to perform regridding for the long range forcing. ; ; ; ; Input: hrrr file, rainfall file ; ; ; ; Output: hrrr file with revised rainfall ; ; ; ; For non-fatal errors output is witten to $DATA/logs ; ; ; ; Author(s)/Contact(s): Linlin Pan, lpan@ucar.edu ; ; Origination Sept., 2015 ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; begin print("Start to replace the precipitation for analysis.") hrrrFile = getenv("hrrrFile") ; HRRR data rainFile = getenv("rainFile") ; rain data f2 = addfile(hrrrFile + ".nc","w") f1 = addfile(rainFile,"r") ; dd = dimsizes(f1->precip_rate) ; print("dd="+dd) ; dimlat = dd(0) ; dimlon = dd(1) ndim=dimsizes(dimsizes(f1->precip_rate)) if(ndim.eq.2)then precip_rate = f1->precip_rate(:,:) else precip_rate = f1->precip_rate(0,:,:) end if printVarSummary(precip_rate) printVarSummary(f2->RAINRATE) ; f2->RAINRATE = (/precip_rate(:,:)/) f2->RAINRATE(0,:,:) = (/precip_rate/) ; f2->RAINRATE@units="mm s-1" ; f2->RAINRATE@long_name="Surface Precipitation Rate" print("End to replace the precipitation for analysis.") exit end status_exit(1)