source: trunk/LMDZ.MARS/libf/aeronomars/thermosphere.F @ 2825

Last change on this file since 2825 was 2823, checked in by emillour, 3 years ago

Mars GCM:
Remove the "tracer" (logical) flag as we now always run with at least
one tracer.
EM

File size: 2.9 KB
RevLine 
[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
[2823]12      include "callkeys.h"
[38]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
[2615]42!$OMP THREADPRIVATE(firstcall)
43
[38]44      if (firstcall) then
[2823]45        rnew(1:ngrid,1:nlayer)=r
46        cpnew(1:ngrid,1:nlayer)=cpp
[38]47        firstcall= .false.
48      endif
49
[1274]50      ! initialize tendencies to zero in all cases
51      ! (tendencies are added later on, even if parametrization is not called)
52      zdteuv(1:ngrid,1:nlayer)=0
53      zdtconduc(1:ngrid,1:nlayer)=0
54      zdumolvis(1:ngrid,1:nlayer)=0
55      zdvmolvis(1:ngrid,1:nlayer)=0
56      zdqmoldiff(1:ngrid,1:nlayer,1:nq)=0
57     
[38]58      if (calleuv) then
[1047]59        call euvheat(ngrid,nlayer,nq,pt,pdt,pplev,pplay,zzlay,
[38]60     $               mu0,ptimestep,ptime,zday,pq,pdq,zdteuv)
61      endif
62
63      if (callconduct) THEN
[1047]64        call conduction(ngrid,nlayer,ptimestep,pplay,pplev,pt,zdteuv,
[38]65     $                   tsurf,zzlev,zzlay,zdtconduc)
66      endif
67
68      if (callmolvis) THEN
[1047]69        call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt,
70     &                zdteuv,zdtconduc,pu,
[38]71     $                   tsurf,zzlev,zzlay,zdumolvis)
[1047]72        call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt,
73     &                zdteuv,zdtconduc,pv,
[38]74     $                   tsurf,zzlev,zzlay,zdvmolvis)
75      endif
76
77      if (callmoldiff) THEN
[1047]78        call moldiff_red(ngrid,nlayer,nq,
79     &                   pplay,pplev,pt,pdt,pq,pdq,ptimestep,
[2467]80     &                   zzlay,zdteuv,zdtconduc,zdqmoldiff,
81     &                   PhiEscH,PhiEscH2,PhiEscD)
[38]82      endif
83
84      end
85
86
Note: See TracBrowser for help on using the repository browser.