Skip to content

Commit 68d060a

Browse files
committed
Revise code typo and update README
1 parent 7242862 commit 68d060a

7 files changed

Lines changed: 206 additions & 169 deletions

File tree

1_code_modification/src/biogeophys/UrbanAlbedoMod.F90

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ module UrbanAlbedoMod
2121
use SurfaceAlbedoType , only : surfalb_type
2222
use LandunitType , only : lun
2323
use ColumnType , only : col
24-
use PatchType , only : patch
24+
use PatchType , only : patch
25+
use UrbanDynAlbMod , only : urbanalbtv_type
2526
!
2627
! !PUBLIC TYPES:
2728
implicit none
@@ -46,7 +47,7 @@ module UrbanAlbedoMod
4647
!-----------------------------------------------------------------------
4748
subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, &
4849
num_urbanc, filter_urbanc, num_urbanp, filter_urbanp, &
49-
waterstate_inst, urbanparams_inst, solarabs_inst, surfalb_inst)
50+
waterstate_inst, urbanparams_inst, solarabs_inst, surfalb_inst, urbanalbtv_inst)
5051
!
5152
! !DESCRIPTION:
5253
! Determine urban landunit component albedos
@@ -61,6 +62,7 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, &
6162
use clm_varcon , only : sb
6263
use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall
6364
use column_varcon , only : icol_road_perv, icol_road_imperv
65+
use clm_varctl , only : Dynamic_UrbanAlbedoRoof, Dynamic_UrbanAlbedoImproad, Dynamic_UrbanAlbedoWall
6466
!
6567
! !ARGUMENTS:
6668
type(bounds_type) , intent(in) :: bounds
@@ -74,6 +76,7 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, &
7476
type(urbanparams_type) , intent(inout) :: urbanparams_inst
7577
type(solarabs_type) , intent(inout) :: solarabs_inst
7678
type(surfalb_type) , intent(inout) :: surfalb_inst
79+
type(urbanalbtv_type) , intent(in) :: urbanalbtv_inst
7780
!
7881
! !LOCAL VARIABLES:
7982
integer :: fl,fp,fc,g,l,p,c,ib ! indices
@@ -110,26 +113,36 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, &
110113
real(r8) :: sref_improad_dir (bounds%begl:bounds%endl, numrad) ! direct solar reflected by impervious road per unit ground area per unit incident flux
111114
real(r8) :: sref_improad_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by impervious road per unit ground area per unit incident flux
112115
real(r8) :: sref_perroad_dir (bounds%begl:bounds%endl, numrad) ! direct solar reflected by pervious road per unit ground area per unit incident flux
113-
real(r8) :: sref_perroad_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by pervious road per unit ground area per unit incident flux
116+
real(r8) :: sref_perroad_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by pervious road per unit ground area per unit incident flux
117+
real(r8) :: alb_roof_dir (bounds%begl:bounds%endl, numrad)
118+
real(r8) :: alb_roof_dif (bounds%begl:bounds%endl, numrad)
119+
real(r8) :: alb_wall_dir (bounds%begl:bounds%endl, numrad)
120+
real(r8) :: alb_wall_dif (bounds%begl:bounds%endl, numrad)
121+
real(r8) :: alb_improad_dir (bounds%begl:bounds%endl, numrad)
122+
real(r8) :: alb_improad_dif (bounds%begl:bounds%endl, numrad)
114123
!-----------------------------------------------------------------------
115-
116124
associate( &
117125
ctype => col%itype , & ! Input: [integer (:) ] column type
118126
coli => lun%coli , & ! Input: [integer (:) ] beginning column index for landunit
119127
canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street width
120128
wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road
121129

122130
frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
123-
124-
alb_roof_dir => urbanparams_inst%alb_roof_dir , & ! Output: [real(r8) (:,:) ] direct roof albedo
125-
alb_roof_dif => urbanparams_inst%alb_roof_dif , & ! Output: [real(r8) (:,:) ] diffuse roof albedo
126-
alb_improad_dir => urbanparams_inst%alb_improad_dir , & ! Output: [real(r8) (:,:) ] direct impervious road albedo
127-
alb_improad_dif => urbanparams_inst%alb_improad_dif , & ! Output: [real(r8) (:,:) ] diffuse imprevious road albedo
128-
alb_perroad_dir => urbanparams_inst%alb_perroad_dir , & ! Output: [real(r8) (:,:) ] direct pervious road albedo
129-
alb_perroad_dif => urbanparams_inst%alb_perroad_dif , & ! Output: [real(r8) (:,:) ] diffuse pervious road albedo
130-
alb_wall_dir => urbanparams_inst%alb_wall_dir , & ! Output: [real(r8) (:,:) ] direct wall albedo
131-
alb_wall_dif => urbanparams_inst%alb_wall_dif , & ! Output: [real(r8) (:,:) ] diffuse wall albedo
132-
131+
132+
alb_perroad_dir => urbanparams_inst%alb_perroad_dir , & ! Input: [real(r8) (:,:) ] direct pervious road albedo
133+
alb_perroad_dif => urbanparams_inst%alb_perroad_dif , & ! Input: [real(r8) (:,:) ] diffuse pervious road albedo
134+
con_alb_roof_dir => urbanparams_inst%alb_roof_dir , & ! Input: [real(r8) (:,:) ] direct roof albedo
135+
con_alb_roof_dif => urbanparams_inst%alb_roof_dif , &
136+
con_alb_wall_dir => urbanparams_inst%alb_wall_dir , & ! Input: [real(r8) (:,:) ] direct wall albedo
137+
con_alb_wall_dif => urbanparams_inst%alb_wall_dif , &
138+
con_alb_improad_dif => urbanparams_inst%alb_improad_dif , &
139+
con_alb_improad_dir => urbanparams_inst%alb_improad_dir , &
140+
dyn_alb_roof_dir => urbanalbtv_inst%dyn_alb_roof_dir ,& ! Output: [real(r8) (:,:) ] direct roof albedo
141+
dyn_alb_roof_dif => urbanalbtv_inst%dyn_alb_roof_dif ,&
142+
dyn_alb_improad_dir => urbanalbtv_inst%dyn_alb_improad_dir , & ! Output: [real(r8) (:,:) ] direct improad albedo
143+
dyn_alb_improad_dif => urbanalbtv_inst%dyn_alb_improad_dif , &
144+
dyn_alb_wall_dir => urbanalbtv_inst%dyn_alb_wall_dir , & ! Output: [real(r8) (:,:) ] direct roof albedo
145+
dyn_alb_wall_dif => urbanalbtv_inst%dyn_alb_wall_dif , &
133146
sabs_roof_dir => solarabs_inst%sabs_roof_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by roof per unit ground area per unit incident flux
134147
sabs_roof_dif => solarabs_inst%sabs_roof_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by roof per unit ground area per unit incident flux
135148
sabs_sunwall_dir => solarabs_inst%sabs_sunwall_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by sunwall per unit wall area per unit incident flux
@@ -165,7 +178,35 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, &
165178
! Solar declination and cosine solar zenith angle and zenith angle for
166179
! next time step
167180
! ----------------------------------------------------------------------------
168-
181+
do ib = 1, numrad
182+
do fl = 1,num_urbanl
183+
l = filter_urbanl(fl)
184+
if (.not. Dynamic_UrbanAlbedoRoof) then
185+
alb_roof_dir(l,ib) = con_alb_roof_dir(l,ib)
186+
alb_roof_dif(l,ib) = con_alb_roof_dif(l,ib)
187+
else
188+
alb_roof_dir(l,ib) = dyn_alb_roof_dir(l,ib)
189+
alb_roof_dif(l,ib) = dyn_alb_roof_dif(l,ib)
190+
end if
191+
192+
if (.not. Dynamic_UrbanAlbedoWall) then
193+
alb_wall_dir(l,ib) = con_alb_wall_dir(l,ib)
194+
alb_wall_dif(l,ib) = con_alb_wall_dif(l,ib)
195+
else
196+
alb_wall_dir(l,ib) = dyn_alb_wall_dir(l,ib)
197+
alb_wall_dif(l,ib) = dyn_alb_wall_dif(l,ib)
198+
end if
199+
200+
if (.not. Dynamic_UrbanAlbedoImproad) then
201+
alb_improad_dir(l,ib) = con_alb_improad_dir(l,ib)
202+
alb_improad_dif(l,ib) = con_alb_improad_dif(l,ib)
203+
else
204+
alb_improad_dir(l,ib) = dyn_alb_improad_dir(l,ib)
205+
alb_improad_dif(l,ib) = dyn_alb_improad_dif(l,ib)
206+
end if
207+
end do
208+
end do
209+
169210
do fl = 1,num_urbanl
170211
l = filter_urbanl(fl)
171212
g = lun%gridcell(l)
@@ -332,16 +373,16 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, &
332373
do fc = 1,num_urbanc
333374
c = filter_urbanc(fc)
334375
l = col%landunit(c)
335-
if (ctype(c) == icol_roof) then
376+
if (ctype(c) == icol_roof) then
336377
alb_roof_dir_s(l,ib) = alb_roof_dir(l,ib)*(1._r8-frac_sno(c)) &
337378
+ albsnd_roof(l,ib)*frac_sno(c)
338379
alb_roof_dif_s(l,ib) = alb_roof_dif(l,ib)*(1._r8-frac_sno(c)) &
339-
+ albsni_roof(l,ib)*frac_sno(c)
340-
else if (ctype(c) == icol_road_imperv) then
380+
+ albsni_roof(l,ib)*frac_sno(c)
381+
else if (ctype(c) == icol_road_imperv) then
341382
alb_improad_dir_s(l,ib) = alb_improad_dir(l,ib)*(1._r8-frac_sno(c)) &
342383
+ albsnd_improad(l,ib)*frac_sno(c)
343-
alb_improad_dif_s(l,ib) = alb_improad_dif(l,ib)*(1._r8-frac_sno(c)) &
344-
+ albsni_improad(l,ib)*frac_sno(c)
384+
alb_improad_dif_s(l,ib) = alb_improad_dif(l,ib)*(1._r8-frac_sno(c)) &
385+
+ albsni_improad(l,ib)*frac_sno(c)
345386
else if (ctype(c) == icol_road_perv) then
346387
alb_perroad_dir_s(l,ib) = alb_perroad_dir(l,ib)*(1._r8-frac_sno(c)) &
347388
+ albsnd_perroad(l,ib)*frac_sno(c)

0 commit comments

Comments
 (0)