; --------------------------------------------------------------------------- ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Program Name: Combine_hgt.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, rap/gfs, outfile ; ; ; ; Output: combined file ; ; ; ; For non-fatal errors output is witten to $DATA/logs ; ; ; ; Author(s)/Contact(s): Linlin Pan, lpan@ucar.edu ; ; Origination Sept., 2015 ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; begin hrrrFile = getenv("hrrrFile") ; HRRR data gfsFile = getenv("gfsFile") ; GFS data outFile = getenv("outFile") ; outFile data indexFlag = getenv("INDEX") if(indexFlag .eq. "true") then indexf = addfile("index.nc","r") index = indexf->index end if f1 = addfile(hrrrFile,"r") f2 = addfile(gfsFile,"r") system("rm -f "+outFile) fout = addfile(outFile,"c") dd = dimsizes(f1->HGT) print("dd="+dd) dimlat = dd(0) dimlon = dd(1) v1d = ndtooned(f1->HGT) if(indexFlag .eq. "false") then findexOut = addfile("index_out.nc","c") index = ind(ismissing(v1d) ) findexOut->index = index system("mv index_out.nc index.nc") exit end if v1dgfs = ndtooned(f2->HGT) v1d(index) = v1dgfs(index) HGT = onedtond(v1d,(/dimlat,dimlon/)) fout->HGT = HGT end