Skip to content

Commit 9f85b62

Browse files
committed
Fix routines to generate full sphere radial grids
1 parent 52eba82 commit 9f85b62

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/half_chebyshev_radial_grid.f90

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ subroutine half_chebyshev_distance_shell &
4444
kst = 1
4545
ked = nlayer_CMB
4646
do k = kst, ked
47-
r_grid(k) = r_CMB * sin(half * pi * dble(k)/dble(nlayer_CMB))
47+
r_grid(k) &
48+
& = r_CMB * cos(half * pi * dble(ked - k)/dble(ked))
4849
end do
4950
!
50-
kst = nlayer_CMB + 1
51+
kst = nlayer_CMB
5152
ked = min(num_layer, nlayer_CMB + nlayer_CMB/2)
52-
do k = kst, ked
53-
r_grid(k) = r_CMB + r_CMB * (one - sin(half*pi &
54-
& * dble(k-nlayer_CMB)/dble(nlayer_CMB)) )
53+
do k = kst+1, ked
54+
r_grid(k) &
55+
& = r_CMB * (two - cos(half*pi * dble(k-kst)/dble(kst)))
5556
end do
5657
dr = r_grid(ked) - r_grid(ked-1)
5758
!
@@ -93,15 +94,13 @@ subroutine count_half_chebyshev_external(nri, r_CMB, r_max, &
9394
r = r_CMB + r_CMB * (one - cos(half*pi*dble(k)/dble(nri)) )
9495
dr = r_CMB * (-cos(half*pi*dble(k )/dble(nri)) &
9596
& +cos(half*pi*dble(k-1)/dble(nri)) )
96-
! write(*,*) k, r, dr
9797
end do
9898
!
9999
!
100100
do
101101
if(r .ge. r_max) exit
102102
k = k + 1
103103
r = r + dr
104-
! write(*,*) k, r, dr
105104
end do
106105
!
107106
if(k .le. 1) then
@@ -110,7 +109,7 @@ subroutine count_half_chebyshev_external(nri, r_CMB, r_max, &
110109
ngrid_ext = k
111110
end if
112111
!
113-
nlayer_ICB = 0
112+
nlayer_ICB = 1
114113
nlayer_CMB = nri
115114
ntot_shell = nlayer_CMB + ngrid_ext
116115
!

src/Fortran_libraries/UTILS_src/MERGE/parallel_assemble_sph.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,11 @@ subroutine set_mode_table_4_assemble(org_sph, new_sph, j_table)
8989
type(sph_grids), intent(in) :: new_sph
9090
type(rj_assemble_tbl), intent(inout) :: j_table
9191
!
92-
integer(kind = kint) :: j_org, j_gl, j_new
92+
integer(kind = kint) :: j_org, j_new
9393
integer(kind = 4) :: l_gl, m_gl
9494
!
9595
!
9696
do j_org = 1, org_sph%sph_rj%nidx_rj(2)
97-
j_gl = org_sph%sph_rj%idx_gl_1d_rj_j(j_org,1)
9897
l_gl = int(org_sph%sph_rj%idx_gl_1d_rj_j(j_org,2))
9998
m_gl = int(org_sph%sph_rj%idx_gl_1d_rj_j(j_org,3))
10099
j_new = find_local_sph_address(new_sph%sph_rj, l_gl, m_gl)

0 commit comments

Comments
 (0)