source: trunk/LMDZ.VENUS/libf/phyvenus/blendrad.F @ 1356

Last change on this file since 1356 was 1310, checked in by slebonnois, 11 years ago

SL: VENUS VERTICAL EXTENSION. NLTE and thermospheric processes, to be run with 78 levels and specific inputs.

File size: 2.6 KB
Line 
1      subroutine blendrad(nlon, nlev, pplay, heat,
2     &                     cool, pdtnirco2,zdtnlte, dtsw,dtlw )
3c
4c  Combine radiative tendencies.  LTE contributions (heat and cool)
5c  have been calculated for the first NLAYLTE layers, zdtnirco2 and
6c  zdtnlte have been calculated for all nlev layers (but zdtnlte may
7c  be zero low down).  cool is phased out in favour of zdtnlte with
8c  height; heat is also phased out to remove possible spurious heating
9c  at low pressures.  The pressure at which the transition occurs and
10c  the scale over which this happens are set in the nlteparams.h file.
11c  Above layer NLAYLTE the tendency is purely the sum of NLTE contributions.
12c  (Note : nlaylte is calculated by "nlthermeq" and stored in common "yomlw.h")
13c  Stephen Lewis 6/2000 FF
14
15      use dimphy
16      implicit none
17#include "dimensions.h"
18c#include "dimradmars.h"
19#include "nlteparams.h"
20c#include "yomlw.h"
21#include "YOMCST.h"
22
23c     Input:
24      integer nlon, nlev
25      real pplay(nlon, nlev)
26      real cool(nlon, nlev)
27      real heat(nlon, nlev)
28      real pdtnirco2(nlon, nlev)
29      real zdtnlte(nlon, nlev)
30c
31c     Output:
32c      real dtrad(nlon, nlev)
33      real dtlw(nlon, nlev)
34      real dtsw(nlon, nlev)
35c
36c     Local:
37      integer l, ig
38      real alpha, alpha2
39      real, parameter :: p_lowup = 10.e2
40
41c
42c     This is split into two loops to minimize number of calculations,
43c     but for vector machines it may be faster to perform one big
44c     loop from 1 to nlev and remove the second loop.
45c
46
47c          print*, '--- NLAYTE value is: ---'
48c          print*, nlaylte
49
50c     Loop over layers for which heat/lw have been calculated.
51       do l = 1,nlaylte !defini dans nlthermeq
52         do ig = 1, nlon
53c           alpha is actually 0.5*(1+tanh((z-ztrans)/zw))
54c           written here in a simpler form, with z=-ln(p) and zwi=2/zw
55            alpha  = 1./(1.+(pplay(ig,l)/ptrans)**zwi)
56            alpha2 = 1./(1.+(pplay(ig,l)/p_lowup)**zwi)
57           
58c     This formula is used in the Martian routines
59c            dtrad(ig,l) = (1.-alpha)*(heat(ig,l)+cool(ig,l))
60c     &                  + pdtnirco2(ig,l) + alpha*zdtnlte(ig,l)
61
62            dtlw(ig,l) = (1.-alpha)*(-cool(ig,l))
63     &                  + alpha*zdtnlte(ig,l)
64            dtsw(ig,l) = (1-alpha2)*(heat(ig,l))
65     &                  +  alpha2*pdtnirco2(ig,l)
66
67         enddo
68      enddo
69
70c
71c     Faster loop over any remaining layers.
72      do l = nlaylte+1, nlev
73         do ig = 1, nlon
74
75c           dtrad(ig,l) = pdtnirco2(ig,l) + zdtnlte(ig,l)
76
77            dtlw(ig,l) = zdtnlte(ig,l)
78            dtsw(ig,l) = pdtnirco2(ig,l)
79         enddo
80      enddo
81
82      return
83      end
Note: See TracBrowser for help on using the repository browser.