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 | $ PhiEscH,PhiEscH2,PhiEscD) |
---|
7 | |
---|
8 | use conc_mod, only: rnew, cpnew |
---|
9 | USE comcstfi_h, only: r, cpp |
---|
10 | implicit none |
---|
11 | |
---|
12 | #include "callkeys.h" |
---|
13 | |
---|
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 |
---|
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) |
---|
31 | |
---|
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) |
---|
37 | REAL*8,INTENT(out) :: PhiEscH,PhiEscH2,PhiEscD |
---|
38 | |
---|
39 | INTEGER :: l,ig |
---|
40 | logical,save :: firstcall=.true. |
---|
41 | |
---|
42 | if (firstcall) then |
---|
43 | if (.not. tracer) then |
---|
44 | do l=1,nlayer |
---|
45 | do ig=1,ngrid |
---|
46 | rnew(ig,l)=r |
---|
47 | cpnew(ig,l)=cpp |
---|
48 | enddo |
---|
49 | enddo |
---|
50 | endif |
---|
51 | firstcall= .false. |
---|
52 | endif |
---|
53 | |
---|
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 | |
---|
62 | if (calleuv) then |
---|
63 | call euvheat(ngrid,nlayer,nq,pt,pdt,pplev,pplay,zzlay, |
---|
64 | $ mu0,ptimestep,ptime,zday,pq,pdq,zdteuv) |
---|
65 | endif |
---|
66 | |
---|
67 | if (callconduct) THEN |
---|
68 | call conduction(ngrid,nlayer,ptimestep,pplay,pplev,pt,zdteuv, |
---|
69 | $ tsurf,zzlev,zzlay,zdtconduc) |
---|
70 | endif |
---|
71 | |
---|
72 | if (callmolvis) THEN |
---|
73 | call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt, |
---|
74 | & zdteuv,zdtconduc,pu, |
---|
75 | $ tsurf,zzlev,zzlay,zdumolvis) |
---|
76 | call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt, |
---|
77 | & zdteuv,zdtconduc,pv, |
---|
78 | $ tsurf,zzlev,zzlay,zdvmolvis) |
---|
79 | endif |
---|
80 | |
---|
81 | if (callmoldiff) THEN |
---|
82 | call moldiff_red(ngrid,nlayer,nq, |
---|
83 | & pplay,pplev,pt,pdt,pq,pdq,ptimestep, |
---|
84 | & zzlay,zdteuv,zdtconduc,zdqmoldiff, |
---|
85 | & PhiEscH,PhiEscH2,PhiEscD) |
---|
86 | endif |
---|
87 | |
---|
88 | end |
---|
89 | |
---|
90 | |
---|