source: LMDZ6/branches/Optimisation_LMDZ/libf/phymar/swtt1.F90 @ 5006

Last change on this file since 5006 was 2089, checked in by Laurent Fairhead, 10 years ago

Inclusion de la physique de MAR


Integration of MAR physics

File size: 2.8 KB
Line 
1SUBROUTINE SWTT1 ( KIDIA,KFDIA,KLON,KNU,KABS,KIND, PU, PTR )
2
3!**** *SWTT1* - COMPUTES THE SHORTWAVE TRANSMISSION FUNCTIONS
4
5!     PURPOSE.
6!     --------
7!           THIS ROUTINE COMPUTES THE TRANSMISSION FUNCTIONS FOR ALL THE
8!     ABSORBERS (H2O, UNIFORMLY MIXED GASES, AND O3) IN THE TWO SPECTRAL
9!     INTERVALS.
10
11!**   INTERFACE.
12!     ----------
13!          *SWTT1* IS CALLED FROM *SW1S*.
14
15
16!        EXPLICIT ARGUMENTS :
17!        --------------------
18! KNU    :                     ; INDEX OF THE SPECTRAL INTERVAL
19! KABS   :                     ; NUMBER OF ABSORBERS
20! KIND   : (KABS)              ; INDICES OF THE ABSORBERS
21! PU     : (KLON,KABS)         ; ABSORBER AMOUNT
22!     ==== OUTPUTS ===
23! PTR    : (KLON,KABS)         ; TRANSMISSION FUNCTION
24
25!        IMPLICIT ARGUMENTS :   NONE
26!        --------------------
27
28!     METHOD.
29!     -------
30
31!          TRANSMISSION FUNCTION ARE COMPUTED USING PADE APPROXIMANTS
32!     AND HORNER'S ALGORITHM.
33
34!     EXTERNALS.
35!     ----------
36
37!          NONE
38
39!     REFERENCE.
40!     ----------
41
42!        SEE RADIATION'S PART OF THE MODEL'S DOCUMENTATION AND
43!        ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE IFS
44
45!     AUTHOR.
46!     -------
47!        JEAN-JACQUES MORCRETTE  *ECMWF*
48
49!     MODIFICATIONS.
50!     --------------
51!        ORIGINAL : 95-01-20
52   
53!-----------------------------------------------------------------------
54
55#include "tsmbkind.h"
56
57USE YOESW    , ONLY : APAD     ,BPAD     ,D
58
59
60IMPLICIT NONE
61
62
63!     DUMMY INTEGER SCALARS
64INTEGER_M :: KABS
65INTEGER_M :: KFDIA
66INTEGER_M :: KIDIA
67INTEGER_M :: KLON
68INTEGER_M :: KNU
69
70
71
72!-----------------------------------------------------------------------
73
74!*       0.1   ARGUMENTS
75!              ---------
76
77INTEGER_M :: KIND(KABS)
78REAL_B :: PU(KLON,KABS)
79REAL_B :: PTR(KLON,KABS)
80
81!-----------------------------------------------------------------------
82
83!*       0.2   LOCAL ARRAYS
84!              ------------
85
86REAL_B :: ZR1(KLON), ZR2(KLON), ZU(KLON)
87
88!     LOCAL INTEGER SCALARS
89INTEGER_M :: IA, JA, JL
90
91
92!-----------------------------------------------------------------------
93
94!*         1.      HORNER'S ALGORITHM TO COMPUTE TRANSMISSION FUNCTION
95
96
97DO JA = 1,KABS
98  IA=KIND(JA)
99  DO JL = KIDIA,KFDIA
100    ZU(JL) = PU(JL,JA)
101    ZR1(JL) = APAD(KNU,IA,1) + ZU(JL) * (APAD(KNU,IA,2) + ZU(JL)&
102     &* ( APAD(KNU,IA,3) + ZU(JL) * (APAD(KNU,IA,4) + ZU(JL)&
103     &* ( APAD(KNU,IA,5) + ZU(JL) * (APAD(KNU,IA,6) + ZU(JL)&
104     &* ( APAD(KNU,IA,7) ))))))
105
106    ZR2(JL) = BPAD(KNU,IA,1) + ZU(JL) * (BPAD(KNU,IA,2) + ZU(JL)&
107     &* ( BPAD(KNU,IA,3) + ZU(JL) * (BPAD(KNU,IA,4) + ZU(JL)&
108     &* ( BPAD(KNU,IA,5) + ZU(JL) * (BPAD(KNU,IA,6) + ZU(JL)&
109     &* ( BPAD(KNU,IA,7) ))))))
110
111
112!*         2.      ADD THE BACKGROUND TRANSMISSION
113
114
115    PTR(JL,JA) = (ZR1(JL)/ZR2(JL)) * (_ONE_-D(KNU,IA)) + D(KNU,IA)
116  ENDDO
117ENDDO
118
119RETURN
120END SUBROUTINE SWTT1
Note: See TracBrowser for help on using the repository browser.