Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FMT what does it mean?

Status
Not open for further replies.

pi3cho

Programmer
Oct 18, 2010
10
PL
Hi all,
I'm new fortran user and i wanted to ask what FMT means in following line:

WRITE(1,FMT=varfmt)(i*1.,i=1,imxcol,1)?

Thanks for help
 
To be a little bit more precise than GerritGroot, even if his answer is in the same time short and correct, it exists three types of format when writing to (reading from) a formatted file :

- fmt=* : list directed format, which produces an output which is partly compiler dependent,

- fmt=label : the label is a integer value (10, 999 ...) which points to a specific FORMAT instruction associated to that label. In that case, the format is fixed (determined at compile time)

- fmt=variable_name : in that case, the format may be defined at run time and is represented by the contents of a CHARACTER variable.

Taking into account the instruction you have provided, it seems that you are using the third case.

Two additional remarks :

- the syntax 'fmt=' is optional if the format is provided in second position, like your example.

- a format follows rather complicated rules : you need to read the documentation before being able to create your own format.
 
Thank you all for help:)
I've got one more question and please correct me if I am wrong.In the instruction "fmt" means format and "varfmt" is a name of format created by user.Is that correct?
 
Yes, that's correct varfmt must be a string like
'(A3,F15.10,E20.15)' for example.

You can try findng out with WRITE(*,*)varfmt if you don't want to look it up in the code... ..or WRITE(*,FMT='(A)')varfmt talking about formats...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top