From 9ba3286ae5f0e12e1bed1ddcd8df33d8cea8a0e6 Mon Sep 17 00:00:00 2001 From: Kareem Sorathia Date: Wed, 12 Nov 2025 13:29:48 -0500 Subject: [PATCH] Fixing compiler-dep. seg fault when doCC=F --- src/raiju/raijulosses.F90 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/raiju/raijulosses.F90 b/src/raiju/raijulosses.F90 index 3a18fc45..f964e671 100644 --- a/src/raiju/raijulosses.F90 +++ b/src/raiju/raijulosses.F90 @@ -205,6 +205,7 @@ module raijulosses !logical, dimension(Grid%shGrid%isg:Grid%shGrid%ieg, & ! Grid%shGrid%jsg:Grid%shGrid%jeg) :: isGood real(rp) :: deleta, eta0, pNFlux, tau + logical :: isValid !where (State%active .eq. RAIJUACTIVE) ! isGood = .true. @@ -212,9 +213,6 @@ module raijulosses ! isGood = .false. !end where - ! ! !$OMP PARALLEL DO default(shared) collapse(1) & - ! ! !$OMP schedule(dynamic) & - ! ! !$OMP private(j,i,eta0, deleta) do j=Grid%shGrid%jsg,Grid%shGrid%jeg do i=Grid%shGrid%isg,Grid%shGrid%ieg !if (.not. isGood(i,j)) then @@ -242,8 +240,11 @@ module raijulosses State%precipNFlux(k)%data(i,j) = State%precipNFlux(k)%data(i,j) + dt*pNFlux State%precipEFlux(k)%data(i,j) = State%precipEFlux(k)%data(i,j) + dt*nFlux2EFlux(pNFlux, Grid%alamc(k), State%bVol_cc(i,j)) + isValid = .false. + if (Model%doCC) isValid = State%lps(State%lp_cc_idx)%p%isValidSpc(Grid%spc(Grid%k2spc(k))) + ! Do special stuff for Coulomb collision effects - if (Model%doCC .and. State%lps(State%lp_cc_idx)%p%isValidSpc(Grid%spc(Grid%k2spc(k)))) then + if (isValid) then ! We can estimate heat transfer to plasmasphere electrons by energy lost from RC species to CC ! So we can follow same prodecure as above, by using just CC tau and dividing later by coupling dt to get average heat flux ! Treating this separately from precipication since its not actually precipitating ions