1 | subroutine blendrad(ngrid, nlayer, pplay, |
---|
2 | & zdtsw, zdtlw, zdtnirco2, zdtnlte, dtrad) |
---|
3 | c |
---|
4 | c Combine radiative tendencies. LTE contributions (zdtsw and zdtlw) |
---|
5 | c have been calculated for the first NLAYLTE layers, zdtnirco2 and |
---|
6 | c zdtnlte have been calculated for all nlayer layers (but zdtnlte may |
---|
7 | c be zero low down). zdtlw is phased out in favour of zdtnlte with |
---|
8 | c height; zdtsw is also phased out to remove possible spurious heating |
---|
9 | c at low pressures. The pressure at which the transition occurs and |
---|
10 | c the scale over which this happens are set in the nlteparams.h file. |
---|
11 | c Above layer NLAYLTE the tendency is purely the sum of NLTE contributions. |
---|
12 | c (Note : nlaylte is calculated by "nlthermeq" and stored in common "yomlw.h") |
---|
13 | c Stephen Lewis 6/2000 FF |
---|
14 | c |
---|
15 | implicit none |
---|
16 | #include "dimensions.h" |
---|
17 | #include "dimphys.h" |
---|
18 | #include "dimradmars.h" |
---|
19 | #include "nlteparams.h" |
---|
20 | #include "yomlw.h" |
---|
21 | |
---|
22 | c 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) |
---|
29 | c |
---|
30 | c Output: |
---|
31 | real dtrad(ngrid, nlayer) |
---|
32 | c |
---|
33 | c Local: |
---|
34 | integer l, ig |
---|
35 | real alpha |
---|
36 | c |
---|
37 | c This is split into two loops to minimize number of calculations, |
---|
38 | c but for vector machines it may be faster to perform one big |
---|
39 | c loop from 1 to nlayer and remove the second loop. |
---|
40 | c |
---|
41 | c Loop over layers for which zdtsw/lw have been calculated. |
---|
42 | do l = 1,nlaylte |
---|
43 | do ig = 1, ngrid |
---|
44 | c alpha is actually 0.5*(1+tanh((z-ztrans)/zw)) |
---|
45 | c 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 |
---|
51 | c |
---|
52 | c 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 |
---|
58 | c |
---|
59 | return |
---|
60 | end |
---|