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