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

Fortran write help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 25, 2007, 11: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, 13: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, 00: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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 7 December 15, 2020 13:06
Fortran Compiler-CFX12.1 Araz CFX 13 March 27, 2017 05:37
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 13:02
visual fortran Monica Main CFD Forum 1 August 28, 2004 20:45


All times are GMT -4. The time now is 07:33.