source: palm/trunk/SOURCE/cuda_fft_interfaces.f90 @ 4432

Last change on this file since 4432 was 4360, checked in by suehring, 5 years ago

Bugfix in output of time-averaged plant-canopy quanities; Output of plant-canopy data only where tall canopy is defined; land-surface model: fix wrong location strings; tests: update urban test case; all source code files: copyright update

  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1!> @file cuda_fft_interfaces.f90
2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
16! Copyright 1997-2020 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21!
22!
23! Former revisions:
24! -----------------
25! $Id: cuda_fft_interfaces.f90 4360 2020-01-07 11:25:50Z raasch $
26! Corrected "Former revisions" section
27!
28! 3655 2019-01-07 16:51:22Z knoop
29! 1683 2015-10-07 23:57:51Z knoop
30!
31!
32! Description:
33! ------------
34!> FORTRAN interfaces for the CUDA fft
35!> Routines for the fft along x and y (forward/backward) using the CUDA fft
36!--------------------------------------------------------------------------------!
37 MODULE cuda_fft_interfaces
38 
39
40#if defined ( __cuda_fft )
41
42    USE kinds
43
44    INTEGER(iwp) ::  CUFFT_FORWARD = -1   !<
45    INTEGER(iwp) ::  CUFFT_INVERSE =  1   !<
46    INTEGER(iwp) ::  CUFFT_R2C = Z'2a'    !< Real to Complex (interleaved)
47    INTEGER(iwp) ::  CUFFT_C2R = Z'2c'    !< Complex (interleaved) to Real
48    INTEGER(iwp) ::  CUFFT_C2C = Z'29'    !< Complex to Complex, interleaved
49    INTEGER(iwp) ::  CUFFT_D2Z = Z'6a'    !< Double to Double-Complex
50    INTEGER(iwp) ::  CUFFT_Z2D = Z'6c'    !< Double-Complex to Double
51    INTEGER(iwp) ::  CUFFT_Z2Z = Z'69'    !< Double-Complex to Double-Complex
52
53    PUBLIC
54
55
56!
57!-- cufftPlan1d( cufftHandle *plan, int nx, cufftType type, int batch )
58    INTERFACE CUFFTPLAN1D
59
60!------------------------------------------------------------------------------!
61! Description:
62! ------------
63!> @todo Missing subroutine description.
64!------------------------------------------------------------------------------!
65       SUBROUTINE CUFFTPLAN1D( plan, nx, type, batch ) bind( C, name='cufftPlan1d' )
66
67          USE ISO_C_BINDING
68
69          INTEGER(C_INT)        ::  plan   !<
70          INTEGER(C_INT), value ::  batch  !<
71          INTEGER(C_INT), value ::  nx     !<
72          INTEGER(C_INT), value ::  type   !<
73       END SUBROUTINE CUFFTPLAN1D
74
75    END INTERFACE CUFFTPLAN1D
76
77!
78!-- cufftDestroy( cufftHandle plan )  !!! remove later if not really needed !!!
79    INTERFACE CUFFTDESTROY
80
81!------------------------------------------------------------------------------!
82! Description:
83! ------------
84!> @todo Missing subroutine description.
85!------------------------------------------------------------------------------!
86       SUBROUTINE CUFFTDESTROY( plan ) bind( C, name='cufftDestroy' )
87
88          USE ISO_C_BINDING
89
90          INTEGER(C_INT), VALUE ::  plan
91
92       END SUBROUTINE CUFFTDESTROY
93
94    END INTERFACE CUFFTDESTROY
95
96
97    INTERFACE CUFFTEXECZ2D
98
99!------------------------------------------------------------------------------!
100! Description:
101! ------------
102!> @todo Missing subroutine description.
103!------------------------------------------------------------------------------!
104       SUBROUTINE CUFFTEXECZ2D( plan, idata, odata ) bind( C, name='cufftExecZ2D' )
105
106          USE ISO_C_BINDING
107          USE kinds
108
109          INTEGER(C_INT), VALUE ::  plan          !<
110          COMPLEX(dp), DEVICE   ::  idata(:,:,:)  !<
111          REAL(dp), DEVICE      ::  odata(:,:,:)  !<
112
113       END SUBROUTINE CUFFTEXECZ2D
114
115    END INTERFACE CUFFTEXECZ2D
116
117
118    INTERFACE CUFFTEXECD2Z
119
120!------------------------------------------------------------------------------!
121! Description:
122! ------------
123!> @todo Missing subroutine description.
124!------------------------------------------------------------------------------!
125       SUBROUTINE CUFFTEXECD2Z( plan, idata, odata ) bind( C, name='cufftExecD2Z' )
126
127          USE ISO_C_BINDING
128         
129          USE kinds
130
131          INTEGER(C_INT), VALUE ::  plan          !<
132          REAL(dp), DEVICE      ::  idata(:,:,:)  !<
133          COMPLEX(dp), DEVICE   ::  odata(:,:,:)  !<
134
135       END SUBROUTINE CUFFTEXECD2Z
136
137    END INTERFACE CUFFTEXECD2Z
138
139#else
140
141    INTERFACE CUFFTdummy
142
143!------------------------------------------------------------------------------!
144! Description:
145! ------------
146!> Dummy interface to avoid compiler warnings in case of no bublic objects
147!> declared.
148!------------------------------------------------------------------------------!
149       SUBROUTINE CUFFTdummy( dummy )
150       
151          USE kinds
152
153          REAL(wp) ::  dummy  !<
154
155       END SUBROUTINE CUFFTdummy
156
157    END INTERFACE CUFFTdummy
158
159#endif
160
161 END MODULE cuda_fft_interfaces
Note: See TracBrowser for help on using the repository browser.