comp.lang.fortran
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
December 2008
motuwethfrsasuw
1234567 49
891011121314 50
15161718192021 51
22232425262728 52
293031     1
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
  OPTIONAL STRING argument problem         


Author: zuying
Date: Dec 26, 2008 15:27

Merry Xmas everybody,

I ran into this problem when I started working today after Xmas.

Here is the arguments of the subroutine I wrote,
"
SUBROUTINE TEST(outfile,rmin,rmax,x1,weightf1,x2,weightf2)
character*(*) :: outfile, weightf1,
real(kind=4) :: rmin, rmax
real, dimension(:) :: x1

real, dimension(:), optional :: x2
character*(*), optional :: weightf2

....
"

when I called the subroutine like this,

call TEST(filename1,rmin,rmax,x1,wf1)

and compiled and ran in intel fortran compiler 11.0,

filename1 is passed successfully, but wf1 can't.

if called with all optional arguments, everything is ok. I think it's
because of the conflict between variable size string argument
"weightf1" and the OPTIONAL nature of the last two arguments.
Show full article (0.87Kb)
no comments
  Fortran IV to F77         


Author: Terence
Date: Dec 26, 2008 14:12

Just a note that I finished what I started.
If I had known the complexities I might not have started, but well..

I now have the conversion, the parsing of Format satements to
"correct" the source to match F77 compilers, optional indenting and re-
numbering of labels and Formats separately, source output listing with
DO-loop level notations, adding CONTINUEs where the DO loop ended on
an assignment (interesting danger there- you have to check only the DO-
loop uses that label, and not a branch within the loop which needs
it's own label still to get to the assignmnet and not the end of the
loop!).
Show full article (1.27Kb)
no comments
  Re: infinite DO         


Author: David Flower
Date: Dec 26, 2008 02:40

On Dec 24, 3:00�pm, Charles Coldwell gmail.com> wrote:
> I am writing a program in Classical FORTRAN[*]. �I chose this dialect
> because it is what the target audience understands, not because I am
> interested in starting a Holy War. �My question is, what is the idiom
> for "forever" in this dialect? �I tried
>
> � � � DO 100
> C � � � blah, blah, blah
> � � � IF (DONE) GO TO 110
> 100 � CONTINUE
> 110 � etc.
>
> In other words, I want the loop to run until the LOGICAL variable DONE
> becomes true, then exit. �There is no explicit loop iteration variable
> because none is needed.
>
> g77, gfortran, sunf77 and ifort all swallowed this without complaint.
> pgf77 gives me
>
> PGFTN-S-0034-Syntax error at or near end of line (legendre.f: 92) ...
Show full article (1.55Kb)
no comments
  Re: Newbie F90 Question -- or may not be!         


Author: robin
Date: Dec 25, 2008 16:55

"Ron Shepard" NOSPAM.comcast.net> wrote in message
news:ron-shepard-F988DE.23173815122008@forte.easynews.com...
> In article
> <7e6bc0a9-c9a7-42cf-8d8a-8c88fd52c4c8@k36g2000pri.googlegroups.com>,
> robert.corbett@sun.com wrote:
>
>> The most common case of
>> reentrant I/O is where the input/output list of a
>> READ, WRITE, or PRINT statement contains a function call
>> and the function called does on I/O operation on the same
>> unit.
>
> Must it be the same unit? I thought this was illegal in f90 (and
> before) even if different units were used.

It is (illegal). Any kind of recursive I/O was illegal.
Even using internal I/O to convert a value to string form
was illegal when done by a function called from an I/O list.
no comments
  Re: Fortran libraries & modules...         


Author: robin
Date: Dec 25, 2008 16:55

