Skip to content

Commit 6d8c9f7

Browse files
Kateryna Yakymenkokyakymenko
authored andcommitted
Fix mix-up with species indices and related energy interpolation issue
1 parent e9b1520 commit 6d8c9f7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ModRamBoundary.f90

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ subroutine get_geomlt_flux(NameParticleIn, fluxOut_II, S)
117117
! outside of the files energy range.
118118
rE = 0
119119
lE = 0
120-
if (eGrid_SI(iSpec,1).gt.EkeV(iSpec, 1)) lE = 1
121-
if (eGrid_SI(iSpec,NEL_).lt.EkeV(iSpec, nE)) rE = 1
120+
if (eGrid_SI(iSpec,1).gt.EkeV(S, 1)) lE = 1
121+
if (eGrid_SI(iSpec,NEL_).lt.EkeV(S, nE)) rE = 1
122122
pE = rE + lE
123123
allocate(flux_II(0:NTL,NEL_+pE), logFlux_II(nT,NEL_+pE), logELan(NEL_+pE), logERam(nE))
124124
flux_II = 0.0; logFlux_II = 0.0; logELan = 0.0; logERam = 0.0
@@ -172,6 +172,8 @@ subroutine get_geomlt_flux(NameParticleIn, fluxOut_II, S)
172172

173173
if (rE.eq.1) then
174174
do j=1,NTL-1
175+
! FIX NEEDED: for the case of energy grid extending to high energies,
176+
! 0.1 is probably too high
175177
flux_II(j,NEL_+pE) = 0.1
176178
enddo
177179
endif
@@ -201,7 +203,7 @@ subroutine get_geomlt_flux(NameParticleIn, fluxOut_II, S)
201203
! Place energy grids into log space.
202204
logELan(1+lE:NEL_+le) = log10(eGrid_SI(iSpec,1:NEL_))
203205
if (lE.eq.1) logELan(1) = log10(0.1000)
204-
if (rE.eq.1) logELan(NEL_+pE) = log10(1000.00)
206+
if (rE.eq.1) logELan(NEL_+pE) = log10(EkeV(S,NE))
205207
! logERam = log10(Ekev(iSpec,:)) ! VJ: this is wrong
206208
logERam = log10(Ekev(S,:))
207209

0 commit comments

Comments
 (0)