| 1 | subroutine thermosphere(ngrid,nlayer,nq, |
|---|
| 2 | & pplev,pplay,dist_sol, |
|---|
| 3 | $ mu0,ptimestep,ptime,zday,tsurf,zzlev,zzlay, |
|---|
| 4 | & pt,pq,pu,pv,pdt,pdq, |
|---|
| 5 | $ zdteuv,zdtconduc,zdumolvis,zdvmolvis,zdqmoldiff) |
|---|
| 6 | |
|---|
| 7 | use conc_mod, only: rnew, cpnew |
|---|
| 8 | USE comcstfi_h, only: r, cpp |
|---|
| 9 | implicit none |
|---|
| 10 | |
|---|
| 11 | #include "callkeys.h" |
|---|
| 12 | |
|---|
| 13 | integer,intent(in) :: ngrid ! number of atmospheric columns |
|---|
| 14 | integer,intent(in) :: nlayer ! number of atmospheric layers |
|---|
| 15 | integer,intent(in) :: nq ! number of advected tracers |
|---|
| 16 | REAL,INTENT(in) :: pplay(ngrid,nlayer) |
|---|
| 17 | REAL,INTENT(in) :: pplev(ngrid,nlayer+1) |
|---|
| 18 | REAL,INTENT(in) :: zzlay(ngrid,nlayer) |
|---|
| 19 | REAL,INTENT(in) :: zzlev(ngrid,nlayer+1) |
|---|
| 20 | REAL,INTENT(in) :: pt(ngrid,nlayer) |
|---|
| 21 | REAL,INTENT(in) :: zday |
|---|
| 22 | REAL,INTENT(in) :: dist_sol |
|---|
| 23 | REAL,INTENT(in) :: mu0(ngrid) |
|---|
| 24 | REAL,INTENT(in) :: pq(ngrid,nlayer,nq) |
|---|
| 25 | REAL,INTENT(in) :: ptimestep |
|---|
| 26 | REAL,INTENT(in) :: ptime |
|---|
| 27 | REAL,INTENT(in) :: tsurf(ngrid) |
|---|
| 28 | REAL,INTENT(in) :: pu(ngrid,nlayer),pv(ngrid,nlayer) |
|---|
| 29 | REAL,INTENT(in) :: pdt(ngrid,nlayer),pdq(ngrid,nlayer,nq) |
|---|
| 30 | |
|---|
| 31 | REAL,INTENT(out) :: zdteuv(ngrid,nlayer) |
|---|
| 32 | REAL,INTENT(out) :: zdtconduc(ngrid,nlayer) |
|---|
| 33 | REAL,INTENT(out) :: zdumolvis(ngrid,nlayer) |
|---|
| 34 | REAL,INTENT(out) :: zdvmolvis(ngrid,nlayer) |
|---|
| 35 | REAL,INTENT(out) :: zdqmoldiff(ngrid,nlayer,nq) |
|---|
| 36 | |
|---|
| 37 | INTEGER :: l,ig |
|---|
| 38 | logical,save :: firstcall=.true. |
|---|
| 39 | |
|---|
| 40 | if (firstcall) then |
|---|
| 41 | if (.not. tracer) then |
|---|
| 42 | do l=1,nlayer |
|---|
| 43 | do ig=1,ngrid |
|---|
| 44 | rnew(ig,l)=r |
|---|
| 45 | cpnew(ig,l)=cpp |
|---|
| 46 | enddo |
|---|
| 47 | enddo |
|---|
| 48 | endif |
|---|
| 49 | firstcall= .false. |
|---|
| 50 | endif |
|---|
| 51 | |
|---|
| 52 | ! initialize tendencies to zero in all cases |
|---|
| 53 | ! (tendencies are added later on, even if parametrization is not called) |
|---|
| 54 | zdteuv(1:ngrid,1:nlayer)=0 |
|---|
| 55 | zdtconduc(1:ngrid,1:nlayer)=0 |
|---|
| 56 | zdumolvis(1:ngrid,1:nlayer)=0 |
|---|
| 57 | zdvmolvis(1:ngrid,1:nlayer)=0 |
|---|
| 58 | zdqmoldiff(1:ngrid,1:nlayer,1:nq)=0 |
|---|
| 59 | |
|---|
| 60 | if (calleuv) then |
|---|
| 61 | call euvheat(ngrid,nlayer,nq,pt,pdt,pplev,pplay,zzlay, |
|---|
| 62 | $ mu0,ptimestep,ptime,zday,pq,pdq,zdteuv) |
|---|
| 63 | endif |
|---|
| 64 | |
|---|
| 65 | if (callconduct) THEN |
|---|
| 66 | call conduction(ngrid,nlayer,ptimestep,pplay,pplev,pt,zdteuv, |
|---|
| 67 | $ tsurf,zzlev,zzlay,zdtconduc) |
|---|
| 68 | endif |
|---|
| 69 | |
|---|
| 70 | if (callmolvis) THEN |
|---|
| 71 | call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt, |
|---|
| 72 | & zdteuv,zdtconduc,pu, |
|---|
| 73 | $ tsurf,zzlev,zzlay,zdumolvis) |
|---|
| 74 | call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt, |
|---|
| 75 | & zdteuv,zdtconduc,pv, |
|---|
| 76 | $ tsurf,zzlev,zzlay,zdvmolvis) |
|---|
| 77 | endif |
|---|
| 78 | |
|---|
| 79 | if (callmoldiff) THEN |
|---|
| 80 | call moldiff_red(ngrid,nlayer,nq, |
|---|
| 81 | & pplay,pplev,pt,pdt,pq,pdq,ptimestep, |
|---|
| 82 | & zzlay,zdteuv,zdtconduc,zdqmoldiff) |
|---|
| 83 | endif |
|---|
| 84 | |
|---|
| 85 | end |
|---|
| 86 | |
|---|
| 87 | |
|---|