Fortran program structuring

  • Fortran
  • Thread starter dichotomy
  • Start date
  • #1
24
0

Main Question or Discussion Point

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
 

Answers and Replies

  • #2
Dr Transport
Science Advisor
Gold Member
2,330
446
Not sure about subroutines within a subroutine, gut feeling is that it won't work. As for returning an array, that is possible.
 
  • #3
24
0
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.
 

Related Threads on Fortran program structuring

  • Last Post
Replies
8
Views
8K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
4
Views
2K
Replies
2
Views
1K
  • Last Post
Replies
1
Views
4K
  • Last Post
Replies
6
Views
4K
Replies
2
Views
3K
Replies
3
Views
2K
Replies
1
Views
2K
  • Last Post
Replies
1
Views
3K
Top