Re: Global sum question

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 02 2013 - 08:31:01 MDT

Thanks for the heads up Lifen. I've CC'ed ncl-talk so they know this issue was resolved.

--Mary

On Jul 2, 2013, at 7:51 AM, Jiang, Lifen wrote:

> Dear Mary,
>
> I just let you know that both my script and result are correct. I have checked this with the author of that paper. He got the same value with you and I. The problem is they use a revised data set, not the same with me.
>
> Thank you so much for help checking the data!
>
> Lifen
>
> [SNIP…offline conversation…]
>
> --Mary
> On Jul 1, 2013, at 11:47 AM, Jiang, Lifen wrote:
> > Dear Mary,
> >
> > Thank you for running my data! I got the same value with you. I am using 6.1.2.
> >
> > Did you use the code I provided or different code?
> >
> > Lifen
> >
> >
> > 2013-07-01
> > Jiang, Lifen
> > 发件人: Mary Haley
> > 发送时间: 2013-07-01 12:41:54
> > 收件人: Jiang, Lifen
> > 抄送: ncl-talk
> > 主题: Re: [ncl-talk] Global sum question
> > Lifen,
> > I'm getting a value of 4.621394e+14 when I run your script.
> > What version of NCL are you using, and what value are you expecting?
> > --Mary
> > On Jun 30, 2013, at 7:00 PM, Jiang, Lifen wrote:
> > > Hi, NCL group,
> > >
> > > I have used a NCL function to calculate the global sum of my data of two dimensions. However, my global sum (462) is a little lower than another report using different language.
> > >
> > > Could anyone help check if my result is correct? I have uploaded my data file (Regrid.med_c0_kgm-2) to NCL folder "incoming" and attached codes below.
> > >
> > > Thank you in advance for your time!
> > >
> > > With best regards,
> > >
> > > Lifen
> > >
> > >
> > > ***********************************
> > >
> > > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> > > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> > > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> > > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> > >
> > >
> > >
> > > in = addfile("Regrid.med_c0_kgm-2.nc","r")
> > > t = in->regrid
> > >
> > > fili = "Regrid.med_c0_kgm-2.nc"
> > > a = addfile (fili, "r")
> > > t=a->regrid
> > > t = lonFlip(t)
> > > printVarSummary(t)
> > >
> > > lat = in->LAT
> > > lon = in->LON
> > >
> > > re = 6.37122e06
> > > rad = 4.0 * atan(1.0) / 180.0
> > > con = re * rad
> > > clat = cos(lat * rad) ; cosine of latitude
> > >
> > > dlon = (lon(2) - lon(1)) ; assume dlon is constant
> > > dlat = (lat(2) - lat(1)) ; assume dlat is constant
> > >
> > > dx = con * dlon * clat ; dx at each latitude
> > > dy = con * dlat ; dy is constant
> > > dxdy = dx * dy ; dxdy(nlat)
> > > dydx = dy * dx ; dydx(nlat)
> > >
> > > wgt = new((/180, 360/), typeof(t))
> > > wgt = conform(wgt, dxdy, 0)
> > >
> > > qSum = wgt_areasum2(t, wgt, 0) ; => qSum
> > > print(qSum)
> > >
> > >
> > > filo = "GlobalSum_"+fili
> > > system("/bin/rm -f "+filo)
> > > fout=addfile(filo,"c")
> > > fout@creation_date = systemfunc("date")
> > > fout@title=" GlobalSum "+fili
> > > fout->qSum=qSum
> > >
> > > 2013-06-30
> > > Jiang, Lifen
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 2 08:31:10 2013

This archive was generated by hypermail 2.1.8 : Fri Jul 05 2013 - 13:06:49 MDT