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

Last change on this file since 1242 was 1047, checked in by emillour, 11 years ago

Mars GCM:

  • IMPORTANT CHANGE: Removed all reference/use of ngridmx (dimphys.h) in routines (necessary prerequisite to using parallel dynamics); in most cases this just means adding 'ngrid' as routine argument, and making local saved variables allocatable (and allocated at first call). In the process, had to convert many *.h files to equivalent modules: yomaer.h => yomaer_h.F90 , surfdat.h => surfdat_h.F90 , comsaison.h => comsaison_h.F90 , yomlw.h => yomlw_h.F90 , comdiurn.h => comdiurn_h.F90 , dimradmars.h => dimradmars_mod.F90 , comgeomfi.h => comgeomfi_h.F90, comsoil.h => comsoil_h.F90 , slope.h => slope_mod.F90
  • Also updated EOF routines, everything is now in eofdump_mod.F90
  • Removed unused routine lectfux.F (in dyn3d)

EM

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