SUBROUTINE DLNEXTRP in uv2dv_cfd

From: Wei-Jen Tseng <tseng.weijen_at_nyahnyahspammersnyahnyah>
Date: Sat Apr 27 2013 - 19:12:20 MDT

Dear all,

I feel confused when I read the code about the linear extrapolation used in
the uv2dv_cfd.

The subroutine shows the way to calculate the divergence of 4 corner points.
I have two questions.

First, the calculations of 2 points [NL=1&ML=1, NL=1&ML=MLON] look fine
because they use 4 another points to get the answer.
But, the others [NL=NLAT&ML=1, NL=NLAT&ML=MLON] only use 3 points to
calculate the divergence.!?
Second, the if-statement and the calculation are not consistent in the
SUBROUTINE DLNEXTRP.

For example, it is the original code in NCL:

IF (NL.EQ.NLAT .AND. ML.EQ.MLON) THEN
  IF (X(ML,NL-1).NE.XMSG .AND.
+ X(ML,NL-2).NE.XMSG .AND.
+ X(ML-1,NL).NE.XMSG .AND.
+ X(ML-1,NL).NE.XMSG) THEN
      X(ML,NL) =
(2.D0*X(ML,NL-2)-X(ML,NL-2)+2.D0*X(ML-1,NL)-X(ML-2,NL))*0.5D0
END IF
END IF

The corrected code maybe look like this….?

IF (NL.EQ.NLAT .AND. ML.EQ.MLON) THEN
  IF (X(ML,NL-1).NE.XMSG .AND.
+ X(ML,NL-2).NE.XMSG .AND.
+ X(ML-1,NL).NE.XMSG .AND.
+ X(ML-2,NL).NE.XMSG) THEN
      X(ML,NL) =
(2.D0*X(ML,NL-1)-X(ML,NL-2)+2.D0*X(ML-1,NL)-X(ML-2,NL))*0.5D0
END IF
END IF

I would like to know just the misunderstanding of the code or it's a bug.
Thank you in advance.

Best regards,

Wei-Jen

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Apr 27 19:12:30 2013

This archive was generated by hypermail 2.1.8 : Thu May 02 2013 - 11:16:45 MDT