Re: terrain following coordinates

From: Kate Hedstrom (kate AT unknown)
Date: Tue Aug 06 2002 - 11:42:41 MDT

  • Next message: Nancy Westcott: "plotting contours using natgrids and cprect over a base map"

    > I'm new to NCAR and have the following question: How can I tranform
    > terrain following coordinates (sigma coordinates) to NCAR's XY
    > coordinates. The X values are regularly spaced but Y values vary with
    > the terrain.

    Are you making contour plots? If so, you need to replace the cpmpxy
    routine provided in the NCARG libraries. A minimal version is:

          subroutine cpmpxy(imap,x,y,fx,fy)
          integer imap
          real x, y, fx, fy
    #include "bathy.h"

          if ( imap .eq. 3) then
            fx = x_v(int(x),int(y))
         & + (x_v(int(x)+1,int(y))-x_v(int(x),int(y)))*(x-aint(x))
         & + (x_v(int(x),int(y)+1)-x_v(int(x),int(y)))*(y-aint(y))
         & + (x_v(int(x)+1,int(y)+1)-x_v(int(x),int(y)+1)
         & - x_v(int(x)+1,int(y))+x_v(int(x),int(y)))
         & *(x-aint(x))*(y-aint(y))
            fy = y_v(int(x),int(y))
         & + (y_v(int(x)+1,int(y))-y_v(int(x),int(y)))*(x-aint(x))
         & + (y_v(int(x),int(y)+1)-y_v(int(x),int(y)))*(y-aint(y))
         & + (y_v(int(x)+1,int(y)+1)-y_v(int(x),int(y)+1)
         & - y_v(int(x)+1,int(y))+y_v(int(x),int(y)))
         & *(x-aint(x))*(y-aint(y))
          end if
          return
          end

    The x_v and y_v arrays are in a common block in bathy.h and are
    set elsewhere.

    In your code, before calling the contouring routines, you need to
    set imap:

          call cpseti ('MAP - mapping flag', 3)

    Kate

    P.S. I once lived in Slidell and I enjoyed the lizards everywhere.

    -- 
    Kate Hedström       Arctic Region Supercomputing Center
    kate AT unknown       University of Alaska, Fairbanks
    _______________________________________________
    ncarg-talk mailing list
    ncarg-talk AT unknown
    http://mailman.ucar.edu/mailman/listinfo/ncarg-talk
    



    This archive was generated by hypermail 2b29 : Tue Aug 06 2002 - 13:34:18 MDT