Skip to content

Commit

Permalink
Merge pull request #1 from kjetilaas/release-clm5.0.14-Nor
Browse files Browse the repository at this point in the history
NorESM CMIP6 version of CLM
  • Loading branch information
Anne Fouilloux authored Feb 5, 2020
2 parents 6414fc0 + ed7194d commit 273812a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/biogeophys/SoilHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f
dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m)

t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin)
t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature (Kelvin) KSA2018

frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1)
frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Output: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present)
Expand Down Expand Up @@ -518,6 +519,15 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f
qflx_infl_excess(c) = 0._r8
endif

! if surface water is frozen, send infiltration excess to runoff to
! avoid artificial loop between snow and h2osfc. KSA2018
if (h2osfcflag/=0 .and. t_h2osfc(c) <= tfrz) then
! shift infiltration excess from h2osfc input to surface runoff
qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_infl_excess(c)
qflx_surf(c)= qflx_surf(c) + qflx_infl_excess(c)
qflx_infl_excess(c) = 0._r8
end if

qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_h2osfc_surf(c)

!6. update h2osfc prior to calculating bottom drainage from h2osfc
Expand Down
10 changes: 7 additions & 3 deletions src/biogeophys/SurfaceAlbedoMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ subroutine SurfaceAlbedo(bounds,nc, &
!
! !USES:
use shr_orb_mod
use clm_time_manager , only : get_nstep
use clm_time_manager , only : get_nstep, get_step_size !+tht add step_size
use abortutils , only : endrun
use clm_varctl , only : subgridflag, use_snicar_frc, use_fates
use CLMFatesInterfaceMod, only : hlm_fates_interface_type
Expand Down Expand Up @@ -278,6 +278,9 @@ subroutine SurfaceAlbedo(bounds,nc, &
real(r8) :: mss_cnc_aer_in_frc_oc (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for OC forcing (col,lyr,aer) [kg kg-1]
real(r8) :: mss_cnc_aer_in_frc_dst (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for dust forcing (col,lyr,aer) [kg kg-1]
real(r8) :: mss_cnc_aer_in_fdb (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of all aerosol species for feedback calculation (col,lyr,aer) [kg kg-1]

real(r8) :: dtavg !+tht land model time step (sec)

real(r8), parameter :: mpe = 1.e-06_r8 ! prevents overflow for division by zero
integer , parameter :: nband =numrad ! number of solar radiation waveband classes
!-----------------------------------------------------------------------
Expand Down Expand Up @@ -355,8 +358,9 @@ subroutine SurfaceAlbedo(bounds,nc, &

! Cosine solar zenith angle for next time step

dtavg=get_step_size() !+tht
do g = bounds%begg,bounds%endg
coszen_gcell(g) = shr_orb_cosz (nextsw_cday, grc%lat(g), grc%lon(g), declinp1)
coszen_gcell(g) = shr_orb_cosz (nextsw_cday, grc%lat(g), grc%lon(g), declinp1, dtavg) !+tht dtavg
end do
do c = bounds%begc,bounds%endc
g = col%gridcell(c)
Expand Down Expand Up @@ -685,7 +689,7 @@ subroutine SurfaceAlbedo(bounds,nc, &
! (NEEDED FOR ENERGY CONSERVATION)
do i = -nlevsno+1,1,1
if (subgridflag == 0 .or. lun%itype(col%landunit(c)) == istdlak) then
if (ib == 1) then
if (ib == 1) then
flx_absdv(c,i) = flx_absd_snw(c,i,ib)*frac_sno(c) + &
((1.-frac_sno(c))*(1-albsod(c,ib))*(flx_absd_snw(c,i,ib)/(1.-albsnd(c,ib))))
flx_absiv(c,i) = flx_absi_snw(c,i,ib)*frac_sno(c) + &
Expand Down
8 changes: 4 additions & 4 deletions src/main/histFileMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,11 @@ subroutine hist_htapes_build ()
tape(t)%dov2xy = hist_dov2xy(t)
tape(t)%nhtfrq = hist_nhtfrq(t)
tape(t)%mfilt = hist_mfilt(t)
if (hist_ndens(t) == 1) then
! if (hist_ndens(t) == 1) then
tape(t)%ncprec = ncd_double
else
tape(t)%ncprec = ncd_float
endif
! else
! tape(t)%ncprec = ncd_float
! endif
end do

! Set time of beginning of current averaging interval
Expand Down

0 comments on commit 273812a

Please sign in to comment.