diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2011-10-08 20:30:28 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2011-10-08 20:30:28 +0200 |
| commit | 5df79c53745fde5d6c3340a2979b1429cd5892c1 (patch) | |
| tree | 1a81af141708b826e9c61e8a04019994fcca8298 /src/labat/grabgr.f | |
Initial import of htcd system 1.0
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/labat/grabgr.f')
| -rw-r--r-- | src/labat/grabgr.f | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/labat/grabgr.f b/src/labat/grabgr.f new file mode 100644 index 0000000..1ed039c --- /dev/null +++ b/src/labat/grabgr.f | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | subroutine grabgr(r,gradup,graddn,i,imin,imax,done,gagd,gagup, | ||
| 2 | j gagdn) | ||
| 3 | c calculates grad(abs(grad(density))) | ||
| 4 | c input r : radial coordinate (array) | ||
| 5 | c input gradup : grad(density), spin up (array) | ||
| 6 | c input graddn : grad(density), spin down (array) | ||
| 7 | c input i : counter, i.e. current position = r(i) | ||
| 8 | c input imin : min value of i | ||
| 9 | c input imax : max value of i | ||
| 10 | c in/output done : true if abs(grad(density)) is splined | ||
| 11 | c output gagd : grad(abs(grad(density))) | ||
| 12 | c output gagup,gagdn : grad(abs(grad(density))), spin up and down | ||
| 13 | implicit logical (a-z) | ||
| 14 | logical done | ||
| 15 | double precision r,gradup,graddn,gagd,gagup,gagdn,temp,gag2,deriv | ||
| 16 | integer i,imin,imax,j | ||
| 17 | common/ggagag/temp,gag2 | ||
| 18 | dimension r(561),gradup(561),graddn(561) | ||
| 19 | dimension temp(2,561),gag2(2,561) | ||
| 20 | if (.not.done) then | ||
| 21 | do 10 j = imin,imax | ||
| 22 | temp(1,j) = dabs(gradup(j)) | ||
| 23 | temp(2,j) = dabs(graddn(j)) | ||
| 24 | 10 continue | ||
| 25 | call spline(r,imin+1,imax,temp,gag2) | ||
| 26 | done = .true. | ||
| 27 | endif | ||
| 28 | gagup = deriv(r,temp,gag2,1,i,imin,imax) | ||
| 29 | gagdn = deriv(r,temp,gag2,-1,i,imin,imax) | ||
| 30 | gagd = gagup + gagdn | ||
| 31 | return | ||
| 32 | end | ||
