Skip to content

Commit

Permalink
Merge pull request #798 from emkemp/fix/lisf74_557ww_lvt_ps41
Browse files Browse the repository at this point in the history
Add support for multi-layer snow from JULES 5.0 (PS41 configuration)
  • Loading branch information
emkemp authored May 18, 2021
2 parents e84205f + 016f00e commit beb7266
Show file tree
Hide file tree
Showing 36 changed files with 4,972 additions and 2,534 deletions.
69 changes: 62 additions & 7 deletions lis/core/LIS_histDataMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module LIS_histDataMod
public :: LIS_MOC_SLIQFRAC
public :: LIS_MOC_LAYERSNOWDEPTH
public :: LIS_MOC_LAYERSNOWDENSITY
public :: LIS_MOC_LAYERSNOWGRAIN
public :: LIS_MOC_LWUP
public :: LIS_MOC_GPP
public :: LIS_MOC_NPP
Expand Down Expand Up @@ -452,7 +453,14 @@ module LIS_histDataMod
PUBLIC :: LIS_MOC_JULES_FSAT
PUBLIC :: LIS_MOC_JULES_FWETL
public :: LIS_MOC_JULES_ESOIL

! For JULES 5.0 PS41
public :: LIS_MOC_SNOW_SOOT
public :: LIS_MOC_GRND_SNOW
public :: LIS_MOC_SURFT_SNOW

integer :: LIS_MOC_SNOW_SOOT = -9999
integer :: LIS_MOC_GRND_SNOW = -9999
integer :: LIS_MOC_SURFT_SNOW = -9999
integer :: LIS_MOC_JULES_STHZW = -9999
integer :: LIS_MOC_JULES_STHU = -9999
integer :: LIS_MOC_JULES_STHU_MIN = -9999
Expand Down Expand Up @@ -561,6 +569,7 @@ module LIS_histDataMod
integer :: LIS_MOC_SNOWTHRESH = -9999
integer :: LIS_MOC_LAYERSNOWDEPTH = -9999
integer :: LIS_MOC_LAYERSNOWDENSITY = -9999
integer :: LIS_MOC_LAYERSNOWGRAIN = -9999

! ALMA VARIABLES TO BE COMPARED WITH REMOTE SENSED DATA
integer :: LIS_MOC_LWUP = -9999
Expand Down Expand Up @@ -1091,6 +1100,17 @@ subroutine LIS_histDataInit(n, ntiles)
! read the meta data attributes for each variable
!-------------------------------------------------------------------------
!!! JULES
call ESMF_ConfigFindLabel(modelSpecConfig,"SnowSoot:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
"SnowSoot",&
"snow_soot_content",&
"snow soot content",rc)
if ( rc == 1 ) then
call register_dataEntry(LIS_MOC_LSM_COUNT,LIS_MOC_SNOW_SOOT,&
LIS_histData(n)%head_lsm_list,&
n,1,ntiles,(/"kg/kg"/),1,(/"-"/),1,112,0,&
model_patch=.true.)
endif

call ESMF_ConfigFindLabel(modelSpecConfig,"sthu:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
Expand Down Expand Up @@ -1736,15 +1756,14 @@ subroutine LIS_histDataInit(n, ntiles)
call ESMF_ConfigFindLabel(modelSpecConfig,"SnowDensity:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
"SnowDensity",&
"snow_density_for_each_layer",&
"snow density for each layer",rc)
"snowpack_bulk_density",&
"snowpack bulk density",rc)
if ( rc == 1 ) then
call register_dataEntry(LIS_MOC_LSM_COUNT,LIS_MOC_SNOWDENSITY,&
LIS_histData(n)%head_lsm_list,&
n,1,ntiles,(/"kg/m3"/),1,(/"-"/),1,1,1,&
model_patch=.true.)
endif


call ESMF_ConfigFindLabel(modelSpecConfig,"LayerSnowDensity:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
Expand All @@ -1757,19 +1776,31 @@ subroutine LIS_histDataInit(n, ntiles)
n,1,ntiles,(/"kg/m3"/),1,(/"-"/),1,1,1,&
model_patch=.true.)
endif

call ESMF_ConfigFindLabel(modelSpecConfig,"SnowGrain:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
"SnowGrain",&
"snow_grain_size_for_each_layer",&
"snow grain size for each layer",rc)
"snow_grain_size",&
"snow grain size",rc)
if ( rc == 1 ) then
call register_dataEntry(LIS_MOC_LSM_COUNT,LIS_MOC_SNOWGRAIN,&
LIS_histData(n)%head_lsm_list,&
n,1,ntiles,(/"micron"/),1,(/"-"/),1,1,1,&
model_patch=.true.)
endif

