LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What does it mean in GFortran? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-it-mean-in-gfortran-4175528375/)

AlexBB 12-15-2014 08:09 PM

What does it mean in GFortran?
 
I am seeing such expressions:

Code:

FAC(3:NF+2)
What does the colon do? why is it there? Thanks, - A.

evo2 12-15-2014 08:17 PM

Hi,

you haven't given any context to I'll guess that it's an array operation in fortran 90.

Evo2.

AlexBB 12-16-2014 08:37 AM

Thanks. What do you mean a context? This line is a part of a very large package in Fortran on Fast fourier Transform. I cannot access the code now, only in about 12 hours. But even when I do what other informarion do you want? For a person familar with GFortran or any contemporary variant like Fortran 2008, etc, it should be self-explainatory.

BTW, this code is not a part of a declaration.

suicidaleggroll 12-16-2014 10:03 AM

It's just referencing a certain index range in FAC.

Say NF is 5, it would be pulling out indices 3,4,5,6,7 from the array FAC.

AlexBB 12-16-2014 04:00 PM

suicidaleggroll is again on top of the game. Thanks.

evo2 12-16-2014 06:52 PM

HI,
Quote:

Originally Posted by AlexBB (Post 5285497)
Thanks. What do you mean a context?

It wasn't even a full line of code. The colon gave the hint that FAC was an array, but you didn't even bother to tell us that. Furthermore, you could have looked this up in less time than it took you to write your post.
Quote:

Originally Posted by AlexBB (Post 5285497)
This line is a part of a very large package in Fortran on Fast fourier Transform.

That is context too. FFT, would hint towards dealing with arrays.

Quote:

Originally Posted by AlexBB (Post 5285497)
I cannot access the code now, only in about 12 hours. But even when I do what other informarion do you want? For a person familar with GFortran or any contemporary variant like Fortran 2008, etc, it should be self-explainatory.

Really? Since you are clearly not, it seems very niave to assert that.

Evo2.

AlexBB 12-16-2014 08:11 PM

Of course, I am learning. I write code and learn at the same time. Many programs can be written without sophisticated statements new Fortran variants offer. I programmed in Fortran IV years ago ad nauseum. I do not try to hide anything intentionally. I thought that posting a snippet will make your job easier. Now I fully understand what it meant. Still posting here is better than googling and reading although I do both. I also have another, similar question to ask. Will make a separate thread. I did not assert that I am an expert. You did not read my post attentively. I meant people like suicidaleggroll for instance.

This snippet actually appears only once in a comment, nowhere else. Here it is:

Quote:

! Output, real ( kind = 8 ) FAC(15), factorization information.
! FAC(1) is N, FAC(2) is NF, the number of factors, and FAC(3:NF+2) are the
! factors.

evo2 12-16-2014 08:28 PM

Hi,
Quote:

Originally Posted by AlexBB (Post 5285861)
You did not read my post attentively.

You're welcome.

Plonk.


All times are GMT -5. The time now is 10:10 PM.