Ignore:
Timestamp:
May 21, 2014, 4:18:35 PM (11 years ago)
Author:
emillour
Message:

Mars GCM:

  • Bug fix in thermosphere.F, always initialize all tendencies to zero. (only really matters in cases when only some of the included parametrizations are used).

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/aeronomars/thermosphere.F

    r1266 r1274  
    66
    77      use conc_mod, only: rnew, cpnew
    8       USE comcstfi_h
     8      USE comcstfi_h, only: r, cpp
    99      implicit none
    1010
     
    1414      integer,intent(in) :: nlayer ! number of atmospheric layers
    1515      integer,intent(in) :: nq ! number of advected tracers
    16       REAL pplay(ngrid,nlayer)
    17       real pplev(ngrid,nlayer+1)
    18       REAL zzlay(ngrid,nlayer)
    19       real zzlev(ngrid,nlayer+1)
    20       REAL pt(ngrid,nlayer)
    21       real zday
    22       REAL dist_sol
    23       real mu0(ngrid)
    24       real pq(ngrid,nlayer,nq)
    25       real ptimestep
    26       real ptime
    27       real tsurf(ngrid)
    28       REAL pu(ngrid,nlayer),pv(ngrid,nlayer)
    29       REAL pdt(ngrid,nlayer),pdq(ngrid,nlayer,nq)
     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)
    3030
    31       REAL zdteuv(ngrid,nlayer)
    32       REAL zdtconduc(ngrid,nlayer)
    33       REAL zdumolvis(ngrid,nlayer)
    34       REAL zdvmolvis(ngrid,nlayer)
    35       real zdqmoldiff(ngrid,nlayer,nq)
     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)
    3636
    37       INTEGER l,ig
     37      INTEGER :: l,ig
    3838      logical,save :: firstcall=.true.
    3939
     
    5050      endif
    5151
     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     
    5260      if (calleuv) then
    53         zdteuv(1:ngrid,1:nlayer)=0
    5461        call euvheat(ngrid,nlayer,nq,pt,pdt,pplev,pplay,zzlay,
    5562     $               mu0,ptimestep,ptime,zday,pq,pdq,zdteuv)
     
    5764
    5865      if (callconduct) THEN
    59         zdtconduc(1:ngrid,1:nlayer)=0
    6066        call conduction(ngrid,nlayer,ptimestep,pplay,pplev,pt,zdteuv,
    6167     $                   tsurf,zzlev,zzlay,zdtconduc)
     
    6369
    6470      if (callmolvis) THEN
    65         zdumolvis(1:ngrid,1:nlayer)=0
    6671        call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt,
    6772     &                zdteuv,zdtconduc,pu,
    6873     $                   tsurf,zzlev,zzlay,zdumolvis)
    69         zdvmolvis(1:ngrid,1:nlayer)=0
    7074        call molvis(ngrid,nlayer,ptimestep,pplay,pplev,pt,
    7175     &                zdteuv,zdtconduc,pv,
     
    7478
    7579      if (callmoldiff) THEN
    76         zdqmoldiff(1:ngrid,1:nlayer,1:nq)=0
    7780        call moldiff_red(ngrid,nlayer,nq,
    7881     &                   pplay,pplev,pt,pdt,pq,pdq,ptimestep,
     
    8083      endif
    8184
    82       return
    8385      end
    8486
Note: See TracChangeset for help on using the changeset viewer.