source: trunk/LMDZ.MARS/libf/phymars/blendrad.F @ 706

Last change on this file since 706 was 38, checked in by emillour, 14 years ago

Ajout du modè Martien (mon LMDZ.MARS.BETA, du 28/01/2011) dans le rértoire mars, pour pouvoir suivre plus facilement les modifs.
EM

File size: 2.0 KB
Line 
1      subroutine blendrad(ngrid, nlayer, pplay,
2     &                    zdtsw, zdtlw, zdtnirco2, zdtnlte, dtrad)
3c
4c  Combine radiative tendencies.  LTE contributions (zdtsw and zdtlw)
5c  have been calculated for the first NLAYLTE layers, zdtnirco2 and
6c  zdtnlte have been calculated for all nlayer layers (but zdtnlte may
7c  be zero low down).  zdtlw is phased out in favour of zdtnlte with
8c  height; zdtsw 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
14c
15      implicit none
16#include "dimensions.h"
17#include "dimphys.h"
18#include "dimradmars.h"
19#include "nlteparams.h"
20#include "yomlw.h"
21
22c     Input:
23      integer ngrid, nlayer
24      real pplay(ngrid, nlayer)
25      real zdtlw(ngrid, nlayer)
26      real zdtsw(ngrid, nlayer)
27      real zdtnirco2(ngrid, nlayer)
28      real zdtnlte(ngrid, nlayer)
29c
30c     Output:
31      real dtrad(ngrid, nlayer)
32c
33c     Local:
34      integer l, ig
35      real alpha
36c
37c     This is split into two loops to minimize number of calculations,
38c     but for vector machines it may be faster to perform one big
39c     loop from 1 to nlayer and remove the second loop.
40c
41c     Loop over layers for which zdtsw/lw have been calculated.
42      do l = 1,nlaylte
43         do ig = 1, ngrid
44c           alpha is actually 0.5*(1+tanh((z-ztrans)/zw))
45c           written here in a simpler form, with z=-ln(p) and zwi=2/zw
46            alpha = 1./(1.+(pplay(ig,l)/ptrans)**zwi)
47            dtrad(ig,l) = (1.-alpha)*(zdtsw(ig,l)+zdtlw(ig,l))
48     &                  + zdtnirco2(ig,l) + alpha*zdtnlte(ig,l)
49         enddo
50      enddo
51c
52c     Faster loop over any remaining layers.
53      do l = nlaylte+1, nlayer
54         do ig = 1, ngrid
55            dtrad(ig,l) = zdtnirco2(ig,l) + zdtnlte(ig,l)
56         enddo
57      enddo
58c
59      return
60      end
Note: See TracBrowser for help on using the repository browser.