From 6c4682fb56bc8a8fdaa2a27fd4972ae0ee6449c2 Mon Sep 17 00:00:00 2001 From: Daniela Farina Date: Tue, 28 Aug 2012 14:01:09 +0000 Subject: [PATCH] restored old contour_psi routine. Added check on regrid output --- src/gray.f | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/gray.f b/src/gray.f index 2c8a9a6..94a8e4a 100644 --- a/src/gray.f +++ b/src/gray.f @@ -1200,7 +1200,7 @@ c icocos<10: input psi is in Wb/rad (gray convention) do j=1,nz do i=1,nr if(ipsinorm.eq.0) then - psin(i,j)=abs(psi(i,j)-psiax)/abs(psia0) + psin(i,j)=(psi(i,j)-psiax)/(psia0) psi(i,j)=psin(i,j)*psia else psi(i,j)=psin(i,j)*psia @@ -1216,6 +1216,12 @@ c call regrid(iopt,nr,rv,nz,zv,fvpsi,rmnm,rmxm,zmnm,zmxm, . kspl,kspl,sspl,nrest,nzest,nsr,tr,nsz,tz,cc,fp, . wrk,lwrk,iwrk,liwrk,ier) + if(ier.eq.-1) then + sspl=0.0d0 + call regrid(iopt,nr,rv,nz,zv,fvpsi,rmnm,rmxm,zmnm,zmxm, + . kspl,kspl,sspl,nrest,nzest,nsr,tr,nsz,tz,cc,fp, + . wrk,lwrk,iwrk,liwrk,ier) + end if nsrt=nsr nszt=nsz if (sspl.gt.0.0d0) then @@ -2056,18 +2062,18 @@ c call profil(iopt,tr,nsr,tz,nsz,cc,kspl,kspl,zc,nsr,czc,ier) if(ier.gt.0) print*,' profil =',ier val=h+psiaxis0/psia - call sproota(val,tr,nsr,czc,zeroc,mest,m,ier) - call sort (mest, zeroc) + call sproota(val,tr,nsr,czc,zeroc,mest,m,ier) if (zeroc(1).gt.rwallm) then - iic=1 - else - iic=2 - if (zeroc(2).lt.rwallm) iic=3 - end if - rcn(ic)=zeroc(iic) + rcn(ic)=zeroc(1) zcn(ic)=zc - rcn(2*np+2-ic)=zeroc(iic+1) + rcn(2*np+2-ic)=zeroc(2) zcn(2*np+2-ic)=zc + else + rcn(ic)=zeroc(2) + zcn(ic)=zc + rcn(2*np+2-ic)=zeroc(3) + zcn(2*np+2-ic)=zc + end if end do if (ipr.gt.0) then do ii=1,2*np+1