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 | integer,parameter :: ix_co2 = 1 |
---|
51 | integer,parameter :: ix_co = 2 |
---|
52 | integer,parameter :: ix_o = 3 |
---|
53 | integer,parameter :: ix_o1d = 4 |
---|
54 | integer,parameter :: ix_o2 = 5 |
---|
55 | integer,parameter :: ix_o3 = 6 |
---|
56 | integer,parameter :: ix_h = 7 |
---|
57 | integer,parameter :: ix_h2 = 8 |
---|
58 | integer,parameter :: ix_oh = 9 |
---|
59 | integer,parameter :: ix_ho2 = 10 |
---|
60 | integer,parameter :: ix_h2o2 = 11 |
---|
61 | integer,parameter :: ix_h2o = 12 |
---|
62 | integer,parameter :: ix_n = 13 |
---|
63 | integer,parameter :: ix_n2d = 14 |
---|
64 | integer,parameter :: ix_no = 15 |
---|
65 | integer,parameter :: ix_no2 = 16 |
---|
66 | integer,parameter :: ix_n2 = 17 |
---|
67 | |
---|
68 | c*************************PROGRAM STARTS******************************* |
---|
69 | |
---|
70 | !If nighttime, photoabsorption coefficient set to 0 |
---|
71 | if(zenit.gt.90.) then !140 in the martian routine |
---|
72 | dn='n' |
---|
73 | else |
---|
74 | dn='d' |
---|
75 | end if |
---|
76 | if(dn.eq.'n') then |
---|
77 | do i=1,klev |
---|
78 | jtot(i)=0. |
---|
79 | enddo |
---|
80 | return |
---|
81 | endif |
---|
82 | |
---|
83 | !initializations |
---|
84 | jergs(:,:,:)=0. |
---|
85 | xabsi(:,:)=0. |
---|
86 | jtot(:)=0. |
---|
87 | !All number densities to a single array, xabsi(species,layer) |
---|
88 | ! WARNING xabs(nabs,nlev), j=1,nabs --> the values of j should |
---|
89 | ! be the same for xabs than for jfotsout(indexint,j,i) |
---|
90 | ! |
---|
91 | do i=1,klev |
---|
92 | xabsi(1,i) = rm(i,ix_co2) ! CO2 |
---|
93 | xabsi(2,i) = rm(i,ix_o2) ! O2 |
---|
94 | xabsi(3,i) = rm(i,ix_o) ! O(3P) |
---|
95 | xabsi(4,i) = rm(i,ix_h2o) ! H2O |
---|
96 | xabsi(5,i) = rm(i,ix_h2) ! H2 |
---|
97 | xabsi(6,i) = rm(i,ix_h2o2) ! H2O2 |
---|
98 | !Only if O3, N or ion chemistry requested |
---|
99 | if(euvmod.ge.1) then |
---|
100 | xabsi(7,i) = rm(i,ix_o3) ! O3 |
---|
101 | endif |
---|
102 | xabsi(8,i) = rm(i,ix_n2) ! N2 |
---|
103 | !Only if N or ion chemistry requested |
---|
104 | if(euvmod.ge.2) then |
---|
105 | xabsi(9,i) = rm(i,ix_n) ! N |
---|
106 | xabsi(10,i) = rm(i,ix_no) ! NO |
---|
107 | xabsi(13,i) = rm(i,ix_no2) ! NO2 |
---|
108 | endif |
---|
109 | xabsi(11,i) = rm(i,ix_co) ! CO |
---|
110 | xabsi(12,i) = rm(i,ix_h) ! H |
---|
111 | end do |
---|
112 | |
---|
113 | !Calculation of photoabsortion coefficient |
---|
114 | call jthermcalc_e107(ig,klev,euvmod,rm,nespeuv,tx,iz,zenit) |
---|
115 | |
---|
116 | !Total photoabsorption coefficient ! erg/(s*cm3) |
---|
117 | do i=1,klev |
---|
118 | jtot(i)=0. |
---|
119 | do j=1,nabs |
---|
120 | do indexint=1,ninter |
---|
121 | jergs(indexint,j,i) = jfotsout(indexint,j,i) |
---|
122 | $ * xabsi (j,i) * fluxtop(indexint) |
---|
123 | $ / (0.5e9 * freccen(indexint)) |
---|
124 | jtot(i)=jtot(i)+jergs(indexint,j,i) |
---|
125 | |
---|
126 | |
---|
127 | end do |
---|
128 | end do |
---|
129 | end do |
---|
130 | |
---|
131 | return |
---|
132 | |
---|
133 | end |
---|
134 | |
---|