CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

question on fortran

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

LinkBack Thread Tools Display Modes
Old   May 23, 2003, 17:46
Default question on fortran
Posts: n/a
hi, everybody:

I am working on writing a converter between 2 commercial software. i.e., i must parse the output of one software to the input of another software.

software A's output has 5 significant digits. software B's input data field width has only 7 characters.

if i use "F7.4" format to output, i lose record that >9999. if i use "E7.2", I only have 2 signicicant digits.

Is there a way to do the converting job while preserve as many significant digits as possible. one way is to use nested if statements and select the right format statements accordingly.

Any one knows a better method than this stupid one?

Thanks to all!

  Reply With Quote

Old   May 24, 2003, 16:27
Default Re: question on fortran
Posts: n/a
commercial software only has 7 characters? that's bad. Maybe you can try 'g' instead of 'e' and 'f'
  Reply With Quote

Old   May 27, 2003, 08:38
Default Re: question on fortran
Posts: n/a
Actually, your nested loop is not so stupid - it is a good way, with relatively simple logic and coding, to optimize the output for given ranges of numbers. I'd say go with it.
  Reply With Quote


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
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
a strange question about Fortran Hall Main CFD Forum 9 May 18, 2004 02:48
Question on USER FORTRAN: GETVAR BoZ CFX 2 May 6, 2003 10:32
Short question on command in user fortran Franz Thomsen CFX 2 June 20, 2000 06:35
'C' or FORTRAN or 'C++' Yogesh Talekar Main CFD Forum 20 October 21, 1999 04:00

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