CPSPS1(3NCARG)

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

✨ CPSPS1 ✨ (the 3NCARG glow-up, bestie edition)

okay so welcome to the NCAR GRAPHICS corner of the manual, where we talk about CPSPS1. she's a Fortran girlie, she's from 3NCARG, and honestly? she eats. πŸ’…


🌸 NAME 🌸

CPSPS1 β€” she interpolates from an array of data on a "sparse" rectangular grid that's regularly spaced in X and Y, over to an array of data on a "dense" rectangular grid, and then she initializes contouring from the array on that dense grid. πŸ¦‹

and like, when we say "sparse" grid we mean one whose dimensions are smaller than you'd like, so contour lines built directly on it end up being these long straight segments. not the vibe. so yeah, CPSPS1 can lowkey be viewed as a data smoothing routine. ✨

also, CPSPRS is an alternate name for the routine CPSPS1. two names, one icon. πŸ‘‘


πŸ“œ SYNOPSIS πŸ“œ

CALL CPSPS1 (ZSPS, KSPS, MSPS, NSPS, RWRK, LRWK, IWRK,
+ LIWK, ZDAT, LZDT)

πŸ’– C-BINDING SYNOPSIS πŸ’–

#include <ncarg/ncargC.h>

void c_cpsps1 (float *zsps, int ksps, int msps, int nsps,
float *rwrk, int lrwk, int *iwrk, int liwk, float *zdat,
int lzdt)

πŸŽ€ DESCRIPTION πŸŽ€

so here's the cast of characters, and every single one of them matters, no skips:

  • ZSPS β€” (REAL array, dimensioned KSPS x n, where "n" is greater than or equal to NSPS, input) this is the "sparse" array of data, and it's the one the "dense" array is gonna get generated from. 🌱
  • KSPS β€” (INTEGER, input) the first dimension of the array ZSPS.
  • MSPS β€” (INTEGER, input) the first dimension of the "sparse" array of data inside ZSPS. heads up: MSPS must be less than or equal to KSPS. 🫢
  • NSPS β€” (INTEGER, input) the second dimension of the "sparse" array of data inside ZSPS. and again: NSPS must be less than or equal to the declared second dimension of the array ZSPS. no cap.
  • RWRK β€” (REAL array, dimensioned LRWK, input/output) the real work array. she works. πŸ’ͺ
  • LRWK β€” (INTEGER, input) the length of RWRK.
  • IWRK β€” (INTEGER array, dimensioned LIWK, input/output) the integer work array. also works. πŸ”₯
  • LIWK β€” (INTEGER, input) the length of IWRK.
  • ZDAT β€” (REAL array, dimensioned LZDT, output) the array where the interpolated "dense" array of data gets returned. ✨ the dimensions of the interpolated array can be supplied by you, or determined by Conpack, depending on the value of the parameter 'ZDS'. and listen β€” if the size of the dense array is not a product of the size of the sparse array and some perfect square, the aspect ratio of the dense grid may be slightly different from that of the sparse grid. minor, but like, noted. πŸ‘€
  • LZDT β€” (INTEGER, input) the length of ZDAT.

🌈 C-BINDING DESCRIPTION 🌈

the C-binding argument descriptions are the same as the FORTRAN argument descriptions, with these exceptions (yes, the dimensions flip, stay with me):

  • zsps(l,ksps) β€” dimensioned l by ksps, where l β‰₯ nsps.
  • ksps β€” the second dimension of the array zsps.
  • msps β€” the second dimension of the sparse array of data in zsps. msps ≀ ksps.
  • nsps β€” the first dimension of the sparse array of data in zsps. nsps ≀ l, where l is the declared first dimension of the array zsps.

πŸ¦‹ USAGE πŸ¦‹

CPSPS1 performs the same functions as CPRECT, but on top of that, she also interpolates from a sparse array of data to a dense array of data. main character multitasking. πŸ‘‘

how does she do it? she uses the routines BSURF1 and BSURF2, from the package Fitpack, by Alan K. Cline, to fit bicubic splines under tension to the sparse array of data, and to compute the dense grid of data that gets returned to you. the tension on the spline surfaces is specified by the parameter 'T3D'. πŸŽ€

by default, CPSPS1 selects the dimensions of the dense array of data. but if you want, you can specify those dimensions yourself by setting the parameter 'ZDS' non-zero and the parameters 'ZD1', 'ZDM', and 'ZDN' to the desired values. either way β€” once 'ZD1', 'ZDM', and 'ZDN' are set, do not reset them until the contour plot is complete and a different contour plot is about to be drawn. like, fr fr, leave them alone. πŸ™ˆ

now, because BSURF1 and BSURF2 don't have a built-in special value feature, if the special value parameter 'SPV' is set non-zero and the sparse array contains occurrences of that value, special action must be taken. here's the whole tea: the indices of the special values in the sparse array get saved in a part of the integer workspace array; the special values are then replaced by values interpolated from adjacent grid points, and the resulting array is used to obtain the dense array; then the special values in the sparse array are restored, and the corresponding elements of the dense array are also given the special value. 🫢 teamwork makes the dream work.


πŸ’œ ACCESS πŸ’œ

to use CPSPS1 or c_cpsps1, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. order matters, bestie, don't shuffle it. ✨


πŸ’Œ MESSAGES πŸ’Œ

see the conpack man page for a description of all Conpack error messages and/or informational messages. she's got a lot to say, and it's all documented. 😭


πŸ‘€ SEE ALSO πŸ‘€

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

Hardcopy: NCAR Graphics Contouring and Mapping Tutorial

like, the whole friend group is listed. go say hi. 🫢


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 β€” no notes, she's iconic, periodt. πŸ’–

okay and literally one last thing: this page comes to you from the UNIX manual, dated March 1993, filed under CPSPS1(3NCARG). she's vintage and she's still slaying. bye bestie, go contour something gorgeous! πŸŽ€βœ¨πŸŒΈπŸ’…

πŸ“¦ where this page comes from