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