| 1 | SUBROUTINE concentrations2(pplay,t_seri,pdt,co2vmr_gcm, n2vmr_gcm, |
|---|
| 2 | $ covmr_gcm,o3pvmr_gcm,nvmr_gcm,ptimestep) |
|---|
| 3 | |
|---|
| 4 | use dimphy |
|---|
| 5 | use conc, only: mmean, Akknew, rnew, cpnew |
|---|
| 6 | use cpdet_mod, only: cpdet |
|---|
| 7 | implicit none |
|---|
| 8 | |
|---|
| 9 | !======================================================================= |
|---|
| 10 | ! CALCULATION OF MEAN MOLECULAR MASS, Cp, Akk and R |
|---|
| 11 | ! |
|---|
| 12 | ! mmean(klon,klev) amu |
|---|
| 13 | ! cpnew(klon,klev) J/kg/K |
|---|
| 14 | ! rnew(klon,klev) J/kg/K |
|---|
| 15 | ! akknew(klon,klev) coefficient of thermal conduction |
|---|
| 16 | ! |
|---|
| 17 | ! version: April 2012 - Franck Lefevre |
|---|
| 18 | !======================================================================= |
|---|
| 19 | |
|---|
| 20 | ! declarations |
|---|
| 21 | |
|---|
| 22 | #include "dimensions.h" |
|---|
| 23 | #include "YOMCST.h" |
|---|
| 24 | #include "clesphys.h" |
|---|
| 25 | c#include "comdiurn.h" |
|---|
| 26 | c#include "chimiedata.h" |
|---|
| 27 | c#include "tracer.h" |
|---|
| 28 | #include "mmol.h" |
|---|
| 29 | |
|---|
| 30 | ! input/output |
|---|
| 31 | |
|---|
| 32 | real pplay(klon,klev) |
|---|
| 33 | c real pt(klon,klev) |
|---|
| 34 | real t_seri(klon, klev) |
|---|
| 35 | real pdt(klon,klev) |
|---|
| 36 | real co2vmr_gcm(klon,klev), n2vmr_gcm(klon,klev) |
|---|
| 37 | real covmr_gcm(klon,klev) |
|---|
| 38 | real o3pvmr_gcm(klon,klev),nvmr_gcm(klon,klev) |
|---|
| 39 | c real pq(klon,klev,nqmx) |
|---|
| 40 | c real pdq(klon,klev,nqmx) |
|---|
| 41 | real ptimestep |
|---|
| 42 | |
|---|
| 43 | ! local variables |
|---|
| 44 | |
|---|
| 45 | integer :: i, l, ig, iq |
|---|
| 46 | real :: ntot |
|---|
| 47 | real :: zt(klon, klev) |
|---|
| 48 | real, save :: akico2,akio,akin2,akico |
|---|
| 49 | real, save :: akin |
|---|
| 50 | real, save :: cpico2,cpico,cpio,cpin2 |
|---|
| 51 | real, save :: cpio2 |
|---|
| 52 | |
|---|
| 53 | logical, save :: firstcall = .true. |
|---|
| 54 | |
|---|
| 55 | if (firstcall) then |
|---|
| 56 | |
|---|
| 57 | ! initialize thermal conductivity and specific heat coefficients |
|---|
| 58 | ! values are taken from the literature [J/kg K] |
|---|
| 59 | |
|---|
| 60 | ! co2 |
|---|
| 61 | akico2 = 3.072e-4 |
|---|
| 62 | cpico2 = 0.834e3 |
|---|
| 63 | |
|---|
| 64 | ! co |
|---|
| 65 | akico = 4.87e-4 |
|---|
| 66 | cpico = 1.034e3 |
|---|
| 67 | |
|---|
| 68 | ! o |
|---|
| 69 | akio = 7.59e-4 |
|---|
| 70 | cpio = 1.3e3 |
|---|
| 71 | |
|---|
| 72 | ! n |
|---|
| 73 | ! akin = 0.0 |
|---|
| 74 | ! cpin = 0.0 |
|---|
| 75 | |
|---|
| 76 | ! n2 |
|---|
| 77 | akin2 = 5.6e-4 |
|---|
| 78 | cpin2 = 1.034e3 |
|---|
| 79 | |
|---|
| 80 | firstcall = .false. |
|---|
| 81 | end if ! if (firstcall) |
|---|
| 82 | |
|---|
| 83 | ! update temperature |
|---|
| 84 | |
|---|
| 85 | do l = 1,klev |
|---|
| 86 | do ig = 1,klon |
|---|
| 87 | c zt(ig,l) = pt(ig,l) + pdt(ig,l)*ptimestep |
|---|
| 88 | zt(ig,l) = t_seri(ig,l) |
|---|
| 89 | |
|---|
| 90 | end do |
|---|
| 91 | end do |
|---|
| 92 | |
|---|
| 93 | ! mmean : mean molecular mass |
|---|
| 94 | ! rnew : specific gas constant |
|---|
| 95 | |
|---|
| 96 | mmean(:,:) = 0. |
|---|
| 97 | |
|---|
| 98 | do l = 1,klev |
|---|
| 99 | do ig = 1,klon |
|---|
| 100 | c do i = 1,nbq |
|---|
| 101 | c iq = niq(i) |
|---|
| 102 | c mmean(ig,l) = mmean(ig,l) + zq(ig,l,iq)/mmol(iq) |
|---|
| 103 | c end do |
|---|
| 104 | mmean(ig,l) = RMD |
|---|
| 105 | rnew(ig,l) = 8.314/mmean(ig,l)*1.e3 ! J/kg K |
|---|
| 106 | end do |
|---|
| 107 | end do |
|---|
| 108 | |
|---|
| 109 | ! cpnew : specific heat |
|---|
| 110 | ! akknew : thermal conductivity cofficient |
|---|
| 111 | |
|---|
| 112 | c cpnew(:,:) = 0. |
|---|
| 113 | c akknew(:,:) = 0. |
|---|
| 114 | |
|---|
| 115 | do l = 1,klev |
|---|
| 116 | do ig = 1,klon |
|---|
| 117 | |
|---|
| 118 | ntot = pplay(ig,l)/(RKBOL*zt(ig,l))*1.e-6 ! in #/cm3 |
|---|
| 119 | |
|---|
| 120 | cpnew(ig,l) = ntot*o3pvmr_gcm(ig,l)*cpio |
|---|
| 121 | $ +ntot* co2vmr_gcm(ig,l)*cpdet(zt(ig,l)) |
|---|
| 122 | $ + ntot*n2vmr_gcm(ig,l)*cpin2 + ntot*covmr_gcm(ig,l)*cpico |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | akknew(ig,l) = ntot*o3pvmr_gcm(ig,l)*akio + |
|---|
| 126 | $ ntot*co2vmr_gcm(ig,l)*akico2 + |
|---|
| 127 | $ ntot*n2vmr_gcm(ig,l)*akin2 + ntot*covmr_gcm(ig,l)*akico |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | cpnew(ig,l) = cpnew(ig,l)/ntot |
|---|
| 131 | akknew(ig,l)= akknew(ig,l)/ntot |
|---|
| 132 | |
|---|
| 133 | c print*, '--- concentrations ---' |
|---|
| 134 | c print*, l, cpnew(1,l), rnew(1,l), akknew(1,l) |
|---|
| 135 | end do |
|---|
| 136 | end do |
|---|
| 137 | c STOP |
|---|
| 138 | |
|---|
| 139 | return |
|---|
| 140 | end |
|---|