From 1b037fa88a44a1780e0fb0540d779ae405eb7b22 Mon Sep 17 00:00:00 2001 From: Lorenzo Figini Date: Wed, 29 Aug 2012 16:22:02 +0000 Subject: [PATCH] added check (z only) to avoid absorption outside the plasma boundary --- src/gray.f | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gray.f b/src/gray.f index 94a8e4a..781a860 100644 --- a/src/gray.f +++ b/src/gray.f @@ -209,6 +209,7 @@ c common/index_rt/index_rt common/ipass/ipass common/rwallm/rwallm + common/bound/zbmin,zbmax pabstot=0.0d0 currtot=0.0d0 @@ -236,10 +237,12 @@ c ierr=0 psjki(j,k,i)=psinv rrm=sqrt(xv(1)**2+xv(2)**2)/100.d0 + zzm=xv(3)/100.d0 if(j.eq.1) rrm11=rrm if (iwarm.gt.0.and.i.gt.1) then - if(psinv.ge.0.and.psinv.le.1.0d0) then + if(psinv.ge.0.and.psinv.le.1.0d0.and. + . zzm.ge.zbmin.and.zzm.le.zbmax) then call pabs_curr(i,j,k) iiv(j,k)=i else @@ -254,7 +257,7 @@ c ierr=0 if(i.gt.1.and.psinv.ge.0.and.psinv.lt.psdbnd) . iov(j,k)=1 - if(iov(j,k).eq.1.and.psinv.ge.psdbnd) iov(j,k)=2 + if(iov(j,k).eq.1.and.psinv.ge.1.0d0) iov(j,k)=2 c iov=0 initially, iov=1 first entrance in plasma, c iov=2 first exit from plasma, iov=3 after 2nd entrance into plasma