ShadeLtContour and ShadeLtGtContour

From: Takeshi Enomoto (eno AT XXXXXX)
Date: Mon Dec 22 2003 - 02:36:16 MST


Hello,

I noticed that difference in behaviour between ShadeLtContour and
ShadeLtGtContour of shea_util.ncl.

CnLt is not included in
        ShadeLtGtContour(plot,CnLt,FillPatLt,CnGt,FillPatGt)

but is included in
        ShadeLtContour(plot,CnLt,FillPatLt)
when FillPatLt is applied.

The source code is consistent with the results.
ShadeLtContour: -- note .le. in the condition
        do i=0,N-1 ; Fill contour levels
depending on
          if(cnlvls(i).le.CnLt) then ; different criteria.
            patterns(i) = FillPatLt ; see above URL
          end if
        end do
ShadeLtGtContour: -- note .lt. in the condition
        do i=0,N-1 ; Fill contour levels
depending on
          if(cnlvls(i).lt.CnLt) then ; different criteria.
            patterns(i) = FillPatLt ; see above URL
          end if

It appears that ShadeLtContour is an exception.
".lt." would be consistent with the naming
but for me it would be easier if I could just shade the contour levels
equal to or smaller (greater) than CnLt (CnGt).

Confusingly CnGt in ShadeLtGtContour is somehow included in the shade.
If I need to shade x<=-6 and x>=6 (with a level spacing of 2), I have
to write
        ShadeLtGtContour(plot, -5., 6, 6., 17); shades x<=-6 and x>=6
but not
        ShadeLtGtContour(plot, -6., 6, 6., 17); shades x<=-4 and x>=6
or
        ShadeLtGtContour(plot, -5., 6, 5., 17); shades x<=-6 and x>=4.

BTW, is it correct to compare float values with .le., .eq., .ne., and
.ge. in ncl?
Shouldn't I compare abs(x-y) with a very small value?

I would appreciate if I am doing something funny.

Happy holidays!
-----
Dr. Takeshi Enomoto
eno@jamstec.go.jp
Frontier Research System for Global Change

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Dec 22 2003 - 07:42:09 MST