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