Skip to content

Instantly share code, notes, and snippets.

@zrhans
Last active November 13, 2017 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zrhans/ff354f20215a639d31d5b192a2a79056 to your computer and use it in GitHub Desktop.
Save zrhans/ff354f20215a639d31d5b192a2a79056 to your computer and use it in GitHub Desktop.
program calling_func
implicit none
real :: x, y, z, disc
x= 1.0
y = 5.0
z = 2.0
call intent_example(x, y, z, disc)
Print *, "O valor do discriminante vale"
Print *, disc
end program calling_func
subroutine intent_example (a, b, c, d)
implicit none
! dummy arguments
real, intent (in) :: a
real, intent (in) :: b
real, intent (in) :: c
real, intent (out) :: d
d = b * b - 4.0 * a * c
end subroutine intent_example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment