/glade/p/cesmdata/cseg/releases/cesm1_2_2/models/drv/driver/seq_flux_mct.F90
integer(in) :: nloc ! number of gridcell
real(r8) :: anidr ! albedo: near infrared, direct
real(r8) :: avsdr ! albedo: visible , direct
real(r8) :: anidf ! albedo: near infrared, diffuse
real(r8) :: avsdf ! albedo: visible , diffuse
real(R8),parameter :: albdif = 0.06_R8 ! 60 deg reference albedo, diffuse
real(R8),parameter :: albdir = 0.07_R8 ! 60 deg reference albedo, direct
……………………………………..
if (flux_albav) then
do n=1,nloc_o
anidr = albdir
avsdr = albdir
anidf = albdif
avsdf = albdif
! Albedo is now function of latitude (will be new implementation)
!rlat = const_deg2rad * lats(n)
!anidr = 0.069_R8 - 0.011_R8 * cos(2._R8 * rlat)
!avsdr = anidr
!anidf = anidr
!avsdf = anidr
xao_o%rAttr(index_xao_So_avsdr,n) = avsdr
xao_o%rAttr(index_xao_So_anidr,n) = anidr
xao_o%rAttr(index_xao_So_avsdf,n) = avsdf
xao_o%rAttr(index_xao_So_anidf,n) = anidf
end do
update_alb = .true.
else
! Solar declination
! Will only do albedo calculation if nextsw_cday is not -1.
call seq_infodata_GetData(infodata,nextsw_cday=nextsw_cday,orb_eccen=eccen, &
orb_mvelpp=mvelpp, orb_lambm0=lambm0, orb_obliqr=obliqr)
if (nextsw_cday >= -0.5_r8) then
calday = nextsw_cday
call shr_orb_decl(calday, eccen, mvelpp,lambm0, obliqr, delta, eccf)
! Compute albedos
do n=1,nloc_o
rlat = const_deg2rad * lats(n)
rlon = const_deg2rad * lons(n)
cosz = shr_orb_cosz( calday, rlat, rlon, delta )
If (lats(n) .lt. -20 .and. lats(n) .gt. -40 .and. lons(n) .lt. 360 .and. lons(n) .gt. 330)
Then anidr=0.15, anidf=0.15
Else if (lats(n) .lt. -20 .and. lats(n) .gt. -40 .and lons(n) .lt. 105 .and. lons(n) .gt. 55) Then anidr=0.15, anidf=0.15
Else if (lats(n) .gt. -15 .and. lats(n) .lt. -40 .and. lons(n) .lt. 280 .and. lons(n) .gt. 190)
Then anidr=0.15, anidf=0.15
Else
if (cosz 0.0_R8) then !--- sun hit --
anidr = (.026_R8/(cosz**1.7_R8 + 0.065_R8)) +
(.150_R8*(cosz - 0.100_R8 ) *
(cosz - 0.500_R8 ) *
(cosz - 1.000_R8 ) )
avsdr = anidr
anidf = albdif
avsdf = albdif
else !--- dark side of earth ---
anidr = 1.0_R8
avsdr = 1.0_R8
anidf = 1.0_R8
avsdf = 1.0_R8
end if
xao_o%rAttr(index_xao_So_avsdr,n) = avsdr
xao_o%rAttr(index_xao_So_anidr,n) = anidr
xao_o%rAttr(index_xao_So_avsdf,n) = avsdf
xao_o%rAttr(index_xao_So_anidf,n) = anidf
end do ! nloc_o
update_alb = .true.
endif ! nextsw_cday
endif !latlonbright
end if ! flux_albav
---
Important variable definitions from earlier in the code:
integer(in) :: nloc ! number of gridcell
real(r8) :: anidr ! albedo: near infrared, direct
real(r8) :: avsdr ! albedo: visible , direct
real(r8) :: anidf ! albedo: near infrared, diffuse
real(r8) :: avsdf ! albedo: visible , diffuse
real(R8),parameter :: albdif = 0.06_R8 ! 60 deg reference albedo, diffuse
real(R8),parameter :: albdir = 0.07_R8 ! 60 deg reference albedo, direct
For n=1,nloc
If (lats(n) .lt. -20 .and. lats(n) .gt. -40 .and. lons(n) .lt. 360 .and. lons(n) .gt. 330)
Then foam = true
Else if (lats(n) .lt. -20 .and. lats(n) .gt. -40 .and lons(n) .lt. 105 .and. lons(n) .gt. 55) Then foam = true
Else if (lats(n) .gt. -15 .and. lats(n) .lt. -40 .and. lons(n) .lt. 280 .and. lons(n) .gt. 190)
Then foam = true
Else foam = false