[3] | 1 | SUBROUTINE profile(unit,nlev,dzst,temp) |
---|
| 2 | IMPLICIT NONE |
---|
| 3 | c======================================================================= |
---|
| 4 | c Subroutine utilisee dans le modele 1-D "testphys1d" |
---|
| 5 | c pour l'initialisation du profil atmospherique |
---|
| 6 | c======================================================================= |
---|
| 7 | c |
---|
| 8 | c differents profils d'atmospheres. T=f(z) |
---|
| 9 | c entree: |
---|
| 10 | c unit unite de lecture de "testphys1d.def" |
---|
| 11 | c nlev nombre de niveaux (nlev=llm+1, surf + couches 1 a llm) |
---|
| 12 | c dzst dz/T (avec dz = epaisseur de la couche en m) |
---|
| 13 | c ichoice choix de l'atmosphere: |
---|
| 14 | c 1 Temperature constante |
---|
| 15 | c 2 profil VIRA lisse |
---|
| 16 | c 3 |
---|
| 17 | c 4 |
---|
| 18 | c 5 |
---|
| 19 | c 6 T constante + perturbation gauss (level) (christophe 10/98) |
---|
| 20 | c 7 T constante + perturbation gauss (km) (christophe 10/98) |
---|
| 21 | c 8 Lecture du profile dans un fichier ASCII (profile) |
---|
| 22 | c tref temperature de reference |
---|
| 23 | c isin ajout d'une perturbation (isin=1) |
---|
| 24 | c pic pic perturbation gauss pour ichoice = 6 ou 7 |
---|
| 25 | c largeur largeur de la perturbation gauss pour ichoice = 6 ou 7 |
---|
| 26 | c hauteur hauteur de la perturbation gauss pour ichoice = 6 ou 7 |
---|
| 27 | c |
---|
| 28 | c sortie: |
---|
| 29 | c temp temperatures en K |
---|
| 30 | c |
---|
| 31 | c======================================================================= |
---|
| 32 | c----------------------------------------------------------------------- |
---|
| 33 | c declarations: |
---|
| 34 | c ------------- |
---|
| 35 | |
---|
| 36 | c arguments: |
---|
| 37 | c ---------- |
---|
| 38 | |
---|
| 39 | INTEGER nlev, unit |
---|
| 40 | REAL dzst(nlev),temp(nlev) |
---|
| 41 | |
---|
| 42 | c local: |
---|
| 43 | c ------ |
---|
| 44 | |
---|
| 45 | INTEGER il,ichoice,isin,iter |
---|
| 46 | REAL pi |
---|
| 47 | REAL tref,t1,t2,t3,ww |
---|
| 48 | REAL pic,largeur |
---|
| 49 | REAL hauteur,tmp |
---|
| 50 | REAL zkm(nlev) ! altitude en km |
---|
| 51 | |
---|
| 52 | isin = 0 |
---|
| 53 | |
---|
| 54 | c----------------------------------------------------------------------- |
---|
| 55 | c choix du profil: |
---|
| 56 | c ---------------- |
---|
| 57 | |
---|
| 58 | c la lecture se fait dans le testphys1d.def, ouvert par testphys1d.F |
---|
| 59 | READ(unit,*) |
---|
| 60 | READ(unit,*) |
---|
| 61 | READ(unit,*) |
---|
| 62 | READ(unit,*) ichoice |
---|
| 63 | READ(unit,*) tref |
---|
| 64 | READ(unit,*) isin |
---|
| 65 | READ(unit,*) pic |
---|
| 66 | READ(unit,*) largeur |
---|
| 67 | READ(unit,*) hauteur |
---|
| 68 | CLOSE(unit) |
---|
| 69 | |
---|
| 70 | c----------------------------------------------------------------------- |
---|
| 71 | c ichoice=1 temperature constante: |
---|
| 72 | c -------------------------------- |
---|
| 73 | |
---|
| 74 | IF(ichoice.EQ.1) THEN |
---|
| 75 | temp(1) = tref |
---|
| 76 | zkm(1) = 0.0 |
---|
| 77 | DO il=2,nlev |
---|
| 78 | temp(il)= tref |
---|
| 79 | zkm(il) = zkm(il-1)+temp(il)*dzst(il)/1000. |
---|
| 80 | ENDDO |
---|
| 81 | |
---|
| 82 | c----------------------------------------------------------------------- |
---|
| 83 | c ichoice=2 VIRA lisse: |
---|
| 84 | c --------------------- |
---|
| 85 | |
---|
| 86 | ELSE IF(ichoice.EQ.2) THEN |
---|
| 87 | temp(1) = 735. |
---|
| 88 | zkm(1) = 0.0 |
---|
| 89 | DO il=2,nlev |
---|
| 90 | zkm(il) = zkm(il-1)+temp(il-1)*dzst(il)/1000. ! approx avec T(l-1) |
---|
| 91 | if(zkm(il).lt.60.) then |
---|
| 92 | temp(il)=735.-7.95*zkm(il) |
---|
| 93 | else |
---|
| 94 | temp(il)=AMAX1(258.-3.*(zkm(il)-60.),168.) |
---|
| 95 | endif |
---|
| 96 | zkm(il) = zkm(il-1)+(temp(il-1)+temp(il))/2.*dzst(il)/1000. |
---|
| 97 | ENDDO |
---|
| 98 | |
---|
| 99 | c----------------------------------------------------------------------- |
---|
| 100 | c ichoice=3 VIRA lisse - 135K: |
---|
| 101 | c ---------------------------- |
---|
| 102 | |
---|
| 103 | ELSE IF(ichoice.EQ.3) THEN |
---|
| 104 | temp(1) = 600. |
---|
| 105 | zkm(1) = 0.0 |
---|
| 106 | DO il=2,nlev |
---|
| 107 | zkm(il) = zkm(il-1)+temp(il-1)*dzst(il)/1000. ! approx avec T(l-1) |
---|
| 108 | temp(il)=AMAX1(600.-7.95*zkm(il),168.) |
---|
| 109 | zkm(il) = zkm(il-1)+(temp(il-1)+temp(il))/2.*dzst(il)/1000. |
---|
| 110 | ENDDO |
---|
| 111 | |
---|
| 112 | c----------------------------------------------------------------------- |
---|
| 113 | c ichoice=4 : |
---|
| 114 | c ------------------ |
---|
| 115 | |
---|
| 116 | ELSE IF(ichoice.EQ.4) THEN |
---|
| 117 | print*,"Cas non defini..." |
---|
| 118 | print*,"Stop dans profile.F" |
---|
| 119 | STOP |
---|
| 120 | |
---|
| 121 | c----------------------------------------------------------------------- |
---|
| 122 | c ichoice=5 : |
---|
| 123 | c ---------------- |
---|
| 124 | |
---|
| 125 | ELSE IF(ichoice.EQ.5) THEN |
---|
| 126 | print*,"Cas non defini..." |
---|
| 127 | print*,"Stop dans profile.F" |
---|
| 128 | STOP |
---|
| 129 | |
---|
| 130 | c----------------------------------------------------------------------- |
---|
| 131 | c ichoice=6 |
---|
| 132 | c --------- |
---|
| 133 | |
---|
| 134 | ELSE IF(ichoice.EQ.6) THEN |
---|
| 135 | temp(1) = tref |
---|
| 136 | zkm(1) = 0.0 |
---|
| 137 | DO il=2,nlev |
---|
| 138 | tmp=il-pic |
---|
| 139 | temp(il)= tref + hauteur*exp(-tmp*tmp/largeur/largeur) |
---|
| 140 | zkm(il) = zkm(il-1)+temp(il)*dzst(il)/1000. |
---|
| 141 | ENDDO |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | c----------------------------------------------------------------------- |
---|
| 145 | c ichoice=7 |
---|
| 146 | c --------- |
---|
| 147 | |
---|
| 148 | ELSE IF(ichoice.EQ.7) THEN |
---|
| 149 | temp(1) = tref |
---|
| 150 | zkm(1) = 0.0 |
---|
| 151 | DO il=2,nlev |
---|
| 152 | zkm(il) = zkm(il-1)+tref*dzst(il)/1000. ! approx |
---|
| 153 | tmp=zkm(il)-pic |
---|
| 154 | temp(il)= tref + hauteur*exp(-tmp*tmp*4/largeur/largeur) |
---|
| 155 | zkm(il) = zkm(il-1)+(temp(il-1)+temp(il))/2.*dzst(il)/1000. |
---|
| 156 | ENDDO |
---|
| 157 | |
---|
| 158 | c----------------------------------------------------------------------- |
---|
| 159 | c ichoice=8 |
---|
| 160 | c --------- |
---|
| 161 | |
---|
| 162 | ELSE IF(ichoice.GE.8) THEN |
---|
| 163 | OPEN(11,file='profile',status='old',form='formatted',err=101) |
---|
| 164 | DO il=1,nlev |
---|
| 165 | READ (11,*) temp(il) |
---|
| 166 | ENDDO |
---|
| 167 | zkm(1) = 0.0 |
---|
| 168 | DO il=2,nlev |
---|
| 169 | zkm(il) = zkm(il-1)+(temp(il-1)+temp(il))/2.*dzst(il)/1000. |
---|
| 170 | ENDDO |
---|
| 171 | |
---|
| 172 | GOTO 201 |
---|
| 173 | 101 STOP'fichier profile inexistant' |
---|
| 174 | 201 CONTINUE |
---|
| 175 | CLOSE(10) |
---|
| 176 | |
---|
| 177 | c----------------------------------------------------------------------- |
---|
| 178 | |
---|
| 179 | ENDIF |
---|
| 180 | |
---|
| 181 | c----------------------------------------------------------------------- |
---|
| 182 | c rajout eventuel d'une perturbation: |
---|
| 183 | c ----------------------------------- |
---|
| 184 | |
---|
| 185 | IF(isin.EQ.1) THEN |
---|
| 186 | pi=2.*ASIN(1.) |
---|
| 187 | DO il=1,nlev |
---|
| 188 | temp(il)=temp(il)+(1.-1000./(1000+zkm(il)*zkm(il)))*( |
---|
| 189 | s 6.*SIN(zkm(il)*pi/6.)+9.*SIN(zkm(il)*pi/10.3) ) |
---|
| 190 | ENDDO |
---|
| 191 | ENDIF |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | c----------------------------------------------------------------------- |
---|
| 195 | c Ecriture du profil de temperature dans un fichier profile.out |
---|
| 196 | c ------------------------------------------------------------- |
---|
| 197 | |
---|
| 198 | |
---|
| 199 | c OPEN(12,file='profile.out') |
---|
| 200 | c DO il=1,nlev |
---|
| 201 | c write(12,*) temp(il) |
---|
| 202 | c write(12,*) temp(il),zkm(il) |
---|
| 203 | c ENDDO |
---|
| 204 | c CLOSE(12) |
---|
| 205 | |
---|
| 206 | RETURN |
---|
| 207 | END |
---|