Open and read a .plt file with a fortran code?

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

tg
Newbie
Posts: 1
Joined: Thu Jan 22, 2009 4:58 am
Location: France
Contact:

Open and read a .plt file with a fortran code?

Postby tg » Thu Jan 22, 2009 5:36 am

Hi,

For time and size problem I have converted my file.dat into a file.plt using the
preplot command. Then I have deleted the file.dat (not a good idea).
Now I would like to open and read the file.plt with a fortran code.
Does there is a possibility of doing this? If it's possible does someone
has a example of fortran code doing this?
I have found the Appendix A "Binary Data File Format" in the DataFormat.pdf
but my head is going to explose :shock:

Thanks

tibetriver
Expert
Posts: 83
Joined: Fri Dec 22, 2006 3:45 pm
Location: Richland WA
Contact:

Re: Open and read a .plt file with a fortran code?

Postby tibetriver » Thu Jan 22, 2009 10:32 am

Writing a fortran plt file reader can be done from the information provided in the data format guide. However, it maybe easier to write an ascii data file from tecplot and then use fortran to process the ascii data file. Go to File/Write Data File and select ASCII.

Mike

Ben

Re: Open and read a .plt file with a fortran code?

Postby Ben » Wed Jan 28, 2009 9:07 am

There is also an unsupported function called ReadTec in the tecio library. Here is some info:

Code: Select all

/*
 *
 * Read a binary tecplot datafile. 
 *
 * If GetHeaderInfoOnly is TRUE then only the header info
 * is retrieved.
 *
 * Variable                Description
 * ---------------------------------------------------------------
 * GetHeaderInfoOnly       Return only the header info from the datafile.
 * FName                   Name of the file to read.
 * IVersion                Returns version of the input file.
 * DataSetTitle            Allocates space for and returns dataset title.
 * NumZones                Returns the number of zones.
 * NumVars                 Returns the number of variables.
 * VarNames                Allocates space for and returns the var names.
 * ZoneInfo                Allocates space for and returns the zone information.
 * NumUserRec              Returns the number of user records in the binary datafile.
 * MaxCharsUserRec         Maximum number of characters allowed in user recs.
 * UserRec                 Allocates space for and returns the user records.
 * RawDataspaceAllocated   TRUE = calling program has alloced space for the raw data.
 *                         FALSE= let ReadTec allocate space for the raw data.
 *                         (Only used if GetHeaderInfoOnly is FALSE)
 * NodeMap                 Finite Element connectivity information.  ReadTec
 *                         will allocate the space for you if RawDataspaceAllocated is
 *                         FALSE.
 * VDataBase               Raw field data loaded into double arrays.  ReadTec
 *                         will allocate the space for you if RawDataspaceAllocated is
 *                         FALSE.  If RawDataspaceAllocated is TRUE then ReadTec will
 *                         only load the arrays that have non NULL addresses.
 *
 */
LIBFUNCTION Boolean_t STDCALL ReadTec(Boolean_t       GetHeaderInfoOnly,
                                      char           *FName,
                                      short          *IVersion,
                                      char          **DataSetTitle,
                                      EntIndex_t     *NumZones,
                                      EntIndex_t     *NumVars,
                                      StringList_pa  *VarNames,
                                      StringList_pa  *ZoneNames,
                                      LgIndex_t     **NumPtsI,
                                      LgIndex_t     **NumPtsJ,
                                      LgIndex_t     **NumPtsK,
                                      ZoneType_e    **ZoneType,
                                      StringList_pa  *UserRec,
                                      Boolean_t       RawDataspaceAllocated,
                                      NodeMap_t    ***NodeMap,
                                      double       ***VDataBase);

antonm5012
Newbie
Posts: 4
Joined: Wed Oct 28, 2015 5:58 am
Location: London

Re: Open and read a .plt file with a fortran code?

Postby antonm5012 » Wed Jan 04, 2017 9:45 am

Is there an analogue for Fortran?

thanks


Return to “Loading Data”

Who is online

Users browsing this forum: No registered users and 1 guest