grappleone
Programmer
Could anyone help here?
I am developing a program in F90 to simulate a problem in solid state physics. I have a couple of largish arrays representing the positions of atoms in a solid whose sizes are set at at compile using parameter values. These arrays need to be passed to many subroutines for diverse processing.
e.g
SUBROUTINE Populate_Lattice(Lattice, xmax, ymax, zmax)
INTEGER, INTENT (IN) :: xmax, ymax, zmax
Integer, INTENT (OUT) :: Lattice(xmax,ymax,zmax,5)
Do I have to redeclare them for each subroutine. I've looked at COMMON blocks but that seems rather `unstylish' in terms of code reuse.
Am I on the right track here?
Cheers
Ian
I am developing a program in F90 to simulate a problem in solid state physics. I have a couple of largish arrays representing the positions of atoms in a solid whose sizes are set at at compile using parameter values. These arrays need to be passed to many subroutines for diverse processing.
e.g
SUBROUTINE Populate_Lattice(Lattice, xmax, ymax, zmax)
INTEGER, INTENT (IN) :: xmax, ymax, zmax
Integer, INTENT (OUT) :: Lattice(xmax,ymax,zmax,5)
Do I have to redeclare them for each subroutine. I've looked at COMMON blocks but that seems rather `unstylish' in terms of code reuse.
Am I on the right track here?
Cheers
Ian