Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coil/field.F
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ SUBROUTINE field_bs_rzphi(nr,nz,np,gdr,gdz,cbr,cbz,cbp,op_verbose)
DO iz=0,nz
DO ip=0,np

phi=ip/REAL(np,8)
phi=ip/REAL(np,r8)
xobs(ir,iz,ip)=gdr(ir,iz)*COS(twopi*phi)
yobs(ir,iz,ip)=gdr(ir,iz)*SIN(twopi*phi)
zobs(ir,iz,ip)=gdz(ir,iz)
Expand Down Expand Up @@ -433,7 +433,7 @@ SUBROUTINE field_bs_rzphi(nr,nz,np,gdr,gdz,cbr,cbz,cbp,op_verbose)
DO iz=0,nz
CALL cspline_alloc(bspl,np,3)
DO ip=0,np
phi=ip/REAL(np,8)
phi=ip/REAL(np,r8)
bspl%xs(ip)=phi
bspl%fs(ip,1)=br(ir,iz,ip)*EXP(twopi*ifac*cnn*phi)
bspl%fs(ip,2)=bz(ir,iz,ip)*EXP(twopi*ifac*cnn*phi)
Expand Down
11 changes: 0 additions & 11 deletions coil/makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# This is the makefile for COIL

# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
else
RECURSFLAG=-frecursive
endif

include ../install/DEFAULTS.inc

IFLAGS = -I../equil -I$(MATHINC) -I$(NETCDFINC)
Expand Down
6 changes: 3 additions & 3 deletions dcon/fourfit.F
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ SUBROUTINE fourfit_kinetic_matrix(methodin,writein)
!$OMP END CRITICAL
IF(debug_omp)THEN
CALL SYSTEM_CLOCK(COUNT=t_end)
t_sec = REAL(t_end-t_start,8)/REAL(cr,8)
t_sec = REAL(t_end-t_start,r8)/REAL(cr,r8)
WRITE(*,'(1x,a5,i3,a6,es16.8,a8)')
$ "ipsi=",ipsi," took ",t_sec," seconds"
ENDIF
Expand Down Expand Up @@ -1303,8 +1303,8 @@ SUBROUTINE fourfit_kinetic_matrix(methodin,writein)
ktmats(i)%xs=rzphi%xs
ENDDO
DO ipsi=0,mpsi
iindex = FLOOR(REAL(ipsi+1,8)/FLOOR((mpsi+1)/10.0))*10
ileft = REAL(ipsi+1,8)/FLOOR((mpsi+1)/10.0)*10-iindex
iindex = FLOOR(REAL(ipsi+1,r8)/FLOOR((mpsi+1)/10.0))*10
ileft = REAL(ipsi+1,r8)/FLOOR((mpsi+1)/10.0)*10-iindex
IF ((ipsi /= 0) .AND. (ileft == 0) .AND. verbose)
$ WRITE(*,*)" ...",iindex,"% of kinetic computations"
kwmat = 0
Expand Down
12 changes: 1 addition & 11 deletions dcon/makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
else
RECURSFLAG=-frecursive
endif

include ../install/DEFAULTS.inc

IFLAGS = -I../equil -I../harvest -I../pentrc -I../vacuum -I$(MATHINC) -I$(NETCDFINC)
F90 = $(FC) $(FFLAGS) $(OMPFLAG) $(IFLAGS) $(RECURSFLAG)
F90 = $(FC) $(FFLAGS) $(OMPFLAG) $(IFLAGS) $(RECURSFLAG) $(LEGACYFLAG)
export FFLAGS # for sub-makes

.f.o:
Expand Down
28 changes: 21 additions & 7 deletions docs/examples/DIIID_ideal_example/coil.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
machine="d3d" ! Choose from: nstx, d3d, kstar, iter
ip_direction="positive" ! Set positive for CCW or negative for CW from a top down view
bt_direction="negative" ! Set positive for CCW or negative for CW from a top down view
coil_num=1 ! Total number of coil sets activated
coil_num=3 ! Total number of coil sets activated

cmpsi=64 ! ?? Why do we need this is only care about psi_lim??
cmtheta=480 ! Number of poloidal gridpoints (uses DCON jac_type??)
Expand All @@ -23,12 +23,26 @@
! bl2l(9), avvu(9), avvm(9), avvl(9)

coil_name(1)="c" ! External correction coil set
coil_cur(1,1)= 1e3 ! 1kA, 19 degree phase n=1 field
coil_cur(1,2)= 5e2
coil_cur(1,3)=-5e2
coil_cur(1,4)=-1e3
coil_cur(1,5)=-5e2
coil_cur(1,6)= 5e2
coil_cur(1,1)= 982 ! 1kA, 30 degree phase n=1 field
coil_cur(1,2)= 656
coil_cur(1,3)=-326
coil_cur(1,4)=-982
coil_cur(1,5)=-656
coil_cur(1,6)= 326
coil_name(2)="il" ! External correction coil set
coil_cur(2,1)= 1e3 ! 1kA, 30 degree phase n=1 field
coil_cur(2,2)= 5e2
coil_cur(2,3)=-5e2
coil_cur(2,4)=-1e3
coil_cur(2,5)=-5e2
coil_cur(2,6)= 5e2
coil_name(3)="iu" ! External correction coil set
coil_cur(3,1)= 1e3 ! 1kA, 30 degree phase n=1 field
coil_cur(3,2)= 5e2
coil_cur(3,3)=-5e2
coil_cur(3,4)=-1e3
coil_cur(3,5)=-5e2
coil_cur(3,6)= 5e2

/
&COIL_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/DIIID_ideal_example/gpec.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

resp_flag=t ! Output energy, reluctance, inductance, and permeability eigenvalues, eigenvectors, and matrices
filter_flag=t ! Outputs energy, reluctance, pereability, and (optionally) the singular-coupling eigenmodes on the control surface
singcoup_flag=f ! Calculate coupling of each m to resonant surfaces
singcoup_flag=t ! Calculate coupling of each m to resonant surfaces
singfld_flag=t ! Output of resonant surface quantities (flux,current,etc.)
vsingfld_flag=f ! Output of vacuum resonant surface quantities
singthresh_flag=t ! Calculate Callen resonant field penetration threshold (requires kinetic profiles from pentrc.in)
Expand Down
2 changes: 2 additions & 0 deletions docs/examples/DIIID_kinetic_example/coil.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
cmpsi=64 ! ?? Why do we need this is only care about psi_lim??
cmtheta=480 ! Number of poloidal gridpoints (uses DCON jac_type??)
cmzeta=40 ! Number of toroidal gridpoints (uses DCON jac_type??)
coil_threads=0 ! Number of parallel threads used when computing fields from coils (no reason to go beyond 4 for coils with less than 1000 points). Setting to <= 0 uses OMP_NUM_THREADS env variable.


! Array values should be specified for each of the coil arrays to be activated.
! The supported coil sets (number of coils) include...
Expand Down
2 changes: 2 additions & 0 deletions docs/examples/DIIID_resistive_example/coil.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
cmpsi=64 ! ?? Why do we need this is only care about psi_lim??
cmtheta=480 ! Number of poloidal gridpoints (uses DCON jac_type??)
cmzeta=40 ! Number of toroidal gridpoints (uses DCON jac_type??)
coil_threads=0 ! Number of parallel threads used when computing fields from coils (no reason to go beyond 4 for coils with less than 1000 points). Setting to <= 0 uses OMP_NUM_THREADS env variable.


! Array values should be specified for each of the coil arrays to be activated.
! The supported coil sets (number of coils) include...
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/DIIID_resistive_example/gpec.in
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@
verbose=t ! Print run log to terminal
/
&GPEC_DIAGNOSE
timeit=f ! Print timer splits for major subroutines
timeit=t ! Print timer splits for major subroutines
radvar_flag=f ! Map various radial variables (rho,psi_tor) on psi_n grid
/
11 changes: 1 addition & 10 deletions equil/makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
else
RECURSFLAG=-frecursive
endif
include ../install/DEFAULTS.inc

F90 = $(FC) $(FFLAGS) $(RECURSFLAG)

Expand Down
12 changes: 1 addition & 11 deletions gpec/makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
else
RECURSFLAG=-frecursive
endif

include ../install/DEFAULTS.inc

IFLAGS = -I../equil -I../vacuum -I../harvest -I../pentrc -I../coil -I../slayer -I$(MATHINC) -I$(NETCDFINC)
F90 = $(FC) $(FFLAGS) $(OMPFLAG) $(IFLAGS) $(RECURSFLAG)
F90 = $(FC) $(FFLAGS) $(OMPFLAG) $(IFLAGS) $(RECURSFLAG) $(LEGACYFLAG)
export FFLAGS # for sub-makes

.f.o:
Expand Down
21 changes: 19 additions & 2 deletions install/DEFAULTS.inc
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,30 @@ ifdef X11_HOME
X11_LIB_DIR = -L$(X11_HOME)/lib
endif

#Common compiler flags for OpenMP
#Different flags for different compilers
ifeq ($(findstring ifort,$(FC)),ifort)
OMPFLAG ?= -qopenmp
ZEROFLAG ?= -zero
RECURSFLAG ?= -recursive
LEGACYFLAG ?=
else ifeq ($(findstring ifx,$(FC)),ifx)
OMPFLAG ?= -qopenmp
ZEROFLAG ?= -zero
RECURSFLAG ?= -recursive
LEGACYFLAG ?=
else ifeq ($(findstring gfortran,$(FC)),gfortran)
OMPFLAG ?= -fopenmp
ZEROFLAG ?= -finit-local-zero
RECURSFLAG ?= -frecursive
LEGACYFLAG ?= -std=legacy
else ifeq ($(findstring pgfortran,$(FC)),pgfortran)
OMPFLAG ?= -mp
ZEROFLAG ?= -zeroinit
RECURSFLAG ?= -Mrecursive

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did my best here to find what flags pgfortran would use but I have never used pgfortran before -- it seems like this was just used for GPU stuff related to #116.

