source: trunk/LMDZ.VENUS/libf/phyvenus/hrtherm.F @ 1521

Last change on this file since 1521 was 1442, checked in by slebonnois, 10 years ago

SL: update of the Venus GCM, + corrections on routines used for newstart/start2archive for Titan and Venus, + some modifications on tools

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