Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
MODULE INM_rrtm_interface
use parkinds, only: rf=>kind_rf, im=>kind_im
use rrtmg_lw_rad, only: rrtmg_lw
use rrtmg_sw_rad, only: rrtmg_sw
use parrrtm, only : nbndlw, ngptlw
use parrrsw, only : nbndsw, ngptsw
IMPLICIT NONE
PRIVATE
PUBLIC :: rrtm_init
type radiationDataType
real, allocatable :: uflx(:,:) !Total sky upward flux (W/m2)
real, allocatable :: dflx(:,:) !Total sky downward flux (W/m2)
real, allocatable :: uflxc(:,:) !Clear sky upward flux (W/m2)
real, allocatable :: dflxc(:,:) !Clear sky downward flux (W/m2)
real, allocatable :: hr(:,:) !Total sky radiative heating rate (K/d)
real, allocatable :: hrc(:,:) !Clear sky radiative heating rate (K/d)
end type radiationDataType
!real,dimension(1,34) :: uflx,dflx,uflxc,dflxc ! Total sky and Clear sky longwave upward,downward flux (W/m2)
!real,dimension(1,34) :: swuflx,swdflx,swuflxc,swdflxc ! Total sky and Clear sky shortwave upward,downward flux (W/m2)
!real,dimension(1,33) :: hr,hrc ! Total sky and Clear sky longwave radiative heating rate (K/d)
!real,dimension(1,33) :: swhr,swhrc ! Total sky and Clear sky longwave radiative heating rate (K/d)
CONTAINS
SUBROUTINE rrtm_init (t_init,t_lay,p_init,p_lay,q_lay,o3_lay,o2_lay,tsfc,nlay,swuflx,swdflx,swuflxc,swdflxc,swhr,swhrc,uflx,dflx,uflxc,dflxc,hr,hrc)
!INPUT
type (forcing_1d), intent(in) :: t_init,t_lay,p_init,p_lay,q_init,o3_lay,o2_lay
integer, intent(in) :: nlay
real(kind=rf), intent(in) :: tsfc ! Surface temperature (K)
!OUTUP
real,dimension(ncol,nlay+1), intent(out) :: uflx,dflx,uflxc,dflxc ! Total sky and Clear sky longwave upward,downward flux (W/m2)
real,dimension(ncol,nlay+1), intent(out) :: swuflx,swdflx,swuflxc,swdflxc ! Total sky and Clear sky shortwave upward,downward flux (W/m2)
real,dimension(ncol,nlay), intent(out) :: hr,hrc ! Total sky and Clear sky longwave radiative heating rate (K/d)
real,dimension(ncol,nlay), intent(out) :: swhr,swhrc ! Total sky and Clear sky longwave radiative heating rate (K/d)
!Local
!----- Input for rrtm-----
! Note: All volume mixing ratios are in dimensionless units of mole fraction obtained
! by scaling mass mixing ratio (g/g) with the appropriate molecular weights (g/mol)
!real, allocatable, intent(inout) :: uflx(:,:),dflx(:,:),uflxc(:,:),dflxc(:,:),swuflx(:,:),swdflx(:,:),swuflxc(:,:),swdflxc(:,:)
!uflx,dflx,uflxc,dflxc - Total sky and Clear sky longwave upward,downward flux (W/m2)
!swuflx,swdflx,swuflxc,swdflxc - Total sky and Clear sky shortwave upward,downward flux (W/m2)
!hr,hrc - Total sky and Clear sky longwave radiative heating rate (K/d)
!swhr,swhrc - Total sky and Clear sky longwave radiative heating rate (K/d)
integer,parameter :: ncol=1
integer,parameter:: dyofyr=150 ! Day of the year (used to get Earth/Sun)
integer, parameter :: isolvar = 0 ! Flag for solar variability method
real,parameter :: scon = 1360.85 ! Solar constant (W/m2)
integer,parameter :: iaer =10 ! Aerosol option flag
! 0: No aerosol
! 6: ECMWF method
! 10:Input aerosol optical
! properties
integer,parameter :: icld=0 ! Cloud overlap method
! 0: Clear only
! 1: Random
! 2: Maximum/random
! 3: Maximum
integer,parameter:: idrv=0 ! Flag for calculation of dFdT, the change
! in upward flux as a function of
! surface temperature [0=off, 1=on]
! 0: Normal forward calculation
! 1: Normal forward calculation with
! duflx_dt and duflxc_dt output
real:: play(ncol,nlay),plev(ncol,nlay+1),tlay(ncol,nlay),tlev(ncol,nlay+1) ! Layer,Interface pressures and temperatures (hPa, mb) (K)
real,dimension(ncol,nlay):: h2ovmr,o3vmr,co2vmr,ch4vmr,n2ovmr,o2vmr,cfc11vmr,cfc12vmr,cfc22vmr,ccl4vmr ! H2O,o3,co2,ch4,n20,o2 volume mixing ratio
real:: emis(ncol,nbndlw) ! Surface emissivity
real:: asdir,aldir,asdif,aldif ! UV/vis,Near-IR surface albedo direct,diffuse rad
real :: adjes ! Flux adjustment for Earth/Sun distance
real :: coszen(ncol) ! Cosine of solar zenith angle
integer :: inflgsw ! Flag for cloud optical properties
integer :: iceflgsw ! Flag for ice particle specification
integer :: liqflgsw ! Flag for liquid droplet specification
integer :: inflglw ! Flag for cloud optical properties
integer :: iceflglw ! Flag for ice particle specification
integer :: liqflglw ! Flag for liquid droplet specification
real,dimension(ngptlw,ncol,nlay) :: cldfmcl_lw,taucmcl_lw,ssacmcl_lw,asmcmcl_lw,fsfcmcl_lw,ciwpmcl_lw,clwpmcl_lw
real,dimension(ncol,nlay) :: reicmcl_lw,relqmcl_lw
real :: cldfmcl_sw(ngptsw,ncol,nlay) ! Cloud fraction
real :: taucmcl_sw (ngptsw,ncol,nlay) ! In-cloud optical depth
real :: ssacmcl_sw (ngptsw,ncol,nlay) ! In-cloud single scattering albedo
! Dimensions: (ngptsw,ncol,nlay)
real :: asmcmcl_sw (ngptsw,ncol,nlay) ! In-cloud asymmetry parameter
! Dimensions: (ngptsw,ncol,nlay)
real :: fsfcmcl_sw (ngptsw,ncol,nlay) ! In-cloud forward scattering fraction
! Dimensions: (ngptsw,ncol,nlay)
real :: ciwpmcl_sw (ngptsw,ncol,nlay) ! In-cloud ice water path (g/m2)
! Dimensions: (ngptsw,ncol,nlay)
real :: clwpmcl_sw (ngptsw,ncol,nlay) ! In-cloud liquid water path (g/m2)
! Dimensions: (ngptsw,ncol,nlay)
real :: reicmcl_sw (ncol,nlay) ! Cloud ice effective radius (microns)
! Dimensions: (ncol,nlay)
! specific definition of reicmcl depends on setting of iceflgsw:
! iceflgsw = 0: (inactive)
!
! iceflgsw = 1: ice effective radius, r_ec, (Ebert and Curry, 1992),
! r_ec range is limited to 13.0 to 130.0 microns
! iceflgsw = 2: ice effective radius, r_k, (Key, Streamer Ref. Manual, 1996)
! r_k range is limited to 5.0 to 131.0 microns
! iceflgsw = 3: generalized effective size, dge, (Fu, 1996),
! dge range is limited to 5.0 to 140.0 microns
! [dge = 1.0315 * r_ec]
real :: relqmcl_sw (ncol,nlay) ! Cloud water drop effective radius (microns)
real:: tauaer_lw (ncol,nlay,nbndlw) ! Aerosol longwave
real:: tauaer_sw (ncol,nlay,nbndsw), ssaaer_sw (ncol,nlay,nbndsw),asmaer_sw (ncol,nlay,nbndsw),ecaer_sw (ncol,nlay,nbndsw) ! Aerosol
! ----- Local -----
integer :: i,j,k
do i=1,nlay
tlay(1,i)=t_lay%val(i)
play(1,i)=p_lay%val(i)
h2ovmr(1,i)=q_lay%val(i)
o3vmr(1,i)=o3_lay%val(i)
o2vmr(1,i)=o2_lay%val(i)
enddo
do i=1,nlay+1
tlev(1,i)=p_init%val(i)
plev(1,i)=p_init%val(i)
enddo
!for longwave
!flags
inflglw = 0
iceflglw = 0
liqflglw = 0
!variables
do i=1,ncol
do j=1,nlay
do k=1,nbndlw
cldfmcl_lw(k,i,j) = 0
taucmcl_lw(k,i,j) = 0
ssacmcl_lw(k,i,j) = 0
asmcmcl_lw(k,i,j) = 0
fsfcmcl_lw(k,i,j) = 0
ciwpmcl_lw(k,i,j) = 0
clwpmcl_lw(k,i,j) = 0
tauaer_lw(i,j,k) = 0
enddo
co2vmr(i,j) = 0
ch4vmr(i,j) = 0
n2ovmr(i,j) = 0
cfc11vmr(i,j) = 0
cfc12vmr(i,j) = 0
cfc22vmr(i,j) = 0
ccl4vmr(i,j) = 0
reicmcl_lw(i,j) = 0
relqmcl_lw(i,j) = 0
enddo
enddo
call rrtmg_lw &
(ncol ,nlay ,icld ,idrv , &
play ,plev ,tlay ,tlev ,tsfc , &
h2ovmr ,o3vmr ,co2vmr ,ch4vmr ,n2ovmr ,o2vmr , &
cfc11vmr,cfc12vmr,cfc22vmr,ccl4vmr ,emis , &
inflglw ,iceflglw,liqflglw,cldfmcl_lw , &
taucmcl_lw ,ciwpmcl_lw ,clwpmcl_lw ,reicmcl_lw ,relqmcl_lw , &
tauaer_lw , &
uflx ,dflx ,hr ,uflxc ,dflxc, hrc)
!for shortwave
!flags
inflgsw = 0
iceflgsw = 0
liqflgsw = 0
!variables
asdir = 0.2
asdif = 0.2
aldir = 0.2
aldif = 0.2
coszen = 0.6
adjes = 1
!arrays
do i=1,ncol
do j=1,nlay
do k=1,nbndsw
cldfmcl_sw(k,i,j) = 0._rb
taucmcl_sw(k,i,j) = 0._rb
ssacmcl_sw(k,i,j) = 0._rb
asmcmcl_sw(k,i,j) = 0._rb
fsfcmcl_sw(k,i,j) = 0._rb
ciwpmcl(k,i,j) = 0._rb
clwpmcl(k,i,j) = 0._rb
tauaer_sw(i,j,k) = 0._rb
ssaaer_sw(i,j,k) = 0._rb
asmaer_sw(i,j,k) = 0._rb
ecaer_sw(i,j,k) = 0._rb
enddo
co2vmr(i,j) = 0._rb
ch4vmr(i,j) = 0._rb
n2ovmr(i,j) = 0._rb
cfc11vmr(i,j) = 0._rb
cfc12vmr(i,j) = 0._rb
cfc22vmr(i,j) = 0._rb
ccl4vmr(i,j) = 0._rb
reicmcl(i,j) = 0._rb
relqmcl(i,j) = 0._rb
enddo
enddo
call rrtmg_sw &
(ncol ,nlay ,icld ,iaer , &
play ,plev ,tlay ,tlev ,tsfc , &
h2ovmr , o3vmr ,co2vmr ,ch4vmr ,n2ovmr ,o2vmr , &
asdir ,asdif ,aldir ,aldif , &
coszen ,adjes ,dyofyr ,scon ,isolvar, &
inflgsw ,iceflgsw,liqflgsw,cldfmcl_sw , &
taucmcl_sw ,ssacmcl_sw ,asmcmcl_sw ,fsfcmcl_sw , &
ciwpmcl ,clwpmcl ,reicmcl ,relqmcl , &
tauaer_sw ,ssaaer_sw ,asmaer_sw ,ecaer_sw , &
swuflx ,swdflx ,swhr ,swuflxc ,swdflxc ,swhrc)
END SUBROUTINE rrtm_init
END MODULE INM_rrtm_interface