source: trunk/LMDZ.VENUS/libf/phyvenus/hrtherm.F @ 2187

Last change on this file since 2187 was 1530, checked in by emillour, 9 years ago

Venus and Titan GCMs:
Updates in the physics to keep up with updates in LMDZ5 (up to
LMDZ5 trunk, rev 2350) concerning dynamics/physics separation:

  • Adapted makelmdz and makelmdz_fcm script to stop if trying to compile 1d model or newstart or start2archive in parallel.
  • got rid of references to "dimensions.h" in physics. Within physics packages, use nbp_lon (=iim), nbp_lat (=jjmp1) and nbp_lev (=llm) from module mod_grid_phy_lmdz (in phy_common) instead. Only partially done for Titan, because of many hard-coded commons; a necessary first step will be to clean these up (using modules).

EM

File size: 3.4 KB
RevLine 
[1310]1c**********************************************************************
2
3      subroutine hrtherm(ig,euvmod,rm,nespeuv,tx,iz,zenit,zday,jtot)
4
5
6c     feb 2002        fgg           first version
7c     nov 2002        fgg           second version
8
9c**********************************************************************
10      use dimphy
11      use conc
12      implicit none
13
14c     common variables and constants
15
16
17#include "param.h"
18#include "param_v4.h"
19#include "clesphys.h"
20
21
22c    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
31c     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
53c*************************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
82c         xabsi(6,i)  = rm(i,i_h2o2)
83         !Only if O3, N or ion chemistry requested
84c         if(euvmod.ge.1) then
85c            xabsi(7,i)  = rm(i,i_o)
86c         endif
87         !Only if N or ion chemistry requested
88c         if(euvmod.ge.2) then
89c            xabsi(8,i)  = rm(i,i_n2)
90c            xabsi(9,i)  = rm(i,i_n)
91c            xabsi(10,i) = rm(i,i_no)
92c            xabsi(13,i) = rm(i,i_no2)
93c         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
Note: See TracBrowser for help on using the repository browser.