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