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!

write(unit,namelist) can I controll the output format!?

Status
Not open for further replies.

albi73

Programmer
Sep 16, 2010
18
IT
I'd like to be able to control the output format when I write an namelist on a file.

I call a compiled code from my fortran code.
This compiled code needs an input file , which is clearly wrote by using namelist. My code has to charge the variables from this input file, works on them and at the end write again on file. What i'd like would be to be able to write with the same original format.

[code/]
file:

&test
A=10, B=20, cavity="second"
G=3
/

[/code]

if one reads the variables and then writes them on file by using namelist, at the end he will find a format that is compiler o machine dipendent and i'm not able to find the same format as before

resut
[code/]
&test
A=10,
B=20,
cavity="second"
G=3, /
[/code]

is there a way that someone know?
Thanks, Albi


 
Which version of Fortran are you using F77, F90, F95 or F2003? Also, which compiler/os are you using?

On F77 it was a feature of the compiler - it wasn't standard as yet so every compiler was different.
 

on linux
absoft 8.0, lahey 8.1, gfortran 4.1
on windows
lahey 5.6

I think I have tested the write namelist on windows (lahey) and on linux with lahey 8.1, gfortran 4.1 not with absoft.

Usualy I work with F95. Any way i have never find any kind of possible controll on the format. I have seen that gfortran works also with "&End" on the place of "/" to close the namelist, but nothing more.
have i lost some new functions of F2003? ... this could be a good news

Thatks, Albi

 
Looks like you can't change the format. It is decided by the compiler manufacturer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top