| 1 | SUBROUTINE ch4surf(ngrid,nlayer,nq,ptimestep,capcal,tsurf, |
|---|
| 2 | & pdtsurf,pplev,pdpsurf,pq,pdq,pqsurf,pdqsurf,pdqch4,pdqsch4) |
|---|
| 3 | |
|---|
| 4 | use callkeys_mod, only: dayfrac, thresh_non2, no_ch4frost |
|---|
| 5 | use comcstfi_mod, only: g, r |
|---|
| 6 | use comgeomfi_h |
|---|
| 7 | use comsaison_h, only: fract |
|---|
| 8 | use planete_mod, only: z0 |
|---|
| 9 | use tracer_h, only: igcm_ch4_gas,igcm_ch4_ice,igcm_n2,mmol,lw_ch4 |
|---|
| 10 | IMPLICIT NONE |
|---|
| 11 | |
|---|
| 12 | c---------------- |
|---|
| 13 | c declarations: |
|---|
| 14 | c ------------- |
|---|
| 15 | |
|---|
| 16 | #include "dimensions.h" |
|---|
| 17 | |
|---|
| 18 | ! Routine for nogcm : sublimation/condensation scheme at the surface |
|---|
| 19 | ! Output : tendancy for methane mixing ratio and surface reservoir : |
|---|
| 20 | ! pdqch4, pdqs_ch4 |
|---|
| 21 | |
|---|
| 22 | !----------------------------------------------------------------------- |
|---|
| 23 | ! Arguments |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | INTEGER ngrid,nlayer,nq |
|---|
| 27 | REAL ptimestep |
|---|
| 28 | INTEGER ig,iq |
|---|
| 29 | |
|---|
| 30 | ! input : |
|---|
| 31 | REAL capcal(ngrid) ! surface heat capacity (J m-2 K-1) |
|---|
| 32 | REAL tsurf(ngrid) |
|---|
| 33 | REAL pplev(ngrid,nlayer+1) |
|---|
| 34 | REAL pdpsurf(ngrid) |
|---|
| 35 | REAL pq(ngrid,nlayer,nq) |
|---|
| 36 | REAL pdq(ngrid,nlayer,nq) |
|---|
| 37 | REAL pqsurf(ngrid,nq) |
|---|
| 38 | REAL pdqsurf(ngrid,nq) |
|---|
| 39 | REAL pdtsurf(ngrid) |
|---|
| 40 | |
|---|
| 41 | ! Output |
|---|
| 42 | REAL pdqch4(ngrid) |
|---|
| 43 | REAL pdqsch4(ngrid) |
|---|
| 44 | |
|---|
| 45 | ! local |
|---|
| 46 | REAL qsat(ngrid) |
|---|
| 47 | REAL zpsrf(ngrid) |
|---|
| 48 | REAL zq_ch4(ngrid) |
|---|
| 49 | REAL zq_n2surf(ngrid) |
|---|
| 50 | REAL ztsurf(ngrid) |
|---|
| 51 | REAL gamm(ngrid) ! activity coefficient |
|---|
| 52 | REAL rho,u,v,uv,z00,cdrag,alt |
|---|
| 53 | REAL vonk ! Von Karman Constant |
|---|
| 54 | SAVE vonk |
|---|
| 55 | DATA vonk/0.4/ |
|---|
| 56 | |
|---|
| 57 | ! Calculation of turbulent flux : F=rho*cdrag*uv*(qsat-zq) |
|---|
| 58 | |
|---|
| 59 | ! Calcul de cdrag |
|---|
| 60 | alt=5. ! m |
|---|
| 61 | !z00=1.e-2 ! rugosity |
|---|
| 62 | z00=z0 |
|---|
| 63 | cdrag=(vonk/log(alt/z00))**2 |
|---|
| 64 | |
|---|
| 65 | u=0.3 ! 6 |
|---|
| 66 | v=0.4 ! 3 |
|---|
| 67 | uv=sqrt(u**2+v**2) |
|---|
| 68 | |
|---|
| 69 | pdqsch4(:)=0. |
|---|
| 70 | pdqch4(:)=0. |
|---|
| 71 | |
|---|
| 72 | !! Update CH4, pressure |
|---|
| 73 | DO ig=1,ngrid |
|---|
| 74 | zpsrf(ig)=pplev(ig,1) |
|---|
| 75 | zq_ch4(ig)=pq(ig,1,igcm_ch4_gas) |
|---|
| 76 | & + pdq(ig,1,igcm_ch4_gas)*ptimestep |
|---|
| 77 | zq_n2surf(ig)=pqsurf(ig,igcm_n2) |
|---|
| 78 | & + pdqsurf(ig,igcm_n2)*ptimestep |
|---|
| 79 | ztsurf(ig)=tsurf(ig) !+pdtsurf(ig)*ptimestep |
|---|
| 80 | ENDDO |
|---|
| 81 | |
|---|
| 82 | !! Get qsat for CH4 |
|---|
| 83 | call methanesat(ngrid,ztsurf,zpsrf,qsat,zq_n2surf(:)) |
|---|
| 84 | |
|---|
| 85 | !! Dayfrac: Fraction of the daytime where we do not condense CH4 in N2 |
|---|
| 86 | ! corresponds to cold layer of N2 pushing CH4 or depleting CH4 near the surface |
|---|
| 87 | ! By default, we do not take this into account : dayfrac=0. We condense all the time |
|---|
| 88 | ! dayfrac = 1 : we do not condense CH4 in N2 during daytime |
|---|
| 89 | ! dayfrac = 2 : all saturated, so we never condense CH4 in N2 |
|---|
| 90 | ! dayfrac = 0.5 : we do not condense CH4 during half of the daytime (we condense during all night + half of daytime) |
|---|
| 91 | |
|---|
| 92 | !! Loop |
|---|
| 93 | DO ig=1,ngrid |
|---|
| 94 | |
|---|
| 95 | !! Take into account activity coefficient |
|---|
| 96 | ! gamm(ig)=499.9-21.8*ztsurf(ig)+0.249*ztsurf(ig)**2 |
|---|
| 97 | ! & -1.3*(zq_ch4(ig)* |
|---|
| 98 | ! & mmol(igcm_n2)/mmol(igcm_ch4_gas)*100.-0.6)/0.3 |
|---|
| 99 | ! gamm(ig)=max(gamm(ig),1.) |
|---|
| 100 | ! qsat(ig)=qsat(ig)*gamm(ig) |
|---|
| 101 | |
|---|
| 102 | !! option to not form any CH4 frost |
|---|
| 103 | if (no_ch4frost.and.pqsurf(ig,igcm_ch4_ice).lt.5000.) then |
|---|
| 104 | |
|---|
| 105 | pdqch4(ig)=0. |
|---|
| 106 | pdqsch4(ig)=0. |
|---|
| 107 | |
|---|
| 108 | else |
|---|
| 109 | |
|---|
| 110 | rho = zpsrf(ig) / (r * tsurf(ig) ) |
|---|
| 111 | !! Condensation Flux |
|---|
| 112 | pdqsch4(ig)=(-rho*uv*cdrag*(qsat(ig)-zq_ch4(ig))) |
|---|
| 113 | |
|---|
| 114 | if (dayfrac.gt.0.and.zq_n2surf(ig).gt.thresh_non2) then |
|---|
| 115 | if (dayfrac.gt.1.) then |
|---|
| 116 | pdqsch4(ig)=min(pdqsch4(ig),0.) |
|---|
| 117 | else |
|---|
| 118 | if (pdqsch4(ig).gt.0.) then ! condensation |
|---|
| 119 | pdqsch4(ig)=pdqsch4(ig)*(1.-fract(ig)*dayfrac) |
|---|
| 120 | endif |
|---|
| 121 | endif |
|---|
| 122 | endif |
|---|
| 123 | |
|---|
| 124 | !! Conserve mass if reservoir depleted |
|---|
| 125 | if ((-pdqsch4(ig)*ptimestep).gt. |
|---|
| 126 | & (pqsurf(ig,igcm_ch4_ice))) then |
|---|
| 127 | pdqsch4(ig)=-pqsurf(ig,igcm_ch4_ice)/ptimestep |
|---|
| 128 | endif |
|---|
| 129 | |
|---|
| 130 | if (pdqsch4(ig)*ptimestep.gt.zq_ch4(ig)*zpsrf(ig)/g) then |
|---|
| 131 | pdqsch4(ig)=zq_ch4(ig)/ptimestep*zpsrf(ig)/g |
|---|
| 132 | endif |
|---|
| 133 | |
|---|
| 134 | !! Security to avoid large changes in temperatures due to |
|---|
| 135 | !latent heat |
|---|
| 136 | if (lw_ch4*pdqsch4(ig)*ptimestep/capcal(ig).gt.1.) then |
|---|
| 137 | pdqsch4(ig)=1./(lw_ch4*ptimestep)*capcal(ig) |
|---|
| 138 | endif |
|---|
| 139 | if (lw_ch4*pdqsch4(ig)*ptimestep/capcal(ig).lt.-1.) then |
|---|
| 140 | pdqsch4(ig)=-1./(lw_ch4*ptimestep)*capcal(ig) |
|---|
| 141 | endif |
|---|
| 142 | !if (pdqsch4(ig)*ptimestep.gt.0.25) then |
|---|
| 143 | ! pdqsch4(ig)=0.25/ptimestep |
|---|
| 144 | !endif |
|---|
| 145 | !if (pdqsch4(ig)*ptimestep.lt.-0.25) then |
|---|
| 146 | ! pdqsch4(ig)=-0.25/ptimestep |
|---|
| 147 | !endif |
|---|
| 148 | |
|---|
| 149 | !! Atm tendency |
|---|
| 150 | pdqch4(ig)=-pdqsch4(ig)*g/zpsrf(ig) |
|---|
| 151 | |
|---|
| 152 | endif |
|---|
| 153 | |
|---|
| 154 | ENDDO |
|---|
| 155 | |
|---|
| 156 | RETURN |
|---|
| 157 | END |
|---|