3 Using the Utilities

Before calling any of the utilities, GKS must be open and at least one workstation open and active. This can be done with the following sequence of GKS calls:

        CALL GOPKS( LUERR, -1 )
        CALL GOPWK( IWKID, ICONID, IWTYPE )
        CALL GACWK( IWKID )

where LUERR is a Fortran logical unit to which messages resulting from GKS internal errors may be written (unit 6 is recommended on all operating systems used by Starlink), IWKID is a workstation identifier (any integer you care to choose) and IWTYPE and ICONID are the workstation type and connection identifier respectively.

A more friendly user interface can be provided if, instead of asking the user for a GKS workstation type and connection identifier, a GNS workstation name is used (i.e. as used by SGS). A GNS name can be translated to its GKS equivalent by the GNS (SUN/57) call

        CALL GNS_TNG( NAME, IWKTYP, ICONID, STATUS )

where STATUS is the inherited status (returned SAI__OK if the translation is successful). More information on workstation names can be found in SUN/57.

If you wish to do any plotting with SGS routines, SGS_OPEN must be used to open GKS and the workstation. SGS makes the entire display surface of a workstation available for plotting, which in general means that part of the normalized device co-ordinate unit square will not be visible. Since the default behaviour of the NCAR utilities is to use the whole of the NDC unit square, using them becomes a little more complicated. This is discussed further in the section on co-ordinate systems (i.e. §4).

When plotting is complete, GKS must be closed down with either:

        CALL GDAWK( IWKID )
        CALL GCLWK( IWKID )
        CALL GCLKS

or

        CALL SGS_CLOSE

as appropriate.