Author |
Message |
Topic: Attempt to call a subroutine as if it were a real(kind=1) fu |
dzovan137
Replies: 5
Views: 12073
|
Forum: Plato Posted: Sat Nov 09, 2013 2:10 pm Subject: Attempt to call a subroutine as if it were a real(kind=1) fu |
I have a problem with the following code:
function ran2(idum)
implicit real*8 (a-h,o-z)
integer idum,im1,im2,imm1,ia1,ia2,iq1,iq2,ir1,ir2,ntab,ndiv
paramet ... |
Topic: output problem |
dzovan137
Replies: 9
Views: 14646
|
Forum: Plato Posted: Sun Sep 15, 2013 4:37 pm Subject: Re: |
Try using:
p =(real(hits)/real(N))*(2**10 -1)
John
This does the job. I think there is no loss by forcing the type conversion in the case of my code. |
Topic: output problem |
dzovan137
Replies: 9
Views: 14646
|
Forum: Plato Posted: Sun Sep 15, 2013 4:31 pm Subject: Re: |
There are 3 possible cases comparing hits to N:
hits < N
hits = N
and hits > N (but given your DO loop, this is impossible)
Without running your problem, it seems that the most likel ... |
Topic: output problem |
dzovan137
Replies: 9
Views: 14646
|
Forum: Plato Posted: Thu Sep 12, 2013 4:08 pm Subject: output problem |
I have been having trouble with following code:
PROGRAM HitMiss
integer :: hits,i,N
real :: r,s,p
! RANDOM STUFF FROM THE CLOCK JUST TO MAKE SURE THAT WITH EVERY RUN THE INIT ... |
|