From 49303ac2e34c2c837c50c309961a97e27e1ed23a Mon Sep 17 00:00:00 2001 From: Daniele Micheletti Date: Thu, 14 Mar 2019 10:47:39 +0000 Subject: [PATCH] refl/gray/after_onestep: fixed test for 2nd pass, fixed exin2,eyin2 evaluation, added test for powrfl<0 --- src/gray.f | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gray.f b/src/gray.f index ac648db..637afd1 100644 --- a/src/gray.f +++ b/src/gray.f @@ -424,7 +424,7 @@ c central ray re-enters the plasma . (taumn.lt.1.0e+30_wp_.and.taumn.gt.taucr)))) then istop=1 else if(ipass.gt.1 .and. index_rt.eq.1 .and. - . ((iowmin.gt.1 .and. aknmin.gt.0) .or. + . ((iowmax.gt.1 .and. aknmin.gt.0) .or. . (iowmax.le.1 .and. iop(1,1).gt.2))) then c flag second pass mode coupling as unset powrfl=-1.0_wp_ @@ -448,7 +448,7 @@ c determine mode coupling at the plasma boundary c look for first ray hitting the plasma, starting from the central c and evaluate polarization if (ivac.eq.1) then - y(1:3)=xvjk(:,j,k) + y(1:3)=xvvac y(4:6)=anvjk(:,j,k) call fwork(y,dery) call pol_limit(exin2,eyin2) @@ -477,6 +477,7 @@ c initial polarization (possibly reflected) end if end do end do + if(powrfl.lt.0.0_wp_) powrfl=0.0_wp_ strfl11=i*dst write(6,*) ' ' write(6,*) 'Reflected power fraction =',powrfl