comp.lang.fortran
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.fortran Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  What's the meaning of "a model set of integers (reals)" in Fortran?         


Author: hermitian
Date: Jan 31, 2008 21:06

Hi, everyone. I'm reading a book titled "Fortran 90/95 Explained" to
learn Fortran by myself. My major is chemistry, so this question might
be silly.

In section 8.7.1 models for integer and real data. The authors wrote:

For each kind of integer, it is the set

i = s \times \sum_{k=1}^{q} w_k \times r^{k-1}

For each kind of real, it is the set

x = 0

and

x = s \times b^e \time \sum_{k=1}^{p} f_k \times b^{-k}

I am puzzled about the models. Could anyone give me more detailed
information or some examples on the models? For example, how about the
models for an integer 5 and a floating-number 5.0! Any helps are
appreciated!

Thank you!
7 Comments
  Which direction is Fortran going?         


Author: Frank
Date: Jan 31, 2008 18:38

Use to see Fortran compilers and books in the computer stores, but now they
don't even know what I'm talking about. A friend is a recent graduate with a
degree in engineering from an accredited university and knows many program
languages but no Fortran. Why is that?

If you need to solve a complex engineering problem, is the program of choice
still Fortran? In other words, is Fortran a worthwhile language to learn for
a young engineer or has other number crunching languages superseded it?
4 Comments
  Re: Type specification and initialization expressions         


Author: Steve Lionel
Date: Jan 31, 2008 13:23

On Jan 31, 7:38 am, Tobias Burnus wrote:
> Hello,
>
> Is the following code valid or not?
>
> implicit none
> REAL(kind(0.0d0)), dimension(kind(xyz)) :: xyz
> REAL, PARAMETER :: xxx(kind(xxx)) = 1.0

We've been here before. Here's the text of Interp 00090 against F95
discussing this issue. The text was clarified in F2003. I'll comment
for the record that Intel Fortran doesn't get all the cases right
either in that we accept and do not warn about certain non-standard
usages. We intend to fix that in a future release.

Steve
Show full article (5.96Kb)
no comments
  Re: Type specification and initialization expressions         


Author: James Giles
Date: Jan 31, 2008 12:37

Tobias Burnus wrote:
> Hello,
>
> Is the following code valid or not?
>
> implicit none
> REAL(kind(0.0d0)), dimension(kind(xyz)) :: xyz
> REAL, PARAMETER :: xxx(kind(xxx)) = 1.0
>
> This is accepted by NAG f95 and gfortran (and both have then size(xyz)
> == kind(0d0)), but it is unclear for me whether this is valid.

I don't think it is since KIND(xyz) is not defined until after xyz is
declared. I don't think *during* the declaration counts as *after*.
The following has been discussed before and I think was determined
to be non-standard for the same reason:

Real :: X(5), Y(size(x))

Even if such things were standard, I would avoid then for legibility
reassons.
Show full article (0.96Kb)
3 Comments
  Re: Automatically transform or expand do loop in a subroutine         


Author: Dr Ivan D. Reid
Date: Jan 31, 2008 12:08

On Wed, 30 Jan 2008 23:25:01 -0800, Richard Maine
wrote in <1ibjyb7.1hw8i1tx9pokqN%%nospam@see.signature>:
> highegg gmail.com> wrote:
>> On Jan 31, 7:06 am, nos...@see.signature (Richard Maine) wrote:
>>> yaqi gmail.com> wrote:
>>>> I want to save computing time as much as I can.
>>> ...
>>>> do i=1,d
>>>> c = c + i
>>>> end do
>>> The "obvious" way to save a lot of computing time here is to replace the
>>> loop with
>>> c = c + d*i
>> certainly not. c = c + d*(d+1)/2, more likely :)
> Um. Er. Right.
Show full article (1.33Kb)
1 Comment
  Re: Automatically transform or expand do loop in a subroutine         


Author: Dick Hendrickson
Date: Jan 31, 2008 09:44

yaqi wrote:
> Hi All,
>
> I knew following piece of code will not be compiled, at least with
> Compaq Visual Fortran. My intention of this code is to let the
> compiler automatically transform or expand the loop inside the
> function (I do not care the code size) if the caller has a SMALL
> CONSTANT integer 'd' in its argument list when the compiler is doing
> optimization. Because the function is really crucial for the
> performance, I want to save computing time as much as I can. So do not
> ask me why I want to do this. Actually I guess this idea is similar as
> the template in C++.
>
> Are there any ways to implement this idea easily with Fortran?
Show full article (1.73Kb)
7 Comments
  Re: Allocatable Arrays As Outputs         


Author: Infinity77
Date: Jan 31, 2008 07:04

Hi All,

thank you very much for your kind and quick suggestions. By
following the advice provided by Reinhold (and supported by others) I
was able to make my routine working. Sorry for the newbie question.

Andrea.
1 Comment
  Re: Automatically transform or expand do loop in a subroutine         


Author: Gordon Sande
Date: Jan 31, 2008 06:59

On 2008-01-31 00:15:54 -0400, yaqi gmail.com> said:
> Hi All,
>
> I knew following piece of code will not be compiled, at least with
> Compaq Visual Fortran. My intention of this code is to let the
> compiler automatically transform or expand the loop...
Show full article (2.20Kb)
10 Comments
  Re: passing a variable number of args/vectors to a routine         


Author: dpb
Date: Jan 31, 2008 06:43

Mirko.Vukovic@gmail.com wrote:
> On Jan 30, 6:07 pm, dpb non.net> wrote:
>> Mirko.Vuko...@gmail.com wrote:
>>
>> ...
>>
>>> I pass the data to the TecPlot dump routine by calling:
>>> call dump_data( vData1,vData2, ...)
>> That's not the question -- where do vDataN come from and why can't they
>> be an ALLOCATED array of the proper dimension, instead?
>>
>> --
>
> Hmm, I am not sure what you're getting at. But here's my story:
>
> I am doing a 1-D time-dependent electromagnetic simulation and
> calculate E and B fields. These are stored in their own vectors.
> After each time step, I want to pass the two vectors to the tecplot
> dump routine. So, I do allocate the two vectors at the beginning of
> the run. ...
Show full article (1.02Kb)
2 Comments
  Re: The concept of a record         


Author: Gordon Sande
Date: Jan 31, 2008 06:31

On 2008-01-30 22:08:49 -0400, qsc gmail.com> said:
> On Jan 30, 3:18 pm, Gordon Sande worldnet.att.net> wrote:
>>
>> The values that are in the record come one after the other.
>>
>> The structure of (1,n) or (n,1) is an artifact of your program...
Show full article (2.40Kb)
no comments
1 2 3 4 5 6 7 8 9