# [ncl-talk] Question about addition of coriolis parameter (1Darray) and a variable(4D-aray)

Dennis Shea shea at ucar.edu
Mon Feb 11 09:04:12 MST 2019

```See: I modified a script I had. This has extra 'stuff; in it like EOFs but
the 1st part calculates the *local vorticity tendency*

*https://www.ncl.ucar.edu/Applications/wind.shtml*
<https://www.ncl.ucar.edu/Applications/wind.shtml>
*Example 6*
=========================================
Bottom two examples:* shear_stretch_deform, qvector*

Cheers

On Fri, Feb 8, 2019 at 8:21 AM Lyndz <olagueralyndonmark429 at gmail.com>
wrote:

> Hi Sir  Dennis,
>
> Thanks a lot!
> I was also looking at *conform* a while ago but didn't know how to use it.
>
>
> Lyndz
>
>
> On Sat, Feb 9, 2019 at 12:15 AM Dennis Shea <shea at ucar.edu> wrote:
>
>> vr(ntim,klev,nlat,mlon)  ==> dimension numbers (0,1,2,3)
>>              flat(nlat)
>> -----
>>      va = vr + *conform*
>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml>(vr,
>> flat, 2) )    ; flat matched the '2-th' dimension of 'vr'
>>
>>      va at long_name = "absolute vorticity"
>>      va at units     = "per second
>>      *copy_VarCoords*
>> <http://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarCoords.shtml>(u,
>> va)
>>
>> or overwrite rather than create a new variable
>>
>>      vr = vr + *conform*
>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml>(vr,
>> flat, 2) )    ; flat matched the '2-th' dimension of 'vr'
>>
>>      vr at long_name = "absolute vorticity"
>>      vr at units     = "per second
>>      *copy_VarCoords*
>> <http://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarCoords.shtml>(u,
>> vr)
>> "
>>
>> Good luck
>>
>> On Fri, Feb 8, 2019 at 2:11 AM Lyndz <olagueralyndonmark429 at gmail.com>
>> wrote:
>>
>>> Dear NCL-experts,
>>>
>>> I am calculating vorticity tendency using the following equation (also
>>> attached in this email):
>>> I want to add the coriolis parameter (1D) and the calculated relative
>>> vorticity (4D) before calculating its advection. These two parameters have
>>> dimensions.
>>>
>>> [image: Screenshot from 2019-02-08 18-02-16.png]
>>>
>>>
>>> Below is the part  that calculates the vorticity using spherical
>>> harmonics and the coriolis parameter.
>>> ;************************************************
>>> ; variable and file handling
>>> ;************************************************
>>>   f   = addfile("../ncep_6h_jan.nc","r")       ; open netcdf file
>>>   u   = f->U_GRD_2_ISBL(:,:,:,:)            ; pull u off file
>>>   v   = f->V_GRD_2_ISBL(:,:,:,:)            ; pull v off file
>>>   u = u(:,:,::-1,:)                         ;for speherical harmonics
>>>   v = v(:,:,::-1,:)
>>> ;************************************************
>>> ; calculate vorticity on a Fixed Grid
>>> ;************************************************
>>> *  vr = uv2vrF_Wrap(u,v)*
>>>   printVarSummary(vr)
>>>
>>>   vr at long_name = "vorticity"
>>>   vr at units     = "per second"
>>> ;************************************************
>>> ;calculate coriolis parameter
>>> ;************************************************
>>>   lat = vr&lat
>>> *  flat = coriolis_param(lat)*
>>>
>>> [1] I apologize, I think this is a basic question. How do add the
>>> coriolis parameter to the calculated vorticity? I already know how to get
>>> the advection, I only got stuck in this part.
>>>
>>> I'll appreciate any help.
>>>
>>>
>>> Sincerely,
>>>
>>> *Lyndz*
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190211/a55f3fc0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2019-02-08 18-02-16.png
Type: image/png
Size: 42272 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190211/a55f3fc0/attachment.png>
```