NGREOP(3NCARG)
π NGREOP β bestie, we're reopening a metafile π
okay so real talk, this is a page from the NCAR Graphics manual (the 3NCARG corner of the world), and it's about NGREOP, which is the little subroutine that reopens an existing NCAR Graphics metafile for appending. like, you already made a metafile, you closed it (maybe only temporarily, no drama), and now you wanna go back in and add more stuff. that's the whole vibe. β¨
πΈ SYNOPSIS πΈ
CALL NGREOP(WKID, CONID, ITYPE, FNAME, IOPT, IAT, RAT,
NCOLRS, NSTART, CTAB)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
#include <ncarg/gks.h>
void c_ngsrat(int wkid, int conid, int itype, char *fname,
int iopt, int *iat, float *rat, int ncolrs,
int nstart, Gcolr_rep *ctab)
(yes bestie, the C binding synopsis in the source really does say c_ngsrat up there, we do not touch it, we do not fix it, we simply respect the lore π
)
β¨ DESCRIPTION β¨
okay so here's the whole cast of arguments, one by one, no skipping, no summarising, we're doing this properly:
WKIDβ an input variable of typeINTEGER, and it's the workstation identifier that this freshly reopened metafile will be known by from now on. important tea: it does not have to match the workstation identifier that was used to create the original metafile. glow-up, honestly. πCONIDβ an input variable of typeINTEGERspecifying the connection identifier.ITYPEβ an input variable of typeINTEGERspecifying the workstation type. rn the only valid value is"1". and listen, this subroutine may be augmented in the future to accommodate PostScript files, so keep an eye out. πFNAMEβ an input variable of typeCHARACTERspecifying the filename of the metafile being opened for appending.IOPTβ an input variable of typeINTEGERthat says what you actually want to happen. choose your fighter:= 0β reestablish the color table only (using the color table in the argumentCTABdescribed below). heads up though: the attributes of the reopened workstation get set to default values, and they may well be out of sync with the current GKS attributes. lowkey chaotic. π¬= 1β reestablish the color table and GKS state (that GKS state coming in via the argumentsIATandRATdescribed below). the state values will not be flushed to the metafile.= 2β reestablish the color table and GKS state and flush the GKS state values to the metafile.= 3β reestablish the color table and flush the current GKS state values to the metafile (not the values inIATandRAT). values to the metafile.
ifIOPTequals1or2, thenIATandRATmust be supplied. otherwise, not. that's the rule bestie, no cap.
IATβ an input array of typeINTEGERdimensioned for14, holding GKS integer state variables like this:IAT( 1)= Clip indicatorIAT( 2)= Line typeIAT( 3)= Polyline color indexIAT( 4)= Marker typeIAT( 5)= Polymarker color indexIAT( 6)= Text fontIAT( 7)= Text precisionIAT( 8)= Text color indexIAT( 9)= Text pathIAT(10)= Text horizontal alignmentIAT(11)= Text vertical alignmentIAT(12)= Fill area interior styleIAT(13)= Fill are style indexIAT(14)= Fill area color index
RATβ an input array of typeREALdimensioned for7, holding theREALGKS attribute settings like this:RAT( 1)= Linewidth scale factorRAT( 2)= Marker scale factorRAT( 3)= Character expansion factorRAT( 4)= Character spacingRAT( 5)= Character height in world coordinatesRAT( 6)= Character up vector, X component in world coordinatesRAT( 7)= Character up vector, Y component in world coordinates
NCOLRSβ an input variable of typeINTEGERspecifying the number of colors in the color table supplied in the argumentCTAB, described below. fun fact:NCOLRScan be0. zero. nothing. empty. π«NSTARTβ an input variable of typeINTEGERspecifying the color index associated with the first color in the color tableCTAB(all the other color indices get filled in, in sequence). for example, ifNCOLRS = 3andNSTART = 4, then the color values defined inCTABwould be used to define color indices4,5, and6. math is mathing. π’CTABβ in the FORTRAN version of this routine, a two-dimensional input array of typeREALdimensionedCTAB(3,NCOLRS); in the C version of this routine, a one-dimensional input array of typeGcolr_repdimensionedctab[ncolrs]. it specifies a color table used to initialize the reopened metafile. and no, this color table does not necessarily have to agree with the color table that was in effect when the original metafile was created. freedom. π
π USAGE π
the most common usage of NGREOP would be in conjunction with usage of NGSRAT and NGMFTC. here's the routine: NGMFTC would be used to temporarily close a metafile, and NGSRAT used to save the state of the GKS primitive attributes at the time of the close. then, to reopen that temporarily closed metafile, you'd call NGREOP with the attribute settings you previously saved and a setting of IOPT of 2. and honestly? NGMFTC can be used to temporarily close a metafile any time after it has been opened, even in the middle of a picture. mid-picture closure. iconic behavior. π
now, crucial detail, don't skip this one: NGREOP only reopens the metafile and does not activate it. so it will be necessary to call GACWK before sending graphics primitives to the reopened metafile. it's giving "you have to knock before you enter." πͺ
and also, NGREOP can be used to reopen a previously created metafile too β either one created in an independent job step, or one created in the same job step. flexible queen. π
π₯ EXAMPLES π₯
the following sequence:
CALL NGMFTC(1)
CALL NGSRAT(2, IAT, RAT)
... do stuff
CALL NGREOP(CALL NGREOP(1, 2, 1, 'gmeta1', 2, IAT, RAT,
NCOLS, 0, CTAB)
would temporarily close the metafile with workstation ID of 1 (in this case a metafile with name "gmeta1") and save the GKS state variables at the time of the close. then the call to NGREOP would reopen the metafile for appending. and yes, that example really is written like that in the original, we reproduce it faithfully, character for character, it's part of the heritage now. ποΈ
use the ncargex command to see the following relevant example: pgkex27. go look at it, it's cute.
π ACCESS π
to use NGREOP or c_ngreop, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β preferably in that order. order matters bestie, trust. π«Ά
π MESSAGES π
NGREOP issues the same messages as those issued by GOPWK. same energy, different subroutine.
π SEE ALSO π
Online: ngmftc(3NCARG), ngsrat(3NCARG)
Online URL: http://ngwww.ucar.edu/ngdoc/ng/gks/gkshome.html
π¦ COPYRIGHT π¦
Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.
okay that's the whole page, you ate, you understood it, you're literally a metafile-appending legend now. this was the NCAR Graphics manual, NGREOP(3NCARG), straight out of October 1996, and the source line says UNIX at the bottom. slay, mwah, go append something beautiful. πβ¨ππ¦πΈπ
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms