Skip to content

Commit 33ff848

Browse files
author
Miles A. Engel
committed
Updates to make energy by species work with SCE
There have been several updates since I started this branch, these changes bring us to a working point with the current upstream changes
1 parent 4efdf0c commit 33ff848

5 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/ModRamIO.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ subroutine ram_hour_write(S) !Previously WRESULT in ram_all
11251125
AVEFL(I,J,K)=AVEFL(I,J,K)+F(I,J,K,L)*WMU(L)
11261126
ENDDO
11271127
AVEFL(I,J,K)=AVEFL(I,J,K)/(MU(NPA)-MU(UPA(I)))
1128-
PRECFL=PRECFL+AVEFL(I,J,K)*PI*WE(K)
1128+
PRECFL=PRECFL+AVEFL(I,J,K)*PI*WE(S,K)
11291129
ENDDO
11301130
WRITE(UNITTMP_,70) LZ(I),PHI(J),PRECFL
11311131
END DO
@@ -1148,7 +1148,7 @@ subroutine ram_hour_write(S) !Previously WRESULT in ram_all
11481148
if (outsideMGNP(I,J) == 1) F(I,J,:,:) = 1e-31
11491149
DO 822 K=2,NE
11501150
! WRITE(20,31) T/3600.,LZ(I),KP,MLT(J),EKEV(K),F(I,J,K,2)
1151-
WRITE(30,31) T/3600.,LZ(I),KP,MLT(J),EKEV(K),F(I,J,K,27)
1151+
WRITE(30,31) T/3600.,LZ(I),KP,MLT(J),EKEV(S,K),F(I,J,K,27)
11521152
! WRITE(40,31) T/3600.,LZ(I),KP,MLT(J),EKEV(K),F(I,J,K,UPA(I))
11531153
822 CONTINUE
11541154
ENDDO

src/ModRamRun.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ SUBROUTINE ANISCH(S)
588588
taudaa_he = ATAW_emic_he(I,J,K,L)/MUBOUN/BOUNHS(I,J,L)/(1.-MUBOUN*MUBOUN)
589589

590590
IF(DoSaveLwgr .and. (MOD(INT(T),3600).EQ.0.)) THEN
591-
write(24,556)ekev(k), PABn(L), taudaa_h, taudaa_he, &
591+
write(24,556)ekev(S,k), PABn(L), taudaa_h, taudaa_he, &
592592
1./taudaa_h, 1./taudaa_he
593593
ENDIF
594594

