I'm want to incorporate a parameter declared in one module in another module. Here's a code snippet then I'll explain more.
MODULE MAXIMUMS
INTEGER, PARAMETER :: MAXSTRUTS = 8000
END MODULE
MODULE SI
TYPE STRUT_INFO
INTEGER HUB_POSITION
REAL SS(2)
END TYPE
END MODULE
PROGRAM EXAMPLE
USE MAXIMUMS
USE SI
TYPE(STRUT_INFO), DIMENSION(MAXSTRUTS) :: ST ! I would like to put this in MODULE SI but since it uses "MAXSTRUTS" the compiler complains.
.
.
.
END EXAMPLE
I would like to just say "USE SI" and have the derived type ST be declared within that module. Is there anyway I can do this? Before you say just meld MAXIMUMS and SI together in one module you need to understand that I use MAXIMUMS all over the place (and it's actually has a lot more parameters in it, I just shortened it for this example) and I use SI in only a few places.
Yes, I can leave it as is but I'm basically lazy. Every time I say USE SI and don't want to have to remember to declare ST.
Any ideas would be appreciated.
MODULE MAXIMUMS
INTEGER, PARAMETER :: MAXSTRUTS = 8000
END MODULE
MODULE SI
TYPE STRUT_INFO
INTEGER HUB_POSITION
REAL SS(2)
END TYPE
END MODULE
PROGRAM EXAMPLE
USE MAXIMUMS
USE SI
TYPE(STRUT_INFO), DIMENSION(MAXSTRUTS) :: ST ! I would like to put this in MODULE SI but since it uses "MAXSTRUTS" the compiler complains.
.
.
.
END EXAMPLE
I would like to just say "USE SI" and have the derived type ST be declared within that module. Is there anyway I can do this? Before you say just meld MAXIMUMS and SI together in one module you need to understand that I use MAXIMUMS all over the place (and it's actually has a lot more parameters in it, I just shortened it for this example) and I use SI in only a few places.
Yes, I can leave it as is but I'm basically lazy. Every time I say USE SI and don't want to have to remember to declare ST.
Any ideas would be appreciated.