You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From F95 standard (this can be inside of a main program or a subprogram):
R210 internal-subprogram-part is contains-stmt
internal-subprogram
[internal-subprogram] ...
Also see Intel Developer Zone example. Basically, you can specify a nested procedure inside another procedure or main program using CONTAINS. A toy example:
$ cat internal.f90
subroutine s(x)
integer x
call s2(x)
contains
subroutine s2(y)
integer y
end subroutine
end subroutine
$ gfortran -fsyntax-only internal.f90
$ fort -fsyntax-only internal.f90
internal.f90:4:11: error: expected '='
contains
^
internal.f90:5:16: error: expected '='
subroutine s2(y)
^
internal.f90:6:15: error: expected '='
integer y
^
internal.f90:8:1: error: expected 'end program'
end subroutine
^
<unknown>:0: note: to match this 'program'
$
The text was updated successfully, but these errors were encountered:
From F95 standard (this can be inside of a main program or a subprogram):
Also see Intel Developer Zone example. Basically, you can specify a nested procedure inside another procedure or main program using
CONTAINS
. A toy example:The text was updated successfully, but these errors were encountered: