[1913] | 1 | MODULE newsedim_mod |
---|
| 2 | |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | CONTAINS |
---|
| 6 | |
---|
[358] | 7 | SUBROUTINE newsedim(ngrid,nlay,naersize,nrhosize,ptimestep, |
---|
[38] | 8 | & pplev,masse,epaisseur,pt,rd,rho,pqi,wq,beta) |
---|
[1913] | 9 | USE comcstfi_h, ONLY: r,g |
---|
[38] | 10 | IMPLICIT NONE |
---|
| 11 | |
---|
| 12 | c======================================================================= |
---|
| 13 | c |
---|
| 14 | c Compute sedimentation of 1 tracer |
---|
| 15 | c of radius rd (m) and density rho (kg.m-3) |
---|
| 16 | c |
---|
| 17 | c======================================================================= |
---|
| 18 | |
---|
| 19 | c----------------------------------------------------------------------- |
---|
| 20 | c declarations: |
---|
| 21 | c ------------- |
---|
| 22 | |
---|
| 23 | c |
---|
| 24 | c arguments: |
---|
| 25 | c ---------- |
---|
| 26 | |
---|
[358] | 27 | INTEGER,INTENT(IN) :: ngrid,nlay,naersize,nrhosize |
---|
[38] | 28 | REAL,INTENT(IN) :: ptimestep ! pas de temps physique (s) |
---|
| 29 | REAL,INTENT(IN) :: pplev(ngrid,nlay+1) ! pression aux inter-couches (Pa) |
---|
| 30 | REAL,INTENT(IN) :: pt(ngrid,nlay) ! temperature au centre des couches (K) |
---|
| 31 | real,intent(in) :: masse (ngrid,nlay) ! masse d'une couche (kg) |
---|
| 32 | real,intent(in) :: epaisseur (ngrid,nlay) ! epaisseur d'une couche (m) |
---|
| 33 | real,intent(in) :: rd(naersize) ! particle radius (m) |
---|
[358] | 34 | real,intent(in) :: rho(nrhosize) ! particle density (kg.m-3) |
---|
[38] | 35 | |
---|
| 36 | |
---|
| 37 | c Traceurs : |
---|
| 38 | real,intent(inout) :: pqi(ngrid,nlay) ! traceur (e.g. ?/kg) |
---|
[1047] | 39 | real,intent(out) :: wq(ngrid,nlay+1) ! flux de traceur durant timestep (?/m-2) |
---|
[38] | 40 | real,intent(in) :: beta ! correction for the shape of the particles |
---|
| 41 | ! (see Murphy et al. JGR 1990 vol.95) |
---|
| 42 | ! beta=1 for spheres |
---|
| 43 | ! beta=0.85 for irregular particles |
---|
| 44 | ! beta=0.5 for disk shaped particles |
---|
| 45 | |
---|
| 46 | c local: |
---|
| 47 | c ------ |
---|
| 48 | |
---|
| 49 | INTEGER l,ig, k, i |
---|
[358] | 50 | REAL rfall,rhofall |
---|
[38] | 51 | |
---|
| 52 | LOGICAL,SAVE :: firstcall=.true. |
---|
| 53 | |
---|
[2616] | 54 | !$OMP THREADPRIVATE(firstcall) |
---|
| 55 | |
---|
[38] | 56 | c Traceurs : |
---|
| 57 | c ~~~~~~~~ |
---|
[1047] | 58 | real traversee (ngrid,nlay) |
---|
| 59 | real vstokes(ngrid,nlay) |
---|
| 60 | real w(ngrid,nlay) |
---|
[38] | 61 | real ptop, dztop, Ep, Stra |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | c Physical constant |
---|
| 65 | c ~~~~~~~~~~~~~~~~~ |
---|
| 66 | c Gas molecular viscosity (N.s.m-2) |
---|
| 67 | real,parameter :: visc=1.e-5 ! CO2 |
---|
| 68 | c Effective gas molecular radius (m) |
---|
| 69 | real,parameter :: molrad=2.2e-10 ! CO2 |
---|
| 70 | |
---|
| 71 | c local and saved variable |
---|
| 72 | real,save :: a,b |
---|
| 73 | |
---|
[2616] | 74 | !$OMP THREADPRIVATE(a,b) |
---|
[38] | 75 | |
---|
[2616] | 76 | |
---|
[38] | 77 | c ** un petit test de coherence |
---|
| 78 | c -------------------------- |
---|
| 79 | |
---|
[1779] | 80 | ! AS: OK firstcall absolute |
---|
[38] | 81 | IF (firstcall) THEN |
---|
[1047] | 82 | |
---|
[38] | 83 | firstcall=.false. |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | c Preliminary calculations for sedimenation velocity : |
---|
| 87 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 88 | |
---|
| 89 | c - Constant to compute stokes speed simple formulae |
---|
| 90 | c (Vstokes = b * rho* r**2 avec b= (2/9) * rho * g / visc |
---|
| 91 | b = 2./9. * g / visc |
---|
| 92 | ENDIF ! of IF(firstcall) |
---|
| 93 | |
---|
| 94 | c - Constant to compute gas mean free path |
---|
| 95 | c l= (T/P)*a, avec a = ( 0.707*8.31/(4*pi*molrad**2 * avogadro)) |
---|
[530] | 96 | a = 0.707*8.31/(4*3.1416* molrad*molrad * 6.023e23) |
---|
[38] | 97 | |
---|
| 98 | c - Correction to account for non-spherical shape (Murphy et al. 1990) |
---|
| 99 | a = a * beta |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | c----------------------------------------------------------------------- |
---|
| 104 | c 1. initialisation |
---|
| 105 | c ----------------- |
---|
| 106 | |
---|
| 107 | c Sedimentation velocity (m/s) |
---|
| 108 | c ~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 109 | c (stokes law corrected for low pressure by the Cunningham |
---|
| 110 | c slip-flow correction according to Rossow (Icarus 36, 1-50, 1978) |
---|
| 111 | |
---|
| 112 | do l=1,nlay |
---|
| 113 | do ig=1, ngrid |
---|
[358] | 114 | c radius |
---|
[38] | 115 | if (naersize.eq.1) then |
---|
| 116 | rfall=rd(1) |
---|
| 117 | else |
---|
| 118 | i=ngrid*(l-1)+ig |
---|
| 119 | rfall=rd(i) |
---|
| 120 | endif |
---|
[358] | 121 | c density |
---|
| 122 | if (nrhosize.eq.1) then |
---|
| 123 | rhofall=rho(1) |
---|
| 124 | else |
---|
| 125 | i=ngrid*(l-1)+ig |
---|
| 126 | rhofall=rho(i) |
---|
| 127 | endif |
---|
| 128 | c vstokes |
---|
[530] | 129 | vstokes(ig,l) = b * rhofall * rfall*rfall * |
---|
[38] | 130 | & (1 + 1.333* ( a*pt(ig,l)/pplev(ig,l) )/rfall) |
---|
| 131 | |
---|
| 132 | c Layer crossing time (s) : |
---|
| 133 | traversee(ig,l)= epaisseur(ig,l)/vstokes(ig,l) |
---|
| 134 | end do |
---|
| 135 | end do |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | c Calcul de la masse d'atmosphere correspondant a q transferee |
---|
| 139 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 140 | c (e.g. on recherche le niveau en dessous de laquelle le traceur |
---|
| 141 | c va traverser le niveau intercouche l : "dztop" est sa hauteur |
---|
| 142 | c au dessus de l (m), "ptop" est sa pression (Pa)) |
---|
| 143 | |
---|
| 144 | do l=1,nlay |
---|
| 145 | do ig=1, ngrid |
---|
| 146 | |
---|
| 147 | dztop = vstokes(ig,l)* ptimestep |
---|
| 148 | Ep=0 |
---|
| 149 | k=0 |
---|
| 150 | |
---|
[117] | 151 | w(ig,l) = 0. !! JF+AS ajout initialisation |
---|
[38] | 152 | c ************************************************************** |
---|
| 153 | c Simple Method |
---|
[117] | 154 | |
---|
| 155 | cc w(ig,l) = |
---|
| 156 | cc & (1.- exp(-dztop*g/(r*pt(ig,l))))*pplev(ig,l) / g |
---|
| 157 | cccc write(*,*) 'OK simple method l,w =', l, w(ig,l) |
---|
| 158 | cccc write(*,*) 'OK simple method dztop =', dztop |
---|
| 159 | |
---|
| 160 | w(ig,l) = 1. - exp(-dztop*g/(r*pt(ig,l))) |
---|
| 161 | !!! Diagnostic: JF. Fix: AS. Date: 05/11 |
---|
| 162 | !!! Probleme arrondi avec la quantite ci-dessus |
---|
| 163 | !!! ---> vaut 0 pour -dztop*g/(r*pt(ig,l)) trop petit |
---|
| 164 | !!! ---> dans ce cas on utilise le developpement limite ! |
---|
| 165 | !!! ---> exp(-x) = 1 - x lorsque x --> 0 avec une erreur de x^2 / 2 |
---|
| 166 | IF ( w(ig,l) .eq. 0. ) THEN |
---|
| 167 | w(ig,l) = ( dztop*g/(r*pt(ig,l)) ) * pplev(ig,l) / g |
---|
| 168 | ELSE |
---|
| 169 | w(ig,l) = w(ig,l) * pplev(ig,l) / g |
---|
| 170 | ENDIF |
---|
| 171 | |
---|
| 172 | |
---|
[38] | 173 | c ************************************************************** |
---|
| 174 | cccc Complex method : |
---|
[117] | 175 | if (dztop.gt.epaisseur(ig,l)) then !!!if on traverse plus d'une couche |
---|
[38] | 176 | cccc Cas ou on "epuise" la couche l : On calcule le flux |
---|
| 177 | cccc Venant de dessus en tenant compte de la variation de Vstokes |
---|
[117] | 178 | c ************************************************************** |
---|
[38] | 179 | Ep= epaisseur(ig,l) |
---|
| 180 | Stra= traversee(ig,l) |
---|
| 181 | do while(dztop.gt.Ep.and.l+k+1.le.nlay) |
---|
| 182 | k=k+1 |
---|
| 183 | dztop= Ep + vstokes(ig,l+k)*(ptimestep -Stra) |
---|
| 184 | Ep = Ep + epaisseur(ig,l+k) |
---|
| 185 | Stra = Stra + traversee(ig,l+k) |
---|
| 186 | enddo |
---|
| 187 | Ep = Ep - epaisseur(ig,l+k) |
---|
[117] | 188 | !ptop=pplev(ig,l+k)*exp(-(dztop-Ep)*g/(r*pt(ig,l+k))) |
---|
| 189 | |
---|
| 190 | !!! JF+AS 05/11 Probleme arrondi potentiel, meme solution que ci-dessus |
---|
| 191 | ptop=exp(-(dztop-Ep)*g/(r*pt(ig,l+k))) |
---|
| 192 | IF ( ptop .eq. 1. ) THEN |
---|
[147] | 193 | !PRINT*, 'newsedim: exposant trop petit ', ig, l |
---|
[117] | 194 | ptop=pplev(ig,l+k) * ( 1. - (dztop-Ep)*g/(r*pt(ig,l+k))) |
---|
| 195 | ELSE |
---|
| 196 | ptop=pplev(ig,l+k) * ptop |
---|
| 197 | ENDIF |
---|
| 198 | w(ig,l) = (pplev(ig,l) - Ptop)/g |
---|
| 199 | |
---|
| 200 | endif !!!!!if complex method |
---|
| 201 | |
---|
| 202 | |
---|
[38] | 203 | cc write(*,*) 'OK new method l,w =', l, w(ig,l) |
---|
| 204 | cc write(*,*) 'OK new method dztop =', dztop |
---|
| 205 | cc if(l.eq.7)write(*,*)'l=7,k,pplev,Ptop',pplev(ig,l),Ptop |
---|
| 206 | cc if(l.eq.7)write(*,*)'l=7,dztop,Ep',dztop,Ep |
---|
| 207 | cc if(l.eq.6)write(*,*)'l=6,k, w',k, w(1,l) |
---|
| 208 | cc if(l.eq.7)write(*,*)'l=7,k, w',k, w(1,l) |
---|
| 209 | cc if(l.eq.8)write(*,*)'l=8,k, w',k, w(1,l) |
---|
| 210 | c ************************************************************** |
---|
[117] | 211 | |
---|
| 212 | |
---|
[38] | 213 | end do |
---|
| 214 | end do |
---|
[1047] | 215 | call vlz_fi(ngrid,nlay,pqi,2.,masse,w,wq) |
---|
[38] | 216 | c write(*,*) ' newsed: wq(6), wq(7), q(6)', |
---|
| 217 | c & wq(1,6),wq(1,7),pqi(1,6) |
---|
| 218 | |
---|
| 219 | |
---|
[1913] | 220 | END SUBROUTINE newsedim |
---|
| 221 | |
---|
| 222 | END MODULE newsedim_mod |
---|
[38] | 223 | |
---|