VVUMXY(3NCARG)
π VVUMXY β the glow-up-your-own-vector-mapping routine π
okay bestie, so this is a page from the NCAR GRAPHICS manual, and it's about VVUMXY from the 3NCARG section. no cap, this one is a choose-your-own-adventure routine. π¦
β¨ NAME β¨
VVUMXY β the routine you get to modify so you can define a custom mapping of vectors from a data coordinate system (one that's aligned with the natural boundaries of the vector field, obviously π
) over to the uniform normalized device coordinate (NDC) system that's suitable for generating a plot on an output device.
it has the same parameters as the internal Vectors routine, VVMPXY, which is the one used for the predefined mappings β y'know, the ones that kick in when the MAP parameter has a value between 0 and 2. π
β¨ SYNOPSIS β¨
CALL VVUMXY (X,Y,U,V,UVM,XB,YB,XE,YE,IST)
β¨ DESCRIPTION β¨
okay so here's the whole cast of characters, one by one, no skips π«Ά
Xβ (REAL, input) where the vector sits along the first dimensional axis in the data coordinate system. whenMAPis0, this is the X Axis. ifMAPis1, it's the longitudinal axis, and ifMAPis2, it's the radial axis. for any other values ofMAPβ the ones that actually causeVVUMXYto get invoked β the interpretation is up to the author of the mapping routine. you're the main character here, bestie. πYβ (REAL, input) where the vector sits along the second dimensional axis in the data coordinate system. whenMAPis0, this is the Y Axis. ifMAPis1, it's the latitudinal axis, and ifMAPis2, it's the angular axis. for other values ofMAPβ again, the ones that makeVVUMXYget called β the interpretation is up to the author of the mapping routine. β¨Uβ (REAL, input) the U component of the vector. ifTRTis set to1, the direction of theUcomponent is tangent to the direction of the first dimensional axis in the data coordinate system, at the location of the vector. ifTRTis set to0, andMAPhas a value of0or2, then the direction of theUcomponent is parallel to the horizontal (X axis) in NDC space. slay.Vβ (REAL, input) the V component of the vector. ifTRTis set to1, the direction of theVcomponent is normal to the direction of the first dimensional axis in the data coordinate system, at the location of the vector. ifTRTis set to0, andMAPhas a value of0or2, then the direction of theVcomponent is parallel to the vertical (Y axis) in NDC space. iconic behavior honestly.UVMβ (REAL, input) the magnitude of the U and V components,SQRT(U*U+V*V). like yes, technically this could be calculated inside the routine, but it's more efficient for the calling routine to supply the value as an argument, because it's needed for other purposes at a higher level. bestie is doing the math so you don't have to. π§XBβ (REAL, output) location of the vector starting point along the horizontal (X axis) in NDC space, before adjustment based on the value of the vector positioning parameter,VPO. πΈYBβ (REAL, output) location of the vector starting point along the vertical (Y axis) in NDC space, before adjustment based on the value of the vector positioning parameter,VPO. πΈXEβ (REAL, output) location of the vector ending point along the horizontal (X axis) in NDC space, before adjustment based on the value of the vector positioning parameter,VPO. πΈYEβ (REAL, output) location of the vector ending point along the vertical (Y axis) in NDC space, before adjustment based on the value of the vector positioning parameter,VPO. πΈISTβ (REAL, output) the status of the vector mapping operation:0means success π- negative values mean the mapping failed π
- positive values are reserved and should not be used by the implementor of a mapping routine. hands off, bestie. π
β¨ USAGE β¨
so here's the tea: the user does not call VVUMXY. π«’ Vectors calls it, and only when the parameter MAP has a value other than 0, 1, or 2 β those three mappings are handled by Vectors internally. iykyk.
also, heads up: unlike the other user-modifiable mapping routines in NCAR Graphics, like CPMPXY, which map a single point into the user coordinate system β this routine returns two points, representing both ends of the vector, scaled for magnitude, in the normalized device coordinate (NDC) system.
and why NDC for output? because NDC is a coordinate system that's guaranteed to be rectangular and uniform, so it's a super convenient reference system for mapping both vector magnitude and direction correctly. π
now, "uniform" here means: an arbitrary numerical increment along either the X or Y axis has the same length given any offset from the coordinate system origin. the user coordinate system does not qualify, because it may be log-scaled, or the X units may have a different size from the Y units. not uniform, not invited. π
π implementing your own custom mapping π
to implement a custom mapping, you gotta:
- pick a unique mapping code β a positive integer greater than
2 - then modify
VVUMXYto recognize and respond to the chosen code
in the standard distribution of NCAR Graphics, this routine resides in the file, vvumxy.f. π
VVUMXY has access to a common block called VVMAP that contains a number of variables used to record the current transformation state. in order to accommodate a variety of mapping implementations, VVMAP provides more information than normally required. consider the values stored in VVMAP as strictly read-only. π«βοΈ
one essential member of this common block is IMAP, which contains the value currently assigned to the MAP parameter. π
π¦ the non-linear mapping situation π¦
when implementing a non-linear mapping, an iterative differential technique will most likely be required. go look at the routine, VVMPXY, in vvmpxy.f β it handles the pre-defined mappings, and it's full of examples of the method. πβ¨
both the default transformation (MAP set to 0) β which exists to account for possible log scaling of the user coordinate axes β and also the Ezmap projection (MAP set to 1) use such a technique. so you're in good company.
basically the idea is:
- the vector components must be proportionally reduced in size enough that an effectively "instantaneous" angle can be calculated,
- but they must not become so small that the calculation is adversely affected by the floating point precision available for the machine. π
additionally, checks must be put in place to prevent the increment from stepping off the edge of the coordinate system space.
and the pre-defined mappings? they step in the opposite direction to find the angle whenever an increment in the original direction would fall off the edge. iconic problem-solving, honestly. π
β¨ ACCESS β¨
to use VVUMXY, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β preferably in that order. don't fight the order, bestie. π«Ά
β¨ SEE ALSO β¨
Online: vectors, vectors_params, vvectr, vvgetc, vvgeti, vvgetr, vvinit, vvrset, vvsetc, vvseti, vvsetr, vvudmv, ncarg_cbind.
Hardcopy: NCAR Graphics Fundamentals, UNIX Version
β¨ COPYRIGHT β¨
Copyright (C) 1987-2009 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
and that's the whole page, bestie!! πβ¨ this was VVUMXY(3NCARG) from the UNIX manual, dated April 1993 β yeah, she's vintage, she's timeless, she ate. π go forth and write your custom mapping, you absolute icon. πππ¦
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms