Skip to content

Commit 65e1e01

Browse files
committed
keep up w master 7
1 parent 2a42194 commit 65e1e01

File tree

4 files changed

+49
-35
lines changed

4 files changed

+49
-35
lines changed

src/dforce.f90

+4-12
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,10 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis)
458458
voltotal = voltotal+vvolume(vvol)
459459
!write(*,*) "Calc beta: ", betavol(vvol), vvolume(vvol)
460460
enddo
461-
! Calculate total beta which is obtained from individual betas
462-
! write(*,*) "all betas", betavol(1:Nvol)
463-
BetaTotal = sum(betavol(1:Nvol))/voltotal
464-
! write(*,*) "Total BETA ", BetaTotal
465-
! write(*,*)"total vol", voltotal
461+
462+
BetaTotal = sum(betavol(1:Nvol))/voltotal ! Calculate total beta which is obtained from individual betas
466463

467464
Energy = sum( lBBintegral(1:Nvol) ) ! should also compute beta;
468-
! write(*,*)"total Energy", Energy
469-
!write(*,*) "Betatotal", BetaTotal, voltotal
470465

471466
!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!
472467

@@ -974,10 +969,7 @@ subroutine dforce( NGdof, position, force, LComputeDerivatives, LComputeAxis)
974969
!call MPI_BARRIER( MPI_COMM_WORLD, ierr )
975970

976971
!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!
977-
978-
!if(LcomputeDerivatives .and. Lhessianallocated .and. Igeometry .eq. 1) then
979-
!if(Lhessianallocated .and. Igeometry .eq. 1) then
980-
972+
981973
if(Lhessianallocated .and. Igeometry.eq.1) then
982974
if( myid.eq.0 ) then ; cput = GETTIME ; write(ounit,'("hesian : ",f10.2," : LHmatrix="L2" ;")')cput-cpus, LHmatrix ;
983975
write(*,*) "Writing .hessian file..."
@@ -1013,7 +1005,7 @@ subroutine fndiff_dforce( NGdof )
10131005
iRbc, iZbs, iRbs, iZbc, &
10141006
LGdof, psifactor, dBdX, &
10151007
YESstellsym, NOTstellsym, &
1016-
hessian, ext, vvolume
1008+
hessian, ext
10171009

10181010
LOCALS
10191011

src/dfp100.f90

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ subroutine dfp100(Ndofgl, x, Fvec, LComputeDerivatives)
8181
LOGICAL :: LComputeDerivatives
8282
INTEGER :: deriv, Lcurvature
8383

84+
85+
8486
BEGIN(dfp100)
8587

8688
dpflux(2:Mvol) = x - xoffset

src/global.f90

+42-22
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ module allglobal
246246

247247
!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!
248248

249-
CHARACTER(LEN=1000) :: ext ! extension of input filename, i.e., "path/G3V01L1Fi.001" for an input file path/G3V01L1Fi.001.sp
249+
CHARACTER(LEN=1000) :: ext ! extension of input filename, i.e., "path/G3V01L1Fi.001" for an input file path/G3V01L1Fi.001.sp
250250

251251
REAL :: ForceErr !< total force-imbalance
252252
REAL :: Energy !< MHD energy
@@ -952,6 +952,26 @@ subroutine set_mpi_comm(comm)
952952

953953
!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!
954954

955+
pure function get_hidden(ext) result(hidden_ext)
956+
implicit none
957+
CHARACTER(len=1000), intent(in) :: ext
958+
! ext with a "." prefix added to the basename "path/.G3V01L1Fi.001" for an input file path/G3V01L1Fi.001.sp
959+
CHARACTER(LEN=1000) :: hidden_ext
960+
INTEGER :: basename_start_index
961+
962+
! Prepare the "hidden" ext filepath that has a "." prefix.
963+
! Split ext into directory path and basename using INDEX function, then concatenate them again with a "." inbetween
964+
#ifdef _WIN32
965+
basename_start_index = INDEX(ext, '\', .TRUE.)
966+
#else
967+
basename_start_index = INDEX(ext, '/', .TRUE.)
968+
#endif
969+
! folder + . + filename
970+
hidden_ext = trim(ext(1:basename_start_index))//"."//trim(ext(basename_start_index+1:))
971+
end function get_hidden
972+
973+
!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!
974+
955975
subroutine read_inputlists_from_file()
956976

957977
use constants
@@ -1648,28 +1668,28 @@ subroutine wrtend
16481668
write(iunit,'(" Nvol = ",i9 )') Nvol
16491669
write(iunit,'(" Mpol = ",i9 )') Mpol
16501670
write(iunit,'(" Ntor = ",i9 )') Ntor
1651-
write(iunit,'(" Lrad = ",1025i23 )') Lrad(1:Mvol)
1652-
write(iunit,'(" tflux = ",1025es23.15)') tflux(1:Mvol)
1653-
write(iunit,'(" pflux = ",1025es23.15)') pflux(1:Mvol)
1654-
write(iunit,'(" helicity = ",1025es23.15)') helicity(1:Mvol)
1671+
write(iunit,'(" Lrad = ",257i23 )') Lrad(1:Mvol)
1672+
write(iunit,'(" tflux = ",257es23.15)') tflux(1:Mvol)
1673+
write(iunit,'(" pflux = ",257es23.15)') pflux(1:Mvol)
1674+
write(iunit,'(" helicity = ",257es23.15)') helicity(1:Mvol)
16551675
write(iunit,'(" pscale = ",es23.15 )') pscale
16561676
write(iunit,'(" Ladiabatic = ",i9 )') Ladiabatic
1657-
write(iunit,'(" pressure = ",1025es23.15)') pressure(1:Mvol)
1658-
write(iunit,'(" adiabatic = ",1025es23.15)') adiabatic(1:Mvol)
1659-
write(iunit,'(" mu = ",1025es23.15)') mu(1:Mvol)
1660-
write(iunit,'(" Ivolume = ",1025es23.15)') Ivolume(1:Mvol)
1661-
write(iunit,'(" Isurf = ",1025es23.15)') IPDt(1:Mvol) ! EDIT by EROL !!!!
1677+
write(iunit,'(" pressure = ",257es23.15)') pressure(1:Mvol)
1678+
write(iunit,'(" adiabatic = ",257es23.15)') adiabatic(1:Mvol)
1679+
write(iunit,'(" mu = ",257es23.15)') mu(1:Mvol)
1680+
write(iunit,'(" Ivolume = ",257es23.15)') Ivolume(1:Mvol)
1681+
write(iunit,'(" Isurf = ",257es23.15)') IPDt(1:Mvol-1), 0.0
16621682
write(iunit,'(" Lconstraint = ",i9 )') Lconstraint
1663-
write(iunit,'(" pl = ",1025i23 )') pl(0:Mvol)
1664-
write(iunit,'(" ql = ",1025i23 )') ql(0:Mvol)
1665-
write(iunit,'(" pr = ",1025i23 )') pr(0:Mvol)
1666-
write(iunit,'(" qr = ",1025i23 )') qr(0:Mvol)
1667-
write(iunit,'(" iota = ",1025es23.15)') iota(0:Mvol)
1668-
write(iunit,'(" lp = ",1025i23 )') lp(0:Mvol)
1669-
write(iunit,'(" lq = ",1025i23 )') lq(0:Mvol)
1670-
write(iunit,'(" rp = ",1025i23 )') rp(0:Mvol)
1671-
write(iunit,'(" rq = ",1025i23 )') rq(0:Mvol)
1672-
write(iunit,'(" oita = ",1025es23.15)') oita(0:Mvol)
1683+
write(iunit,'(" pl = ",257i23 )') pl(0:Mvol)
1684+
write(iunit,'(" ql = ",257i23 )') ql(0:Mvol)
1685+
write(iunit,'(" pr = ",257i23 )') pr(0:Mvol)
1686+
write(iunit,'(" qr = ",257i23 )') qr(0:Mvol)
1687+
write(iunit,'(" iota = ",257es23.15)') iota(0:Mvol)
1688+
write(iunit,'(" lp = ",257i23 )') lp(0:Mvol)
1689+
write(iunit,'(" lq = ",257i23 )') lq(0:Mvol)
1690+
write(iunit,'(" rp = ",257i23 )') rp(0:Mvol)
1691+
write(iunit,'(" rq = ",257i23 )') rq(0:Mvol)
1692+
write(iunit,'(" oita = ",257es23.15)') oita(0:Mvol)
16731693
write(iunit,'(" mupftol = ",es23.15 )') mupftol
16741694
write(iunit,'(" mupfits = ",i9 )') mupfits
16751695
write(iunit,'(" Lreflect = ",i9 )') Lreflect
@@ -1855,7 +1875,7 @@ subroutine wrtend
18551875
!write(iunit,'(" epsr = ",es23.15 )') epsr
18561876
write(iunit,'(" nPpts = ",i9 )') nPpts
18571877
write(iunit,'(" Ppts = ",es23.15 )') Ppts
1858-
write(iunit,'(" nPtrj = ",656i6 )') nPtrj(1:Mvol)
1878+
write(iunit,'(" nPtrj = ",256i6 )') nPtrj(1:Mvol)
18591879
write(iunit,'(" LHevalues = ",L9 )') LHevalues
18601880
write(iunit,'(" LHevectors = ",L9 )') LHevectors
18611881
write(iunit,'(" LHmatrix = ",L9 )') LHmatrix
@@ -1885,7 +1905,7 @@ subroutine wrtend
18851905
#endif
18861906

18871907
! write initial guess of interface geometry
1888-
do imn = 1, mn ; write(iunit,'(2i6,20000es23.15)') im(imn), in(imn)/Nfp, ( iRbc(imn,vvol), iZbs(imn,vvol), iRbs(imn,vvol), iZbc(imn,vvol), vvol = 1, Nvol )
1908+
do imn = 1, mn ; write(iunit,'(2i6,1024es23.15)') im(imn), in(imn)/Nfp, ( iRbc(imn,vvol), iZbs(imn,vvol), iRbs(imn,vvol), iZbc(imn,vvol), vvol = 1, Nvol )
18891909
enddo
18901910

18911911
close(iunit)

src/sphdf5.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ subroutine hdfint
10891089
HWRITERV( grpOutput, 1, BnsErr, (/ BnsErr /)) ! already in /input/global
10901090
!latex \type{ForceErr} & real & \pb{force-balance error across interfaces} \\
10911091
HWRITERV( grpOutput, 1, ForceErr, (/ ForceErr /))
1092-
!latex \type{ForceErr} & real & \pb{force-balance error across interfaces} \\
1092+
!latex \type{BetaTotal} & real & \pb{Total plasma beta} \\
10931093
HWRITERV( grpOutput, 1, BetaTotal, (/ BetaTotal /))
10941094
!latex \type{Ivolume} & real & \pb{Volume current at output (parallel, externally induced)}
10951095
HWRITERV( grpOutput, Mvol, Ivolume, Ivolume(1:Mvol))

0 commit comments

Comments
 (0)