- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:\Codice\IterSolver_v14x1\MGM.F90 902
Is there anything I can do?
Alessandro
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:\Codice\IterSolver_v14x1\MGM.F90 902
Is there anything I can do?
Alessandro
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Alessandro
Hi,
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:CodiceIterSolver_v14x1MGM.F90 902
Is there anything I can do?
Alessandro
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:CodiceIterSolver_v14x1MGM.F90 902
Is there anything I can do?
Alessandro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Andrew Smith
I dont know what transfer_c does but if it similar to the Fortran transfer function then it would not be suitable. Why not try: dv_Gfft = G_fft
It's a wrapper for CUDA, dv_Gfft is more like a struct, and transfer_c deals with the transfer of the data into the variable of the device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Alessandro
It's a wrapper for CUDA, dv_Gfft is more like a struct, and transfer_c deals with the transfer of the data into the variable of the device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I understand you correctly, the code compiles if kvar ist set to sgl. As the value of kvar has to be known at compile time anyway, the simplest solution seems to be to use conditional compilation:
#ifdef SGLPREC
call transfer_c(G_fft,dv_Gfft,.true.)
#endif
You could define your parameter kvar like this:
#ifdef SGLPREC
call transfer_c(G_fft,dv_Gfft,.true.)
#endif
You could define your parameter kvar like this:
integer, parameter :: kvar = sgl
#else
integer, parameter :: kvar = dbl
#endif
To compile the program with single precision:
ifort -fpp -DSGLPREC [...]
and with double precision:
ifort -fpp [...]

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page