Re: How the stream function and gradient function work

From: guangshan chen <gchen9_at_nyahnyahspammersnyahnyah>
Date: Mon, 24 Aug 2009 22:48:26 -0500

Hi Dennis,

Thanks for your suggestion.

I checked my data. It is ordered from *north-to-south*. I reordered it.
But the wind field is still different.

Because in the uv2sfvpf function, the stream function is defined as:
u = - SFx, v = SFy
After I changed
  v_est = - sf_x
  u_est = sf_y
to
  v_est = sf_x
  u_est = - sf_y
the two wind field are exactly same.

Thanks for the help. I think you may add this to the introduction of
uv2sfvpf or uv2sfvpg to let others know how the
steam function is defined.

Bests

Guangshan

On Aug 24, 2009, at 5:52 PM, Dennis Shea wrote:

> Hello,
>
>
> Both the uv2sfvpf and gradsf require that the
> data be ordered from *south-to-north*. If they are
> *north-to-south*, then
>
> wave_jet_uwind_file = addfile("uwnd.mon.mean.pml.wave-jet-
> year.nc","r")
> wave_jet_vwind_file = addfile("vwnd.mon.mean.pml.wave-jet-
> year.nc","r")
>
> ; read and reverse the latitude order
> uwind = wave_jet_uwind_file->uwnd(7,9,::-1,:)
> vwind = wave_jet_vwind_file->vwnd(7,9,::-1,:)
>
> If the latitudes are ordered correctly and you
> still have a problem, then you can send the files to:
>
>
> ftp ftp.cgd.ucar.edu
> anonymous
> Use your email address for the password
> cd incoming
> put ...
> put ...
> :
> quit
>
> After ftp-ing the files, send us an email with the
> following information:
>
> * The version of NCL you are running (ncl -V).
> * The type of system you are on (uname -a).
>
> We will take a look.
> -------------------------------
>
> Finally, please place the attached .hluresfile at
>
> http://www.ncl.ucar.edu/Document/Graphics/hlures.shtml
>
> your home directory. This is recommended for all.
>
> Guangshan Chen wrote:
>> Dear all,
>> I did a test to the stream function (uv2sfvpf) and the gradient
>> function (gradsf). But there seems something is wrong in my script.
>> I used the uv2sfvpf function to calculate stream function from u
>> and v wind. Then I used the gradsf to calculate
>> u and v wind from the stream function that I calculated in the
>> first step. Last, I compared the original wind field
>> and the wind field calculate from the steam function.
>> These two wind field should be the same, supposedly. But the
>> figure show that they are quite different.
>> I attached my script and the figure. Could anyone give me a hand?
>> The following is the core of the code.
>> ;;;;;;;;;;;;;;;;;;;;
>> ; calculate stream function
>> ;;;;;;;;;;;;;;;;;;;;
>> uvmsg = 1e+36
>> sf = new ( (/nlat,mlon /), float, uvmsg ) ; stream function
>> vp = new ( (/nlat,mlon /), float, uvmsg ) ; velocity potential
>> uv2sfvpf (uwind,vwind, sf,vp) ; u,v ==> stream function +
>> velocity pot
>> ;;;;;;;;;;;;;;;;;;;;;
>> ; calcualte the stream function's
>> ; lat and longitudinal derivatives
>> ;;;;;;;;;;;;;;;;;;;;;
>> sf_x = sf
>> sf_y = sf
>> gradsf(sf, sf_x, sf_y)
>> v_est = -sf_x
>> u_est = sf_y
>> copy_VarCoords(uwind,u_est)
>> copy_VarCoords(vwind,v_est)
>> Thanks in advance.
>> Guangshan
>> ---------------------------------------------------------------------
>> ---
>> ---------------------------------------------------------------------
>> ---
>> _______________________________________________
>> 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 Mon Aug 24 2009 - 21:48:26 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 02 2009 - 12:24:39 MDT