Hello,
To use this function (or any spherical harmonic function) the following two
statements must be true:
1) Your dump4d array does not have any missing data
(denoted by @_FillValue attribute)
2) dump4d is on a global grid
If either one of those two statemets is false, try using the function linint2...
Also, there is no need for your double do loops in your script, you can pass the
first two dimensions into the g2gsh fxn:
newgrid4d = new((/ntime,nlev,newlat,newlon/),float)
print("writing netcdffile->" + innames(6)) ;; Tmin
dump4d = infile->$innames(6)$
newgrid4d = (/ g2gsh(dump2d,(/newlat,newlon/), 0) /)
filevardef(netcdffile, "Tmin","float",(/"time","lev","lat","lon"/))
Finally, it is usually suggested that you use the _Wrap version of this routine
to carry the coordinate variables + attributes over to the left hand side:
(Make sure you load contributed.ncl if you do this)
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
print("writing netcdffile->" + innames(6)) ;; Tmin
dump4d = infile->$innames(6)$
newgrid4d = g2gsh_Wrap(dump2d,(/newlat,newlon/), 0)
filevardef(netcdffile, "Tmin","float",(/"time","lev","lat","lon"/))
Let us know if you are still having problems.
Adam
>Delivered-To: asphilli@ucar.edu
>Delivered-To: ncl-talk@ucar.edu
>Date: Fri, 04 Mar 2005 11:27:36 +0200
>From: "e.k." <ekati@mg.uoa.gr>
>User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830
>X-Accept-Language: en-us, en
>MIME-Version: 1.0
>To: ncl-talk@ucar.edu
>Content-Transfer-Encoding: 7bit
>X-Mailman-Approved-At: Fri, 04 Mar 2005 08:53:36 -0700
>Subject: g2gsh problem
>X-BeenThere: ncl-talk@ucar.edu
>X-Mailman-Version: 2.1.1
>List-Id: NCAR Command Language User Group <ncl-talk.ucar.edu>
>List-Unsubscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request@ucar.edu?subject=unsubscribe>
>List-Post: <mailto:ncl-talk@ucar.edu>
>List-Help: <mailto:ncl-talk-request@ucar.edu?subject=help>
>List-Subscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request@ucar.edu?subject=subscribe>
>
>Dear users,
>
>I am having trouble on making interpolation from a gauusian grid to a
>higher resolution
>gaussian grid. When using the command g2gsh for the regriding the ncl
>script
>seems to work fine and creates another netcdf file with the right
>resolution but
>it returns negative values at the variables.
>
>a sample from the script:
>
>;newgrid4d = new((/ntime,nlev,newlat,newlon/),float)
>;print("writing netcdffile->" + innames(6)) ;; Tmin
>;;dump4d = infile->$innames(6)$
>;do i=0, ntime-1
>;do l = 0, nlev-1
>; dump2d = dump4d(i,l,:,:)
>; newgrid = g2gsh(dump2d,(/newlat,newlon/), 0)
>; newgrid4d(i,l,:,:) = newgrid
>;end do
>;end do
>;filevardef(netcdffile, "Tmin","float",(/"time","lev","lat","lon"/))
>
>
>Any help in this regard will be highly appreciated.
>
>Best regards and thank you for your time.
>
>Yours sincerely,
>
>
>_______________________________________________
>ncl-talk mailing list
>ncl-talk@ucar.edu
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------------------------------------------------------
Adam Phillips email: asphilli@ucar.edu
Climate and Global Dynamics Division tel: (303) 497-1726
National Center for Atmospheric Research fax: (303) 497-1333
P.O. Box 3000
Boulder, CO 80307-3000 http://www.cgd.ucar.edu/~asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Fri Mar 04 2005 - 10:06:45 MST