|
|
Up |
|
|
  |
Author: analyst41analyst41
Date: May 18, 2008 12:03
I want to replace every occurrence of a dash in a string by a space.
Surely this can be done with a one-liner?
Thanks for any responses.
|
| |
|
| |
110 Comments |
|
  |
Author: SidSid
Date: May 18, 2008 03:00
Hi,
I am trying to create a .so file from a fortran 90 program in order to
call it from an IDL program. Could someone please tell me the correct
compiler options to do this?
My apologies if this is very trivial...I program in IDL, so have no
idea how this is done.
Best,
Sid
|
| |
|
| |
2 Comments |
|
  |
Author: James Van BuskirkJames Van Buskirk
Date: May 18, 2008 02:36
Consider the following sequence of events:
C:\gfortran\test\dprod>type dprod_test1.f90
program dprod_test
implicit none
integer, parameter :: sp = selected_real_kind(6,30)
integer, parameter :: dp = selected_real_kind(15,300)
real(sp) x
real(sp) y
intrinsic dprod
x = 3.14
y = 2.86
write(*,*) kind(x), kind(y), kind(dprod(x,y))
write(*,*) dprod(x,y)
call sub(dprod)
end program dprod_test
|
| Show full article (3.10Kb) |
|
2 Comments |
|
  |
Author: BammBamm
Date: May 18, 2008 01:39
Finally my fortran class is over! That means no more g77 for me.
Yay! :)
|
| |
|
5 Comments |
|
  |
Author: braamsbraams
Date: May 17, 2008 13:34
I wonder if anyone can share experience about code that takes
exceptionally long to compile with Ifort -- what sort of code
structure might be the cause? The code with which I have this problem
is a library of fortran-95 modules. I developed it mainly on a Sun
system using the Sun fortran compiler. When the library was smaller I
found compilation using Ifort to be quite a bit faster than that using
Sun Fortran, but now it takes maybe 10 or 20 times longer using Ifort
than using either Sun Fortran or the Pathscale compiler. Perhaps the
culprit is my rather deep nesting of module "use" statements, but I
don't know this for sure and I don't know how to test the conjecture
on smaller examples -- on smaller code the problem isn't visible. I'm
not above restructuring my code to see it compile...
|
| Show full article (1.15Kb) |
|
10 Comments |
|
  |
Author: JohnJohn
Date: May 16, 2008 18:34
Hi,
I've written a small file copy routine for text files. The problem I
have is that sometimes the final of the line is copied twice and
sometimes only once. I can't quite figure out why the final line is
being copied inconsistently. Usually, it is copied twice however, which
is preferable to having the final line not copied. Can anyone spot the
problem, or is it just one of those problems I have to live with?
Any other comments on improving my subroutine are welcome also.
Thanks,
John
module copy_file
implicit none
contains
!=======================================================================
subroutine copy(oname,nname,max_line_length)
implicit none
character (len=*), intent(in) :: oname
character (len=*), intent(in) :: nname
integer, intent(in) :: max_line_length
|
| Show full article (2.97Kb) |
|
38 Comments |
|
  |
Author: louisJlouisJ
Date: May 16, 2008 06:09
Hi
I compile my code with g95.
I write in a file a variable that has been set to 0.
and when I open the file I see 0.232699336-309 (yes, without the
'E') instead of the expected 0.000000000E+00.
For information, when I compile with ifort I don't have this error.
This is free fortran format. On a 64bit machine.
Any idea how to avoid this, i.e. write the expected 0.000000000E+00
or 0.232699336E-309 (with the 'E') ?
|
| |
|
18 Comments |
|
  |
Author: James Van BuskirkJames Van Buskirk
Date: May 16, 2008 02:24
C:\gfortran\james\intrinsics\func1>type abs.f90
program abstest
complex(10) c10
c10 = ( 1.7951958020513104220_10, 2.6457513110645905904_10 )
write(*,*) 'Alive to here'
write(*,*) abs(c10)
write(*,*) 'Survived the ordeal'
end program abstest
C:\gfortran\james\intrinsics\func1>gfortran abs.f90 -oabs
C:\gfortran\james\intrinsics\func1>abs
Alive to here
C:\gfortran\james\intrinsics\func1>
--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
|
| |
|
16 Comments |
|
  |
Author: James Van BuskirkJames Van Buskirk
Date: May 16, 2008 01:19
I found that gfortran is missing the KIND optional argument in some
of the transformational intrinsics. Also a couple of usages of KIND
were not documented, and gfortran does not yet accept f2008 usage for
the SIZE intrinsic.
C:\gfortran\james\intrinsics\func1>type kind.f90
program test
implicit none
integer, parameter :: ck = kind('A')
integer, parameter :: ik = selected_int_kind(18)
integer i
real x
integer array(1)
i = 42
x = 3.14
array = 13
|
| Show full article (1.76Kb) |
|
16 Comments |
|
  |
|
|
  |
Author: James Van BuskirkJames Van Buskirk
Date: May 16, 2008 01:15
I found some places where the gfortran manual had keyword arguments
inconsistent with standard. In all cases the actual compiler agreed
with the standard rather than gfortran documentation:
C:\gfortran\james\intrinsics\func1>type names.f90
program names
implicit none
integer i
real x
complex z
logical L
|
| Show full article (1.13Kb) |
|
3 Comments |
|
|
|
|
|
|