source: LMDZ5/branches/testing/libf/phylmd/rrtm/rrtm_taumol2.F90 @ 1999

Last change on this file since 1999 was 1999, checked in by Laurent Fairhead, 11 years ago

Merged trunk changes r1920:1997 into testing branch

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 5.5 KB
Line 
1!----------------------------------------------------------------------------
2SUBROUTINE RRTM_TAUMOL2 (KLEV,P_TAU,P_COLDRY,&
3 & P_TAUAERL,P_FAC00,P_FAC01,P_FAC10,P_FAC11,P_FORFAC,K_JP,K_JT,K_JT1,&
4 & P_COLH2O,K_LAYTROP,P_SELFFAC,P_SELFFRAC,K_INDSELF,PFRAC) 
5
6!     BAND 2:  250-500 cm-1 (low - H2O; high - H2O)
7
8! Modifications
9!        M.Hamrud      01-Oct-2003 CY28 Cleaning
10
11!     D Salmond   2000-05-15 speed-up
12!     JJMorcrette 2000-05-17 speed-up
13!     JJMorcrette 2000-07-14 bugfix
14!     Y. Seity    2006-09-26 Nec optimisation
15
16USE PARKIND1  ,ONLY : JPIM     ,JPRB
17USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
18
19USE PARRRTM  , ONLY : JPLAY  ,JPBAND ,JPGPT  ,NG2   ,NGS1
20USE YOERRTWN , ONLY :      NSPA   ,NSPB
21USE YOERRTA2 , ONLY : ABSA   ,ABSB   ,FRACREFA, FRACREFB,&
22 & FORREF   ,SELFREF , REFPARAM 
23USE YOERRTBG2, ONLY : CORR1  ,CORR2
24
25!  Input
26!#include "yoeratm.h"
27
28IMPLICIT NONE
29
30INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
31REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAU(JPGPT,JPLAY)
32REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLDRY(JPLAY)
33REAL(KIND=JPRB)   ,INTENT(IN)    :: P_TAUAERL(JPLAY,JPBAND)
34REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(JPLAY)
35REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(JPLAY)
36REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(JPLAY)
37REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(JPLAY)
38REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFAC(JPLAY)
39INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(JPLAY)
40INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(JPLAY)
41INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(JPLAY)
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLH2O(JPLAY)
43INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(JPLAY)
45REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(JPLAY)
46INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(JPLAY)
47REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFRAC(JPGPT,JPLAY)
48!  Output
49!- from AER
50!- from INTFAC     
51!- from INTIND
52!- from PROFDATA             
53!- from SELF             
54!- from SP             
55REAL(KIND=JPRB) :: Z_FC00(JPLAY),Z_FC01(JPLAY),Z_FC10(JPLAY),Z_FC11(JPLAY)
56!      REAL TAUAER(JPLAY)
57REAL(KIND=JPRB) :: Z_FRACINT(JPLAY)
58INTEGER(KIND=JPIM) :: IND0(JPLAY),IND1(JPLAY),INDS(JPLAY), INDEX(JPLAY)
59
60INTEGER(KIND=JPIM) :: IFP, IFRAC, IG, JFRAC, I_LAY
61
62REAL(KIND=JPRB) :: Z_FP, Z_H2OPARAM, Z_WATER
63REAL(KIND=JPRB) :: ZHOOK_HANDLE
64
65!      EQUIVALENCE (TAUAERL(1,2),TAUAER)
66
67!     Compute the optical depth by interpolating in ln(pressure) and
68!     temperature.  Below LAYTROP, the water vapor self-continuum is
69!     interpolated (in temperature) separately.
70
71IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL2',0,ZHOOK_HANDLE)
72DO I_LAY = 1, K_LAYTROP
73  Z_WATER = 1.E20_JPRB * P_COLH2O(I_LAY) / P_COLDRY(I_LAY)
74  Z_H2OPARAM = Z_WATER/(Z_WATER +.002_JPRB)
75 
76!  DO IFRAC = 2, 12
77!    IF (H2OPARAM  >=  REFPARAM(IFRAC)) GO TO 1900
78!  ENDDO
79!  1900 CONTINUE
80!  FRACINT(LAY) = (H2OPARAM-REFPARAM(IFRAC))/&
81!   &(REFPARAM(IFRAC-1)-REFPARAM(IFRAC))
82  IFRAC=INDEX(I_LAY)
83  IF (Z_H2OPARAM >= REFPARAM(2)) THEN
84          IFRAC=2
85  ELSE
86!cdir unroll=11
87    DO JFRAC = 2, 12
88      IF (Z_H2OPARAM < REFPARAM(JFRAC)) THEN
89         IFRAC=JFRAC+1
90      ENDIF 
91    ENDDO
92  ENDIF 
93 
94!---- JJM_000714
95! set above IFRAC instead of INDEX(I_LAY), store now - NEC jh
96! IFRAC=INDEX(I_LAY)
97  INDEX(I_LAY)=IFRAC
98
99  Z_FRACINT(I_LAY) = (Z_H2OPARAM-REFPARAM(IFRAC))/&
100   & (REFPARAM(IFRAC-1)-REFPARAM(IFRAC)) 
101ENDDO
102
103DO I_LAY = 1, K_LAYTROP
104
105  Z_FP = P_FAC11(I_LAY) + P_FAC01(I_LAY)
106  IFP = 2.E2_JPRB*Z_FP+0.5_JPRB
107
108!---MI 981104       
109!       IF (IFP.LE.0) IFP=0
110
111  IFP=MAX(0,IFP)
112
113  Z_FC00(I_LAY) = P_FAC00(I_LAY) * CORR2(IFP)
114  Z_FC10(I_LAY) = P_FAC10(I_LAY) * CORR2(IFP)
115  Z_FC01(I_LAY) = P_FAC01(I_LAY) * CORR1(IFP)
116  Z_FC11(I_LAY) = P_FAC11(I_LAY) * CORR1(IFP)
117  IND0(I_LAY) = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(2) + 1
118  IND1(I_LAY) = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(2) + 1
119  INDS(I_LAY) = K_INDSELF(I_LAY)
120ENDDO
121
122!-- DS_000515 
123DO IG = 1, NG2
124  DO I_LAY = 1, K_LAYTROP
125!-- JJM_000714
126    IFRAC=INDEX(I_LAY) 
127!-- DS_000515 
128    P_TAU (NGS1+IG,I_LAY) = P_COLH2O(I_LAY) *&
129     & (Z_FC00(I_LAY) * ABSA(IND0(I_LAY)  ,IG) +&
130     & Z_FC10(I_LAY) * ABSA(IND0(I_LAY)+1,IG) +&
131     & Z_FC01(I_LAY) * ABSA(IND1(I_LAY)  ,IG) +&
132     & Z_FC11(I_LAY) * ABSA(IND1(I_LAY)+1,IG) +&
133     & P_SELFFAC(I_LAY) * (SELFREF(INDS(I_LAY),IG) + &
134     & P_SELFFRAC(I_LAY) *&
135     & (SELFREF(INDS(I_LAY)+1,IG) - SELFREF(INDS(I_LAY),IG)))&
136     & + P_FORFAC(I_LAY) * FORREF(IG) ) &
137     & + P_TAUAERL(I_LAY,2) 
138    PFRAC(NGS1+IG,I_LAY) = FRACREFA(IG,IFRAC) + Z_FRACINT(I_LAY) *&
139     & (FRACREFA(IG,IFRAC-1)-FRACREFA(IG,IFRAC)) 
140  ENDDO
141ENDDO
142
143DO I_LAY = K_LAYTROP+1, KLEV
144  Z_FP = P_FAC11(I_LAY) + P_FAC01(I_LAY)
145  IFP = 2.E2_JPRB*Z_FP+0.5_JPRB
146
147!---MI 981104       
148  IF (IFP <= 0) IFP=0
149
150  Z_FC00(I_LAY) = P_FAC00(I_LAY) * CORR2(IFP)
151  Z_FC10(I_LAY) = P_FAC10(I_LAY) * CORR2(IFP)
152  Z_FC01(I_LAY) = P_FAC01(I_LAY) * CORR1(IFP)
153  Z_FC11(I_LAY) = P_FAC11(I_LAY) * CORR1(IFP)
154  IND0(I_LAY) = ((K_JP(I_LAY)-13)*5+(K_JT(I_LAY)-1))*NSPB(2) + 1
155  IND1(I_LAY) = ((K_JP(I_LAY)-12)*5+(K_JT1(I_LAY)-1))*NSPB(2) + 1
156ENDDO
157
158!-- JJM_000517
159DO IG = 1, NG2
160  DO I_LAY = K_LAYTROP+1, KLEV
161!-- JJM_000517
162    P_TAU (NGS1+IG,I_LAY) = P_COLH2O(I_LAY) *&
163     & (Z_FC00(I_LAY) * ABSB(IND0(I_LAY)  ,IG) +&
164     & Z_FC10(I_LAY) * ABSB(IND0(I_LAY)+1,IG) +&
165     & Z_FC01(I_LAY) * ABSB(IND1(I_LAY)  ,IG) +&
166     & Z_FC11(I_LAY) * ABSB(IND1(I_LAY)+1,IG)&
167     & + P_FORFAC(I_LAY) * FORREF(IG) ) &
168     & + P_TAUAERL(I_LAY,2) 
169    PFRAC(NGS1+IG,I_LAY) = FRACREFB(IG)
170  ENDDO
171ENDDO
172
173IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL2',1,ZHOOK_HANDLE)
174END SUBROUTINE RRTM_TAUMOL2
Note: See TracBrowser for help on using the repository browser.