Skip to content

Commit

Permalink
Merge branch 'master' into dmd
Browse files Browse the repository at this point in the history
  • Loading branch information
jcandy committed Jan 13, 2025
2 parents 46aac74 + 38ef8eb commit e0f553d
Show file tree
Hide file tree
Showing 8 changed files with 288 additions and 234 deletions.
2 changes: 1 addition & 1 deletion le3/src/le3_geometry.f90
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ subroutine le3_geometry
! cos(u) = Z_t/sqrt(g_tt)
cosu(:,:) = dzdt/sqrt(gtt)

btor(:,:) = 1.0/(r*g)
btor(:,:) = 1.0/g*sqrt(gpp)

bpol(:,:) = 1.0/g*(gpt/sqrt(gtt)+iota*sqrt(gtt))

Expand Down
10 changes: 4 additions & 6 deletions le3/src/le3_geometry_matrix.f90
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ subroutine le3_geometry_matrix
! B/Bunit
call remap_theta(bmag(:,:),xtemp(:,:),0.0)
write (1,'(e16.8)') xtemp(:,:)

! Btor/Bunit
call remap_theta(btor(:,:),xtemp(:,:),0.0)
write (1,'(e16.8)') xtemp(:,:)

! anorm*(bhat dot grad) = bdotgrad * (iota d/dt + d/dp) = (1) d/dt + (2) d/dp
call remap_theta(bdotgrad(:,:),xtemp(:,:),0.0)
Expand All @@ -532,9 +536,6 @@ subroutine le3_geometry_matrix
write (1,'(e16.8)') grad_perpsq_gk(:,:,2)
write (1,'(e16.8)') grad_perpsq_gk(:,:,3)

call remap_theta(b1(:,:),xtemp(:,:),0.0)
write (1,'(e16.8)') xtemp(:,:)

call remap_theta(chi1(:,:),xtemp(:,:),0.0)
write (1,'(e16.8)') xtemp(:,:)

Expand All @@ -543,9 +544,6 @@ subroutine le3_geometry_matrix

call remap_theta(dtheta(:,:),xtemp(:,:),0.0)
write (1,'(e16.8)') xtemp(:,:)

call remap_theta(dtheta_t(:,:),xtemp(:,:),0.0)
write (1,'(e16.8)') xtemp(:,:)

close(1)
deallocate(xtemp)
Expand Down
56 changes: 26 additions & 30 deletions le3/src/le3_geometry_rho.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subroutine le3_geometry_rho
real :: up,pp,pt
real :: d0, eta, d1, gpp_1, gtt_1, gpt_1
real :: sum1, sum2, sum3, sum4

real, dimension(:,:), allocatable :: s1a,s1b
real, dimension(:,:), allocatable :: s2a,s2b
real, dimension(:,:), allocatable :: a11a,a11b
Expand Down Expand Up @@ -279,35 +279,31 @@ subroutine le3_geometry_rho
!--------------------------------------------------------------------
! Check with GEO result
!
if (equilibrium_model == 0) then
GEO_model_in = 0
GEO_rmin_in = rmin
GEO_rmaj_in = rmaj
GEO_drmaj_in = shift
GEO_zmag_in = zmag
GEO_dzmag_in = dzmag
GEO_q_in = q
GEO_s_in = s
GEO_kappa_in = kappa
GEO_s_kappa_in = s_kappa
GEO_delta_in = delta
GEO_s_delta_in = s_delta
GEO_zeta_in = zeta
GEO_s_zeta_in = s_zeta
GEO_beta_star_in = beta_star
!call GEO_alloc(1)
!call GEO_do()
!open(unit=1,file='out.miller',status='replace')
!do i=1,n_theta
! theta = (i-1)*2*pi/(n_theta-1)-pi
! call GEO_interp(theta)
! print '(2(1pe12.5,1x))', GEO_theta_s,GEO_chi2
! write(1,*) GEO_theta_s,GEO_chi2
!enddo
!close(1)
!call GEO_alloc(0)

endif
!if (equilibrium_model == 0) then
! GEO_model_in = 0
! GEO_rmin_in = rmin
! GEO_rmaj_in = rmaj
! GEO_drmaj_in = shift
! GEO_zmag_in = zmag
! GEO_dzmag_in = dzmag
! GEO_q_in = q
! GEO_s_in = s
! GEO_kappa_in = kappa
! GEO_s_kappa_in = s_kappa
! GEO_delta_in = delta
! GEO_s_delta_in = s_delta
! GEO_zeta_in = zeta
! GEO_s_zeta_in = s_zeta
! GEO_beta_star_in = beta_star
! call GEO_alloc(1)
! call GEO_do()
!call GEO_interp(nt,tb(:,1),.false.)
!do i=1,nt
! print *, tb(i,1), btor(i,1), GEO_bt(i), bpol(i,1), GEO_bp(i)
!enddo
!close(1)
!call GEO_alloc(0)
!endif
!--------------------------------------------------------------------

deallocate(sys_m)
Expand Down
52 changes: 52 additions & 0 deletions platform/build/make.inc.OSX_SEQUOIA
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#---------------------------------------------------
# OSX Sequoia 15.2
#
# macport installation instructions for new Mac
# running Sequoia, assuming OMFIT being installed as
# well. YMMV.
# uses XCODE 16.2
#
# 1) install OMFIT via macports- gets initial
# dependencies
# 2) sudo port install mpich
# 3) sudo port install netcdf-fortran
# 4) determine local host name via uname -n
# add following line to /etc/hosts
# 127.0.0.1 <local host name>
#
#---------------------------------------------------

# Compilers and flags

FC = mpif90 -DNO_DIMATCOPY -I$(GACODE_ROOT)/modules -J$(GACODE_ROOT)/modules -fPIC -framework Accelerate
F77 = mpif77 -std=legacy
CC = ${FC}

GOMPTEST := $(shell ${CC} -v 2>&1 | grep " version " | grep gcc >/dev/null; echo $$?)
ifeq ($(GOMPTEST),0)
FOMP =-fopenmp
endif

FMATH =-fdefault-real-8 -fdefault-double-8
FOPT =-O3
FDEBUG =-Wall -fcheck=all -ffpe-trap=invalid,zero,overflow -g -fbacktrace
F2PY = f2py

# System math libraries

LMATH = /opt/local/lib/libfftw3.a
FFTW_INC = /opt/local/include

ifdef FANN_ROOT
# neural net libraries
NN_LIB=-L$(GACODE_ROOT)/../neural/ -I$(GACODE_ROOT)/../neural/ -lbrainfuse -lfann
endif

# NetCDF libraries

NETCDF = -L/opt/local/lib -lnetcdff -L/opt/local/lib -Wl,-headerpad_max_install_names -lnetcdf -lnetcdf
NETCDF_INC = /opt/local/include

# Archive

ARCH = ar cr
13 changes: 13 additions & 0 deletions platform/exec/exec.OSX_SEQUOIA
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# GACODE Parallel execution script (OSX_MOUNTAINLION)

simdir=${1}
nmpi=${2}
exec=${3}
nomp=${4}
numa=${5}
mpinuma=${6}

cd $simdir
mpirun -env OMP_NUM_THREADS $nomp -np $nmpi $exec

Loading

0 comments on commit e0f553d

Please sign in to comment.