|
|
Up |
|
|
  |
|
|
  |
Author: j.s.supermailj.s.supermail
Date: Jun 30, 2008 14:55
Hi, everyone
I'm new to fortran. From an online tutorial I've found the following
code example:
Integer I, n, sum
sum = 0
do 10 i = 1, n
sum = sum + i
write(*,*) 'sum=', sum
10 continue
stop
end
When I compile this function with g77 loop.f, the error comes out:
sum = 0 ( there's a small arrow under 's')
End of source file before end of block started at (^)
Does someone know how to deal with it?
Thanks a lot
|
| |
|
| |
5 Comments |
|
  |
Author: Paul van DelstPaul van Delst
Date: Jun 30, 2008 09:25
Hello,
Compilation of the following test code
PROGRAM test_cmplx
! Double precision
INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(15)
! Variables
COMPLEX(dp) :: z
REAL(dp) :: x, y
! Assign a value to the complex number
z = CMPLX(3.14159_dp,-0.12345_dp,dp)
PRINT *, z
! Split out the parts
x = REAL(z,dp); y = AIMAG(z)
PRINT *, x, y
END PROGRAM test_cmplx
on an IBM P6 using the AIX v11.1 xlf95 compiler with the -qlanglvl=95pure switch produces
the output:
|
| Show full article (4.31Kb) |
|
5 Comments |
|
  |
Author: James TursaJames Tursa
Date: Jun 29, 2008 17:12
FYI, here are some comments from the MATLAB newsgroup about Fortran:
(begin quote)
> I see Fortran as a language that's continually changing to
> try to keep up with more modern languages.
There is one sole reason for teaching (and learning) Fortran
these days: To be able to read and understand old code, in
order to port the algoprithms to some other language.
The fortran language as such is obsolete.
> The die-hards
> always claim that Fortran is fast because its simplicity
> makes it easier for compilers to optimise (undoutedly true
> for Fortran 66 constructs).
Not quite true. The reason Fortran is fast is that it
lacks dynamic memory management (that was added in
fortran 90 or 95, a mere 15 years ago). Everything is
easy once the memory maps are fixed at compile time.
|
| Show full article (1.98Kb) |
|
21 Comments |
|
  |
Author: EdEd
Date: Jun 29, 2008 03:05
Hello
I know that there is a bunch of threads on the subject but I don't
seem to get the rirght way of coding a specific code for my problem.
Here is the cvs dat format (too many to change format)
5,01/02/2008 15:00:00,01/02/2008 15:00:00, 29.48, 1298, 329.6
5,01/02/2008 16:00:00,01/02/2008 16:00:00, 29.38, 1265, 313.28
5,01/02/2008 17:00:00,01/02/2008 17:00:00, 28.25, 1199, 271...
|
| Show full article (3.03Kb) |
|
8 Comments |
|
  |
Author: jinolejinole
Date: Jun 28, 2008 19:54
We engaged in the development of the depth of resources,Now we need to
expand personnel.
If you are interested, we can exchange.
More information, visit: http://www.ivoivo.cn
|
| |
|
no comments
|
|
  |
Author: wimwim
Date: Jun 28, 2008 06:47
Hi all,
ifort and gfortran compile the following without complaining:
$ cat mtest.f90
module mtest
implicit none
character(len=5), parameter :: test(5) =
["tan","atan2","atan","sin","asin"]
end module mtest
Not so with g95:
$ g95 -c -o mtest.o mtest.f90
In file mtest.f90:3
character(len=5), parameter :: test(5) =
["tan","atan2","atan","sin","asin"]
1
Error: Element in character array constructor at (1) has length 5
instead of 3
|
| Show full article (0.89Kb) |
|
9 Comments |
|
  |
Author: Clay BlankenshipClay Blankenship
Date: Jun 27, 2008 13:59
I am running a very large program--an implementation of the Land
Information System--on a Linux cluster (1 processor) using Intel
Fortran 90. I am getting an overflow error with the following
message.
7200.000 3.0411966E+07 6.5823113E+10
7200.000 3.0402494E+07 6.5785352E+10
7200.000 3.0392248E+07 6.5744241E+10
7200.000 3.0386762E+07 6.5722331E+10
7200.000 ...
|
| Show full article (2.20Kb) |
|
5 Comments |
|
  |
Author: deadpickledeadpickle
Date: Jun 27, 2008 13:16
I am trying to compile a fortran 90 code (snippet):
include 'netcdf.inc'
!Open file and check for error
print *, "Open ", filename, "for NetCDF reading"
status = NF_OPEN(filename,0,ncid)
if (status /= NF_NOERR) then
print *, ' --! ERROR: Problem opening ', ADJUSTR(filename)
stop
endif
print *,"---Done"
with netcdf.inc containing:
integer nf_open
! (character*(*) path,
! integer mode,
! integer ncid)
external nf_open
On compiling I get the error:
In function `crefcell_mp_crefextract_.':
test1.f90: undefined reference to `nf_open_'
|
| Show full article (0.74Kb) |
|
2 Comments |
|
  |
|
|
  |
Author: brady.m.adamsbrady.m.adams
Date: Jun 27, 2008 09:51
I have a Fortran program that I would like to implement a GUI with. In
doing a little reading around the net it seems that I will probably
want to call a different programming language such as C++, Java, or
Python. Starting out the GUI will be really simple: something like
"You are running blah blah blah. Continue?" --- with yes and no
buttons. If things go smoothly the GUI could get considerably more
complex.
My question: is this feasible? If so what would be the best language
to do this with? I know nothing about C, C++, or Java, but I know a
little Python. Or is there something else that would be better? Are
there any good books or online references on interfacing two different
languages (one of which being Fortran)?
Thank you!
|
| |
|
8 Comments |
|
|
|
|
|
|