Skip to content

Commit

Permalink
remove redundant array init in radial_spectra.f90
Browse files Browse the repository at this point in the history
  • Loading branch information
tgastine committed Jul 30, 2024
1 parent 81ca82b commit 2c46270
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 29 deletions.
12 changes: 5 additions & 7 deletions src/TO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,11 @@ subroutine getTO(vr,vt,vp,cvr,dvpdr,br,bt,bp,cbr,cbt,phase,dtLast,nR)
phiNorm=one/real(n_phi_max, kind=cp)

!-- Set values to zero before filling it
do nTheta=1,n_theta_max
dzCorAS_Rloc(nTheta,nR) =0.0_cp
dzRstrAS_Rloc(nTheta,nR)=0.0_cp
dzAstrAS_Rloc(nTheta,nR)=0.0_cp
if ( l_mag ) dzLFAS_Rloc(nTheta,nR)=0.0_cp
if ( l_phase_field ) dzPenAS_Rloc(nTheta,nR)=0.0_cp
end do
dzCorAS_Rloc(:,nR) =0.0_cp
dzRstrAS_Rloc(:,nR)=0.0_cp
dzAstrAS_Rloc(:,nR)=0.0_cp
if ( l_mag ) dzLFAS_Rloc(:,nR)=0.0_cp
if ( l_phase_field ) dzPenAS_Rloc(:,nR)=0.0_cp

!-- Big loop over thetas in block:
do nTheta=1,n_theta_max
Expand Down
6 changes: 3 additions & 3 deletions src/dtB.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module dtB_mod
& lm2lmS, lm2lmA
use radial_spectra ! rBrSpec, rBpSpec
use sht, only: scal_to_SH, spat_to_sphertor
use constants, only: two
use constants, only: two, ci
use radial_der, only: get_dr

implicit none
Expand Down Expand Up @@ -428,8 +428,8 @@ subroutine get_dtBLMfinish(time,n_time_step,omega_ic,b,ddb,aj,dj,ddj,b_ic, &
do lm=start_lm,stop_lm
l=lo_map%lm2l(lm)
m=lo_map%lm2m(lm)
PadvLMIC_LMloc(lm,nR)=-omega_ic*dPhi(st_map%lm2(l,m))*b_ic(lm,nR)
TadvLMIC_LMloc(lm,nR)=-omega_ic*dPhi(st_map%lm2(l,m))*aj_ic(lm,nR)
PadvLMIC_LMloc(lm,nR)=-omega_ic*ci*m*b_ic(lm,nR)
TadvLMIC_LMloc(lm,nR)=-omega_ic*ci*m*aj_ic(lm,nR)
PdifLMIC_LMloc(lm,nR)=opm*O_sr * ( ddb_ic(lm,nR) + &
& two*real(l+1,cp)*O_r_ic(nR)*db_ic(lm,nR) )
TdifLMIC_LMloc(lm,nR)=opm*O_sr * ( ddj_ic(lm,nR) + &
Expand Down
19 changes: 0 additions & 19 deletions src/radial_spectra.f90
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,13 @@ subroutine rBrSpec(time,Pol,PolIC,fileRoot,lIC,map)

!-- Inner core:
if ( lIC ) then

lAS=.true.
if ( trim(adjustl(fileRoot)) == 'rBrAdvSpec' ) lAS= .false.

O_r_icb_E_2=one/r_icb**2

do n_r=2,n_r_ic_max
rRatio=r_ic(n_r)/r_ic(1)
do l=1,6
e_p(l,n_r_max-1+n_r)=0.0_cp
e_p_AS(l,n_r_max-1+n_r)=0.0_cp
end do
do lm=llm,ulm
l=map%lm2l(lm)
if ( l > 0 .and. l <= 6 ) then
Expand All @@ -106,13 +101,6 @@ subroutine rBrSpec(time,Pol,PolIC,fileRoot,lIC,map)
end if
end do
end do
else
do n_r=2,n_r_ic_max
do l=1,6
e_p_AS(l,n_r_max-1+n_r)=0.0_cp
e_p(l,n_r_max-1+n_r) =0.0_cp
end do
end do
end if

call reduce_radial(e_p, e_p_global, 0)
Expand Down Expand Up @@ -190,13 +178,6 @@ subroutine rBpSpec(time,Tor,TorIC,fileRoot,lIC,map)
end do ! do loop over lms in block
end do ! radial grid points

!-- Inner core:
do n_r=2,n_r_ic_max
do l=1,6
e_t_AS(l,n_r_max-1+n_r)=0.0_cp
e_t(l,n_r_max-1+n_r) =0.0_cp
end do
end do
if ( lIC .and. l_cond_ic ) then

lAS=.true.
Expand Down

0 comments on commit 2c46270

Please sign in to comment.