call ESMF_ConfigFindLabel(modelSpecConfig,"LayerSnowGrain:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
"LayerSnowGrain",&
"layer_snow_grain_size_for_each_layer",&
"snow grain size for each layer",rc)
if ( rc == 1 ) then
call register_dataEntry(LIS_MOC_LSM_COUNT,LIS_MOC_LAYERSNOWGRAIN,&
LIS_histData(n)%head_lsm_list,&
n,1,ntiles,(/"micron"/),1,(/"-"/),1,1,1,&
model_patch=.true.)
endif

call ESMF_ConfigFindLabel(modelSpecConfig,"SnowDepth:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
"SnowDepth",&
Expand All @@ -1782,6 +1813,30 @@ subroutine LIS_histDataInit(n, ntiles)
model_patch=.true.)
! cm is added for VIC, Shugong Wang 02/20/2012
endif

call ESMF_ConfigFindLabel(modelSpecConfig,"GrndSnow:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
"GrndSnow",&
"snow_on_grond_beneath_canopy",&
"snow on ground (beneath canopy)",rc)
if ( rc == 1 ) then
call register_dataEntry(LIS_MOC_LSM_COUNT,LIS_MOC_GRND_SNOW,&
LIS_histData(n)%head_lsm_list,&
n,1,ntiles,(/"kg/m2"/),1,(/"-"/),1,1,1,&
model_patch=.true.)
endif

call ESMF_ConfigFindLabel(modelSpecConfig,"SurftSnow:",rc=rc)
call get_moc_attributes(modelSpecConfig, LIS_histData(n)%head_lsm_list, &
"SurftSnow",&
"snow_amount_on_tile",&
"snow amount on tile",rc)
if ( rc == 1 ) then
call register_dataEntry(LIS_MOC_LSM_COUNT,LIS_MOC_SURFT_SNOW,&
LIS_histData(n)%head_lsm_list,&
n,1,ntiles,(/"kg/m2"/),1,(/"-"/),1,1,1,&
model_patch=.true.)
endif

! added by Shugong Wang 05/02/2018 for JULES
call ESMF_ConfigFindLabel(modelSpecConfig,"SnowThick:",rc=rc)
Expand Down
96 changes: 63 additions & 33 deletions lis/surfacemodels/land/jules.5.0/jules50_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ subroutine jules50_main(n)
real :: sfctmp, sfcprs, es, q2, q2sat
real :: relsmc,smc,smcmax,smcwilt
character*3 :: fnest

real :: smoist_m3ovrm3

! check JULES alarm. If alarm is ring, run model.
alarmCheck = LIS_isAlarmRinging(LIS_rc, "JULES.5.0 model alarm")
if (alarmCheck) Then
Expand Down Expand Up @@ -228,6 +229,7 @@ subroutine jules50_main(n)
call top_pdm_to_tile(n, t)
call sf_diag_to_tile(n, t)


![ 1] output variable: soil_temp (unit=K).
! soil layer temperature
do i=1, jules50_struc(n)%sm_levels
Expand All @@ -249,14 +251,20 @@ subroutine jules50_main(n)

! m3/m3
do i=1, jules50_struc(n)%sm_levels

! EMK fix supersaturation induced by m3/m3 conversion
smoist_m3ovrm3 = &
jules50_struc(n)%jules50(t)%smcl_soilt(i)/ &
(1000.0*dzsoil(i))
smoist_m3ovrm3 = min(smoist_m3ovrm3, &
jules50_struc(n)%jules50(t)%p_s_smvcst(i))
call LIS_diagnoseSurfaceOutputVar(n, t, &
LIS_MOC_SOILMOIST, &
value=jules50_struc(n)%jules50(t)%smcl_soilt(i)/ &
(1000.0*dzsoil(i)), &
vlevel=i, unit="m^3 m-3", direction="-", &
surface_type=LIS_rc%lsm_index)
LIS_MOC_SOILMOIST, &
value=smoist_m3ovrm3, &
vlevel=i, unit="m^3 m-3", direction="-", &
surface_type=LIS_rc%lsm_index)
end do

! m3/m3, unfrozen (liquid) soil moisture
do i=1, jules50_struc(n)%sm_levels
! p_s_sthu: unfrozen moisture content of each soil layer as a fraction of saturation (-)
Expand Down Expand Up @@ -600,6 +608,38 @@ subroutine jules50_main(n)


! JULES snow variables
! snow soot
call LIS_diagnoseSurfaceOutputVar(n,t, &
LIS_MOC_SNOW_SOOT, &
value=jules50_struc(n)%jules50(t)%soot_ij, &
vlevel=1,unit="kg kg-1",direction="-", &
surface_type=LIS_rc%lsm_index)

! Snow on the ground (kg/m2). This is the snow beneath the canopy and is only used if can_model=4.
call LIS_diagnoseSurfaceOutputVar(n, t, &
LIS_MOC_GRND_SNOW, &
value = jules50_struc(n)%jules50(t)%snow_grnd(pft), &
vlevel=1, unit="kg m-2", direction="-", &
surface_type = LIS_rc%lsm_index)

! Lying snow on tiles (kg/m2). If can_model=4, snow_surft is the snow on the canopy snow_grnd is the
! snow on the ground beneath canopy If can_model/=4, snow_surft is the total snow.
call LIS_diagnoseSurfaceOutputVar(n, t, &
LIS_MOC_SURFT_SNOW, &
value = jules50_struc(n)%jules50(t)%snow_tile(pft), &
vlevel=1, unit="kg m-2", direction="-", &
surface_type = LIS_rc%lsm_index)

! bulk snow density
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_SNOWDENSITY, &
value = jules50_struc(n)%jules50(t)%rho_snow_grnd(pft),&
vlevel=1, unit="kg m-3", direction="-", surface_type = LIS_rc%lsm_index)

! bulk snow grain size
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_SNOWGRAIN, &
value = jules50_struc(n)%jules50(t)%rgrain(pft),&
vlevel=1, unit="micron", direction="-", surface_type = LIS_rc%lsm_index)
!!!! nsmax = 0, single layer snow physics
if(nsmax .eq.0) then
! snow ice
call LIS_diagnoseSurfaceOutputVar(n, t, &
Expand All @@ -619,56 +659,46 @@ subroutine jules50_main(n)
value=jules50_struc(n)%jules50(t)%tsnow(1,1), &
vlevel=1, unit="K", direction="-", &
surface_type=LIS_rc%lsm_index)
! bulk snow density
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_SNOWDENSITY, &
value = jules50_struc(n)%jules50(t)%rho_snow_grnd(pft),&
vlevel=1, unit="kg m-3", direction="-", surface_type = LIS_rc%lsm_index)

! bulk snow grain size
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_SNOWGRAIN, &
value = jules50_struc(n)%jules50(t)%rgrain(pft),&
vlevel=1, unit="micron", direction="-", surface_type = LIS_rc%lsm_index)


call LIS_diagnoseSurfaceOutputVar(n,t, &
LIS_MOC_SNOWTHICK, &
vlevel=1, &
value=jules50_struc(n)%jules50(t)%snowdepth(pft), &
unit="m", direction="-",&
!!! nsmax > 0, multi-layer snow physics
else
! Number of snow layers on ground on tiles
call LIS_diagnoseSurfaceOutputVar(n, t, &
LIS_MOC_SOWN_NLAYER, &
value=jules50_struc(n)%jules50(t)%nsnow(pft)*1.0, & ! nsnow is integer, -> real by *1.0
vlevel=1, unit="-", direction="-", &
surface_type=LIS_rc%lsm_index)

else
do i=1, jules50_struc(n)%nsmax
! snow ice
! layer snow ice
call LIS_diagnoseSurfaceOutputVar(n, t, &
LIS_MOC_SNOWICE, &
value=jules50_struc(n)%jules50(t)%sice(pft,i), &
vlevel=i, unit="kg m-2", direction="-", &
surface_type=LIS_rc%lsm_index)
! snow liquid water
! layer snow liquid water
call LIS_diagnoseSurfaceOutputVar(n, t, &
LIS_MOC_SNOWLIQ, &
value=jules50_struc(n)%jules50(t)%sliq(pft,i), &
vlevel=i, unit="kg m-2", direction="-", &
surface_type=LIS_rc%lsm_index)
! snow temperature K
! layer snow temperature K
call LIS_diagnoseSurfaceOutputVar(n, t, &
LIS_MOC_SNOWTPROF, &
value=jules50_struc(n)%jules50(t)%tsnow(pft,i), &
vlevel=i, unit="K", direction="-", &
surface_type=LIS_rc%lsm_index)
! snow density
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_SNOWDENSITY, &
! layer snow density
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_LAYERSNOWDENSITY, &
value = jules50_struc(n)%jules50(t)%rho_snow(pft,i),&
vlevel=i, unit="kg m-3", direction="-", surface_type = LIS_rc%lsm_index)

! snow grain size
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_SNOWGRAIN, &
! layer snow grain size
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_LAYERSNOWGRAIN, &
value = jules50_struc(n)%jules50(t)%rgrainl(pft,i),&
vlevel=i, unit="micron", direction="-", surface_type = LIS_rc%lsm_index)

! thickness of snow layers
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_SNOWTHICK, &
! layer thickness of snow layers
call LIS_diagnoseSurfaceOutputVar(n, t, LIS_MOC_LAYERSNOWDEPTH, &
value = jules50_struc(n)%jules50(t)%ds(pft,i),&
vlevel=i, unit="m", direction="-", surface_type = LIS_rc%lsm_index)
end do
Expand Down
Loading

0 comments on commit beb7266

Please sign in to comment.