; --------------------------------------------------------------------------- ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Program Name: change_qpe_mpe.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 Dec., 2017 ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; begin print("Start to replace the precipitation for analysis.") extAnAFile = getenv("extAnAFile") ; orginal AnA data mpeFile = getenv("mpeFile") ; MPE data f2 = addfile(extAnAFile + ".nc","w") f1 = addfile(mpeFile,"r") if (ismissing(f1)) then status_exit(42) end if ndim=dimsizes(dimsizes(f1->RAINRATE)) if (ndim.eq.2)then precip_rate = dble2flt(f1->RAINRATE(::-1,:)) else precip_rate = dble2flt(f1->RAINRATE(0,::-1,:)) end if precip_rate1= f2->RAINRATE(0,:,:) precip_rate=where(ismissing(precip_rate),precip_rate1,precip_rate) 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)