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
1 change: 1 addition & 0 deletions src/global.f90
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ module allglobal
REAL, allocatable :: dessian3D(:,:) !< derivative Hessian 3D

REAL, allocatable :: force_final(:) !< Final force on the interfaces [inface*mode]
REAL, allocatable :: force_final_grad(:, :) !< Final force gradient on the interfaces
!> @}

!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!
Expand Down
11 changes: 10 additions & 1 deletion src/hesian.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof )
dFFdRZ,HdFFdRZ, dBBdmp, dmupfdx, hessian, dessian, Lhessianallocated, psifactor, &
hessian2D,dessian2D,Lhessian2Dallocated, &
Lhessian3Dallocated,denergydrr, denergydrz,denergydzr,denergydzz, &
LocalConstraint
LocalConstraint, dRodR, dRodZ, dZodR, dZodZ, dRadR, dRadZ, dZadR, dZadZ

use sphdf5, only : write_stability

Expand Down Expand Up @@ -241,6 +241,15 @@ subroutine hesian( NGdof, position, Mvol, mn, LGdof )
!endif
!This step cleared.

dRodR = 0.0
dZodR = 0.0
dRodZ = 0.0
dZodZ = 0.0
dRadR = 0.0
dRadZ = 0.0
dZadR = 0.0
dZadZ = 0.0

LComputeDerivatives = .true. !; position(0) = zero ! this is not used; 11 Aug 14;
LComputeAxis = .false.
WCALL( hesian, dforce, ( NGdof, position(0:NGdof), force(0:NGdof), LComputeDerivatives, LComputeAxis) ) ! calculate force-imbalance & hessian;
Expand Down
4 changes: 2 additions & 2 deletions src/sphdf5.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ subroutine hdfint
TT, &
beltramierror, &
IPDt, dlambdaout, lmns, &
force_final, hessian, NGdof
force_final, force_final_grad, NGdof

LOCALS

Expand Down Expand Up @@ -1171,7 +1171,7 @@ subroutine hdfint

if( Lcheck.eq.7 ) then
HWRITERV(grpOutput, NGdof+1, force_final, force_final(0:NGdof))
HWRITERA( grpOutput, NGdof, NGdof, force_final_grad, hessian(1:NGdof,1:NGdof) )
HWRITERA( grpOutput, NGdof, NGdof, force_final_grad, force_final_grad(1:NGdof,1:NGdof) )
end if

HCLOSEGRP( grpOutput )
Expand Down
6 changes: 5 additions & 1 deletion src/xspech.f90
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ subroutine spec
version, &
MPI_COMM_SPEC, &
force_final, Lhessianallocated, LocalConstraint, hessian, dBBdmp, dFFdRZ, dmupfdx, &
dRodR, dRodZ, dZodR, dZodZ, dRadR, dRadZ, dZadR, dZadZ, dessian, LGdof
dRodR, dRodZ, dZodR, dZodZ, dRadR, dRadZ, dZadR, dZadZ, dessian, LGdof, force_final_grad

!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!

Expand Down Expand Up @@ -514,6 +514,10 @@ subroutine spec
WCALL( xspech, dforce, ( NGdof, position(0:NGdof), force_final(0:NGdof), LComputeDerivatives, LComputeAxis) )
Lfindzero = Lfindzero_temp

! Save force gradient for output to .h5 file
SALLOCATE( force_final_grad, (1:NGdof,1:NGdof), zero )
force_final_grad(1:NGdof,1:NGdof) = hessian(1:NGdof,1:NGdof)

else
SALLOCATE( force_final, (0:NGdof), zero )

Expand Down
Loading