PDA

View Full Version : fortran program structuring..


dichotomy
Feb26-07, 02:26 PM
basic question really...can you have subroutines nested within subroutines? or are there any other types of subprograms within fortran95 other than functions and subroutines? (need one that can pass back an array)

if you can [use subs within subs], how do you link them? like in the main program you have to use an INTERFACE-END INTERFACE construction to link to the subroutine...

ta in advance

Dr Transport
Feb26-07, 04:43 PM
Not sure about subroutines within a subroutine, gut feeling is that it won't work. As for returning an array, that is possible.

dichotomy
Feb26-07, 06:26 PM
erm...could you elaborate? i'm writing a program that solves linear equations with gauss seidel iteration (and gauss/gauss jordan elimination), so there's a main program which calls the various methods as subroutines...

except within the gauss seidel subroutine I want to seperate a bit which makes the matrix diagonally dominant(ish)...obviously after rearranging the rows the matrix needs to be passed back to the gauss seidel subroutine.