Fortan Error: Nonnegative width required in format string at (1)
Hi all,
I'm in the process of debugging and compiling about sixty FORTRAN 95 programs and could use a little bit of your help before my brain is fried and fingers are cramped. Thanks for your time! I receive the following errors: In file test_break60.f:12 120 format(2f) 1 Error: Nonnegative width required in format string at (1) In file test_break60.f:19 145 format(i) 1 Error: Nonnegative width required in format string at (1) In file test_break60.f:27 150 format(' i=',i3, 2x,f,2x,f) 1 Error: Nonnegative width required in format string at (1) Here is my code: implicit none integer*4 n_out,i real*4 lat1,lat2,long1,long2,long_out(100),lat_out(100) 100 continue write(6,110) 110 format('$lat1,long1: ') read(5,120) lat1,long1 120 format(2f) write(6,130) 130 format('$lat2,long2: ') read(5,120) lat2,long2 write(6,140) 140 format('$Number of arc segments: ') read(5,145) n_out 145 format(i) lat_out(1) = lat1 lat_out(n_out) = lat2 long_out(1) = long1 long_out(n_out) = long2 call arc_break60(n_out,lat_out,long_out) write(6,150) (i,lat_out(i),long_out(i),i=1,n_out) 150 format(' i=',i3, 2x,f,2x,f) go to 100 end |
Done from memory about 30 years old (using FORTRAN IV and later 77):
Code:
120 format(f6.2) Code:
145 format(i4) Code:
150 format(' i=',i3, 2x,f,2x,f) Code:
150 format(' i=',i3," ",f6.2," ",f6.2) Also, remember that REAL in FORTRAN on a 32bit machine has only 7 meaningful digits. For more you need double precision. |
Thank you! Your memory seemed to do the trick. Now I just have one last error that reads:
undefined reference to 'arc_break60__' According to my memory that seems to be a linking issue. Agree? |
Code:
call arc_break60(n_out,lat_out,long_out) |
Linked and running! :D
Many thanks. |
You're welcome. Sometimes even "prehistoric" memories are useful, glad I could help.
|
All times are GMT -5. The time now is 09:45 PM. |