forked from NOAA-PSL/stochastic_physics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
four_to_grid_stochy.F
54 lines (43 loc) · 1.79 KB
/
four_to_grid_stochy.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
!>@brief The module 'four_to_grid_mod' contains the subroute four_to_grid
module four_to_grid_mod
implicit none
contains
!>@brief The subroutine 'four_to_grd' calculate real values form fourrier coefficients
!>@details This code is taken from the legacy spectral GFS
subroutine four_to_grid(syn_gr_a_1,syn_gr_a_2,
& lon_dim_coef,lon_dim_grid,lons_lat,lot)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
use kinddef
implicit none
!!
real(kind=kind_dbl_prec) syn_gr_a_1(lon_dim_coef,lot)
real(kind=kind_dbl_prec) syn_gr_a_2(lon_dim_grid,lot)
integer lon_dim_coef
integer lon_dim_grid
integer lons_lat
integer lot
!________________________________________________________
real(kind=kind_dbl_prec) aux1crs(44002)
real(kind=kind_dbl_prec) scale_ibm
integer ibmsign
integer init
!________________________________________________________
init = 1
ibmsign = -1
scale_ibm = 1.0d0
call dcrft_stochy(init,
& syn_gr_a_1(1,1) ,lon_dim_coef/2,
& syn_gr_a_2(1,1) ,lon_dim_grid,
& lons_lat,lot,ibmsign,scale_ibm,
& aux1crs,22000,
& aux1crs(22001),20000)
init = 0
call dcrft_stochy(init,
& syn_gr_a_1(1,1) ,lon_dim_coef/2,
& syn_gr_a_2(1,1) ,lon_dim_grid,
& lons_lat,lot,ibmsign,scale_ibm,
& aux1crs,22000,
& aux1crs(22001),20000)
return
end
end module four_to_grid_mod