root / src / Space_GEDIIS_all.f90 @ 3
Historique | Voir | Annoter | Télécharger (2,65 ko)
| 1 |
! SPACE_GEDIIS SIMPLY LOADS THE CURRENT VALUES OF Geom AND Grad INTO THE ARRAYS GeomSet AND GradSet |
|---|---|
| 2 |
|
| 3 |
SUBROUTINE SPACE_GEDIIS_All(NGeomF,IGeom,MRESET,MSET,Geom,Grad,HEAT,NCoord,GeomSet,GradSet,ESET,FRST) |
| 4 |
|
| 5 |
IMPLICIT NONE |
| 6 |
integer, parameter :: KINT = kind(1) |
| 7 |
integer, parameter :: KREAL = kind(1.0d0) |
| 8 |
|
| 9 |
! MSET=mth iteration, MRESET=Maximum no. of iterations. |
| 10 |
INTEGER(KINT) :: NGeomF, IGeom |
| 11 |
INTEGER(KINT) :: NCoord, MRESET, MSET(NGeomF) |
| 12 |
! Geom=geometry with NCoord coordinates. GRAD=gradients. |
| 13 |
REAL(KREAL) :: Geom(NCoord), Grad(NCoord) |
| 14 |
REAL(KREAL) :: Heat |
| 15 |
LOGICAL :: FRST(NGeomF), Print=.FALSE. |
| 16 |
! GeomSet, GradSet : a long array to store. |
| 17 |
REAL(KREAL) :: GeomSet(NGeomF,MRESET*NCoord), GradSet(NGeomF,MRESET*NCoord), ESET(NGeomF,MRESET) |
| 18 |
! Geom and GRAD for all iterations. |
| 19 |
|
| 20 |
INTEGER(KINT) :: I, K, NMK, MI, NI |
| 21 |
INTEGER(KINT), SAVE :: NRESET |
| 22 |
|
| 23 |
! UPDATE PARAMETER AND GRADIENT SUBSPACE: |
| 24 |
IF (PRINT) WRITE(*,'(/,'' BEGIN SPACE_GEDIIS_ALL '')') |
| 25 |
IF(FRST(IGeom))THEN |
| 26 |
! Print *, 'Inside FRST(',IGeom,')=', FRST(IGeom)
|
| 27 |
NRESET=MIN(NCoord/2,MRESET) |
| 28 |
IF (NCoord .LT. 5 ) THEN ! This condition is imposed for small NCoord, |
| 29 |
! particularly if NCoord is equal to 2 or 3. |
| 30 |
NRESET = NCoord-1 |
| 31 |
END IF |
| 32 |
FRST(IGeom)=.FALSE. |
| 33 |
MSET(IGeom)=0 |
| 34 |
ENDIF |
| 35 |
|
| 36 |
IF (PRINT) WRITE(*,'(/,'' SPACE_GEDIIS_ALL 1 '')') |
| 37 |
! purging the very first Geom and GRAD. |
| 38 |
if (print) WRITE(*,*) "DBG SPACE_GEDIIS MSET, NRESET", MSET,NRESET |
| 39 |
IF (MSET(IGeom) .EQ. NRESET) THEN |
| 40 |
DO I=1,MSET(IGeom)-1 |
| 41 |
MI = NCoord*(I-1) |
| 42 |
NI = NCoord*I |
| 43 |
ESET(IGeom,I)=ESET(IGeom,I+1) |
| 44 |
DO K=1,NCoord |
| 45 |
GeomSet(IGeom,MI+K) = GeomSet(IGeom,NI+K) |
| 46 |
GradSet(IGeom,MI+K) = GradSet(IGeom,NI+K) |
| 47 |
END DO |
| 48 |
END DO |
| 49 |
MSET(IGeom)=NRESET-1 |
| 50 |
ENDIF |
| 51 |
|
| 52 |
! STORE THE CURRENT POINT: |
| 53 |
IF (PRINT) WRITE(*,'(/,'' SPACE_GEDIIS_ALL 2 '')') |
| 54 |
DO K=1,NCoord |
| 55 |
NMK = NCoord*MSET(IGeom)+K ! MSET(IGeom) corresponds the mth iteration. |
| 56 |
IF (PRINT) WRITE(*,*) 'K,NMK,MSET(',IGeom,'),NCoord',K,NMK,MSET(IGeom),NCoord !, &
|
| 57 |
! SIZE(GeomSet(IGeom,:)), SIZE(GradSet(IGeom,:)),SIZE(Geom),SIZE(GRAD) |
| 58 |
GeomSet(IGeom,NMK) = Geom(K) |
| 59 |
GradSet(IGeom,NMK) = Grad(K) |
| 60 |
END DO |
| 61 |
|
| 62 |
MSET(IGeom)=MSET(IGeom)+1 |
| 63 |
ESET(IGeom,MSET(IGeom))=HEAT |
| 64 |
|
| 65 |
IF (PRINT) WRITE (*,*) "MSET(",IGeom,")=", MSET(IGeom)
|
| 66 |
IF (PRINT) WRITE(*,'(/,'' END SPACE_GEDIIS_ALL '')') |
| 67 |
|
| 68 |
END SUBROUTINE SPACE_GEDIIS_All |