changed a few dynamic allocations into automatic
This commit is contained in:
parent
e31949e5ae
commit
9a64cc5e59
32
src/gray.f
32
src/gray.f
@ -2105,7 +2105,7 @@ c arguments
|
|||||||
c local variables
|
c local variables
|
||||||
integer iopt,ier,k
|
integer iopt,ier,k
|
||||||
real(wp_) dx,drhot
|
real(wp_) dx,drhot
|
||||||
real(wp_), dimension(:), allocatable :: rhotnr
|
real(wp_), dimension(nr) :: rhotnr
|
||||||
c common/external functions/variables
|
c common/external functions/variables
|
||||||
real(wp_) rhotsx
|
real(wp_) rhotsx
|
||||||
c
|
c
|
||||||
@ -2113,7 +2113,7 @@ c
|
|||||||
c
|
c
|
||||||
if(allocated(cq)) deallocate(cq)
|
if(allocated(cq)) deallocate(cq)
|
||||||
if(allocated(crhot)) deallocate(crhot)
|
if(allocated(crhot)) deallocate(crhot)
|
||||||
allocate(rhotnr(nr),cq(nr,4),crhot(nr,4))
|
allocate(cq(nr,4),crhot(nr,4))
|
||||||
c
|
c
|
||||||
c normalized toroidal rho : ~ Integral q(psi) dpsi
|
c normalized toroidal rho : ~ Integral q(psi) dpsi
|
||||||
c
|
c
|
||||||
@ -2136,8 +2136,6 @@ c spline interpolation of rhotor
|
|||||||
c
|
c
|
||||||
iopt=0
|
iopt=0
|
||||||
call difcsn(psinr,rhotnr,nr,nnr,iopt,crhot,ier)
|
call difcsn(psinr,rhotnr,nr,nnr,iopt,crhot,ier)
|
||||||
c
|
|
||||||
deallocate(rhotnr)
|
|
||||||
c
|
c
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -2331,13 +2329,10 @@ c local variables
|
|||||||
integer, dimension(3,2) :: ja
|
integer, dimension(3,2) :: ja
|
||||||
integer, dimension(1000) :: lx
|
integer, dimension(1000) :: lx
|
||||||
real(wp_) :: drgrd,dzgrd,ah,adn,px,x,y
|
real(wp_) :: drgrd,dzgrd,ah,adn,px,x,y
|
||||||
real(wp_), dimension(:), allocatable :: a
|
real(wp_), dimension(nr*nz) :: a
|
||||||
c
|
c
|
||||||
data px/0.5d0/
|
data px/0.5d0/
|
||||||
c
|
c
|
||||||
if(allocated(a)) deallocate(a)
|
|
||||||
allocate(a(nr*nz))
|
|
||||||
c
|
|
||||||
if(ichoi.eq.0) then
|
if(ichoi.eq.0) then
|
||||||
do j=1,nz
|
do j=1,nz
|
||||||
do i=1,nr
|
do i=1,nr
|
||||||
@ -2505,8 +2500,6 @@ c
|
|||||||
npts(ncon) = icount - iclast
|
npts(ncon) = icount - iclast
|
||||||
iclast = icount
|
iclast = icount
|
||||||
50 continue
|
50 continue
|
||||||
c
|
|
||||||
deallocate(a)
|
|
||||||
c
|
c
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -2531,11 +2524,9 @@ c local variables
|
|||||||
integer :: np,info,ic,ier,ii,iopt,m
|
integer :: np,info,ic,ier,ii,iopt,m
|
||||||
real(wp_) :: ra,rb,za,zb,th,zc,val
|
real(wp_) :: ra,rb,za,zb,th,zc,val
|
||||||
real(wp_), dimension(mest) :: zeroc
|
real(wp_), dimension(mest) :: zeroc
|
||||||
real(wp_), dimension(:), allocatable :: czc
|
real(wp_), dimension(nr+4) :: czc
|
||||||
c
|
c
|
||||||
np=(npoints-1)/2
|
np=(npoints-1)/2
|
||||||
if(allocated(czc)) deallocate(czc)
|
|
||||||
allocate(czc(nr+4))
|
|
||||||
c
|
c
|
||||||
ra=rup
|
ra=rup
|
||||||
rb=rlw
|
rb=rlw
|
||||||
@ -2577,8 +2568,6 @@ c
|
|||||||
write(71,*)
|
write(71,*)
|
||||||
write(71,*)
|
write(71,*)
|
||||||
end if
|
end if
|
||||||
c
|
|
||||||
deallocate(czc)
|
|
||||||
c
|
c
|
||||||
return
|
return
|
||||||
111 format(i6,12(1x,e12.5))
|
111 format(i6,12(1x,e12.5))
|
||||||
@ -2628,9 +2617,8 @@ c
|
|||||||
if(allocated(tjp)) deallocate(tjp)
|
if(allocated(tjp)) deallocate(tjp)
|
||||||
if(allocated(tlm)) deallocate(tlm)
|
if(allocated(tlm)) deallocate(tlm)
|
||||||
if(allocated(ch)) deallocate(ch)
|
if(allocated(ch)) deallocate(ch)
|
||||||
if(allocated(ch01)) deallocate(ch01)
|
|
||||||
allocate(tjp(njest),tlm(nlest),ch((njest-4)*(nlest-4)),
|
allocate(tjp(njest),tlm(nlest),ch((njest-4)*(nlest-4)),
|
||||||
. ch01(lw01),rctemp(npoints),zctemp(npoints),stat=ierr)
|
. rctemp(npoints),zctemp(npoints),stat=ierr)
|
||||||
if (ierr.ne.0) return
|
if (ierr.ne.0) return
|
||||||
|
|
||||||
c computation of flux surface averaged quantities
|
c computation of flux surface averaged quantities
|
||||||
@ -2938,9 +2926,6 @@ c spline interpolation of H(lambda,rhop) and dH/dlambda
|
|||||||
njpt=njp
|
njpt=njp
|
||||||
nlmt=nlm
|
nlmt=nlm
|
||||||
|
|
||||||
call coeff_parder(tjp,njp,tlm,nlm,ch,ksp,ksp,0,1,
|
|
||||||
. ch01,lw01,ier)
|
|
||||||
c
|
|
||||||
return
|
return
|
||||||
99 format(20(1x,e12.5))
|
99 format(20(1x,e12.5))
|
||||||
end
|
end
|
||||||
@ -4813,10 +4798,7 @@ c local variables
|
|||||||
integer :: iopt,ier,m
|
integer :: iopt,ier,m
|
||||||
real(wp_) :: zc,val
|
real(wp_) :: zc,val
|
||||||
real(wp_), dimension(mest) :: zeroc
|
real(wp_), dimension(mest) :: zeroc
|
||||||
real(wp_), dimension(:), allocatable :: czc
|
real(wp_), dimension(nr+4) :: czc
|
||||||
c
|
|
||||||
if(allocated(czc)) deallocate(czc)
|
|
||||||
allocate(czc(nr+4))
|
|
||||||
c
|
c
|
||||||
iopt=1
|
iopt=1
|
||||||
zc=zmaxis
|
zc=zmaxis
|
||||||
@ -4826,8 +4808,6 @@ c
|
|||||||
call sproota(val,tr,nsr,czc,zeroc,mest,m,ier)
|
call sproota(val,tr,nsr,czc,zeroc,mest,m,ier)
|
||||||
r1=zeroc(1)
|
r1=zeroc(1)
|
||||||
r2=zeroc(2)
|
r2=zeroc(2)
|
||||||
c
|
|
||||||
deallocate(czc)
|
|
||||||
c
|
c
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user