2 C Complex example FORTRAN program to write a
3 C binary data file for Tecplot. This example
6 C 1. Open a data file called "field.plt."
7 C 2. Open a data file called "line.plt."
8 C 3. Assign values for X, Y and P. These will be used
9 C in both the ordered and FE data files.
10 C 4. Write out an ordered zone dimensioned 4 x 5 to "field.plt."
11 C 5. Assign values for XL and YL arrays.
12 C 6. Write out data for line plot to "line.plt." Make the data
13 C use double precision.
14 C 7. Write out a finite element zone to "field.plt."
15 C 8. Write out a text record to "field.plt."
16 C 9. Write out a geometry (circle) record to "field.plt."
24 REAL*4 X
(4,5), Y
(4,5), P
(4,5)
26 REAL*4 XLDummy
(1), YLDummy
(1)
27 EQUIVALENCE
(XLDummy
(1), XL
(1))
28 EQUIVALENCE
(YLDummy
(1), YL
(1))
30 INTEGER*4 Debug
,I
,J
,K
,L
,III
,NPts
,NElm
,DIsDouble
,VIsDouble
31 INTEGER*4 IMax
,JMax
,KMax
,NM
(4,12),FileType
32 INTEGER*4 StrandID
,ParentZn
33 INTEGER*4 SharingZone
(3)
34 REAL*8 XP
, YP
, ZP
, FH
, LineSpacing
, PatternLength
35 REAL*8 BoxMargin
, BoxLineThickness
, TextAngle
36 INTEGER*4 AttachToZone
, Zone
, Scope
, PositionCoordSys
38 INTEGER*4 FontType
, HeightUnits
, Anchor
, BoxType
39 INTEGER*4 IsFilled
, GeomType
, LinePattern
, NumEllipsePts
40 INTEGER*4 BoxColor
, BoxFillColor
, TextColor
, Color
, FillColor
41 INTEGER*4 ArrowheadStyle
, ArrowheadAttachment
, NumSegments
42 INTEGER*4 NumSegPts
(1)
43 REAL*8 LineThickness
, ArrowheadSize
, ArrowheadAngle
44 REAL*4 XGeomData
(1), YGeomData
(1), ZGeomData
(1)
47 POINTER
(NullPtr
,Null
)
58 C Open field.plt and write the header information.
60 I
= TECINI112
('DATASET WITH 1 ORDERED ZONE, '//
61 & '1 QUAD ZONE OVER 2 TIME STEPS'//NULCHAR
,
63 & 'field.plt'//NULCHAR
,
69 C Open line.plt and write the header information.
72 I
= TECINI112
('DATASET WITH ONE I-ORDERED ZONE'//NULCHAR
,
74 & 'line.plt'//NULCHAR
,
81 C Calculate values for the field variables.
91 C Make sure writing to file #1.
97 C Write the zone header information for the ordered zone.
105 I
= TECZNE112
('Ordered Zone 1'//NULCHAR
,
117 & 0, ! NumFaceConnections
118 & 0, ! FaceNeighborMode
119 & 0, ! TotalNumFaceNodes
120 & 0, ! NumConnectedBoundaryFaces
121 & 0, ! TotalNumBoundaryConnections
122 & Null
, ! PassiveVarList
123 & Null
, ! ValueLocation
124 & Null
, ! ShareVarFromZone
125 & 0) ! ShareConnectivityFromZone
)
128 C Write out the field data for the ordered zone.
131 I
= TECDAT112
(III
,X
,DIsDouble
)
132 I
= TECDAT112
(III
,Y
,DIsDouble
)
133 I
= TECDAT112
(III
,P
,DIsDouble
)
136 C Calculate values for the I-ordered zone.
144 C Switch to the 'line.plt' file (file number 2)
145 C and write out the line plot data.
150 C Write the zone header information for the XY-data.
157 I
= TECZNE112
('XY Line plot'//NULCHAR
,
179 C Write out the line plot.
183 I
= TECDAT112
(III
,XLDummy
,DIsDouble
)
184 I
= TECDAT112
(III
,YLDummy
,DIsDouble
)
187 C Switch back to the field plot file and write out
188 C the finite-element zone.
193 C Move the coordinates so this zone's not on top of the other
202 C Write the zone header information for the finite-element zone.
209 I
= TECZNE112
('Finite Zone 1'//NULCHAR
,
210 & 3, ! FEQUADRILATERAL
231 C Write out the field data for the finite-element zone.
237 I
= TECDAT112
(III
,X
,DIsDouble
)
238 I
= TECDAT112
(III
,Y
,DIsDouble
)
239 I
= TECDAT112
(III
,P
,DIsDouble
)
242 C Calculate and then write out the connectivity list.
243 C Note: The NM array references cells starting with
259 C Calculate vlues for the new solution variable.
266 C Write the zone header information for time step 2
276 I
= TECZNE112
('Ordered Zone 2'//NULCHAR
,
298 C Write out the solution variable the grid variables are shared.
304 I
= TECDAT112
(III
,P
,DIsDouble
)
306 C Calculate values for the new solution variable.
313 C Write another time step for the FEZone and share from the first
321 I
= TECZNE112
('Finite Zone 2'//NULCHAR
,
322 & 3, ! FEQUADRILATERAL
343 C Write out the solution variable the grid variables are shared.
349 I
= TECDAT112
(III
,P
,DIsDouble
)
352 C Prepare to write out text record. Text is positioned
353 C at 50, 50 in frame units and has a height 5 frame units.
367 BoxLineThickness
= 0.5
399 C Prepare to write out geometry record (circle). Circle is
400 C positioned at 25, 25 in frame units and has a radius of 30.
401 C Circle is drawn using a dashed line pattern.
417 ArrowheadAttachment
= 0
419 ArrowheadAngle
= 15.0
443 & ArrowheadAttachment
,