CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Fortran write help

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 25, 2007, 12:30
Default Fortran write help
  #1
Praveen. C
Guest
 
Posts: n/a
I want to write a set of numbers on the same line.

write(*,*)(x(i),i=1,n)

works fine. But I want to control the format.

write(*,'(e20.10)')(x(i),i=1,n)

puts each number on a new line. Since n is variable I cannot hard code it into the format. Is there any way to achieve this in fortran 77 ?
  Reply With Quote

Old   January 25, 2007, 14:15
Default Re: Fortran write help
  #2
Renato.
Guest
 
Posts: n/a
try it:

write(*,999)(x(i),i=1,n) 999 format(e20.10,/)

Regards

Renato.

  Reply With Quote

Old   January 26, 2007, 01:20
Default Re: Fortran write help
  #3
Markus Lummer
Guest
 
Posts: n/a
Hello Praveen,

you could buildup the appropriate format string in a character variable.

Regards, Markus
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fortran Compiler-CFX12.1 Araz CFX 12 November 2, 2014 13:46
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 6 April 17, 2010 23:40
how to write user fortran for turbulence model waynezw0618 CFX 2 July 10, 2009 01:55
Fortran Compilers to write routines in CFX Luiz CFX 1 February 11, 2008 14:02
visual fortran Monica Main CFD Forum 1 August 28, 2004 20:45


All times are GMT -4. The time now is 21:26.