source: trunk/LMDZ.MARS/libf/phymars/lwtt.F @ 3757

Last change on this file since 3757 was 3757, checked in by emillour, 4 weeks ago

Mars PCM:
More code tidying: puting routines in modules and modernizing some old
constructs. Tested to not change results with respect to previous version.
EM

File size: 2.3 KB
Line 
1      module lwtt_mod
2     
3      implicit none
4     
5      contains
6     
7      subroutine lwtt (kdlon,u,up,nu,tr)
8
9c----------------------------------------------------------------------
10c     LWTT   computes the longwave transmission functions
11c            for all the absorbers in all spectral intervals
12c            using pade approximants and horner's algorithm
13c----------------------------------------------------------------------
14
15      use dimradmars_mod, only : ndlon, ndlo2
16      use yomlw_h, only: ga, gb, cst_voigt
17      implicit none
18
19c----------------------------------------------------------------------
20c         0.1   arguments
21c               ---------
22c                                                            inputs:
23c                                                            -------
24      integer kdlon            ! part of ngrid
25      integer nu               !
26
27      real    u (ndlo2,nu)     ! absorber amounts
28      real    up (ndlo2,nu)    ! idem scaled by the pressure
29
30c                                                            outputs:
31c                                                            --------
32      real    tr (ndlo2,nu)    ! transmission functions
33
34c----------------------------------------------------------------------
35c         0.2   local arrays
36c               ------------
37
38      integer ja,jl
39
40      real xn (ndlon)
41      real xd (ndlon)
42      real ueq (ndlon)
43
44c----------------------------------------------------------------------
45c   Transmission by the CO2 15 microns band:
46c   ----------------------------------------
47
48      do  ja=1,nu
49            do jl=1,kdlon
50c                              equivalent absorber amount (Doppler effect)
51c                             --------------------------------------------
52              ueq(jl) = sqrt(up(jl,ja))
53     .              +cst_voigt(1,ja)*u(jl,ja)**cst_voigt(2,ja)
54
55c                                                      Horner's algorithm
56c                                                      ------------------
57            xn(jl) = ga(1,ja) +
58     .      ueq(jl)*(ga(2,ja) + ueq(jl) * ga(3,ja) )
59            xd(jl) = gb(1,ja) + ueq(jl)*(gb(2,ja) +
60     .      ueq(jl) * ( gb(3,ja) + ueq(jl)  ))
61            tr(jl,ja) = xn(jl) / xd(jl)
62
63            enddo
64      enddo
65
66c----------------------------------------------------------------------
67
68      end subroutine lwtt
69
70      end module lwtt_mod
Note: See TracBrowser for help on using the repository browser.