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