root / src / Space_all.f90 @ 10
Historique | Voir | Annoter | Télécharger (2,56 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_all(NGeomF,IGeom,MRESET,MSET,Geom,GRAD,HEAT,NCoord,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, MRESET=Maximum no. of iterations. |
17 | 3 | pfleura2 | INTEGER(KINT) :: NCoord,MRESET,NGeomF,IGeom |
18 | 3 | pfleura2 | INTEGER(KINT) :: MSET(NGeomF) |
19 | 1 | pfleura2 | !Geom=geometry with NCoord coordinates. GRAD=gradients. |
20 | 1 | pfleura2 | REAL(KREAL) :: Geom(NCoord),GRAD(NCoord) |
21 | 1 | pfleura2 | REAL(KREAL) :: Heat |
22 | 1 | pfleura2 | LOGICAL :: FRST(NGeomF), Print=.FALSE. |
23 | 1 | pfleura2 | ! GeomSet, GradSet : a long array to store |
24 | 1 | pfleura2 | REAL(KREAL) :: GeomSet(NGeomF,MRESET*NCoord),GradSet(NGeomF,MRESET*NCoord), ESET(MRESET) |
25 | 1 | pfleura2 | ! Geom and GRAD for all iterations. |
26 | 1 | pfleura2 | |
27 | 2 | pfleura2 | INTEGER(KINT) :: I, K, NMK, MI, NI |
28 | 1 | pfleura2 | INTEGER(KINT), SAVE :: NRESET |
29 | 1 | pfleura2 | !C |
30 | 1 | pfleura2 | !C UPDATE PARAMETER AND GRADIENT SUBSPACE |
31 | 1 | pfleura2 | !C |
32 | 1 | pfleura2 | IF (PRINT) WRITE(*,'(/,'' BEGIN SPACE '')') |
33 | 1 | pfleura2 | IF(FRST(IGeom))THEN |
34 | 1 | pfleura2 | NRESET=MIN(NCoord/2,MRESET) |
35 | 1 | pfleura2 | IF(NCoord .LT. 5 ) THEN ! This condition is imposed for small NCoord, |
36 | 1 | pfleura2 | ! particularly if NCoord is equal to 2 or 3. |
37 | 1 | pfleura2 | NRESET = NCoord-1 |
38 | 1 | pfleura2 | ENDIF |
39 | 1 | pfleura2 | FRST(IGeom)=.FALSE. |
40 | 1 | pfleura2 | MSET(IGeom)=0 |
41 | 1 | pfleura2 | ENDIF |
42 | 1 | pfleura2 | !C |
43 | 1 | pfleura2 | !IF (PRINT) WRITE(*,'(/,'' SPACE 1 '')') |
44 | 1 | pfleura2 | ! purging the very first Geom and GRAD. |
45 | 1 | pfleura2 | if (print) WRITE(*,*) "DBG Space MSET(",IGeom,"), NRESET",MSET(IGeom),NRESET |
46 | 1 | pfleura2 | IF (MSET(IGeom) .EQ. NRESET) THEN |
47 | 1 | pfleura2 | DO 10 I=1,MSET(IGeom)-1 |
48 | 1 | pfleura2 | MI = NCoord*(I-1) |
49 | 1 | pfleura2 | NI = NCoord*I |
50 | 1 | pfleura2 | ESET(I)=ESET(I+1) |
51 | 1 | pfleura2 | DO 10 K=1,NCoord |
52 | 1 | pfleura2 | GeomSet(IGeom,MI+K) = GeomSet(IGeom,NI+K) |
53 | 1 | pfleura2 | 10 GradSet(IGeom,MI+K) = GradSet(IGeom,NI+K) |
54 | 1 | pfleura2 | MSET(IGeom)=NRESET-1 |
55 | 1 | pfleura2 | ENDIF |
56 | 1 | pfleura2 | !C |
57 | 1 | pfleura2 | !C STORE THE CURRENT POINT |
58 | 1 | pfleura2 | !C |
59 | 1 | pfleura2 | !IF (PRINT) WRITE(*,'(/,'' SPACE 2 '')') |
60 | 1 | pfleura2 | DO K=1,NCoord |
61 | 1 | pfleura2 | NMK = NCoord*MSET(IGeom)+K ! MSET(IGeom) corresponds the mth iteration. |
62 | 1 | pfleura2 | IF (PRINT) WRITE(*,*) 'K,NMK,MSET(',IGeom,'),NCoord',K,NMK,MSET(IGeom),NCoord, & |
63 | 1 | pfleura2 | SIZE(GeomSet(IGeom,:)), SIZE(GradSet(IGeom,:)),SIZE(Geom),SIZE(GRAD) |
64 | 1 | pfleura2 | GeomSet(IGeom,NMK) = Geom(K) |
65 | 1 | pfleura2 | GradSet(IGeom,NMK) = Grad(K) |
66 | 1 | pfleura2 | END DO |
67 | 1 | pfleura2 | MSET(IGeom)=MSET(IGeom)+1 |
68 | 1 | pfleura2 | ESET(MSET(IGeom))=HEAT |
69 | 1 | pfleura2 | |
70 | 1 | pfleura2 | IF (PRINT) WRITE (*,*) "MSET(",IGeom,")=", MSET(IGeom) |
71 | 1 | pfleura2 | IF (PRINT) WRITE(*,'(/,'' END SPACE '')') |
72 | 1 | pfleura2 | |
73 | 1 | pfleura2 | END SUBROUTINE Space_all |