View previous topic :: View next topic |
Author |
Message |
jnp
Joined: 16 Jul 2007 Posts: 2
|
Posted: Tue Jul 17, 2007 12:39 pm Post subject: Problems using f77 code in Plato |
|
|
Hi,
I have recently downloaded FTN95PE (and Plato 3.50), as I was looking for a Fortran compiler for Windows 2000.
I have done some tests using old programs which I have compiled and run before on Windows (using g95) and on Linux (using pgf90) without problems. However, using FTN95 and building a project using Plato I get problems. I have not changed any of the standard settings in Plato (at least I hope so…).
The problem occurs when I try to use the standard Fast-Fourier-Transform routine dcfftb.f (downloaded from http://gams.nist.gov/serve.cgi/ModuleComponent/5683/Fullsource/ITL/dcfftb.f and put in a separate file).
Using the program below I get the following error message:
--------------------------------------------------------------------------
Runtime error from program:c:\ …\win32\testdcfftb.exe
Run-time Error
Attempt to call a routine with argument number three as a real(kind=2) when an integer(kind=3) was required
DCFTI1 - in file dcfftb.f at line 398 [+008a]
DCFFTI - in file dcfftb.f at line 116 [+0181]
HILBERTFFTINSTALL - in file testdcfftb.f90 at line 28 [+0153]
main - in file testdcfftb.f90 at line 16 [+0041]
--------------------------------------------------------------------------
It seems to an internal call in ‘DCFFTB’ which causes the problems.
Does it matter that the ‘DCFFTB’-code is written in F77?
I hope that someone can tell what I am doing wrong.
Thanks for any help I can get!
Best regards,
Jonas
------- Here is the program -------
! Test of FFT-routine dcfftb.f from
! "http://gams.nist.gov/serve.cgi/ModuleComponent/5683/Fullsource/ITL/dcfftb.f"
MODULE ModHilbertFFT
INTEGER :: NLength,NHilbertFFT
REAL(KIND(0.0D0)), DIMENSION(, allocatable :: WhilbertFFT
END MODULE ModHilbertFFT
program testDCFFTB !**********************************
USE ModHilbertFFT
IMPLICIT none
INTEGER ESTEP
ESTEP = 2**12
CALL HilbertFFTInstall(ESTEP) !**********************************
END testDCFFTB
SUBROUTINE HilbertFftInstall(N) !**********************************
USE ModHilbertFft
IMPLICIT NONE
INTEGER, INTENT(IN):: N
Nlength = N
NHilbertFft = 2*N
ALLOCATE(WhilbertFft(4*NHilbertFft+15))
CALL DCFFTI(NHilbertFft,WHilbertFft)
END SUBROUTINE HilbertFftInstall !*********************************
! put the file 'dcfftb.f' from
! http://gams.nist.gov/serve.cgi/ModuleComponent/5683/Fullsource/ITL/dcfftb.f
! into the project. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Tue Jul 17, 2007 12:56 pm Post subject: |
|
|
You can use Fortran 77.
There is a bug in dcfftb.f exactly as described.
The call is
CALL DCFTI1 (N,WSAVE(IW1),WSAVE(IW2))
and the definition is
SUBROUTINE DCFTI1(N,WA,IFAC)
The third argument is double precision in the call and default integer in the definition. |
|
Back to top |
|
|
jnp
Joined: 16 Jul 2007 Posts: 2
|
Posted: Tue Jul 17, 2007 1:39 pm Post subject: |
|
|
Thanks a lot for the very quick reply!
I do not see how I can use F77, as some of the program parts are using modules etc?!
Maybe I can try to fix the subroutine ‘dcfftb.f’ - I naively expected that these old subroutines did not contain that kind of errors .
I also still find it very strange that the other compilers I have used did not give any error/warning messages.
Jonas. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed Jul 18, 2007 6:31 am Post subject: |
|
|
I misunderstood your question. You cannot use a Fortran 77 compiler to compile Fortran 90 code.
The ability of FTN95 to do runtime checking may be unique, at least for some of the checks. |
|
Back to top |
|
|
|