LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2014, 08:23 PM   #1
AlexBB
Member
 
Registered: Mar 2014
Posts: 444

Rep: Reputation: Disabled
What does it mean in GFortran. Question II?


I found this expression I do not understand:

Code:
fac(nf+2) = real ( ntry, kind = 8 )
I understand, there is an array on the left, but why is there a declaration on the right. ntry is declared previously as integer*4 and now it is kind=8, why?

Should it be understood as: assign ntry to fact(nf+2) element but first convert ntry to real*8? Why don't people then write the code simpler:

Code:
fact(nf+2) = DBLE(ntry)
Thanks, - A.
 
Old 12-16-2014, 08:26 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,520

Rep: Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106
Quote:
Originally Posted by AlexBB View Post
Should it be understood as: assign ntry to fact(nf+2) element but first convert ntry to real*8?
Yes

Quote:
Originally Posted by AlexBB View Post
Why don't people then write the code simpler:

Code:
fact(nf+2) = DBLE(ntry)
Could have to do with portability, or perhaps DBLE() isn't ANSI in whatever version of Fortran this is?
 
1 members found this post helpful.
Old 12-17-2014, 07:25 PM   #3
AlexBB
Member
 
Registered: Mar 2014
Posts: 444

Original Poster
Rep: Reputation: Disabled
One more down, many more to go. Suicidaleggroll, thank you again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What does it mean in GFortran? AlexBB Linux - Newbie 7 12-16-2014 08:28 PM
[SOLVED] What does it mean in GFortran? AlexBB Linux - Newbie 4 12-13-2014 12:43 PM
ifort and gfortran hanamilani Linux - Software 1 02-15-2009 12:34 PM
help gfortran mperez Programming 2 12-16-2007 12:50 PM
gfortran libraries curosie Programming 1 08-26-2005 10:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration