79 use dc_message
, only: messagenotify
80 use dc_types
, only: dp
81 use spml_utils
, only: pi
102 real(DP),
allocatable ::
g_x(:)
106 integer(8) :: im = 32
107 integer(8) :: km = 10
108 real(DP) :: xl = 1.0d0
109 integer(8),
allocatable :: it(:)
110 real(DP),
allocatable :: t(:)
123 integer,
intent(in) :: i
125 integer,
intent(in) :: k
127 real(DP),
intent(in) :: xmin
129 real(DP),
intent(in) :: xmax
136 if ( im <= 0 .or. km <= 0 )
then 137 call messagenotify(
'E',
'ae_Initial', &
138 'Number of grid points and waves should be positive')
139 elseif ( mod(im,2_8) /= 0 )
then 140 call messagenotify(
'E',
'ae_Initial', &
141 'Number of grid points should be even')
142 elseif ( km > im/2 )
then 143 call messagenotify(
'E',
'ae_Initial', &
144 'KM shoud be less equal to IM/2')
147 allocate(it(im/2),t(im*3/2))
151 allocate(
g_x(0:im-1))
153 g_x(ii) = xmin + (xl/im)*ii
160 'M',
'ae_initial',
'ae_module (2019/09/17) is initialized')
177 real(DP),
dimension(:,-km:),
intent(in) :: ae
179 real(DP),
dimension(size(ae,1),0:im-1) :: ag_ae
184 if (
size(ae,2) < 2*km+1 )
then 185 call messagenotify(
'E',
'ag_ae', &
186 'The Fourier dimension of input data too small.')
187 elseif (
size(ae,2) > 2*km+1 )
then 188 call messagenotify(
'W',
'ag_ae', &
189 'The Fourier dimension of input data too large.')
194 do k=1,min(km,im/2-1)
195 ag_ae(:,2*k) = ae(:,k)
196 ag_ae(:,2*k+1) = ae(:,-k)
198 if ( km == im/2 )
then 199 ag_ae(:,1) = ae(:,km)
202 call fxrtba(nm,im,ag_ae,it,t)
218 real(DP),
dimension(-km:km),
intent(in) :: e
220 real(DP),
dimension(0:im-1) :: g_e
222 real(DP),
dimension(1,size(e)) :: ae_work
223 real(DP),
dimension(1,0:im-1) :: ag_work
226 ag_work =
ag_ae(ae_work)
246 real(DP),
dimension(:,:),
intent(in) :: ag
248 real(DP),
dimension(size(ag,1),-km:km) :: ae_ag
250 real(DP),
dimension(size(ag,1),0:im-1) :: ag_work
254 if (
size(ag,2) < im )
then 255 call messagenotify(
'E',
'ae_ag', &
256 'The Grid points of input data too small.')
257 elseif (
size(ag,2) > im )
then 258 call messagenotify(
'W',
'ae_ag', &
259 'The Grid points of input data too large.')
263 call fxrtfa(nm,im,ag_work,it,t)
265 do k=1,min(km,im/2-1)
266 ae_ag(:, k) = ag_work(:,2*k)
267 ae_ag(:,-k) = ag_work(:,2*k+1)
269 ae_ag(:,0) = ag_work(:,0)
270 if ( km == im/2 )
then 271 ae_ag(:,km) = ag_work(:,1)
291 real(DP),
dimension(0:im-1),
intent(in) :: g
293 real(DP),
dimension(-km:km) :: e_g
295 real(DP),
dimension(1,size(g)) :: ag_work
296 real(DP),
dimension(1,-km:km) :: ae_work
299 ae_work =
ae_ag(ag_work)
311 real(DP),
dimension(:,-km:),
intent(in) :: ae
313 real(DP),
dimension(size(ae,1),-km:km) :: ae_dx_ae
317 if (
size(ae,2) < 2*km+1 )
then 318 call messagenotify(
'W',
'ae_Dx_ae', &
319 'The Fourier dimension of input data too small.')
320 elseif (
size(ae,2) > 2*km+1 )
then 321 call messagenotify(
'W',
'ae_Dx_ae', &
322 'The Fourier dimension of input data too large.')
326 ae_dx_ae(:,k) = -(2*pi*k/xl)*ae(:,-k)
337 real(DP),
dimension(-km:km),
intent(in) :: e
339 real(DP),
dimension(-km:km) :: e_Dx_e
341 real(DP),
dimension(1,-km:km) :: ae_work
345 e_dx_e = ae_work(1,:)
353 real(DP),
dimension(:,0:),
intent(in) :: ag
355 real(DP),
dimension(size(ag,1)) :: a_Int_ag
359 if (
size(ag,2) < im )
then 360 call messagenotify(
'E',
'ae_Int_ag', &
361 'The Grid points of input data too small.')
362 elseif (
size(ag,2) > im )
then 363 call messagenotify(
'W',
'ae_Int_ag', &
364 'The Grid points of input data too large.')
369 a_int_ag(:) = a_int_ag(:) + ag(:,i)*
g_x_weight(i)
377 real(DP),
dimension(0:im-1),
intent(in) :: g
389 real(DP),
dimension(:,0:),
intent(in) :: ag
391 real(DP),
dimension(size(ag,1)) :: a_Avr_ag
401 real(DP),
dimension(0:im-1),
intent(in) :: g
413 real(DP),
dimension(-km:km),
intent(IN) :: e_data
415 real(DP),
intent(in) :: xval
417 real(DP) :: Interpolate_e
421 interpolate_e = e_data(0)
423 interpolate_e = interpolate_e &
424 & + 2.0d0 * ( e_data(k) * cos(2*pi*k/xl*xval) &
425 & - e_data(-k) * sin(2*pi*k/xl*xval) )
434 real(DP),
dimension(:,-km:),
intent(IN) :: ae_data
436 real(DP),
intent(in) :: xval
438 real(DP),
dimension(size(ae_data,1)) :: a_Interpolate_ae
442 a_interpolate_ae = ae_data(:,0)
445 a_interpolate_ae = a_interpolate_ae &
446 & + 2.0d0 * ( ae_data(:,k) * cos(2*pi*k/xl*xval) &
447 & - ae_data(:,-k) * sin(2*pi*k/xl*xval) )
real(dp) function, dimension(size(ag, 1)), public a_avr_ag(ag)
1 次元格子点データが並んだ 2 次元配列の平均
real(dp) function, dimension(size(ae, 1), 0:im-1), public ag_ae(ae)
スペクトルデータから格子点データへ逆変換する(2 次元データ用)
real(dp), dimension(:), allocatable, save, public g_x_weight
重み座標を格納した 1 次元配列. X方向の格子点の間隔が格納してある.
real(dp) function, dimension(-km:km), public e_g(g)
格子点データからスペクトルデータへ正変換する(1 次元データ用)
real(dp) function, dimension(0:im-1), public g_e(e)
スペクトルデータから格子点データへ逆変換する(1 次元データ用)
real(dp) function, dimension(size(ag, 1),-km:km), public ae_ag(ag)
格子点データからスペクトルデータへ正変換する(2 次元データ用)
real(dp) function, public avr_g(g)
1 次元格子点データの平均
subroutine, public ae_initial(i, k, xmin, xmax)
スペクトル変換の格子点数, 波数, 領域の大きさを設定する.
real(dp) function, public interpolate_e(e_data, xval)
補間計算(1次元)
real(dp) function, dimension(size(ae_data, 1)), public a_interpolate_ae(ae_data, xval)
補間計算(2次元)
real(dp) function, dimension(-km:km), public e_dx_e(e)
入力スペクトルデータに X 微分を作用する(1 次元データ).
real(dp) function, public int_g(g)
1 次元格子点データの積分
real(dp), dimension(:), allocatable, save, public g_x
格子点座標(X)を格納した1次元配列.
real(dp) function, dimension(size(ag, 1)), public a_int_ag(ag)
1 次元格子点データが並んだ 2 次元配列の積分
real(dp) function, dimension(size(ae, 1),-km:km), public ae_dx_ae(ae)
入力スペクトルデータに X 微分を作用する(2 次元データ).