LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-28-2011, 02:29 PM   #1
parekhharsh_j
LQ Newbie
 
Registered: Jun 2011
Posts: 20

Rep: Reputation: Disabled
Formatting following numbers in fortran


I am getting error
Fortran runtime error: Bad value during floating point read
How do I format negative sign?

Code:
REAL(kind=10), DIMENSION(:),ALLOCATABLE::u,v
ALLOCATE(u(5),v(5))

OPEN(UNIT=9,FILE='NSSAVE0001.vtk',STATUS='old',IOSTAT=open_status)
IF(open_status>0) STOP "problem opening the file"
DO n=1,5
READ(9,'(1X,E11.5,1X,E11.5)')u(n),v(n)
ENDDO
PHP Code:
  0.12383E+00 -0.35216E-04 0.
  0.12376E+00 
-0.35447E-04 0.
  0.12369E+00 
-0.35671E-04 0.
  0.12362E+00 
-0.35892E-04 0.
  0.12355E+00 
-0.36113E-04 0. 
 
Old 06-28-2011, 02:48 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Code:
READ(9,'(1X,E12.5,1X,E12.5)') u(n), v(n)
 
1 members found this post helpful.
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] find the total of numbers that are higher than x in a text file with numbers (using awk??) Mike_V Programming 12 11-24-2010 09:51 AM
how to put blank spaces in between list of numbers generated in FORTRAN vjramana Programming 2 08-26-2010 12:35 AM
g77 in gcc 4.1.0 not found only gfortran fortran 95 compiler! I need fortran 77. TheBrick Linux - Software 3 07-04-2007 06:39 AM
Gnu Fortran versus Intel Fortran tomatoefish Linux - Software 3 02-20-2006 01:31 PM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 08:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration