Well, I have this basic function:
real(8) function db(ER)
implicit none
real(8) :: ER
real(8) :: A=-0.14600d0
real(8) :: B=1.093898d0
real(8) :: C
C=B/(2.0d0*A)
print*, ER, ER/A, C**2
db=-sqrt((ER/A) + C**2) - C
return
end function db
And this function is called from other file (STP)
program STP
implicit none
real(8) :: db
print*, 'Waiting ... '
print*, db(1.0d0)
return
end program STP
Finally in my terminar:
ususario@us: gfortran STP.f90 db.f90
ususario@us: ./a.out
Waiting ...
But the problem is coming: my terminal never print the values in the print statement inside
of the function 'db'. The behavior persists
even when I change 'print*, ER, ER/A, C**2'
to print*, 'hola'.
I tried to put the code in a single file, like this
program prueba
implicit none
real(8) :: db
print*, db(0.0d0)
end program prueba
real(8) function db(ER)
implicit none
real(8) :: ER
real(8) :: A=-0.14600d0
real(8) :: B=1.093898d0
real(8) :: C
C=B/(2.0d0*A)
print*, ER, ER/A, C**2
db=-sqrt((ER/A) + C**2) - C
return
end function db
and the values ER, ER/A, C**2 are printed in the terminal