CPCLDR(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– CPCLDR β€” the "draw those contour lines bestie" routine πŸ’–

NCAR Graphics Β· Fortran-visible as CPCLDR Β· section 3NCARG

Okay so. Picture this: you've already set up your whole contouring situation, and now you just need someone to actually, you know, draw the lines. That's this. That's the whole job. It's giving "I just work here" but make it beautiful. πŸ¦‹


✨ NAME ✨

CPCLDR β€” Draws contour lines.

Literally it draws contour lines. That's the vibe. No notes. πŸ‘‘


✨ SYNOPSIS ✨

CALL CPCLDR (ZDAT, RWRK, IWRK)

✨ C-BINDING SYNOPSIS ✨

#include <ncarg/ncargC.h>

void c_cpcldr (float *zdat, float *rwrk, int *iwrk)

✨ DESCRIPTION ✨

So all three of these arguments are arrays that you already handed over in your last call to CPRECT, CPSPS1, or CPSPS2, and here's the thing β€” you cannot have touched their contents since that call. Not even a little. Not even one element. They have to be exactly as they were. Periodt. πŸ’…

  • ZDAT β€” (REAL array, dimensioned exactly like you specified in that last CPRECT, CPSPS1, or CPSPS2 call, input) β€” this is your data array, your whole main character.
  • RWRK β€” (REAL array, dimensioned as specified in the last CPRECT, CPSPS1, or CPSPS2 call, input/output) β€” the real workspace array, it does stuff behind the scenes.
  • IWRK β€” (INTEGER array, dimensioned as specified in the last CPRECT, CPSPS1, or CPSPS2 call, input/output) β€” the integer workspace array, same deal.

✨ C-BINDING DESCRIPTION ✨

The C-binding argument descriptions are the same as the FORTRAN argument descriptions. Same facts, different wrapper. πŸŽ€


✨ USAGE ✨

CPCLDR draws contour lines, and you can call it any time after the initialization call to CPRECT, CPSPS1, or CPSPS2. Whenever. No rush. 🧚

The contour lines it draws are the ones specified by the first 'NCL' elements of the parameter arrays 'CLV' and 'CLU'. And if 'NCL' is zero? Then CPPKCL gets called to generate those values for you. Iconic delegation honestly.

Each element of 'CLV' specifies a contour level. The corresponding element of 'CLU' specifies two things:

  1. whether or not contour lines are to be drawn at that level, and
  2. whether or not the lines are to be labeled.

If the parameter 'T2D' has a non-zero value, the contour lines get smoothed, using cubic splines under tension. Fancy. Sleek. Glow-up behavior. ✨

Now, the edge stuff:

  • If the element of the parameter array 'CLU' corresponding to 'PAI' = -1 is non-zero, the edge of the grid is also drawn.
  • If the element of 'CLU' corresponding to 'PAI' = -2 is non-zero, the edges of special-value areas, if any, are drawn.
  • If the element of 'CLU' corresponding to 'PAI' = -3 is non-zero, the edges of out-of-range areas, if any, are drawn.

The default values are such that none of these edges are drawn. Chill defaults, honestly. πŸ™ˆ

🌸 The drawing order 🌸

Groups of lines are drawn in the following order:

  • contour lines for each of the specified levels, in ascending numeric order,
  • the edges of special-value areas, if any,
  • the edges of out-of-range areas, if any, and
  • the edge of the grid.

🌈 Color, dash, width 🌈

The color, dash pattern, and line width to be used for the lines drawn may be specified by elements of the parameter arrays 'CLC', 'CLD', and 'CLL', respectively.

Each of these contains elements corresponding to values of 'PAI' from 1 to 'NCL', plus three special elements, corresponding to 'PAI' = -1, -2, and -3.

Before and after each group of lines is drawn, the routine CPCHCL is called. You can supply your own version of CPCHCL to override the settings of color, dash pattern, and line width. Customize away, bestie. 🎨

🌟 The 'DPU' situation 🌟

The dash-pattern-usage parameter ('DPU') affects the pattern used to draw the lines. Set the value of 'DPU' as follows:

  • < 0 or = 0 β€” Lines are drawn by calling the SPPS routine CURVE. Lines are all solid and unlabeled; specified dash patterns are not used.
  • > 0 β€” Lines are drawn by calling the Dashline routine CURVED. Lines are solid or dashed, depending on the dash pattern specified by the appropriate element of 'CLD'.
    • If ABS('LLP') = 1, then the dash pattern for those lines that are to be labeled is constructed by replicating, 'DPU' times, the dash pattern specified by the appropriate element of 'CLD', and then appending to it the characters specified by the appropriate element of 'LLT'.
    • If ABS('LLP') is greater than 1, then the lines drawn will pass through any labels drawn by CPLBDR. If this is undesirable, you can call CPLBAM to put the label boxes into an area map and then call CPCLDM instead of CPCLDR to draw only those portions of the contour lines which do not lie inside the label boxes.
Heads up: if, during the last call to CPRECT or CPSPRS, the data being contoured were found to be essentially constant, then no contour lines are drawn. Instead, the constant-field label is written. Other lines are still drawn though, so it's not a total loss. 😭

✨ EXAMPLES ✨

Use the ncargex command to see the following relevant examples: caredg, ccpcff, ccpcfx, ccpcica, ccpcir, ccpcis, ccpcit, ccpclc, ccpcld, ccpcldr, ccpcll, ccpclu, ccpdflt, ccpfil, ccpga, ccphand, ccphcf, ccphl, ccphlt, ccpila, ccpilt, ccpklb, ccplbdr, ccpline, ccpllp, ccpmap, ccpmovi, ccpmpxy, ccpncls, ccpnet, ccpnof, ccpnsd, ccppkcl, ccprect, ccprwc, ccprwu, ccpset, ccpsps1, ccpsps2, ccpspv, ccpt2d, ccptitle, ccpvp, ccpvs, cidsfft, cpex01, cpex05, cpex07, tconpa, fsfsgfa.

That's a lot of examples. Go wild. πŸ”₯


✨ ACCESS ✨

To use CPCLDR or c_cpcldr, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. Order matters, don't fight it. 🫢


✨ MESSAGES ✨

See the conpack man page for a description of all Conpack error messages and/or informational messages. If something yells at you, that's where the answers live.


✨ SEE ALSO ✨

Online: conpack, cpback, cpchcf, cpchcl, cpchhl, cpchil, cpchll, cpcica, cpclam, cpcldm, cpcltr, cpcnrc, cpdrpl, cpezct, cpgetc, cpgeti, cpgetr, cplbam, cplbdr, cpmpxy, cpmviw, cpmvrw, cppkcl, cppklb, cprect, cprset, cpscae, cpsetc, cpseti, cpsetr, cpsps1, cpsps2, ncarg_cbind

Hardcopy: NCAR Graphics Contouring and Mapping Tutorial


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, babe. This was the UNIX flavor of the CPCLDR man page from March 1993 (yes, 1993, we stan a timeless queen), and it lives in section 3NCARG of the NCAR Graphics docs. Go draw something gorgeous. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from