"Thomas Robitaille" spam.com> wrote in message
news:no-EFD1A6.16234615122008@mara100-84.onlink.net...
> Hi everyone,
>
> As many of you here probably also have, I have a 'library' of Fortran
> modules/routines that I use in a number of different projects. I have
> compiled a static library from these, which I can then simply link in
> when I compile code for different projects.
>
> The main issue I have is that .mod files, which need to be included
> alongside the library, are compiler dependent.
>
> However, when coding, I like to switch compilers e.g. to diagnose bugs
> that a particular compilier is failing to pick out. But this means that
> each time I need to go back and re-compile the library with whatever
> compiler I want to use.
>
> Of course, one solution is to pre-compile the library with all the
> different compilers I might want to use, but this isn't great, as it
> means that each time I update my library, I would have to compile with ...
Show full article (1.28Kb)
no comments
  Re: avoiding trailing zeros         


Author: robin
Date: Dec 25, 2008 16:55

"Gordon Sande" worldnet.att.net> wrote in message
news:2008122119323416807-gsande@worldnetattnet...
> On 2008-12-21 18:39:22 -0400, "robin" bigpond.com> said:
>
>> "Gordon Sande" worldnet.att.net> wrote in message
>> news:2008121916520216807-gsande@worldnetattnet...
>>> On 2008-12-19 16:37:58 -0400, norbert9@gmail.com said:
>>>
>>> write ( 10, "(10f20.8)" ) ( x(i), i = 1, 10 )
>>>
>>> becomes
>>>
>>> do i = 1, 10
>>> if ( x(i) == 0.0 ) then
>>> write ( 10, "(1x,f2.0)", advance = "no" ) x(i)
>>
>> Sufficient would be
>> write (10, '(A)' , advance = 'no' ) ' 0.'
>
> Optimization and illustrating a method are often at odds. ...
Show full article (0.74Kb)
no comments
  Re: avoiding trailing zeros         


Author: robin
Date: Dec 25, 2008 16:55

"Gary Scott" sbcglobal.net> wrote in message
news:JJz3l.15189$ZP4.14595@nlpi067.nbdc.sbc.com...
> robin wrote:
>> "glen herrmannsfeldt" ugcs.caltech.edu> wrote in message
news:gih2pj$ko6$1@naig.caltech.edu...
>>
>>> if(x.eq.0) then
>>
>> This archaic form was superseded nearly 20 years ago
>> with: if (x == 0) then
>
> it wasn't actually superceded, it was made redundant with an unnecessary
> new form.

It's an archaic form, and has been superseded (=displaced) by the improved form.
no comments
  Re: Anybody can help me out on WRITE format?         


Author: robin
Date: Dec 25, 2008 16:55

"Jason" gmail.com> wrote in message
news:c2c62096-87a4-451e-98f3-72fdaf4eaafb@w24g2000prd.googlegroups.com...
> my code is processing data for a certain time period. I want to write
> the processing date on the display like a clock

Like a clock? Clocks tell the time, not the date.
no comments
  Re: New to Fortran on Win XP         


Author: robin
Date: Dec 25, 2008 16:55

"Matti" wrote in message
news:0281e3e6-9df7-42db-b54e-29a126d210e4@a29g2000pra.googlegroups.com...
Hi all,
>I wonder what's the best way to start learning Fortran 90/95/2003 on a
>Win 32 XP Pro w. 2GB RAM. I have a wicked feeling that One has to use
>the command prompt (that has a size of roughly 1MB on my computer), so
>I cannot really understand how to run quite large programs.
>I tried g95, compliled a small prg and got the desired a.exe . I
>openend up a Window and clicked on my a.exe and a small command prompt
>flashed on the screen.

Try running the EXE program from the DOS prompt.
no comments
  Re: infinite DO         


Author: robin
Date: Dec 25, 2008 16:55

"Charles Coldwell" gmail.com> wrote in message news:m2wsdppqj1.fsf@gmail.com...
>
> I am writing a program in Classical FORTRAN[*]. I chose this dialect
> because it is what the target audience understands, not because I am
> interested in starting a Holy War. My question is, what is the idiom
> for "forever" in this dialect?

DO
IF (DONE) GO TO 110
END DO
110...
should be comprehensible by anyone.

F90+ has some constructs that are easier to understand.
no comments
1 2