forked from NOAA-PSL/stochastic_physics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
get_ls_node_stochy.f
84 lines (77 loc) · 2.05 KB
/
get_ls_node_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
!>@brief The module 'get_ls_node_stochy_mod' contains the subroutine get_ls_node_stochy
module get_ls_node_stochy_mod
implicit none
contains
!>@brief The subroutine 'get_ls_node_stochy' calculates the decomposition of the spherical harmonics based on the processor layout
subroutine get_ls_node_stochy(me_fake,ls_node,ls_max_node_fake,
c iprint)
!>@details This code is taken from the legacy spectral GFS
!
use spectral_layout_mod
implicit none
!
integer me_fake, ls_max_node_fake, iprint
integer ls_node(ls_dim)
integer ijk, jptls, l, node, nodesio, jcap1
!
!jw if (liope) then
!jw if (icolor.eq.2) then
!jw nodesio=1
!jw else
nodesio = nodes
!jw endif
!jw else
!jw nodesio=nodes
!jw endif
!!
ls_node = -1
jcap1=jcap+1
!
jptls = 0
l = 0
!.............................................
do ijk=1,jcap1
!
do node=1,nodesio
if (node == me_fake+1) then
jptls = jptls + 1
ls_node(jptls) = l
endif
l = l + 1
if (l > jcap) go to 200
enddo
!
do node=nodesio,1,-1
if (node == me_fake+1) then
jptls = jptls + 1
ls_node(jptls) = l
endif
l = l + 1
if (l > jcap) go to 200
enddo
!
enddo
!.............................................
!
200 continue
!
!.............................................
!
if(iprint == 1) print *, 'completed loop 200 in get_ls_node'
ls_max_node_fake = 0
do ijk=1,ls_dim
if(ls_node(ijk) >= 0) then
ls_max_node_fake = ijk
if(iprint == 1)
& print 230, me_fake, ijk, ls_node(ijk)
endif
230 format ('me_fake=',i5,' get_ls_node ls_node(', i5, ')=',i5)
enddo
!
if(iprint == 1)
& print*,'completed get_ls_node, ls_max_node_fake=',
& ls_max_node_fake
!
return
end
end module get_ls_node_stochy_mod