Skip to content

Commit

Permalink
unit mismatch in clm lake
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTrahanNOAA committed Dec 12, 2023
1 parent c0aa212 commit b80e1ac
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
20 changes: 11 additions & 9 deletions physics/clm_lake.f90
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ subroutine calculate_z_dz_lake(i,input_lakedepth,clm_lakedepth,z_lake,dz_lake)
real(kind_lake) :: dz_lake(nlevlake) ! layer thickness for lake (m)
real(kind_lake) :: depthratio

if (input_lakedepth(i) == spval) then
if (input_lakedepth(i) == spval .or. input_lakedepth(i) < 0.1) then
clm_lakedepth(i) = zlak(nlevlake) + 0.5_kind_lake*dzlak(nlevlake)
z_lake(1:nlevlake) = zlak(1:nlevlake)
dz_lake(1:nlevlake) = dzlak(1:nlevlake)
Expand Down Expand Up @@ -267,7 +267,7 @@ SUBROUTINE clm_lake_run( &

! Atmospheric model state inputs:
tg3, pgr, zlvl, gt0, prsi, phii, qvcurr, gu0, gv0, xlat_d, xlon_d, &
ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, rho0, tsfc, &
ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, tsfc, &
flag_iter, ISLTYP, rainncprv, raincprv, &

! Feedback to atmosphere:
Expand All @@ -283,7 +283,7 @@ SUBROUTINE clm_lake_run( &

salty, savedtke12d, snowdp2d, h2osno2d, snl2d, t_grnd2d, t_lake3d, &
lake_icefrac3d, t_soisno3d, h2osoi_ice3d, h2osoi_liq3d, h2osoi_vol3d, &
z3d, dz3d, zi3d, &
z3d, dz3d, zi3d, t1, qv1, prsl1, &
input_lakedepth, clm_lakedepth, cannot_freeze, &

! Error reporting:
Expand Down Expand Up @@ -321,8 +321,8 @@ SUBROUTINE clm_lake_run( &
!
REAL(KIND_PHYS), DIMENSION(:), INTENT(IN):: &
tg3, pgr, zlvl, qvcurr, xlat_d, xlon_d, ch, cm, &
dlwsfci, dswsfci, oro_lakedepth, wind, rho0, &
rainncprv, raincprv
dlwsfci, dswsfci, oro_lakedepth, wind, &
rainncprv, raincprv, t1, qv1, prsl1
REAL(KIND_PHYS), DIMENSION(:,:), INTENT(in) :: gu0, gv0, prsi, gt0, phii
LOGICAL, DIMENSION(:), INTENT(IN) :: flag_iter
INTEGER, DIMENSION(:), INTENT(IN) :: ISLTYP
Expand Down Expand Up @@ -450,6 +450,7 @@ SUBROUTINE clm_lake_run( &
logical, parameter :: feedback_to_atmosphere = .true. ! FIXME: REMOVE

real(kind_lake) :: to_radians, lat_d, lon_d, qss, tkm, bd
real(kind_lake) :: rho0 ! lowest model level air density

integer :: month,num1,num2,day_of_month,isl
real(kind_lake) :: wght1,wght2,Tclim,depthratio
Expand Down Expand Up @@ -693,12 +694,13 @@ SUBROUTINE clm_lake_run( &

!-- The CLM output is combined for fractional ice and water
if( t_grnd(c) >= tfrz ) then
qfx = eflx_lh_tot(c)*invhvap
qfx = eflx_lh_tot(c)*invhvap
else
qfx = eflx_lh_tot(c)*invhsub ! heat flux (W/m^2)=>mass flux(kg/(sm^2))
qfx = eflx_lh_tot(c)*invhsub ! heat flux (W/m^2)=>mass flux(kg/(sm^2))
endif
evap_wat(i) = qfx/rho0(i) ! kinematic_surface_upward_latent_heat_flux_over_water
hflx_wat(i)=eflx_sh_tot(c)/(rho0(i)*cpair) ! kinematic_surface_upward_sensible_heat_flux_over_water
rho0 = prsl1(i) / (rair*t1(i)*(1.0 + con_fvirt*qv1(i)))
evap_wat(i) = qfx/rho0 ! kinematic_surface_upward_latent_heat_flux_over_water
hflx_wat(i) = eflx_sh_tot(c)/(rho0*cpair) ! kinematic_surface_upward_sensible_heat_flux_over_water
gflx_wat(I) = eflx_gnet(c) ![W/m/m] upward_heat_flux_in_soil_over_water
ep1d_water(i) = eflx_lh_tot(c) ![W/m/m] surface_upward_potential_latent_heat_flux_over_water
tsurf_water(I) = t_grnd(c) ![K] surface skin temperature after iteration over water
Expand Down
32 changes: 24 additions & 8 deletions physics/clm_lake.meta
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,6 @@
type = real
kind = kind_phys
intent = in
[rho0]
standard_name = air_pressure_at_surface_adjacent_layer
long_name = mean pressure at lowest model layer
units = Pa
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[tsfc]
standard_name = surface_skin_temperature
long_name = surface skin temperature
Expand Down Expand Up @@ -732,6 +724,30 @@
type = real
kind = kind_phys
intent = in
[t1]
standard_name = air_temperature_at_surface_adjacent_layer
long_name = mean temperature at lowest model layer
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[qv1]
standard_name = specific_humidity_at_surface_adjacent_layer
long_name = water vapor specific humidity at lowest model layer
units = kg kg-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[prsl1]
standard_name = air_pressure_at_surface_adjacent_layer
long_name = mean pressure at lowest model layer
units = Pa
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down

0 comments on commit b80e1ac

Please sign in to comment.