| [630] | 1 | ! |
|---|
| 2 | ! $Header$ |
|---|
| 3 | ! |
|---|
| 4 | c |
|---|
| 5 | c |
|---|
| 6 | subroutine iniadvtrac(nq) |
|---|
| 7 | USE ioipsl |
|---|
| 8 | IMPLICIT NONE |
|---|
| 9 | c======================================================================= |
|---|
| 10 | c |
|---|
| 11 | c Auteur: P. Le Van /L. Fairhead/F.Hourdin |
|---|
| 12 | c ------- |
|---|
| 13 | c Modif special traceur F.Forget 05/94 |
|---|
| 14 | c Modif M-A Filiberti 02/02 lecture de traceur.def |
|---|
| 15 | c |
|---|
| 16 | c Objet: |
|---|
| 17 | c ------ |
|---|
| 18 | c |
|---|
| 19 | c GCM LMD nouvelle grille |
|---|
| 20 | c |
|---|
| 21 | c======================================================================= |
|---|
| 22 | c ... modification de l'integration de q ( 26/04/94 ) .... |
|---|
| 23 | c----------------------------------------------------------------------- |
|---|
| 24 | c Declarations: |
|---|
| 25 | c ------------- |
|---|
| 26 | C |
|---|
| 27 | #include "dimensions.h" |
|---|
| 28 | #include "advtrac.h" |
|---|
| [960] | 29 | #include "control.h" |
|---|
| [630] | 30 | |
|---|
| 31 | c local |
|---|
| 32 | character*3 descrq(30) |
|---|
| 33 | character*1 txts(3) |
|---|
| 34 | character*2 txtp(9) |
|---|
| 35 | character*13 str1,str2,str3 |
|---|
| 36 | |
|---|
| 37 | integer nq,iq,iiq,iiiq,ierr,ii |
|---|
| 38 | integer lnblnk |
|---|
| 39 | external lnblnk |
|---|
| 40 | |
|---|
| 41 | data txts/'x','y','z'/ |
|---|
| 42 | data txtp/'x','y','z','xx','xy','xz','yy','yz','zz'/ |
|---|
| 43 | |
|---|
| 44 | c----------------------------------------------------------------------- |
|---|
| 45 | c Initialisations: |
|---|
| 46 | c ---------------- |
|---|
| 47 | descrq(14)='VLH' |
|---|
| 48 | descrq(10)='VL1' |
|---|
| 49 | descrq(11)='VLP' |
|---|
| 50 | descrq(12)='FH1' |
|---|
| 51 | descrq(13)='FH2' |
|---|
| 52 | descrq(16)='PPM' |
|---|
| 53 | descrq(17)='PPS' |
|---|
| 54 | descrq(18)='PPP' |
|---|
| 55 | descrq(20)='SLP' |
|---|
| 56 | descrq(30)='PRA' |
|---|
| 57 | |
|---|
| [960] | 58 | IF (config_inca /= 'none') THEN |
|---|
| [764] | 59 | #ifdef INCA |
|---|
| [960] | 60 | CALL init_transport( |
|---|
| 61 | $ hadv_flg, |
|---|
| 62 | $ vadv_flg, |
|---|
| 63 | $ conv_flg, |
|---|
| 64 | $ pbl_flg, |
|---|
| 65 | $ tracnam) |
|---|
| [764] | 66 | #endif |
|---|
| [960] | 67 | END IF |
|---|
| [630] | 68 | c----------------------------------------------------------------------- |
|---|
| 69 | c Choix des schemas d'advection pour l'eau et les traceurs |
|---|
| 70 | c |
|---|
| 71 | c iadv = 1 schema transport type "humidite specifique LMD" |
|---|
| 72 | c iadv = 2 schema amont |
|---|
| 73 | c iadv = 14 schema Van-leer + humidite specifique |
|---|
| 74 | c Modif F.Codron |
|---|
| 75 | c iadv = 10 schema Van-leer (retenu pour l'eau vapeur et liquide) |
|---|
| 76 | c iadv = 11 schema Van-Leer pour hadv et version PPM (Monotone) pour vadv |
|---|
| 77 | c iadv = 12 schema Frederic Hourdin I |
|---|
| 78 | c iadv = 13 schema Frederic Hourdin II |
|---|
| 79 | c iadv = 16 schema PPM Monotone(Collela & Woodward 1984) |
|---|
| 80 | c iadv = 17 schema PPM Semi Monotone (overshoots autorisés) |
|---|
| 81 | c iadv = 18 schema PPM Positif Defini (overshoots undershoots autorisés) |
|---|
| 82 | c iadv = 20 schema Slopes |
|---|
| 83 | c iadv = 30 schema Prather |
|---|
| 84 | c |
|---|
| 85 | c Dans le tableau q(ij,l,iq) : iq = 1 pour l'eau vapeur |
|---|
| 86 | c iq = 2 pour l'eau liquide |
|---|
| 87 | c Et eventuellement iq = 3,nqmx pour les autres traceurs |
|---|
| 88 | c |
|---|
| 89 | c iadv(1): choix pour l'eau vap. et iadv(2) : choix pour l'eau liq. |
|---|
| 90 | C------------------------------------------------------------------------ |
|---|
| 91 | c Choix du schema d'advection |
|---|
| 92 | c------------------------------------------------------------------ |
|---|
| 93 | c choix par defaut = van leer pour tous les traceurs |
|---|
| 94 | do iq=1,nqmx |
|---|
| 95 | iadv(iq)=10 |
|---|
| 96 | str1(1:1)='q' |
|---|
| 97 | if (nqmx.le.99) then |
|---|
| 98 | WRITE(str1(2:3),'(i2.2)') iq |
|---|
| 99 | else |
|---|
| 100 | WRITE(str1(2:4),'(i3.3)') iq |
|---|
| 101 | endif |
|---|
| 102 | tnom(iq)=str1 |
|---|
| 103 | tname(iq)=tnom(iq) |
|---|
| 104 | str2=tnom(iq) |
|---|
| 105 | ttext(iq)=str2(1:lnblnk(str2))//descrq(iadv(iq)) |
|---|
| 106 | end do |
|---|
| 107 | nq=nqmx |
|---|
| 108 | c------------------------------------------------------------------ |
|---|
| 109 | c Choix du schema pour l'advection |
|---|
| 110 | c dans fichier traceur.def |
|---|
| 111 | c------------------------------------------------------------------ |
|---|
| [960] | 112 | |
|---|
| 113 | IF (config_inca /= 'none') THEN |
|---|
| [630] | 114 | C le module de chimie fournit les noms des traceurs |
|---|
| 115 | C et les schemas d'advection associes. |
|---|
| [960] | 116 | tnom(1)='H2Ov' |
|---|
| 117 | tnom(2)='H2Ol' |
|---|
| 118 | nq=nbtrac+2 |
|---|
| [764] | 119 | |
|---|
| [630] | 120 | if (nq.gt.nqmx) then |
|---|
| [764] | 121 | print*,'nombre de traceurs incompatible INCA/LMDZT', nq, nbtrac |
|---|
| [630] | 122 | stop |
|---|
| 123 | endif |
|---|
| 124 | do iq =3,nq |
|---|
| 125 | tnom(iq)=tracnam(iq-2) |
|---|
| 126 | end do |
|---|
| 127 | do iq =1,nq |
|---|
| 128 | hadv(iq)= hadv_flg(iq) |
|---|
| 129 | vadv(iq)= vadv_flg(iq) |
|---|
| 130 | end do |
|---|
| [960] | 131 | ELSE ! config_inca=none |
|---|
| 132 | print*,'ouverture de traceur.def' |
|---|
| 133 | open(90,file='traceur.def',form='formatted',status='old', |
|---|
| 134 | s iostat=ierr) |
|---|
| [630] | 135 | if(ierr.eq.0) then |
|---|
| 136 | print*,'ouverture de traceur.def ok' |
|---|
| 137 | read(90,*) nq |
|---|
| 138 | print*,'nombre de traceurs ',nq |
|---|
| 139 | if (nq.gt.nqmx) then |
|---|
| 140 | print*,'nombre de traceurs trop important' |
|---|
| 141 | print*,'verifier traceur.def' |
|---|
| 142 | stop |
|---|
| 143 | endif |
|---|
| 144 | C |
|---|
| 145 | do iq=1,nq |
|---|
| 146 | read(90,999) hadv(iq),vadv(iq),tnom(iq) |
|---|
| 147 | end do |
|---|
| 148 | close(90) |
|---|
| 149 | PRINT*,'lecture de traceur.def :' |
|---|
| 150 | do iq=1,nq |
|---|
| 151 | write(*,*) hadv(iq),vadv(iq),tnom(iq) |
|---|
| 152 | end do |
|---|
| 153 | else |
|---|
| 154 | print*,'pb ouverture traceur.def' |
|---|
| 155 | print*,'ATTENTION on prend des valeurs par defaut' |
|---|
| 156 | nq = 4 |
|---|
| 157 | hadv(1) = 14 |
|---|
| 158 | vadv(1) = 14 |
|---|
| 159 | tnom(1) = 'H2Ov' |
|---|
| 160 | hadv(2) = 10 |
|---|
| 161 | vadv(2) = 10 |
|---|
| 162 | tnom(2) = 'H2Ol' |
|---|
| 163 | hadv(3) = 10 |
|---|
| 164 | vadv(3) = 10 |
|---|
| 165 | tnom(3) = 'RN' |
|---|
| 166 | hadv(4) = 10 |
|---|
| 167 | vadv(4) = 10 |
|---|
| 168 | tnom(4) = 'PB' |
|---|
| 169 | ENDIF |
|---|
| 170 | PRINT*,'Valeur de traceur.def :' |
|---|
| 171 | do iq=1,nq |
|---|
| 172 | write(*,*) hadv(iq),vadv(iq),tnom(iq) |
|---|
| 173 | end do |
|---|
| 174 | |
|---|
| [960] | 175 | END IF ! config_inca |
|---|
| 176 | |
|---|
| [630] | 177 | c a partir du nom court du traceur et du schema d'advection au detemine le nom long. |
|---|
| 178 | iiq=0 |
|---|
| 179 | ii=0 |
|---|
| 180 | do iq=1,nq |
|---|
| 181 | iiq=iiq+1 |
|---|
| 182 | if (hadv(iq).ne.vadv(iq)) then |
|---|
| 183 | if (hadv(iq).eq.10.and.vadv(iq).eq.16) then |
|---|
| 184 | iadv(iiq)=11 |
|---|
| 185 | else |
|---|
| 186 | print*,'le choix des schemas d''advection H et V' |
|---|
| 187 | print*, 'est non disponible actuellement' |
|---|
| 188 | stop |
|---|
| 189 | endif |
|---|
| 190 | else |
|---|
| 191 | iadv(iiq)=hadv(iq) |
|---|
| 192 | endif |
|---|
| 193 | c verification nombre de traceurs |
|---|
| 194 | if (iadv(iiq).lt.20) then |
|---|
| 195 | ii=ii+1 |
|---|
| 196 | elseif (iadv(iiq).eq.20) then |
|---|
| 197 | ii=ii+4 |
|---|
| 198 | elseif (iadv(iiq).eq.30) then |
|---|
| 199 | ii=ii+10 |
|---|
| 200 | endif |
|---|
| 201 | |
|---|
| 202 | str1=tnom(iq) |
|---|
| 203 | tname(iiq)=tnom(iq) |
|---|
| [764] | 204 | IF (iadv(iiq).eq.0) THEN |
|---|
| 205 | ttext(iiq)=str1(1:lnblnk(str1)) |
|---|
| 206 | ELSE |
|---|
| 207 | ttext(iiq)=str1(1:lnblnk(str1))//descrq(iadv(iiq)) |
|---|
| 208 | ENDIF |
|---|
| [630] | 209 | str2=ttext(iiq) |
|---|
| 210 | c schemas tenant compte des moments d'ordre superieur. |
|---|
| 211 | if (iadv(iiq).eq.20) then |
|---|
| 212 | do iiiq=1,3 |
|---|
| 213 | iiq=iiq+1 |
|---|
| 214 | iadv(iiq)=-20 |
|---|
| 215 | ttext(iiq)=str2(1:lnblnk(str2))//txts(iiiq) |
|---|
| 216 | tname(iiq)=str1(1:lnblnk(str1))//txts(iiiq) |
|---|
| 217 | enddo |
|---|
| 218 | elseif (iadv(iiq).eq.30) then |
|---|
| 219 | do iiiq=1,9 |
|---|
| 220 | iiq=iiq+1 |
|---|
| 221 | iadv(iiq)=-30 |
|---|
| 222 | ttext(iiq)=str2(1:lnblnk(str2))//txtp(iiiq) |
|---|
| 223 | tname(iiq)=str1(1:lnblnk(str1))//txtp(iiiq) |
|---|
| 224 | enddo |
|---|
| 225 | endif |
|---|
| 226 | end do |
|---|
| 227 | if(ii.ne.nqmx) then |
|---|
| 228 | print*,'WARNING' |
|---|
| 229 | print*,'le nombre de traceurs et de moments eventuels' |
|---|
| 230 | print*,'est inferieur a nqmx ' |
|---|
| 231 | endif |
|---|
| 232 | if (iiq.gt.nqmx) then |
|---|
| 233 | print*,'le choix des schemas est incompatible avec ' |
|---|
| 234 | print*,'la dimension nqmx (nombre de traceurs)' |
|---|
| 235 | print*,'verifier traceur.def ou la namelist INCA' |
|---|
| 236 | print*,'ou recompiler avec plus de traceurs' |
|---|
| 237 | stop |
|---|
| 238 | endif |
|---|
| 239 | iiq=0 |
|---|
| 240 | do iq=1,nqmx |
|---|
| 241 | if(iadv(iq).ge.0) then |
|---|
| 242 | iiq=iiq+1 |
|---|
| 243 | niadv(iiq)=iq |
|---|
| 244 | endif |
|---|
| 245 | end do |
|---|
| 246 | return |
|---|
| 247 | 999 format (i2,1x,i2,1x,a8) |
|---|
| 248 | END |
|---|