/usr/share/ncarg/hluex/basic/basic03f.f is in libncarg-data 6.2.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | C
C $Id: basic03f.f,v 1.10 1995-06-20 15:19:52 stautler Exp $
C
C***********************************************************************
C *
C Copyright (C) 1995 *
C University Corporation for Atmospheric Research *
C All Rights Reserved *
C *
C***********************************************************************
C
C File: basic03f.f
C
C Author: Tim Scheitlin (converted by Ed Stautler)
C National Center for Atmospheric Research
C PO 3000, Boulder, Colorado
C
C Date: Mon Mar 20 10:43:42 MST 1995
C
C Description: This example demonstrates how to:
C 1. Create a scalar field data object and assign
C it to a plot.
C 2. Set resources using a resource file.
C 3. Set resources during object creation.
C 4. Set resources after object creation.
C
program basic03f
implicit none
external NhlFAppClass
external NhlFNcgmWorkstationClass
external NhlFCairoWindowWorkstationClass
external NhlFContourPlotClass
external NhlFScalarFieldClass
integer appid1,appid2,wks,wks2,con1,con2,con3,field1,rlist,ierr
integer data1(5,5)
data data1 / 3,4,4,5,5,
1 2,3,5,5,4,
2 2,4,5,4,4,
3 3,4,4,4,3,
4 3,3,3,3,3 /
integer dims(2)
data dims / 5, 5 /
C
C Initialize the graphics libraries and create a resource list that
C is normally used to assign name/value pairs within objects. Then
C clear (empty) this list, and create an application object. This
C object manages multiple resource databases used by separate objects.
C
call NhlFInitialize
call NhlFRLCreate(rlist,'SETRL')
call NhlFRLClear(rlist)
call NhlFCreate(appid1,"appid1",NhlFAppClass,0,
1 rlist,ierr)
C
C ###########
C # FRAME 1 #
C ###########
C This frame demonstrates how to create and assign data to a contour
C plot.
C
C
C Create an X workstation.
C
call NhlFRLClear(rlist)
call NhlFRLSetstring(rlist,'wkPause','True',ierr)
call NhlFCreate(wks,"wks",
+ NhlFCairoWindowWorkstationClass,0,rlist,ierr)
C
C Create a scalar field object that will be used as a data set for a
C contour object. The sfDataArray resource is used to assign a data
C array to a scalar field data object.
C
call NhlFRLClear(rlist)
call NhlFRLSetMDIntegerArray(rlist,"sfDataArray",data1,2,
1 dims,ierr)
call NhlFCreate(field1,"field1",NhlFScalarFieldClass,0,
1 rlist,ierr)
C
C Create a contour plot object and assign the data using the
C cnScalarFieldData resource.
C
call NhlFRLClear(rlist)
call NhlFRLSetInteger(rlist,"cnScalarFieldData",field1,ierr)
call NhlFCreate(con1,"con1",NhlFContourPlotClass,wks,
1 rlist,ierr)
C
C Draw the plot.
C
call NhlFDraw(con1,ierr)
C
C Update and clear the workstation.
C
call NhlFFrame(wks,ierr)
C
C ###########
C # FRAME 2 #
C ###########
C This frame demonstrates how to set resources using a resource file.
C
C Resources are read from a resource file called basic03.res because
C the first argument in the create call is "basic03". This resource file
C is only read at the time an application object is created.
C The resource file contains resource assignments that control the
C characteristics of a plot.
C
call NhlFRLClear(rlist)
call NhlFCreate(appid2,"basic03",NhlFAppClass,0,
1 rlist,ierr)
C
C Create another workstation window and make it a child of the
C new application object by using the appid2 variable as the argument
C for the parent id. By making this a child of the application
C object, the resources that are set in the basic03.res resource
C file will apply to this object and its children.
C
call NhlFRLClear(rlist)
call NhlFCreate(wks2,"wks2",NhlFCairoWindowWorkstationClass,
1 appid2,rlist,ierr)
C
C Create another contour plot object and assign the data.
C Notice that the parent id is wks2, making the contour object
C a child of the new workstation.
C
call NhlFRLClear(rlist)
call NhlFRLSetInteger(rlist,"cnScalarFieldData",field1,ierr)
call NhlFCreate(con2,"con2",NhlFContourPlotClass,wks2,
1 rlist,ierr)
C
C The contour object is drawn with filled contours because there is
C a resource in basic03.res that specifies that contour fill is on.
C
call NhlFDraw(con2,ierr)
C
C Updates and clear the workstation.
C
call NhlFFrame(wks2,ierr)
C
C ###########
C # FRAME 3 #
C ###########
C This frame demonstrates how resources can be set when an object is
C created.
C
C A variable length list of resource name/value pairs specifies
C a resource and its value. In this example contour line labels are
C turned off by setting the "cnLineLabelsOn" resource to "False".
C
call NhlFRLClear(rlist)
call NhlFRLSetInteger(rlist,"cnScalarFieldData",field1,ierr)
call NhlFRLSetString(rlist,"cnLineLabelsOn","False",ierr)
call NhlFCreate(con3,"con3",NhlFContourPlotClass,wks2,
1 rlist,ierr)
C
C Draw the contour object.
C
call NhlFDraw (con3,ierr)
C
C Update and clear the workstation.
C
call NhlFFrame(wks2,ierr)
C
C ###########
C # FRAME 4 #
C ###########
C This frame demonstrates how to use the setvalues expression to set
C resources for an object that has already been created.
C
C The setvalues expression is used to assign values to the resources
C of a object whose id is given as the first argument in the expression.
C In this example, that argument is "con3."
C
C Any resource that is valid for the con3 object can be set in the
C following expression. In this example, setting "cnFillOn" to
C "False" turns contour fill off. By default, cnFillOn is "False",
C but since it is set to "True" in the resource file, we can override
C that value by using the setvalues expression.
C
call NhlFRLClear(rlist)
call NhlFRLSetString(rlist,"cnFillOn","False",ierr)
call NhlFSetValues(con3,rlist,ierr)
C
C Draw the contour object.
C
call NhlFDraw (con3,ierr)
C
C Update and clear the workstation
C
call NhlFFrame(wks2,ierr)
C
C Clean up (deleting the parent object recursively deletes all of its
C children).
C
call NhlFDestroy(wks,ierr)
call NhlFDestroy(appid1,ierr)
call NhlFDestroy(appid2,ierr)
call NhlFClose
stop
end
|