source: trunk/LMDZ.MARS/libf/aeronomars/hrtherm.F @ 657

Last change on this file since 657 was 635, checked in by emillour, 13 years ago

Mars GCM: Update of the chemistry package, including:

  • 93 reactions are accounted for (instead of 22); tracking 28 species (instead of 11)
  • computation of photoabsorption using raytracing
  • improved time stepping in the photochemistry
  • updated parameters (cross-sections); with this new version input files

are in 'EUV/param_v5' of "datafile" directory.

  • transition between lower and upper atmosphere chemistry set to 0.1 Pa (calchim.F90)
  • Lots of code clean-up: removed obsolete files column.F, param_v3.h, flujo.F, phdisrate.F, ch.F, interpfast.F, paramfoto.F, getch.F Converted chemtermos.F -> chemthermos.F90 and euvheat.F -> euvheat.F90. Added paramfoto_compact.F , param_v4.h and iono.h
  • Upadted surfacearea.F
  • Cleaned initracer.F and callkeys.h (removed use of obsolete "nqchem" and "oldnames" case when initializing tracers).
  • Minor correction in "callsedim": compute "rdust" and/or "rice" only when it makes sense.

FGG+FL+EM

File size: 3.3 KB
Line 
1c**********************************************************************
2
3      subroutine hrtherm(ig,euvmod,rm,nespeuv,tx,iz,zenit,jtot)
4
5
6c     feb 2002        fgg           first version
7c     nov 2002        fgg           second version
8
9c**********************************************************************
10
11      implicit none
12
13c     common variables and constants
14
15
16      include 'dimensions.h'
17      include 'dimphys.h'
18      include 'param.h'
19      include 'param_v4.h'
20
21
22c    local parameters and variables
23
24      real       xabsi(nabs,nlayermx)                   !densities
25      real       jergs(ninter,nabs,nlayermx)
26     
27      integer    i,j,k,indexint          !indexes
28      character  dn
29
30
31c     input and output variables
32
33      integer    ig  ,euvmod
34      integer    nespeuv
35      real       rm(nlayermx,nespeuv)              !density matrix (cm^-3)
36      real       jtot(nlayermx)                    !output: heating rate(erg/s)
37      real       tx(nlayermx)                      !temperature
38      real       zenit
39      real       iz(nlayermx)
40
41      ! tracer indexes for the EUV heating:
42!!! ATTENTION. These values have to be identical to those in chemthermos.F90
43!!! If the values are changed there, the same has to be done here  !!!
44      integer,parameter :: i_co2=1
45      integer,parameter :: i_o2=2
46      integer,parameter :: i_o=3
47      integer,parameter :: i_co=4
48      integer,parameter :: i_h=5
49      integer,parameter :: i_h2=8
50      integer,parameter :: i_h2o=9
51      integer,parameter :: i_h2o2=10
52      integer,parameter :: i_o3=12
53      integer,parameter :: i_n2=13
54      integer,parameter :: i_n=14
55      integer,parameter :: i_no=15
56      integer,parameter :: i_no2=17
57
58c*************************PROGRAM STARTS*******************************
59
60      !If nighttime, photoabsorption coefficient set to 0
61      if(zenit.gt.140.) then
62         dn='n'
63         else
64         dn='d'
65      end if
66      if(dn.eq.'n') then
67        do i=1,nlayermx                                   
68              jtot(i)=0.
69        enddo       
70        return
71      endif
72
73      !initializations
74      jergs(:,:,:)=0.
75      xabsi(:,:)=0.
76      jtot(:)=0.
77      !All number densities to a single array, xabsi(species,layer)
78      do i=1,nlayermx
79         xabsi(1,i)  = rm(i,i_co2)
80         xabsi(2,i)  = rm(i,i_o2)
81         xabsi(3,i)  = rm(i,i_o)
82         xabsi(4,i)  = rm(i,i_h2o)
83         xabsi(5,i)  = rm(i,i_h2)
84         xabsi(6,i)  = rm(i,i_h2o2)
85         !Only if O3, N or ion chemistry requested
86         if(euvmod.ge.1) then
87            xabsi(7,i)  = rm(i,i_o3)
88         endif
89         !Only if N or ion chemistry requested
90         if(euvmod.ge.2) then
91            xabsi(8,i)  = rm(i,i_n2)
92            xabsi(9,i)  = rm(i,i_n)
93            xabsi(10,i) = rm(i,i_no)
94            xabsi(13,i) = rm(i,i_no2)
95         endif
96         xabsi(11,i) = rm(i,i_co)
97         xabsi(12,i) = rm(i,i_h)
98      end do
99
100      !Calculation of photoabsortion coefficient
101      call jthermcalc(ig,euvmod,rm,nespeuv,tx,iz,zenit)
102
103      !Total photoabsorption coefficient
104      do i=1,nlayermx
105         jtot(i)=0.
106        do j=1,nabs
107          do indexint=1,ninter
108            jergs(indexint,j,i) = jfotsout(indexint,j,i)
109     $              * xabsi (j,i) * fluxtop(indexint) 
110     $              / (0.5e9 * freccen(indexint))
111            jtot(i)=jtot(i)+jergs(indexint,j,i)
112          end do
113        end do
114      end do
115
116      return
117
118      end
119
Note: See TracBrowser for help on using the repository browser.