- #1
napster
- 2
- 0
Hey all!
I have a few simple questions but they have been wrecking my head for a while now, for Fortran 90:
1. I have the following Complex (Kind=pr), Allocatable :: U(:,:,:)
Does that mean that U is a complex array? And if so, I thought a complex number in Fortran is followed by an assignment of say Complex :: C C=(1.0,2.0). So I am probably just over thinking it, but is my U then an array, or a complex array?
I figured out this part, it's an array of complex numbers. Yay!
Then, I have something like U(:, J,K)=U_j, I am not sure how to phrase the question properly so I can google it, but the : part in the bracket, does that mean that whatever value I have there stays as is and I can have DO loops that can change J and K?
2. This is more of a general question, I know FORTRAN is not case sensitive, but when I am declaring variables, if I declare say Complex :: U(N,N) is it the same as declaring Complex :: u(N,N) ?
3. My code has a bunch of modules and subroutines that get called in different modules, subroutines and parts of the main code. So if I have a paramter U complex, declared in module1 and a different subroutine, say subroutine1 declares a parameter U but real, and subroutine1 doesn't call module1, then I guess my two differently declared U don't interfere? Both module1 and subroutine1 are in the same main code. And if subroutine1 did call module1 to execute something, which value would U have, real or complex?
Thanks for any help at all, I am currently trying to comment a code and have never programmed, so learning as I go along... I have several books but they don't seem to be as
I have a few simple questions but they have been wrecking my head for a while now, for Fortran 90:
1. I have the following Complex (Kind=pr), Allocatable :: U(:,:,:)
Does that mean that U is a complex array? And if so, I thought a complex number in Fortran is followed by an assignment of say Complex :: C C=(1.0,2.0). So I am probably just over thinking it, but is my U then an array, or a complex array?
I figured out this part, it's an array of complex numbers. Yay!
Then, I have something like U(:, J,K)=U_j, I am not sure how to phrase the question properly so I can google it, but the : part in the bracket, does that mean that whatever value I have there stays as is and I can have DO loops that can change J and K?
2. This is more of a general question, I know FORTRAN is not case sensitive, but when I am declaring variables, if I declare say Complex :: U(N,N) is it the same as declaring Complex :: u(N,N) ?
3. My code has a bunch of modules and subroutines that get called in different modules, subroutines and parts of the main code. So if I have a paramter U complex, declared in module1 and a different subroutine, say subroutine1 declares a parameter U but real, and subroutine1 doesn't call module1, then I guess my two differently declared U don't interfere? Both module1 and subroutine1 are in the same main code. And if subroutine1 did call module1 to execute something, which value would U have, real or complex?
Thanks for any help at all, I am currently trying to comment a code and have never programmed, so learning as I go along... I have several books but they don't seem to be as
Last edited: