[ncl-talk] How to get second partial derivative of a variable

Gus Correa gus at ldeo.columbia.edu
Thu Apr 15 15:13:32 MDT 2021


This maybe?



  gradp  = grad_latlon_cfd (p, p&lat, p&lon, True, False)



  dpdX  = gradp[0]

  dpdY  = gradp[1]



  graddpdX  = grad_latlon_cfd (dpdX, p&lat, p&lon, True, False)

  d2pdX2 = graddpdX[0]

  d2pdXdY = graddpdX[1]


  graddpdY  = grad_latlon_cfd (dpdY, p&lat, p&lon, True, False)

  d2pdYdX = graddpdY[0]

  d2pdY2 = graddpdX[1]


  myvar = d2pdX2 * d2pdY2

On Thu, Apr 15, 2021 at 3:56 PM Lyndz via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Dear NCL-experts,
>
> *Details:*
> I have mean sea level pressure data from NCEP-DOE reanalysis with the
> following dimensions and sizes.
>
> Dimensions and sizes: [time | 124] x [lat | 73] x [lon | 144]
>
>
> *Problems*:
> (a) I would like to get the second partial derivative of the mslp
> separately for the lon and lat.
> I would like to get their products later and save as a variable such as
> the below image:
> [image: image.png]
>
> a gradient of a gradient or components of a laplacian?
>
> *What I have so far:*
>
> I have the following initial script but only for getting the first partial
> derivative using CFD.
>
>    diri = "."
>
>    fp   = addfile ("mslp_jan_2017.nc", "r")
>
>    p = fp->mslp(:,:,:)
>
> ;****************************************
>
> ; calculate pressure gradients via CFD
>
> ;****************************************
>
>
>   p_gradLatLon  = grad_latlon_cfd (p, p&lat, p&lon, True, False)
>
>   dpdY  = u_gradLatLon[0]
>
>   dpdX  = u_gradLatLon[1]
>
>   delete(p_gradLatLon)
>
>
>   dpdX at long_name = "longitudinal gradient of MSLP"
>
>   dpdX at units     = "P/m"                                         ;(Pa)*(1/m)
> = Pa/m
>
>   dpdY at long_name = "latitudinal gradient of MSLP"
>
>   dpdY at units     = "Pa/m"
>
>   printVarSummary(dpdX)
>
>   printMinMax(dpdX,0)
>
>   print("-------------")
>
>   printVarSummary(dpdY)
>
>   printMinMax(dpdY,0)
>
>   print("-------------")
>
>
>
> I'll appreciate any help on this.
>
> Sincerely,
>
> Lyndz
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210415/ba7bedcd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 3964 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210415/ba7bedcd/attachment.png>


More information about the ncl-talk mailing list