[ncl-talk] Sub: figure error....
Adam Phillips
asphilli at ucar.edu
Mon Sep 18 15:53:00 MDT 2017
Hi Dz,
Just a guess: When interpolating make sure that the ranges of the input
latitude/longitude arrays match the ranges of the output latitude/longitude
arrays. In other words, if the longitudes for the input arrays (lon2d) run
from -180:180E and the longitudes for the regridded output (lonnew) run
from 0:360 you can get results like what you describe.
Hope that helps. If you continue to have issues let the ncl-talk email list
know.
Adam
On Mon, Sep 18, 2017 at 12:04 AM, dale zuri <dalezuri at gmail.com> wrote:
> Hi,
> After interpolating the irregular grid to regular, the output plot
> reflects the missing values for most of the region. I attached here an
> output figure.
> I would appreciate any help and suggestions to fix this issue.
>
> Thanks
> Dz
>
>
> begin
>
>
>
> iz = addfile("landsea2_wrf.nc","r")
> lat2d = iz->lat
> lon2d = iz->lon
> mas=iz->mask
>
> c = addfile("era-down_1989_apr-sep_22z.nc","r")
> t2 = cds->p
>
> t2!1="lon2d"
> t2!2="lat2d"
> t2 at lon2d = lon2d
> t2 at lat2d = lat2d
> printVarSummary(t2)
> aavg= t2(time|:,lat2d|:,lon2d|:)
> printVarSummary(aavg)
> print(aavg(0,:,0))
> printMinMax(aavg,0)
> printMinMax(lat2d,0)
> printMinMax(lon2d,0)
> ;******************************************************
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> f1 = addfile("/import/h/marchforecast/mar1982-2010/sim
> pleWunit.2005031212.nc", "r") ; note the "s" of addfile
> T1 = f1->precSum ; read T from all files
> printVarSummary (T1)
> latnew=f1->lat_0
> lonnew=f1->lon_0
> ;;;;;;Interpolation Step;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;printVarSummary(T)
> ;printVarSummary(aavg)
> ;print(aavg)
> printVarSummary(aavg)
> newsst = rcm2rgrid_Wrap(lat2d,lon2d,aavg,latnew,lonnew,1)
> printMinMax(newsst,0)
> printVarSummary(newsst)
> print(newsst)
>
>
> system("/bin/rm -f simple.nc") ; remove any pre-existing file
> ncdf = addfile("simple.nc" ,"c") ; open output netCDF file
>
> ;===================================================================
> ; create global attributes of the file (optional)
> ;===================================================================
> fAtt = True ; assign file attributes
> fAtt at title = "NCL Simple Approach to netCDF Creation"
> fAtt at source_file = "original-file.nc"
> fAtt at Conventions = "None"
> fAtt at creation_date = systemfunc ("date")
> fileattdef( ncdf, fAtt ) ; copy file attributes
>
> ;===================================================================
> ; make time an UNLIMITED dimension; recommended for most applications
> ;===================================================================
> filedimdef(ncdf,"time",-1,True)
>
> ;===================================================================
> ; output variables directly; NCL will call appropriate functions
> ; to write the meta data associated with each variable
> ;===================================================================
> ncdf->newsst = newsst
>
> end
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170918/2c3fa4cc/attachment.html>
More information about the ncl-talk
mailing list