I'm trying to write a mix of ASCII and binary data as given below for a vtk file format data.
I understand that the binary or ASCII distinction must be made in a file-OPEN statement (in the FORM='BINARY', preferably: ACCESS='STREAM' ). I don't understand how to write the file for the format I require.
What I'm trying to output:
ascii keyword
ascii keyword
ascii keyword
ascii keyword
ascii keywords "variable value in ascii" ascii keywords
.....SOME BINARY DATA ....
.....................
What I'm using:
write(fl) "# vtk DataFile Version 3.0"//CHAR(13)//CHAR(10)
write(fl)"Flow Field"//CHAR(13)//CHAR(10)
write(fl)"BINARY"//CHAR(13)//CHAR(10)
write(fl)"DATASET UNSTRUCTURED_GRID"//CHAR(13)//CHAR(10)
write(fl)"POINTS",npoints,"float" -------------> gives value of npoints(example:8) in binary format
What the output should be:
# vtk DataFile Version 3.0
Flow Field
BINARY
DATASET UNSTRUCTURED_GRID
POINTS 8 Float
.....SOME BINARY DATA ....
.....................
What the output is:
# vtk DataFile Version 3.0
Flow Field
BINARY
DATASET UNSTRUCTURED_GRID
POINTSÒ^O^@^@float
.....SOME BINARY DATA ....
...................