How can I read the plt file with fortran

Moderators: davetaflin, salter, steve, jprenaud, straton, Chris Idso

Jason08
Newbie
Posts: 5
Joined: Sat Jul 21, 2012 1:27 am
Location: China

How can I read the plt file with fortran

Postby Jason08 » Sat Feb 15, 2014 5:20 pm

Hello everyone

I have written some .plt files with tecio.lib and tecio.f90 with fortran code.

Now I want to read the .plt files, so that I continue to running the program with the data in the plt file.

I desperately need to find a method to read this .plt file with fortran. Could anyone give some help?

Thank you very much.

Jason

Svetlana
Expert
Posts: 93
Joined: Sun Dec 22, 2013 3:08 pm
Location: Australia
Contact:

Re: How can I read the plt file with fortran

Postby Svetlana » Sun Feb 16, 2014 2:27 pm

Are you using TecUtilWriteDataSet? It appears to have a WriteBinary Boolean to write as ASCII. Then Tec_IO and the Data format guide give an idea how to read it in. You may also want to take a look at this thread, as it gives details of an unsupported function in the tecio library which could read plt itself; however, whether it still is available is unknown to me.

Jason08
Newbie
Posts: 5
Joined: Sat Jul 21, 2012 1:27 am
Location: China

Re: How can I read the plt file with fortran

Postby Jason08 » Mon Feb 17, 2014 7:30 pm

Svetlana wrote:Are you using TecUtilWriteDataSet? It appears to have a WriteBinary Boolean to write as ASCII. Then Tec_IO and the Data format guide give an idea how to read it in. You may also want to take a look at this thread, as it gives details of an unsupported function in the tecio library which could read plt itself; however, whether it still is available is unknown to me.


Thank you, Svetlana

Here is some info:
Code:
!
! Open field.plt and write the header information.
!
I = TECINI111('DATASET WITH 1 ORDERED ZONE, '// &
'1 QUAD ZONE OVER 2 TIME STEPS'//NULCHAR, &
'X Y D U V P F'//NULCHAR, &
'ZCFL'//filename//NULCHAR, &
'.'//NULCHAR, &
FileType, &
Debug, &
VIsDouble)

!
! Make sure writing to file #1.
!
III = 1
I = TECFIL111(III)

!
! Write the zone header information for the ordered zone.
!
IMax = iix+1
JMax = iiy+1
KMax = 1
SolTime = time
StrandID = 1
ParentZn = 0
I = TECZNE111('Ordered Zone 1'//NULCHAR, &
0, & ! ZONETYPE
IMax, &
JMax, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, & ! ISBLOCK
0, & ! NumFaceConnections
0, & ! FaceNeighborMode
0, & ! TotalNumFaceNodes
0, & ! NumConnectedBoundaryFaces
0, & ! TotalNumBoundaryConnections
Null, & ! PassiveVarList
Null, & ! ValueLocation
Null, & ! ShareVarFromZone
0) ! ShareConnectivityFromZone)

!
! Write out the field data for the ordered zone.
!
III = IMax*JMax
I = TECDAT111(III,X,DIsDouble)
I = TECDAT111(III,Y,DIsDouble)
I = TECDAT111(III,D,DIsDouble)
I = TECDAT111(III,U,DIsDouble)
I = TECDAT111(III,V,DIsDouble)
I = TECDAT111(III,P,DIsDouble)
I = TECDAT111(III,F,DIsDouble)

!
! Close out file 1.
!
I = TECEND111()

==============================================================

I have used the code to read the file .plt, but there are some Garbage characters that I do not understand. I would like to get the data from the file.

Here is the code I used.

OPEN(UNIT=5,FILE='ZCFL0000.plt',STATUS='UNKNOWN')
READ(5,rec=1) CSTR0,CSTR1
READ(5,rec=2) CSTR2,CSTR3
READ(5,rec=3) CSTR4,CSTR5
READ(5,rec=4) IVar0,IVar1,IVar2
READ(5,rec=4) rVar0 , rVar1
READ(5,rec=5) rVar2 , rVar3

READ(5,rec=43) rVar4 , rVar5
READ(5,rec=45) rVar6 , rVar7
READ(5,rec=47) rVar8 , rVar9
READ(5,rec=49) rVar10 , rVar11
READ(5,rec=51) rVar12 , rVar13
READ(5,rec=53) rVar14 , rVar15

WRITE(*,*) CSTR0,CSTR1
WRITE(*,*) CSTR2,CSTR3
WRITE(*,*) CSTR4,'*****'
WRITE(*,*) CSTR5
WRITE(*,*) IVar0,IVar1,IVar2,'----'
WRITE(*,*) rVar0, rVar1
WRITE(*,*) rVar2, rVar3
WRITE(*,*) rVar4 , rVar5,'^^^^^^'
WRITE(*,*) rVar6 , rVar7
WRITE(*,*) rVar8 , rVar9
WRITE(*,*) rVar10 , rVar11
WRITE(*,*) rVar12 , rVar13
WRITE(*,*) rVar14 , rVar15
CLOSE(5)
ENDIF

User avatar
salter
Moderator
Posts: 188
Joined: Thu Dec 21, 2006 10:57 am
Location: NASA Langley Research Center
Contact:

Re: How can I read the plt file with fortran

Postby salter » Tue Feb 18, 2014 6:01 am

Tec_io library used to support the ability to read plt files as well as write them. Unfortunately, this functionality is no longer supposed. To aid in this, I wrote a plot3d export tool wihch enables you to read the data with tecplot and write it into plot3d formats. But there may be other add-ons that provide similar capability. Oh, and the PLOT3D export tool is free to the public.
Steve...

Aerospace Research Engineer
Aerothermodynamics Branch
NASA Langley Research Center

Jason08
Newbie
Posts: 5
Joined: Sat Jul 21, 2012 1:27 am
Location: China

Re: How can I read the plt file with fortran

Postby Jason08 » Fri Feb 21, 2014 6:57 pm

salter wrote:Tec_io library used to support the ability to read plt files as well as write them. Unfortunately, this functionality is no longer supposed. To aid in this, I wrote a plot3d export tool wihch enables you to read the data with tecplot and write it into plot3d formats. But there may be other add-ons that provide similar capability. Oh, and the PLOT3D export tool is free to the public.


Thanks salter,

I find it is really helpful to use the PLOT3D File Structure. But I can only use the code to get the file with ASCII.

How can I get the binary file with PLOT3D File Structure? I would be grateful if you can give me some advice.

Jason

User avatar
salter
Moderator
Posts: 188
Joined: Thu Dec 21, 2006 10:57 am
Location: NASA Langley Research Center
Contact:

Re: How can I read the plt file with fortran

Postby salter » Mon Feb 24, 2014 7:09 am

Jason,

Tecplot offers binary input of PLOT3D and my add-on offers unformatted Fortran binary output. I cannot recall if binary output is available. You choose variables to write and both flow and function files are supported.
Steve...



Aerospace Research Engineer

Aerothermodynamics Branch

NASA Langley Research Center


Return to “Loading Data”

Who is online

Users browsing this forum: No registered users and 2 guests