Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Passing Arguments between Soubroutines - INFINIT RESULT

$
0
0

Dears,

I don't know what I forgot, but I tryied to reproduce a problem I'm facing, which is resulting in na infinity result of:  1.713457071104324E+124. I don't know what is wrong with it

I'm trying to pass arguments through subroutines. See the code below. Could you help me please?

program principal

double precision x, y, z, k, w

x = 1;

y = 1;

z = 1;

call soma(x,y,z)

call multiplica(k,w)

write(*,*) "The value of w is: ", w

end program

subroutine soma(a,b,c)

double precision, intent(in) :: a,b

double precision, intent(out) :: c

c = a+b

end subroutine

subroutine multiplica(d,e)

double precision, intent(in) :: d

double precision, intent(out) :: e

double precision x,y,z

call soma(x,y,z)

e = z*d

end subroutine

 

 

 


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>