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