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