forked from NOAA-PSL/stochastic_physics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
get_lats_node_a_stochy.f
93 lines (88 loc) · 2.54 KB
/
get_lats_node_a_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
!>@brief The module 'get_lats_node_a_stochy_mod' contains the subroutine get_lats_node_a_stochy
module get_lats_node_a_stochy_mod
implicit none
contains
!>@brief The subroutine 'get_lats_node_a_stochy' calculates the decomposition of the gaussian grid based on the processor layout
!>@details This code is taken from the legacy spectral GFS
subroutine get_lats_node_a_stochy(me_fake,global_lats_a,
& lats_nodes_a_fake,gl_lats_index,
& global_time_sort_index,iprint)
cc
use spectral_layout_mod
implicit none
cc
integer gl_lats_index,gl_start
integer me_fake
integer global_lats_a(latg)
integer lats_nodes_a_fake
integer iprint
cc
integer ijk
integer jptlats
integer lat
integer node,nodesio
integer global_time_sort_index(latg)
integer nodes_tmp
cc
c
!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
!!
cc
lat = 1
nodes_tmp = nodes
!jw if (liope .and. icolor .eq. 2) nodes_tmp = nodes -1
gl_start = gl_lats_index
cc.............................................
do ijk=1,latg
cc
do node=1,nodes_tmp
if (node.eq.me_fake+1) then
gl_lats_index=gl_lats_index+1
global_lats_a(gl_lats_index) = global_time_sort_index(lat)
endif
lat = lat + 1
if (lat .gt. latg) go to 200
enddo
cc
do node=nodes_tmp,1,-1
if (node.eq.me_fake+1) then
gl_lats_index=gl_lats_index+1
global_lats_a(gl_lats_index) = global_time_sort_index(lat)
endif
lat = lat + 1
if (lat .gt. latg) go to 200
enddo
cc
enddo
cc.............................................
cc
200 continue
cc
cc.............................................
cc
!jw if (liope .and. icolor .eq. 2) gl_start = 0
do node=1,nodes_tmp
if (node.eq.me_fake+1) then
lats_nodes_a_fake=gl_lats_index-gl_start
c$$$ print*,' setting lats_nodes_a_fake = ',
c$$$ . lats_nodes_a_fake
endif
enddo
if(iprint.eq.1) print 220
220 format ('completed loop 200 in get_lats_a ')
c
if(iprint.eq.1)
& print*,'completed get_lats_node, lats_nodes_a_fake=',
& lats_nodes_a_fake
cc
return
end
end module get_lats_node_a_stochy_mod