I am writing a program that I will use in two main cases: 1D and 2D. The dimension ndim
is loaded through a read
of an external file, this read
I want to do in module param
.
I have various declarations of vectors whose sizes depend on the dimension. So obviously I have to compute these sizes at the beginning of my main program. What is the proper way of doing so? I want to use a module but I fail.
module dimensions
use prec
use param
implicit none
integer ( int32 ), parameter :: nip = 49 ! Number of interior points
contains
subroutine calc_neqn ( )
use prec
implicit none
integer ( int32 ) :: nup ! Number of unknown points
integer ( int32 ) :: neqn ! Number of equations
! compute number of unknown points
nup = (nip+2)**ndim
! compute number of equations
neqn = 2*nup
end subroutine calc_neqn
! systematic computations
call calc_neqn ( )
end module dimensions
I get the following - very clear - error message:
Error: Unexpected CALL statement in CONTAINS section at (1)
In other words, can a module call a subroutine? And what would be the proper syntax?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…