88! ! for Valuable density
99! !
1010! !@verbatim
11- ! ! subroutine set_sph_FDM_fix_hdiv_vscs_mat(n_in, n_out, &
11+ ! ! subroutine set_sph_FDM_fix_hdiv_vscs_mat(kr, n_in, n_out, &
1212! ! & jmax, a2r_ele_rj, a3r_ele_rj, g_sph_rj, &
13+ ! ! & nri_fdm, fdm3e_d0_mat, fdm3e_d1_mat, fdm3e_d3_mat, &
14+ ! ! & hdiv_visous_mat)
15+ ! ! subroutine add_sph_hdiv_viscous_rho_depend &
16+ ! ! & (kr, n_in, n_out, jmax, &
17+ ! ! & a1r_ele_rj, a2r_ele_rj, g_sph_rj, h_rho, h_drhodr, &
18+ ! ! & nri_fdm, fdm3e_d0_mat, fdm3e_d1_mat, fdm3e_d2_mat, &
19+ ! ! & hdiv_visous_mat)
20+ ! ! subroutine add_sph_hdiv_viscous_nu_depend(kr, n_in, n_out, jmax,&
21+ ! ! & a1r_ele_rj, a2r_ele_rj, g_sph_rj, relative_d, h_nu, &
22+ ! ! & nri_fdm, fdm3e_d0_mat, fdm3e_d1_mat, fdm3e_d2_mat, &
23+ ! ! & hdiv_visous_mat)
24+ ! ! integer(kind = kint), intent(in) :: n_in, n_out
25+ ! ! integer(kind = kint), intent(in) :: kr, nri_fdm
26+ ! ! integer(kind = kint), intent(in) :: jmax
27+ ! ! real(kind = kreal), intent(in) :: a1r_ele_rj
28+ ! ! real(kind = kreal), intent(in) :: a2r_ele_rj
29+ ! ! real(kind = kreal), intent(in) :: a3r_ele_rj
30+ ! ! real(kind = kreal), intent(in) :: g_sph_rj(jmax,17)
31+ ! ! real(kind = kreal), intent(in) :: h_rho, h_drhodr
32+ ! ! real(kind = kreal), intent(in) :: relative_d, h_nu
33+ ! ! real(kind = kreal), intent(in) &
34+ ! ! & :: fdm3e_d0_mat(nri_fdm,n_in:n_out)
35+ ! ! real(kind = kreal), intent(in) &
36+ ! ! & :: fdm3e_d1_mat(nri_fdm,n_in:n_out)
37+ ! ! real(kind = kreal), intent(in) &
38+ ! ! & :: fdm3e_d2_mat(nri_fdm,n_in:n_out)
39+ ! ! real(kind = kreal), intent(in) &
40+ ! ! & :: fdm3e_d3_mat(nri_fdm,n_in:n_out)
41+ ! ! real(kind = kreal), intent(inout) &
42+ ! ! & :: hdiv_visous_mat(jmax,n_in:n_out)
43+ ! !
44+ ! ! subroutine each_sph_FDM_fix_hdiv_vscs_mat(n_in, n_out, jmax, &
45+ ! ! & a2r_ele_rj, a3r_ele_rj, g_sph_rj, &
1346! ! & fdm3e_d0_mat, fdm3e_d1_mat, fdm3e_d3_mat, &
1447! ! & hdiv_visous_mat)
15- ! ! subroutine add_sph_hdiv_viscous_rho_depend (n_in, n_out, jmax, &
48+ ! ! subroutine each_sph_hdiv_vscs_rho_depend (n_in, n_out, jmax, &
1649! ! & a1r_ele_rj, a2r_ele_rj, g_sph_rj, h_rho, h_drhodr, &
1750! ! & fdm3e_d0_mat, fdm3e_d1_mat, fdm3e_d2_mat, &
1851! ! & hdiv_visous_mat)
19- ! ! subroutine add_sph_hdiv_viscous_nu_depend (n_in, n_out, jmax, &
52+ ! ! subroutine each_sph_hdiv_vscs_nu_depend (n_in, n_out, jmax, &
2053! ! & a1r_ele_rj, a2r_ele_rj, g_sph_rj, relative_d, h_nu, &
2154! ! & fdm3e_d0_mat, fdm3e_d1_mat, fdm3e_d2_mat, &
2255! ! & hdiv_visous_mat)
@@ -49,8 +82,42 @@ module cal_sph_FDM3e_hdiv_viscous
4982!
5083! -----------------------------------------------------------------------
5184!
52- subroutine set_sph_FDM_fix_hdiv_vscs_mat (n_in , n_out , &
85+ subroutine set_sph_FDM_fix_hdiv_vscs_mat (kr , n_in , n_out , &
5386 & jmax , a2r_ele_rj , a3r_ele_rj , g_sph_rj , &
87+ & nri_fdm , fdm3e_d0_mat , fdm3e_d1_mat , fdm3e_d3_mat , &
88+ & hdiv_visous_mat )
89+ !
90+ integer (kind = kint), intent (in ) :: n_in, n_out
91+ integer (kind = kint), intent (in ) :: kr, nri_fdm
92+ integer (kind = kint), intent (in ) :: jmax
93+ real (kind = kreal), intent (in ) :: a2r_ele_rj
94+ real (kind = kreal), intent (in ) :: a3r_ele_rj
95+ real (kind = kreal), intent (in ) :: g_sph_rj(jmax,17 )
96+ real (kind = kreal), intent (in ) &
97+ & :: fdm3e_d0_mat(nri_fdm,n_in:n_out)
98+ real (kind = kreal), intent (in ) &
99+ & :: fdm3e_d1_mat(nri_fdm,n_in:n_out)
100+ real (kind = kreal), intent (in ) &
101+ & :: fdm3e_d3_mat(nri_fdm,n_in:n_out)
102+ !
103+ real (kind = kreal), intent (inout ) &
104+ & :: hdiv_visous_mat(jmax,n_in:n_out)
105+ !
106+ integer (kind = kint) :: i_next
107+ !
108+ !
109+ do i_next = n_in, n_out
110+ hdiv_visous_mat(1 :jmax,i_next) = - fdm3e_d3_mat(kr,i_next) &
111+ & + g_sph_rj(1 :jmax,3 )* a2r_ele_rj * fdm3e_d1_mat(kr,i_next) &
112+ & - two* g_sph_rj(1 :jmax,3 )* a3r_ele_rj * fdm3e_d0_mat(kr,i_next)
113+ end do
114+ !
115+ end subroutine set_sph_FDM_fix_hdiv_vscs_mat
116+ !
117+ ! -----------------------------------------------------------------------
118+ !
119+ subroutine each_sph_FDM_fix_hdiv_vscs_mat (n_in , n_out , jmax , &
120+ & a2r_ele_rj , a3r_ele_rj , g_sph_rj , &
54121 & fdm3e_d0_mat , fdm3e_d1_mat , fdm3e_d3_mat , &
55122 & hdiv_visous_mat )
56123!
@@ -69,18 +136,63 @@ subroutine set_sph_FDM_fix_hdiv_vscs_mat(n_in, n_out, &
69136 integer (kind = kint) :: i_next
70137!
71138!
139+ ! $omp parallel
72140 do i_next = n_in, n_out
141+ ! $omp workshare
73142 hdiv_visous_mat(1 :jmax,i_next) = - fdm3e_d3_mat(i_next) &
74143 & + g_sph_rj(1 :jmax,3 )* a2r_ele_rj * fdm3e_d1_mat(i_next) &
75144 & - two* g_sph_rj(1 :jmax,3 )* a3r_ele_rj * fdm3e_d0_mat(i_next)
145+ ! $omp end workshare
76146 end do
147+ ! $omp end parallel
77148!
78- end subroutine set_sph_FDM_fix_hdiv_vscs_mat
149+ end subroutine each_sph_FDM_fix_hdiv_vscs_mat
79150!
80151! -----------------------------------------------------------------------
81152! -----------------------------------------------------------------------
82153!
83- subroutine add_sph_hdiv_viscous_rho_depend (n_in , n_out , jmax , &
154+ subroutine add_sph_hdiv_viscous_rho_depend &
155+ & (kr, n_in, n_out, jmax, &
156+ & a1r_ele_rj, a2r_ele_rj, g_sph_rj, h_rho, h_drhodr, &
157+ & nri_fdm, fdm3e_d0_mat, fdm3e_d1_mat, fdm3e_d2_mat, &
158+ & hdiv_visous_mat)
159+ !
160+ integer (kind = kint), intent (in ) :: n_in, n_out
161+ integer (kind = kint), intent (in ) :: kr, nri_fdm
162+ integer (kind = kint), intent (in ) :: jmax
163+ real (kind = kreal), intent (in ) :: a1r_ele_rj
164+ real (kind = kreal), intent (in ) :: a2r_ele_rj
165+ real (kind = kreal), intent (in ) :: g_sph_rj(jmax,17 )
166+ real (kind = kreal), intent (in ) :: h_rho, h_drhodr
167+ real (kind = kreal), intent (in ) &
168+ & :: fdm3e_d0_mat(nri_fdm,n_in:n_out)
169+ real (kind = kreal), intent (in ) &
170+ & :: fdm3e_d1_mat(nri_fdm,n_in:n_out)
171+ real (kind = kreal), intent (in ) &
172+ & :: fdm3e_d2_mat(nri_fdm,n_in:n_out)
173+ !
174+ real (kind = kreal), intent (inout ) &
175+ & :: hdiv_visous_mat(jmax,n_in:n_out)
176+ !
177+ integer (kind = kint) :: i_next
178+ real (kind = kreal) :: c_d1
179+ !
180+ !
181+ c_d1 = two * a1r_ele_rj * h_rho + h_drhodr
182+ do i_next = n_in, n_out
183+ hdiv_visous_mat(1 :jmax,i_next) = hdiv_visous_mat(1 :jmax,i_next) &
184+ & + h_rho * fdm3e_d2_mat(kr,i_next) &
185+ & + c_d1 * fdm3e_d1_mat(kr,i_next) &
186+ & - (g_sph_rj(1 :jmax,3 )* a2r_ele_rj &
187+ & * h_rho * two / three) &
188+ & * fdm3e_d0_mat(kr,i_next)
189+ end do
190+ !
191+ end subroutine add_sph_hdiv_viscous_rho_depend
192+ !
193+ ! -----------------------------------------------------------------------
194+ !
195+ subroutine each_sph_hdiv_vscs_rho_depend (n_in , n_out , jmax , &
84196 & a1r_ele_rj , a2r_ele_rj , g_sph_rj , h_rho , h_drhodr , &
85197 & fdm3e_d0_mat , fdm3e_d1_mat , fdm3e_d2_mat , &
86198 & hdiv_visous_mat )
@@ -103,21 +215,67 @@ subroutine add_sph_hdiv_viscous_rho_depend(n_in, n_out, jmax, &
103215!
104216!
105217 c_d1 = two * a1r_ele_rj * h_rho + h_drhodr
218+ ! $omp parallel
106219 do i_next = n_in, n_out
220+ ! $omp workshare
107221 hdiv_visous_mat(1 :jmax,i_next) = hdiv_visous_mat(1 :jmax,i_next) &
108222 & + h_rho * fdm3e_d2_mat(i_next) &
109223 & + c_d1 * fdm3e_d1_mat(i_next) &
110224 & - (g_sph_rj(1 :jmax,3 )* a2r_ele_rj &
111225 & * h_rho * two / three) &
112226 & * fdm3e_d0_mat(i_next)
227+ ! $omp end workshare
113228 end do
229+ ! $omp end parallel
114230!
115- end subroutine add_sph_hdiv_viscous_rho_depend
231+ end subroutine each_sph_hdiv_vscs_rho_depend
116232!
117233! -----------------------------------------------------------------------
118234! -----------------------------------------------------------------------
119235!
120- subroutine add_sph_hdiv_viscous_nu_depend (n_in , n_out , jmax , &
236+ subroutine add_sph_hdiv_viscous_nu_depend (kr , n_in , n_out , jmax , &
237+ & a1r_ele_rj , a2r_ele_rj , g_sph_rj , relative_d , h_nu , &
238+ & nri_fdm , fdm3e_d0_mat , fdm3e_d1_mat , fdm3e_d2_mat , &
239+ & hdiv_visous_mat )
240+ !
241+ integer (kind = kint), intent (in ) :: n_in, n_out
242+ integer (kind = kint), intent (in ) :: kr, nri_fdm
243+ integer (kind = kint), intent (in ) :: jmax
244+ real (kind = kreal), intent (in ) :: a1r_ele_rj
245+ real (kind = kreal), intent (in ) :: a2r_ele_rj
246+ real (kind = kreal), intent (in ) :: g_sph_rj(jmax,17 )
247+ real (kind = kreal), intent (in ) :: relative_d, h_nu
248+ real (kind = kreal), intent (in ) &
249+ & :: fdm3e_d0_mat(nri_fdm,n_in:n_out)
250+ real (kind = kreal), intent (in ) &
251+ & :: fdm3e_d1_mat(nri_fdm,n_in:n_out)
252+ real (kind = kreal), intent (in ) &
253+ & :: fdm3e_d2_mat(nri_fdm,n_in:n_out)
254+ !
255+ real (kind = kreal), intent (inout ) &
256+ & :: hdiv_visous_mat(jmax,n_in:n_out)
257+ !
258+ integer (kind = kint) :: i_next
259+ real (kind = kreal) :: c_d2, c_d1
260+ !
261+ !
262+ do i_next = n_in, n_out
263+ c_d2 = - h_nu
264+ c_d1 = two * a1r_ele_rj * h_nu
265+ hdiv_visous_mat(1 :jmax,i_next) = hdiv_visous_mat(1 :jmax,i_next) &
266+ & + c_d2 * fdm3e_d2_mat(kr,i_next) &
267+ & + c_d1 * fdm3e_d1_mat(kr,i_next) &
268+ & - g_sph_rj(1 :jmax,3 ) * a2r_ele_rj * h_nu &
269+ & * fdm3e_d0_mat(kr,i_next)
270+ hdiv_visous_mat(1 :jmax,i_next) = relative_d &
271+ & * hdiv_visous_mat(1 :jmax,i_next)
272+ end do
273+ !
274+ end subroutine add_sph_hdiv_viscous_nu_depend
275+ !
276+ ! -----------------------------------------------------------------------
277+ !
278+ subroutine each_sph_hdiv_vscs_nu_depend (n_in , n_out , jmax , &
121279 & a1r_ele_rj , a2r_ele_rj , g_sph_rj , relative_d , h_nu , &
122280 & fdm3e_d0_mat , fdm3e_d1_mat , fdm3e_d2_mat , &
123281 & hdiv_visous_mat )
@@ -139,19 +297,23 @@ subroutine add_sph_hdiv_viscous_nu_depend(n_in, n_out, jmax, &
139297 real (kind = kreal) :: c_d2, c_d1
140298!
141299!
300+ ! $omp parallel
142301 do i_next = n_in, n_out
143302 c_d2 = - h_nu
144303 c_d1 = two * a1r_ele_rj * h_nu
304+ ! $omp workshare
145305 hdiv_visous_mat(1 :jmax,i_next) = hdiv_visous_mat(1 :jmax,i_next) &
146306 & + c_d2 * fdm3e_d2_mat(i_next) &
147307 & + c_d1 * fdm3e_d1_mat(i_next) &
148308 & - g_sph_rj(1 :jmax,3 ) * a2r_ele_rj * h_nu &
149309 & * fdm3e_d0_mat(i_next)
150310 hdiv_visous_mat(1 :jmax,i_next) = relative_d &
151311 & * hdiv_visous_mat(1 :jmax,i_next)
312+ ! $omp end workshare
152313 end do
314+ ! $omp end parallel
153315!
154- end subroutine add_sph_hdiv_viscous_nu_depend
316+ end subroutine each_sph_hdiv_vscs_nu_depend
155317!
156318! -----------------------------------------------------------------------
157319!
0 commit comments