# Re: Errors in dy calculation before using center_finite_diff_n

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed May 29 2013 - 07:36:02 MDT

'dY' is a constant. It should be

dY = 6378388.*dlat

==========================

Also, you can eliminate the 'do loops'

dX = 6378388.*cos(0.0174533*lat)*dlon ; (*)
dqdx = center_finite_diff_n (q, dX , True, 0,2)

dY = 6378388.dlat
dqdy = center_finite_diff_n (q, dY , True,0,1)

copy_VarCoords(q, dqdx) ; contributed.ncl
copy_VarCoords(q, dqdy)

dqdx@long_name = "..."
dqdx@units = "..."

dqdy@long_name = "..."
dqdy@units = "..."

printVarSummary(dqdx)
printVarSummary(dqdy)

On 5/28/13 1:35 PM, Abhik Santra wrote:
>
> Dear NCL-users,
>
> I am trying to calculate dq/dx and dq/dy using "center_finite_diff_n" function.
> For the same, I considered
>
> dlon = (lon(2)-lon(1))*0.0174533
> dlat = (lat(2)-lat(1))*0.0174533
>
> do nl=0,nlat-1
> dX = 6378388.*cos(0.0174533*lat(nl))*dlon
> dqdx(:,nl:nl,:) = center_finite_diff_n (q(:,nl:nl,:), dX , True,0,2)
> end do
>
> do ml=0,mlon-1
> dY = 6378388.*lon(ml)*dlat ; I have also tried dY = 6378388.*cos(0.0174533*lon(ml))*dlat
> dqdy(:,:,ml:ml) = center_finite_diff_n (q(:,:,ml:ml), dY , True,0,1)
> end do
>
> The above calculates the dq/dx term reasonably but gives unrealistic dq/dy values.
> I think probably the dY calculation is not correct.
> What is the error in the above few lines?
> Kindly point out the mistake and help me to solve the problem.
>
> Thanking you.
>
> Regards,
> Abhik.
> ___________________________________________
>
> Abhik Santra
> CSIR Research Fellow,
> Indian Institute of Tropical Meteorology,
> Pune - 411008.
> India
> ___________________________________________
> _______________________________________________
> 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 Wed May 29 07:36:09 2013

This archive was generated by hypermail 2.1.8 : Thu May 30 2013 - 11:38:10 MDT