diff --git a/Makefile.jetto b/Makefile.jetto index 2866f26..ce0f6f5 100644 --- a/Makefile.jetto +++ b/Makefile.jetto @@ -11,14 +11,12 @@ # D. Harting, d.harting@fz-juelich.de # Set the environment from the top-level Makefile of JETTO # -------------------------------------------------------- -#include ../include.mk +include ../include.mk # Alternative search paths vpath %.f90 src -JLIBDIR = ./ -F90 = gfortran -DIRECTIVES = -DREVISION="'$(shell svnversion src)'" +DIRECTIVES = -DEXTBES -DREVISION="rev.155 JETTO" #'$(shell svnversion src)'" # library name # ------------ @@ -40,11 +38,11 @@ FC=$(F90) # Set compiler debug and optimization flags # ----------------------------------------- ifeq ("$(DBG)","") -# FFLAGS= $(AUTO) -O3 -Mpreprocess - FFLAGS=-O3 -cpp + FFLAGS= $(AUTO) -O3 -Mpreprocess +# FFLAGS=-O3 -cpp else -# FFLAGS= $(AUTO) -O0 -Mpreprocess -g -Minform=inform -Mbounds -Mchkptr - FFLAGS=-Wall -g -finit-real=nan -ffpe-trap=invalid -fcheck=all -fbounds-check + FFLAGS= $(AUTO) -O0 -Mpreprocess -g -Minform=inform -Mbounds -Mchkptr +# FFLAGS=-Wall -g -finit-real=nan -ffpe-trap=invalid -fcheck=all -fbounds-check endif # Set include directories @@ -100,10 +98,8 @@ clean: # Dependencies # ------------ -main.o: const_and_precisions.o beams.o coreprofiles.o equilibrium.o \ - graycore.o gray_params.o reflections.o gray_jetto1beam.o: const_and_precisions.o beams.o graycore.o gray_params.o \ - units.o + reflections.o units.o graycore.o: const_and_precisions.o beamdata.o beams.o coreprofiles.o \ dispersion.o eccd.o equilibrium.o errcodes.o gray_params.o \ diff --git a/src/eccd.f90 b/src/eccd.f90 index 48e3bf5..b6f0ebd 100644 --- a/src/eccd.f90 +++ b/src/eccd.f90 @@ -350,6 +350,9 @@ contains ! ajbnm,ajbnp,ajbn real(wp_), dimension(3) :: ajb complex(wp_) :: ex,ey,ez,emxy,epxy +#ifdef EXTBES + real(wp_), external :: dbesjn +#endif yg=extrapar(1) anpl=extrapar(2) @@ -382,13 +385,13 @@ contains thn2u=upr2*thn2 else ! Full polarization term -! nm=nhn-1 -! np=nhn+1 -! ajbnm=dbesjn(nm, bb) -! ajbnp=dbesjn(np, bb) -! ajbn=dbesjn(nhn, bb) -! thn2u=(abs(ez*ajbn*upl+upr*(ajbnp*epxy+ajbnm*emxy)/2.0_wp_))**2 +#ifdef EXTBES + ajb(1)=dbesjn(nhn-1,bb) + ajb(2)=dbesjn(nhn ,bb) + ajb(3)=dbesjn(nhn+1,bb) +#else ajb=bessel_jn(nhn-1, nhn+1, bb) +#endif thn2u=(abs(ez*ajb(2)*upl+upr*(ajb(3)*epxy+ajb(1)*emxy)/2.0_wp_))**2 end if end if diff --git a/src/gray_jetto1beam.f90 b/src/gray_jetto1beam.f90 index c0f0d4e..0a689e5 100644 --- a/src/gray_jetto1beam.f90 +++ b/src/gray_jetto1beam.f90 @@ -8,6 +8,7 @@ subroutine gray_jetto1beam(ijetto, mr, mz, r, z, psin, psia, rax, zax, & eqparam_type,prfparam_type,outparam_type use beams, only : read_beam2 use graycore, only : gray_main + use reflections, only : range2rect implicit none ! arguments integer, intent(in) :: ijetto, mr, mz, nbnd, nrho, ibeam diff --git a/srcjetto/gray.f b/srcjetto/gray.f index a2f1611..e61f8b4 100644 --- a/srcjetto/gray.f +++ b/srcjetto/gray.f @@ -4,7 +4,7 @@ . qsf, nbeam, powin, alphin, betain, dpdv, jcd, pec, icd, ierr) implicit none ! input arguments - integer ijetto, mr, mz, nbnd, nrho, nbeam + integer ijetto, mr, mz, mrd, nbnd, nrho, nbeam real*8 r(mr), z(mz), psin(mrd,mz) real*8 psiax, psibnd, rax, zax real*8 rbnd(nbnd), zbnd(nbnd) @@ -16,6 +16,8 @@ ! gray_main output arguments real*8 dpdvloop(nrho), jcdloop(nrho), pecloop, icdloop integer ierr +! local variables + integer i,j ! === input arguments ================================================== ! @@ -93,7 +95,7 @@ ! and adjust alpha/beta if out of the allowed range ! call main subroutine for the j-th beam - subroutine gray_jetto1beam(ijetto, mr, mz, r, z, psin(1:mr,:), + call gray_jetto1beam(ijetto, mr, mz, r, z, psin(1:mr,:), . psibnd-psiax, rax, zax, nbnd, rbnd, zbnd, nrho, psijet, -f, . te, dne, zeff, -qsf, j, powin(j), alphin(j), betain(j), . dpdvloop, jcdloop, pecloop, icdloop, ierr)