Skip to content

Commit 466668f

Browse files
committed
Remove radial_4_sph_trans
1 parent 06ceb96 commit 466668f

File tree

6 files changed

+112
-104
lines changed

6 files changed

+112
-104
lines changed

src/Fortran_libraries/MHD_src/sph_MHD/cal_energy_flux_rtp.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ subroutine cal_magnetic_fluxes_rtp &
214214
if(fe_trns_frc%i_mag_stretch .gt. 0) then
215215
call cal_rtp_magnetic_streach &
216216
& (sph_rtp%nnod_rtp, sph_rtp%nidx_rtp(1), sph_rtp%nidx_rtp(2), &
217-
& sph_rtp%a_r_1d_rtp_r, sph_rtp%cot_theta_1d_rtp, &
217+
& sph_rtp%ar_1d_rtp, sph_rtp%cot_theta_1d_rtp, &
218218
& trns_b_snap%fld_rtp(1,bs_trns_base%i_magne), &
219219
& trns_b_snap%fld_rtp(1,bs_trns_base%i_velo), &
220220
& trns_b_difv%fld_rtp(1,bs_trns_diff_v%i_grad_vx), &

src/Fortran_libraries/PARALLEL_src/CONST_SPH_GRID/copy_sph_1d_global_index.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ subroutine copy_sph_1d_gl_idx_rtp &
7373
j = sph_rtp%idx_gl_1d_rtp_r(i)
7474
sph_rtp%radius_1d_rtp_r(i) = s3d_radius%radius_1d_gl(j)
7575
end do
76+
call set_sph_one_over_radius_rtp(sph_rtp)
7677
!
7778
do i = 1, sph_rtp%nidx_rtp(2)
7879
j = i - 1 + sph_rtp%ist_rtp(2)

src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_sph_trans.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ subroutine initialize_legendre_trans &
114114
call alloc_work_4_sph_trans &
115115
& (sph%sph_rtm%nidx_rtm, sph%sph_rlm%nidx_rlm, idx_trns)
116116
!
117-
call radial_4_sph_trans(sph%sph_rtp)
118117
call set_mdx_rlm_rtm(sph%sph_params%l_truncation, &
119118
& sph%sph_rtm%nidx_rtm, sph%sph_rlm%nidx_rlm, &
120119
& sph%sph_rtm%idx_gl_1d_rtm_m, sph%sph_rlm%idx_gl_1d_rlm_j, &

src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/set_params_sph_trans.f90

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
!! & (nidx_rtm, idx_gl_1d_mphi, mn_rlm)
2424
!! subroutine set_sin_theta_rtm &
2525
!! & (nth_rtm, g_colat_rtm, asin_theta_1d_rtm)
26-
!! subroutine radial_4_sph_trans(sph_rtp, sph_rtm)
27-
!! type(sph_rtp_grid), intent(inout) :: sph_rtp
28-
!! type(sph_rtm_grid), intent(inout) :: sph_rtm
2926
!!@endverbatim
3027
!
3128
module set_params_sph_trans
@@ -241,22 +238,5 @@ subroutine set_sin_theta_rtp &
241238
end subroutine set_sin_theta_rtp
242239
!
243240
! -----------------------------------------------------------------------
244-
! -----------------------------------------------------------------------
245-
!
246-
subroutine radial_4_sph_trans(sph_rtp)
247-
!
248-
use t_spheric_parameter
249-
!
250-
type(sph_rtp_grid), intent(inout) :: sph_rtp
251-
!
252-
!
253-
!$omp parallel workshare
254-
sph_rtp%a_r_1d_rtp_r(1:sph_rtp%nidx_rtp(1)) &
255-
& = one / sph_rtp%radius_1d_rtp_r(1:sph_rtp%nidx_rtp(1))
256-
!$omp end parallel workshare
257-
!
258-
end subroutine radial_4_sph_trans
259-
!
260-
! -----------------------------------------------------------------------
261241
!
262242
end module set_params_sph_trans

src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/copy_sph_rtp_node_4_IO.f90

Lines changed: 88 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
!>@brief Copy sphectr indices structure between IO buffer
88
!!
99
!!@verbatim
10-
!! subroutine copy_sph_node_4_rtp_from_IO(sph_IO, rtp, l_truncation)
10+
!! subroutine copy_sph_node_4_rtp_from_IO(sph_IO, sph_rtp, &
11+
!! & l_truncation)
1112
!! integer(kind = kint), intent(inout) :: l_truncation
12-
!! type(sph_rtp_grid), intent(inout) :: rtp
13+
!! type(sph_rtp_grid), intent(inout) :: sph_rtp
1314
!! type(sph_IO_data), intent(in) :: sph_IO
14-
!! subroutine copy_sph_node_4_rtp_to_IO(l_truncation, rtp, sph_IO)
15+
!! subroutine copy_sph_node_4_rtp_to_IO(l_truncation, sph_rtp, &
16+
!! & sph_IO)
1517
!! integer(kind = kint), intent(in) :: l_truncation
16-
!! type(sph_rtp_grid), intent(in) :: rtp
18+
!! type(sph_rtp_grid), intent(in) :: sph_rtp
1719
!! type(sph_IO_data), intent(inout) :: sph_IO
1820
!!
1921
!! integer(kind = kint) function compare_sph_rtp_node_with_IO &
20-
!! & (l_truncation, rtp, sph_IO)
21-
!! type(sph_rtp_grid), intent(in) :: rtp
22+
!! & (l_truncation, sph_rtp, sph_IO)
23+
!! type(sph_rtp_grid), intent(in) :: sph_rtp
2224
!! type(sph_IO_data), intent(in) :: sph_IO
2325
!!@endverbatim
2426
!
@@ -38,119 +40,122 @@ module copy_sph_rtp_node_4_IO
3840
!
3941
! ----------------------------------------------------------------------
4042
!
41-
subroutine copy_sph_node_4_rtp_from_IO(sph_IO, rtp, l_truncation)
43+
subroutine copy_sph_node_4_rtp_from_IO(sph_IO, sph_rtp, &
44+
& l_truncation)
4245
!
4346
integer(kind = kint), intent(inout) :: l_truncation
44-
type(sph_rtp_grid), intent(inout) :: rtp
47+
type(sph_rtp_grid), intent(inout) :: sph_rtp
4548
type(sph_IO_data), intent(in) :: sph_IO
4649
!
4750
integer(kind = kint) :: i
4851
!
49-
rtp%irank_sph_rtp(1:ithree) = sph_IO%sph_rank(1:ithree)
52+
sph_rtp%irank_sph_rtp(1:ithree) = sph_IO%sph_rank(1:ithree)
5053
!
51-
rtp%nidx_global_rtp(1:ithree) = sph_IO%nidx_gl_sph(1:ithree)
54+
sph_rtp%nidx_global_rtp(1:ithree) = sph_IO%nidx_gl_sph(1:ithree)
5255
l_truncation = sph_IO%ltr_gl
5356
!
54-
rtp%nnod_rtp = sph_IO%numnod_sph
55-
rtp%nidx_rtp(1:ithree) = sph_IO%nidx_sph(1:ithree)
56-
rtp%ist_rtp(1:ithree) = sph_IO%ist_sph(1:ithree)
57-
rtp%ied_rtp(1:ithree) = sph_IO%ied_sph(1:ithree)
58-
rtp%nnod_med = sph_IO%nidx_sph(1)*sph_IO%nidx_sph(2)
57+
sph_rtp%nnod_rtp = sph_IO%numnod_sph
58+
sph_rtp%nidx_rtp(1:ithree) = sph_IO%nidx_sph(1:ithree)
59+
sph_rtp%ist_rtp(1:ithree) = sph_IO%ist_sph(1:ithree)
60+
sph_rtp%ied_rtp(1:ithree) = sph_IO%ied_sph(1:ithree)
61+
sph_rtp%nnod_med = sph_IO%nidx_sph(1)*sph_IO%nidx_sph(2)
5962
!
60-
call alloc_spheric_param_rtp(rtp)
61-
call alloc_sph_1d_index_rtp(rtp)
63+
call alloc_spheric_param_rtp(sph_rtp)
64+
call alloc_sph_1d_index_rtp(sph_rtp)
6265
!
6366
do i = 1, ithree
64-
rtp%idx_global_rtp(1:rtp%nnod_rtp,i) &
65-
& = sph_IO%idx_gl_sph(1:rtp%nnod_rtp,i)
67+
sph_rtp%idx_global_rtp(1:sph_rtp%nnod_rtp,i) &
68+
& = sph_IO%idx_gl_sph(1:sph_rtp%nnod_rtp,i)
6669
end do
6770
!
6871
!$omp parallel workshare
69-
rtp%radius_1d_rtp_r(1:rtp%nidx_rtp(1)) &
70-
& = sph_IO%r_gl_1(1:rtp%nidx_rtp(1))
71-
rtp%idx_gl_1d_rtp_r(1:rtp%nidx_rtp(1)) &
72-
& = sph_IO%idx_gl_1(1:rtp%nidx_rtp(1))
72+
sph_rtp%radius_1d_rtp_r(1:sph_rtp%nidx_rtp(1)) &
73+
& = sph_IO%r_gl_1(1:sph_rtp%nidx_rtp(1))
74+
sph_rtp%idx_gl_1d_rtp_r(1:sph_rtp%nidx_rtp(1)) &
75+
& = sph_IO%idx_gl_1(1:sph_rtp%nidx_rtp(1))
7376
!$omp end parallel workshare
77+
call set_sph_one_over_radius_rtp(sph_rtp)
7478
!
7579
!$omp parallel workshare
76-
rtp%idx_gl_1d_rtp_t(1:rtp%nidx_rtp(2)) &
77-
& = sph_IO%idx_gl_2(1:rtp%nidx_rtp(2),1)
80+
sph_rtp%idx_gl_1d_rtp_t(1:sph_rtp%nidx_rtp(2)) &
81+
& = sph_IO%idx_gl_2(1:sph_rtp%nidx_rtp(2),1)
7882
!$omp end parallel workshare
7983
!
8084
!$omp parallel workshare
81-
rtp%idx_gl_1d_rtp_p(1:rtp%nidx_rtp(3),1) &
82-
& = sph_IO%idx_gl_3(1:rtp%nidx_rtp(3),1)
83-
rtp%idx_gl_1d_rtp_p(1:rtp%nidx_rtp(3),2) &
84-
& = sph_IO%idx_gl_3(1:rtp%nidx_rtp(3),2)
85+
sph_rtp%idx_gl_1d_rtp_p(1:sph_rtp%nidx_rtp(3),1) &
86+
& = sph_IO%idx_gl_3(1:sph_rtp%nidx_rtp(3),1)
87+
sph_rtp%idx_gl_1d_rtp_p(1:sph_rtp%nidx_rtp(3),2) &
88+
& = sph_IO%idx_gl_3(1:sph_rtp%nidx_rtp(3),2)
8589
!$omp end parallel workshare
8690
!
8791
end subroutine copy_sph_node_4_rtp_from_IO
8892
!
8993
! ----------------------------------------------------------------------
9094
!
91-
subroutine copy_sph_node_4_rtp_to_IO(l_truncation, rtp, sph_IO)
95+
subroutine copy_sph_node_4_rtp_to_IO(l_truncation, sph_rtp, &
96+
& sph_IO)
9297
!
9398
integer(kind = kint), intent(in) :: l_truncation
94-
type(sph_rtp_grid), intent(in) :: rtp
99+
type(sph_rtp_grid), intent(in) :: sph_rtp
95100
type(sph_IO_data), intent(inout) :: sph_IO
96101
!
97102
integer(kind = kint) :: i
98103
integer(kind = kint_gl) :: nr_8, nrt8
99104
!
100105
!
101106
sph_IO%numdir_sph = ithree
102-
sph_IO%sph_rank(1:ithree) = rtp%irank_sph_rtp(1:ithree)
107+
sph_IO%sph_rank(1:ithree) = sph_rtp%irank_sph_rtp(1:ithree)
103108
!
104109
sph_IO%ncomp_table_1d(1) = ione
105110
sph_IO%ncomp_table_1d(2) = ione
106111
sph_IO%ncomp_table_1d(3) = itwo
107112
!
108-
sph_IO%nidx_gl_sph(1:ithree) = rtp%nidx_global_rtp(1:ithree)
113+
sph_IO%nidx_gl_sph(1:ithree) = sph_rtp%nidx_global_rtp(1:ithree)
109114
sph_IO%ltr_gl = l_truncation
110115
!
111-
sph_IO%numnod_sph = rtp%nnod_rtp
116+
sph_IO%numnod_sph = sph_rtp%nnod_rtp
112117
!
113118
call alloc_num_idx_sph_IO(sph_IO)
114119
!
115-
sph_IO%nidx_sph(1:ithree) = rtp%nidx_rtp(1:ithree)
116-
sph_IO%ist_sph(1:ithree) = rtp%ist_rtp(1:ithree)
117-
sph_IO%ied_sph(1:ithree) = rtp%ied_rtp(1:ithree)
120+
sph_IO%nidx_sph(1:ithree) = sph_rtp%nidx_rtp(1:ithree)
121+
sph_IO%ist_sph(1:ithree) = sph_rtp%ist_rtp(1:ithree)
122+
sph_IO%ied_sph(1:ithree) = sph_rtp%ied_rtp(1:ithree)
118123
!
119124
call alloc_nod_id_sph_IO(sph_IO)
120125
call alloc_idx_sph_1d1_IO(sph_IO)
121126
call alloc_idx_sph_1d2_IO(sph_IO)
122127
call alloc_idx_sph_1d3_IO(sph_IO)
123128
!
124129
!$omp parallel do private(i,nr_8,nrt8)
125-
do i = 1, rtp%nnod_rtp
126-
nr_8 = rtp%nidx_global_rtp(1)
127-
nrt8 = rtp%nidx_global_rtp(1)*rtp%nidx_global_rtp(2)
128-
sph_IO%idx_gl_sph(i,1) = rtp%idx_global_rtp(i,1)
129-
sph_IO%idx_gl_sph(i,2) = rtp%idx_global_rtp(i,2)
130-
sph_IO%idx_gl_sph(i,3) = rtp%idx_global_rtp(i,3)
131-
sph_IO%inod_gl_sph(i) = rtp%idx_global_rtp(i,1) &
132-
& + (rtp%idx_global_rtp(i,2) - 1) * nr_8 &
133-
& + (rtp%idx_global_rtp(i,3) - 1) * nrt8
130+
do i = 1, sph_rtp%nnod_rtp
131+
nr_8 = sph_rtp%nidx_global_rtp(1)
132+
nrt8 = sph_rtp%nidx_global_rtp(1)*sph_rtp%nidx_global_rtp(2)
133+
sph_IO%idx_gl_sph(i,1) = sph_rtp%idx_global_rtp(i,1)
134+
sph_IO%idx_gl_sph(i,2) = sph_rtp%idx_global_rtp(i,2)
135+
sph_IO%idx_gl_sph(i,3) = sph_rtp%idx_global_rtp(i,3)
136+
sph_IO%inod_gl_sph(i) = sph_rtp%idx_global_rtp(i,1) &
137+
& + (sph_rtp%idx_global_rtp(i,2) - 1) * nr_8 &
138+
& + (sph_rtp%idx_global_rtp(i,3) - 1) * nrt8
134139
end do
135140
!$omp end parallel do
136141
!
137142
!$omp parallel workshare
138-
sph_IO%r_gl_1(1:rtp%nidx_rtp(1)) &
139-
& = rtp%radius_1d_rtp_r(1:rtp%nidx_rtp(1))
140-
sph_IO%idx_gl_1(1:rtp%nidx_rtp(1)) &
141-
& = rtp%idx_gl_1d_rtp_r(1:rtp%nidx_rtp(1))
143+
sph_IO%r_gl_1(1:sph_rtp%nidx_rtp(1)) &
144+
& = sph_rtp%radius_1d_rtp_r(1:sph_rtp%nidx_rtp(1))
145+
sph_IO%idx_gl_1(1:sph_rtp%nidx_rtp(1)) &
146+
& = sph_rtp%idx_gl_1d_rtp_r(1:sph_rtp%nidx_rtp(1))
142147
!$omp end parallel workshare
143148
!
144149
!$omp parallel workshare
145-
sph_IO%idx_gl_2(1:rtp%nidx_rtp(2),1) &
146-
& = rtp%idx_gl_1d_rtp_t(1:rtp%nidx_rtp(2))
150+
sph_IO%idx_gl_2(1:sph_rtp%nidx_rtp(2),1) &
151+
& = sph_rtp%idx_gl_1d_rtp_t(1:sph_rtp%nidx_rtp(2))
147152
!$omp end parallel workshare
148153
!
149154
!$omp parallel workshare
150-
sph_IO%idx_gl_3(1:rtp%nidx_rtp(3),1) &
151-
& = rtp%idx_gl_1d_rtp_p(1:rtp%nidx_rtp(3),1)
152-
sph_IO%idx_gl_3(1:rtp%nidx_rtp(3),2) &
153-
& = rtp%idx_gl_1d_rtp_p(1:rtp%nidx_rtp(3),2)
155+
sph_IO%idx_gl_3(1:sph_rtp%nidx_rtp(3),1) &
156+
& = sph_rtp%idx_gl_1d_rtp_p(1:sph_rtp%nidx_rtp(3),1)
157+
sph_IO%idx_gl_3(1:sph_rtp%nidx_rtp(3),2) &
158+
& = sph_rtp%idx_gl_1d_rtp_p(1:sph_rtp%nidx_rtp(3),2)
154159
!$omp end parallel workshare
155160
!
156161
end subroutine copy_sph_node_4_rtp_to_IO
@@ -159,55 +164,61 @@ end subroutine copy_sph_node_4_rtp_to_IO
159164
! ----------------------------------------------------------------------
160165
!
161166
integer(kind = kint) function compare_sph_rtp_node_with_IO &
162-
& (l_truncation, rtp, sph_IO)
167+
& (l_truncation, sph_rtp, sph_IO)
163168
!
164169
integer(kind = kint), intent(in) :: l_truncation
165-
type(sph_rtp_grid), intent(in) :: rtp
170+
type(sph_rtp_grid), intent(in) :: sph_rtp
166171
type(sph_IO_data), intent(in) :: sph_IO
167172
!
168173
integer(kind = kint) :: i
169174
!
170175
!
171176
compare_sph_rtp_node_with_IO = 1
172177
do i = 1, ithree
173-
if(sph_IO%sph_rank(i) .ne. rtp%irank_sph_rtp(i)) return
178+
if(sph_IO%sph_rank(i) .ne. sph_rtp%irank_sph_rtp(i)) return
174179
end do
175180
!
176181
do i = 1, ithree
177-
if(sph_IO%nidx_gl_sph(i) .ne. rtp%nidx_global_rtp(i)) return
182+
if(sph_IO%nidx_gl_sph(i) &
183+
& .ne. sph_rtp%nidx_global_rtp(i)) return
178184
end do
179185
if(sph_IO%ltr_gl .ne. l_truncation) return
180186
!
181-
if(sph_IO%numnod_sph .ne. rtp%nnod_rtp) return
187+
if(sph_IO%numnod_sph .ne. sph_rtp%nnod_rtp) return
182188
!
183189
!
184190
do i = 1, ithree
185-
if(sph_IO%nidx_sph(i) .ne. rtp%nidx_rtp(i)) return
186-
if(sph_IO%ist_sph(i) .ne. rtp%ist_rtp(i)) return
187-
if(sph_IO%ied_sph(i) .ne. rtp%ied_rtp(i)) return
191+
if(sph_IO%nidx_sph(i) .ne. sph_rtp%nidx_rtp(i)) return
192+
if(sph_IO%ist_sph(i) .ne. sph_rtp%ist_rtp(i)) return
193+
if(sph_IO%ied_sph(i) .ne. sph_rtp%ied_rtp(i)) return
188194
end do
189195
!
190-
do i = 1, rtp%nnod_rtp
191-
if(sph_IO%idx_gl_sph(i,1) .ne. rtp%idx_global_rtp(i,1)) return
192-
if(sph_IO%idx_gl_sph(i,2) .ne. rtp%idx_global_rtp(i,2)) return
193-
if(sph_IO%idx_gl_sph(i,3) .ne. rtp%idx_global_rtp(i,3)) return
196+
do i = 1, sph_rtp%nnod_rtp
197+
if(sph_IO%idx_gl_sph(i,1) &
198+
& .ne. sph_rtp%idx_global_rtp(i,1)) return
199+
if(sph_IO%idx_gl_sph(i,2) &
200+
& .ne. sph_rtp%idx_global_rtp(i,2)) return
201+
if(sph_IO%idx_gl_sph(i,3) &
202+
& .ne. sph_rtp%idx_global_rtp(i,3)) return
194203
end do
195204
!
196-
do i = 1, rtp%nidx_rtp(1)
197-
if(sph_IO%r_gl_1(i) .ne. rtp%radius_1d_rtp_r(i)) then
198-
if(abs(sph_IO%r_gl_1(i) - rtp%radius_1d_rtp_r(i)) &
205+
do i = 1, sph_rtp%nidx_rtp(1)
206+
if(sph_IO%r_gl_1(i) .ne. sph_rtp%radius_1d_rtp_r(i)) then
207+
if(abs(sph_IO%r_gl_1(i) - sph_rtp%radius_1d_rtp_r(i)) &
199208
& .gt. 1.0d-10) return
200209
end if
201-
if(sph_IO%idx_gl_1(i) .ne. rtp%idx_gl_1d_rtp_r(i)) return
210+
if(sph_IO%idx_gl_1(i) .ne. sph_rtp%idx_gl_1d_rtp_r(i)) return
202211
end do
203212
!
204-
do i = 1, rtp%nidx_rtp(2)
205-
if(sph_IO%idx_gl_2(i,1) .ne. rtp%idx_gl_1d_rtp_t(i)) return
213+
do i = 1, sph_rtp%nidx_rtp(2)
214+
if(sph_IO%idx_gl_2(i,1) .ne. sph_rtp%idx_gl_1d_rtp_t(i)) return
206215
end do
207216
!
208-
do i = 1, rtp%nidx_rtp(3)
209-
if(sph_IO%idx_gl_3(i,1) .ne. rtp%idx_gl_1d_rtp_p(i,1)) return
210-
if(sph_IO%idx_gl_3(i,2) .ne. rtp%idx_gl_1d_rtp_p(i,2)) return
217+
do i = 1, sph_rtp%nidx_rtp(3)
218+
if(sph_IO%idx_gl_3(i,1) &
219+
& .ne. sph_rtp%idx_gl_1d_rtp_p(i,1)) return
220+
if(sph_IO%idx_gl_3(i,2) &
221+
& .ne. sph_rtp%idx_gl_1d_rtp_p(i,2)) return
211222
end do
212223
compare_sph_rtp_node_with_IO = 0
213224
!

0 commit comments

Comments
 (0)