SCIENTIFIC-LINUX-USERS Archives

September 2007

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Matthias Schroeder <[log in to unmask]>
Reply To:
Matthias Schroeder <[log in to unmask]>
Date:
Thu, 20 Sep 2007 11:09:00 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (84 lines)
Christoph P. Kukulies wrote:
> On Thu, Sep 20, 2007 at 10:12:50AM +0200, Klaus Wacker wrote:
>> On Wed, Sep 19, 2007 at 10:25:55AM -0500, Hendrik van Hees wrote:
>>> Thank you very much for all the responses. I think I didn't make the 
>>> problem clear. With the older version of gcc (I am using the fortran 
>>> compiler, g77)
>>>
>>> gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
>>>
>>> the little code runs fine.
>>>
>>> With the newer version, which is definitely in my installation of SL 5 
>>> (I use yum as a package manager),
>>>
>>> gcc version 3.4.6 20060404 (Red Hat 3.4.6-4)
>>>
>>> the same code does not work any more. Perhaps it helps, when I give the 
>>> relevant piece of code:
>>>
>>> cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
>>>
>>>       open(unit=1,
>>>      $     file='RW-total-tadmix4pi-6pi-DY.dat')
>>>
>>>       do x=0.2d0,1.45d0,0.01d0
>>>          erg=ipol(x1,set1,x)+ipol(x2,set2,x)+ipol(x3,set3,x)
>>>      $        +ipol(x4,set4,x)+ipol(x5,set5,x)
>>>          write(unit=1,fmt='(2g25.8e3)') 
>>>      $        x,erg
>>>       end do
>>>       
>>>       close(unit=1)
>>>       
>>> cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
>>> c     add omega and phi (all pT)
>>>       open (unit=2, file='RW-total-tadmix4pi-6pi-DY.dat',
>>>      $     status='old')
>>>       do j=1,nmax1
>>>          read(unit=2,fmt='(2g25.8e3)') x1(j),set1(j)
>>> c         write(*,*) x1(j),set1(j)
>>>       end do
>>>       close(unit=2)
>>> cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
>>>
>>> As you see. It simply writes some columns of double precision, and in 
>>> the next step it reads the same in again.
>>>
>>
>> Somehow the code you show doesn't fit the error message. You seem to be
>> using unit 1 only for writing, whereas the error message talks about
>> reading from unit 1. 
> 
> the crucial statement is
> 
> read(unit=2,fmt='(2g25.8e3)') x1(j),set1(j)

Maybe, but I would not bet on that. As Klaus pointed out the number of 
interations in the first loop is not defined. By chance the OP 
apparently got away with that on the first systems he used.

We don't know which value nmax1 has, so maybe he is trying to read one 
more element than he has written????

I anyhow don't quite understand why he first writes the values to a file 
(in a not well defined format ("format real as decimal or exponential" 
)) only to read it back in a later stage by the same program. To me it 
looks as if there are a few things that are not well defined, which is 
not always a good thing in programming...

Matthias

> 
> albeit the error message talks about unit 1 in the OP (but I guess he
> changed the unit numbers in the code snippet).
> 
> The format '(2g25.8e3)' is obviously triggering the error message I would
> assume.  It could be a matter of the math libs used or also the fortran
> runtime library may have changed in that point. Have you (OP) looked at
> the intermediate data file and compared it under the different
> platforms?
> 
> --
> Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de

ATOM RSS1 RSS2