src/ModRamSce.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ subroutine calculate_precip_flux_jr(IS, nTheta, nPhi, rIono, energy_flux, ave_e,
268268
do i=1, npsi
269269
do j=2, nzeta
270270
do k=1, nE
271-
write(UnitTmp_,'(f8.4,1x,f8.4,1x,f8.4,1x,E14.6)')rGrid(i,j), aGrid(i,j), EKEV(k), ave_fluxEQ(i,j,k)
271+
write(UnitTmp_,'(f8.4,1x,f8.4,1x,f8.4,1x,E14.6)')rGrid(i,j), aGrid(i,j), EKEV(iS,k), ave_fluxEQ(i,j,k)
272272
end do
273273
end do
274274
end do

src/ModSceIono.f90

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MODULE ModSceIono
99

1010
contains
1111
!==================================================================================================
12-
subroutine ionosphere_fluxes(iModel)
12+
subroutine ionosphere_fluxes(iS, iModel)
1313

1414
!\
1515
! Combine the diffusive and discrete precipitating fluxes
@@ -26,7 +26,7 @@ subroutine ionosphere_fluxes(iModel)
2626

2727
implicit none
2828

29-
integer, intent(in) :: iModel
29+
integer, intent(in) :: iS, iModel
3030
real(DP), allocatable :: discrete_ef(:,:), discrete_ae(:,:), &
3131
diffuse_ef(:,:), diffuse_ae(:,:)
3232
!---------------------------------------------------------------------------
@@ -76,7 +76,7 @@ subroutine ionosphere_fluxes(iModel)
7676
end subroutine ionosphere_fluxes
7777

7878
!==================================================================================================
79-
subroutine ionosphere_conductance(Sigma0, SigmaH, SigmaP, SigmaThTh, SigmaThPs, &
79+
subroutine ionosphere_conductance(iS, Sigma0, SigmaH, SigmaP, SigmaThTh, SigmaThPs, &
8080
SigmaPsPs, dSigmaThTh_dTheta, dSigmaThPs_dTheta, &
8181
dSigmaPsPs_dTheta, dSigmaThTh_dPsi, dSigmaThPs_dPsi, &
8282
dSigmaPsPs_dPsi, Eflux, Ave_E, Eflux_diff, Theta, Psi, nTheta, &
@@ -111,7 +111,7 @@ subroutine ionosphere_conductance(Sigma0, SigmaH, SigmaP, SigmaThTh, SigmaThPs,
111111

112112
implicit none
113113

114-
integer, intent(in) :: iModel
114+
integer, intent(in) :: iS, iModel
115115
integer, intent(in) :: nTheta, nPsi
116116
real(DP), intent(inout) :: Sigma0(:,:), SigmaH(:,:), SigmaP(:,:), SigmaThTh(:,:), &
117117
SigmaThPs(:,:), SigmaPsPs(:,:), dSigmaThTh_dTheta(:,:), &
@@ -279,7 +279,7 @@ subroutine ionosphere_conductance(Sigma0, SigmaH, SigmaP, SigmaThTh, SigmaThPs,
279279
if (EFlux(i,j)*1000. > 0.001 .and. Ave_E(i,j)/2.*1000. >1)then
280280
call glow_aurora_conductance(idate, real(ut,DP), glat(i,j), glong(i,j), &
281281
SigmaP_Glow(i,j), SigmaH_Glow(i,j), &
282-
EFlux(i,j)*1000., Ave_E(i,j)/2., EFlux_Diff(i,j,:), EkeV(:), nE, &
282+
EFlux(i,j)*1000., Ave_E(i,j)/2., EFlux_Diff(i,j,:), EkeV(iS,:), nE, &
283283
real(ap,DP), real(f107r,DP), real(f107p,DP),&
284284
real(f107a,DP), DoUseFullSpec, &
285285
zz(i,j,1:nzGlow), ionrate(i,j,1:nzGlow), eDen(i,j,1:nzGlow), &
@@ -448,7 +448,7 @@ subroutine ionosphere_conductance(Sigma0, SigmaH, SigmaP, SigmaThTh, SigmaThPs,
448448
end subroutine ionosphere_conductance
449449

450450
!==================================================================================================
451-
subroutine ionosphere_solver(Jr, SigmaThTh, SigmaThPs, SigmaPsPs, &
451+
subroutine ionosphere_solver(iS, Jr, SigmaThTh, SigmaThPs, SigmaPsPs, &
452452
dSigmaThTh_dTheta, dSigmaThPs_dTheta, &
453453
dSigmaPsPs_dTheta, dSigmaThTh_dPsi, &
454454
dSigmaThPs_dPsi, dSigmaPsPs_dPsi, &
@@ -516,6 +516,7 @@ subroutine ionosphere_solver(Jr, SigmaThTh, SigmaThPs, SigmaPsPs, &
516516

517517
implicit none
518518

519+
integer, intent(in) :: iS
519520
real(DP), intent(inout) :: Jr(:,:), SigmaThTh(:,:), SigmaThPs(:,:), SigmaPsPs(:,:), &
520521
dSigmaThTh_dTheta(:,:), dSigmaThPs_dTheta(:,:), &
521522
dSigmaPsPs_dTheta(:,:), dSigmaThTh_dPsi(:,:), &

src/ModSceRun.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ subroutine sce_solve
8282
iono_north_im_eflux_diff(:,Iono_nPsi,:) = iono_north_im_eflux_diff(:,1,:)
8383

8484
IONO_NORTH_JR = iono_north_im_jr
85-
call ionosphere_fluxes(Conductance_Model)
86-
call ionosphere_conductance(IONO_NORTH_Sigma0, IONO_NORTH_SigmaH, IONO_NORTH_SigmaP, &
85+
call ionosphere_fluxes(S, Conductance_Model)
86+
call ionosphere_conductance(S, IONO_NORTH_Sigma0, IONO_NORTH_SigmaH, IONO_NORTH_SigmaP, &
8787
IONO_NORTH_SigmaThTh, IONO_NORTH_SigmaThPs, IONO_NORTH_SigmaPsPs, &
8888
IONO_NORTH_dSigmaThTh_dTheta, IONO_NORTH_dSigmaThPs_dTheta, &
8989
IONO_NORTH_dSigmaPsPs_dTheta, IONO_NORTH_dSigmaThTh_dPsi, &
@@ -92,7 +92,7 @@ subroutine sce_solve
9292
IONO_NORTH_Theta, IONO_NORTH_Psi, IONO_nTheta, IONO_nPsi, &
9393
dTheta_North, dPsi_North, IONO_NORTH_X, IONO_NORTH_Y, IONO_NORTH_Z,&
9494
Conductance_Model)
95-
call ionosphere_solver(IONO_NORTH_JR, IONO_NORTH_SigmaThTh, IONO_NORTH_SigmaThPs, &
95+
call ionosphere_solver(S, IONO_NORTH_JR, IONO_NORTH_SigmaThTh, IONO_NORTH_SigmaThPs, &
9696
IONO_NORTH_SigmaPsPs, IONO_NORTH_dSigmaThTh_dTheta, &
9797
IONO_NORTH_dSigmaThPs_dTheta, IONO_NORTH_dSigmaPsPs_dTheta, &
9898
IONO_NORTH_dSigmaThTh_dPsi, IONO_NORTH_dSigmaThPs_dPsi, &

0 commit comments

Comments
 (0)