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