LEGACYFLAG ?= -std=legacy
else
ZEROFLAG ?= -zero
OMPFLAG ?= -openmp
endif
RECURSFLAG ?= -recursive
LEGACYFLAG ?= -std=legacy
endif
4 changes: 2 additions & 2 deletions install/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export LDFLAGS

.IGNORE:

all: v harvest equil lsode zlange zvode orbit vacuum pentrc dcon match rdcon rmatch \
all: v harvest equil lsode zlange zvode orbit vacuum pentrc dcon match rdcon rmatch \
multi sum xdraw slayer coil gpec stride mkbin

# fortran only
allf: v harvest equil lsode zlange zvode orbit vacuum pentrc dcon match rdcon rmatch \
allf: v harvest equil lsode zlange zvode orbit vacuum pentrc dcon match rdcon rmatch \
multi sum slayer coil gpec stride mkbin


Expand Down
10 changes: 1 addition & 9 deletions lsode/makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@

ifneq (,$(findstring ifort,$(FC)))
EXTRAFLAGS=-recursive
else ifneq (,$(findstring ifx,$(FC)))
EXTRAFLAGS=-recursive
else
EXTRAFLAGS=-frecursive -std=legacy
endif

include ../install/DEFAULTS.inc

F90 = $(FC) $(FFLAGS) $(EXTRAFLAGS) $(OMPFLAG) -I../equil
F90 = $(FC) $(FFLAGS) $(RECURSFLAG) $(LEGACYFLAG) $(OMPFLAG) -I../equil

LIBDIR = ../lib
LIBS = \
Expand Down
10 changes: 0 additions & 10 deletions match/makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
else
RECURSFLAG=-frecursive
endif

include ../install/DEFAULTS.inc

Expand Down
11 changes: 0 additions & 11 deletions orbit/makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@

include ../install/DEFAULTS.inc

# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
else
RECURSFLAG=-frecursive
endif

IFLAGS = -I../equil -I$(MATHINC)
F90 = $(FC) $(FFLAGS) $(OMPFLAG) $(IFLAGS) $(RECURSFLAG)
export FFLAGS
Expand Down
15 changes: 0 additions & 15 deletions pentrc/makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
LEGACYFLAG=
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
LEGACYFLAG=
else
RECURSFLAG=-frecursive
LEGACYFLAG=-std=legacy
endif



include ../install/DEFAULTS.inc

Expand Down
4 changes: 2 additions & 2 deletions rmatch/deltac.f
Original file line number Diff line number Diff line change
Expand Up @@ -1492,10 +1492,10 @@ SUBROUTINE deltac_lsode_int(u_res,u_h1,u_h2)
CALL deltac_lsode_der(neq,x0,u,u)
u=u*deltac_tol
DO ip=1,neq/2
c tmp=MAX( DABS(REAL(u(ip),8)),DABS(IMAG(u(ip),8)) )
c tmp=MAX( DABS(REAL(u(ip),r8)),DABS(IMAG(u(ip),r8)) )
tmp=CDABS(u(ip))
IF (tmp <deltac_tol) tmp=deltac_tol
atol(ip)=CMPLX(tmp,tmp,8)
atol(ip)=CMPLX(tmp,tmp,r8)
ENDDO
u=0
iwork=0
Expand Down
10 changes: 0 additions & 10 deletions rmatch/makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
LEGACYFLAG=
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
LEGACYFLAG=
else
RECURSFLAG=-frecursive
LEGACYFLAG=-std=legacy
endif

include ../install/DEFAULTS.inc

Expand Down
4 changes: 2 additions & 2 deletions stride/free.f
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ SUBROUTINE free_calc_wp()
c-----------------------------------------------------------------------
CALL SYSTEM_CLOCK(COUNT=fTime)
IF (verbose_performance_output) THEN
print*,"*** wp-calc time=",REAL(fTime-sTime,8)/REAL(cr,8)
print*,"*** wp-calc time=",REAL(fTime-sTime,r8)/REAL(cr,r8)
ENDIF
c-----------------------------------------------------------------------
c terminate.
Expand Down Expand Up @@ -142,7 +142,7 @@ SUBROUTINE free_calc_wv()
c-----------------------------------------------------------------------
CALL SYSTEM_CLOCK(COUNT=fTime)
IF (verbose_performance_output) THEN
print*,"*** wv-calc time=",REAL(fTime-sTime,8)/REAL(cr,8)
print*,"*** wv-calc time=",REAL(fTime-sTime,r8)/REAL(cr,r8)
ENDIF
c-----------------------------------------------------------------------
c terminate.
Expand Down
14 changes: 0 additions & 14 deletions stride/makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
# This is the makefile for STRIDE.

# If using gfortran, the proper syntax is -frecursive.
# If using ifort, the proper syntax is -recursive.

ifneq (,$(findstring ifort,$(FC)))
RECURSFLAG=-recursive
LEGACYFLAG=
else ifneq (,$(findstring ifx,$(FC)))
RECURSFLAG=-recursive
LEGACYFLAG=
else
RECURSFLAG=-frecursive
LEGACYFLAG=-std=legacy
endif

include ../install/DEFAULTS.inc

# flags unique to stride (not to be clobbered by top level install/makefile options)
Expand Down
Loading