forked from NOAA-PSL/stochastic_physics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
epslon_stochy.f
95 lines (90 loc) · 2.27 KB
/
epslon_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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
!>@brief The module 'epslon_stochy_mod' contains the subroute epslon_stochy
module epslon_stochy_mod
implicit none
contains
!>@brief The subroutine 'epslon_stochy' calculate coeffients for use in spectral space
!>@details This code is taken from the legacy spectral GFS
subroutine epslon_stochy(epse,epso,epsedn,epsodn,
& ls_node)
cc
use spectral_layout_mod
use kinddef
implicit none
cc
real(kind_dbl_prec) epse(len_trie_ls)
real(kind_dbl_prec) epso(len_trio_ls)
cc
real(kind_dbl_prec) epsedn(len_trie_ls)
real(kind_dbl_prec) epsodn(len_trio_ls)
cc
integer ls_node(ls_dim,3)
cc
!cmr ls_node(1,1) ... ls_node(ls_max_node,1) : values of L
!cmr ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev
!cmr ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod
cc
integer l,locl,n
cc
integer indev
integer indod
cc
real(kind_dbl_prec) f1,f2,rn,val
cc
real(kind_dbl_prec) cons0 !constant
cc
integer indlsev,jbasev
integer indlsod,jbasod
cc
include 'function2'
cc
cc
cons0=0.0d0 !constant
cc
cc
cc......................................................................
cc
cc
do locl=1,ls_max_node
l=ls_node(locl,1)
jbasev=ls_node(locl,2)
indev=indlsev(l,l)
epse (indev)=cons0 !constant
epsedn(indev)=cons0 !constant
indev=indev+1
cc
do n=l+2,jcap+1,2
rn=n
f1=n*n-l*l
f2=4*n*n-1
val=sqrt(f1/f2)
epse (indev)=val
epsedn(indev)=val/rn
indev=indev+1
enddo
cc
enddo
cc
cc
cc......................................................................
cc
cc
do locl=1,ls_max_node
l=ls_node(locl,1)
jbasod=ls_node(locl,3)
indod=indlsod(l+1,l)
cc
do n=l+1,jcap+1,2
rn=n
f1=n*n-l*l
f2=4*n*n-1
val=sqrt(f1/f2)
epso (indod)=val
epsodn(indod)=val/rn
indod=indod+1
enddo
cc
enddo
cc
return
end
end module epslon_stochy_mod