Skip to content

Commit e7b332f

Browse files
committed
fix Kb_sing calculation
Using a do loop in place of broadcasting is necessary here per the fortran standard since the pointers and arrays are not contiguous in memory.
1 parent 589f263 commit e7b332f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

radiation/TwoStreamMLPEMod.F90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -979,10 +979,12 @@ subroutine ZenithPrep(this,cosz_in)
979979
iter_sing = 0
980980

981981
! Compute the singularity for all bands
982-
Kb_sing(:) = this%band(:)%scelb(ican,icol)%a
983-
if (scelg%lai>nearzero) then
984-
Kb_sing(:) = (Kb_sing(:) * (scelg%lai+scelg%sai) - scelg%sai*Kb_stem)/scelg%lai
985-
end if
982+
do ib = 1,this%n_bands
983+
Kb_sing(ib) = this%band(ib)%scelb(ican,icol)%a
984+
if (scelg%lai>nearzero) then
985+
Kb_sing(ib) = (Kb_sing(ib) * (scelg%lai+scelg%sai) - scelg%sai*Kb_stem)/scelg%lai
986+
end if
987+
end do
986988

987989
do_test_sing: do while(is_sing)
988990
! Now that we have commited to testing it, assume the solution works

0 commit comments

Comments
 (0)