**To**:**David Wang <climater@xxxxxxxxx>****Subject**:**Re: [ferret_users] indefinite integral, axis, regrid and context****From**:**"William.S.Kessler" <William.S.Kessler@xxxxxxxx>**- Date: Sat, 17 Jan 2009 15:55:22 -0800
- Cc: "William.S.Kessler" <William.S.Kessler@xxxxxxxx>, oar.pmel.ferret_users@xxxxxxxx
- In-reply-to: <8be1369e0901170934t7dfd8413q5137dd396ececaa2@xxxxxxxxxxxxxx>
- References: <8be1369e0901170934t7dfd8413q5137dd396ececaa2@xxxxxxxxxxxxxx>
- Sender: owner-ferret_users@xxxxxxxx

yes? save/file=junk.cdf savepsi LISTing to file junk.cdf yes? can var savepsi ! remove the dummy definition yes? use junk.cdf yes? let savepsi0=if basin[d=2,gxy=psi@nrst,k=1] eq 2 then savepsi yes? shade/x=100e:290e savepsi0 ! note specification of x-limits

Billy K On 17/01/2009, at 9:34 AM, David Wang wrote:

Hi Ferreters,I've run into trouble with @iin indefinite integral but wasn't ableto pin down the source of error. I wrote a script meant to give mea quick look at the Sverdrup streamfunction in the tropical Pacificfrom a given wind stress curl. My basic idea is to first mask outthe wind stress curl outside the Pacific basin with zero, do thezonal indefinite integration westward, then mask out the resultingstreamfunction in all basins except the Pacific. Here is the codeusing the publicly available wind data (Trenberth et al. 1990) andmask:\can mode verify can data/a can region ! Load annual wind stress curl and basin mask files use "http://iridl.ldeo.columbia.edu/SOURCES/.TRENBERTH/.Annual/dods";use "http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NODC/.WOA05/.Masks/.basin/dods"! Mask out all basins but the Pacificlet curl_pac = if basin[d=2,gxy=curl[d=1]@nrst,k=1] eq 2 then curl[d=1]/1e8 else 0! Calculate Rossby parameter \beta let f = (2*7.29212e-5) * sin(y[gy=curl_pac]*(4*atan(1.)/180)) let beta = f[y=@ddc] ! Calculate Sverdrup streamfunction (in Sv)let psi = (-1)*(curl_pac[x=0:360@din]-curl_pac[x=0:360@iin])/beta/1027/1e6! Mask out all basin but the Pacific let psi_pac = if basin[d=2,gxy=psi@nrst,k=1] eq 2 then psi ! Show me the result sha/line/key/@t psi_pacThings are still OK after psi is defined (try sha psi). However themasked variable psi_pac has become erroneous (try sha psi_pac). Andthe last command, with a specified context (@t), issues an errormsg complaining inconsistent sizes. I found it tricky to figure outwhat goes wrong in such a script with indefinite integral,regridding between different axes (the x axis starts at 180E (-180)in curl[d=1] while 0.5E in basin[d=2]) and the interplay betweenindefinite integral and context. Does anyone has a clue please?

**Follow-Ups**:**Re: [ferret_users] indefinite integral, axis, regrid and context***From:*David Wang

**References**:**[ferret_users] indefinite integral, axis, regrid and context***From:*David Wang

- Previous by thread:
**[ferret_users] indefinite integral, axis, regrid and context** - Next by thread:
**Re: [ferret_users] indefinite integral, axis, regrid and context**

Contact Us

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement