From 78889db3fa34697f20eda5e84f15ac3fdb59dfa5 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 8 Oct 2024 16:56:49 -0600 Subject: [PATCH] Bug fix in physics/module_sf_noahmp_glacier.F90: only compute glacier albedo in snowalb_bats_glacier if cosz > 0 --- .../Land/Noahmp/module_sf_noahmp_glacier.F90 | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmp_glacier.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmp_glacier.F90 index bcb157c54..d56cf54e9 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmp_glacier.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmp_glacier.F90 @@ -971,18 +971,20 @@ subroutine snowalb_bats_glacier (nband,cosz,fage,albsnd,albsni) albsni(1: nband) = 0. ! when cosz > 0 - - sl=2.0 - sl1=1./sl - sl2=2.*sl - cf1=((1.+sl1)/(1.+sl2*cosz)-sl1) - fzen=amax1(cf1,0.) - - albsni(1)=0.95*(1.-c1*fage) - albsni(2)=0.65*(1.-c2*fage) - - albsnd(1)=albsni(1)+0.4*fzen*(1.-albsni(1)) ! vis direct - albsnd(2)=albsni(2)+0.4*fzen*(1.-albsni(2)) ! nir direct +! https://github.com/ufs-community/ccpp-physics/issues/227 + if (cosz>0) then + sl=2.0 + sl1=1./sl + sl2=2.*sl + cf1=((1.+sl1)/(1.+sl2*cosz)-sl1) + fzen=amax1(cf1,0.) + + albsni(1)=0.95*(1.-c1*fage) + albsni(2)=0.65*(1.-c2*fage) + + albsnd(1)=albsni(1)+0.4*fzen*(1.-albsni(1)) ! vis direct + albsnd(2)=albsni(2)+0.4*fzen*(1.-albsni(2)) ! nir direct + endif end subroutine snowalb_bats_glacier ! ==================================================================================================