foam to Tecplot360 converter
[OpenFOAM-1.6.x.git] / applications / utilities / postProcessing / dataConversion / foamToTecplot360 / tecio / examples / simtest / simtest.f
blobd980915100f49ca991a9402c4814a31f19211482
2 C Simple example fortran program to write a
3 C binary datafile for tecplot. This example
4 C does the following:
6 C 1. Open a datafile called "t.plt"
7 C 2. Assign values for X,Y, and P
8 C 3. Write out a zone dimensioned 4x5
9 C 4. Close the datafile.
12 program test
14 INCLUDE 'tecio.inc'
16 character*1 NULLCHR
17 Integer*4 Debug,III,NPts,NElm
19 Dimension X(4,5), Y(4,5), P(4,5)
20 Real*8 SolTime
21 Integer*4 VIsDouble, FileType
22 Integer*4 ZoneType,StrandID,ParentZn,IsBlock
23 Integer*4 ICellMax,JCellMax,KCellMax,NFConns,FNMode,ShrConn
24 POINTER (NullPtr,Null)
25 Integer*4 Null(*)
27 NULLCHR = CHAR(0)
28 NullPtr = 0
29 Debug = 1
30 FileType = 0
31 VIsDouble = 0
32 IMax = 4
33 JMax = 5
34 KMax = 1
35 ZoneType = 0
36 SolTime = 360.0
37 StrandID = 0
38 ParentZn = 0
39 IsBlock = 1
40 ICellMax = 0
41 JCellMax = 0
42 KCellMax = 0
43 NFConns = 0
44 FNMode = 0
45 ShrConn = 0
47 C... Open the file and write the tecplot datafile
48 C... header information.
50 I = TecIni112('SIMPLE DATASET'//NULLCHR,
51 & 'X Y P'//NULLCHR,
52 & 't.plt'//NULLCHR,
53 & '.'//NULLCHR,
54 & FileType,
55 & Debug,
56 & VIsDouble)
58 Do 10 I = 1,4
59 Do 10 J = 1,5
60 X(I,J) = I
61 Y(I,J) = J
62 P(I,J) = I*J
63 10 Continue
65 C... Write the zone header information.
67 I = TecZne112('Simple Zone'//NULLCHR,
68 & ZoneType,
69 & IMax,
70 & JMax,
71 & KMax,
72 & ICellMax,
73 & JCellMax,
74 & KCellMax,
75 & SolTime,
76 & StrandID,
77 & ParentZn,
78 & IsBlock,
79 & NFConns,
80 & FNMode,
81 & 0,
82 & 0,
83 & 0,
84 & Null,
85 & Null,
86 & Null,
87 & ShrConn)
89 C... Write out the field data.
91 III = IMax*JMax
92 I = TecDat112(III,X,0)
93 I = TecDat112(III,Y,0)
94 I = TecDat112(III,P,0)
96 I = TecEnd112()
97 Stop
98 End