Skip to content

Commit

Permalink
yet more changes missing in prior commits
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTrahanNOAA committed Jul 27, 2023
1 parent 1fae3bc commit 180c43b
Showing 1 changed file with 17 additions and 28 deletions.
45 changes: 17 additions & 28 deletions physics/clm_lake.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2030,8 +2030,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & !
! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term
t_lake_bef(c,j) = t_lake(c,j)
if(debug_print) then
if (abs(xlat_d-51.393).lt.0.1 .and. &
abs(xlon_d-261.117).lt.0.1)then
if (abs(xlat_d-52.1152).lt.0.1 .and. &
abs(xlon_d-260.405).lt.0.1)then
print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d
print *,'j,dz_lake(c,j) ', j,dz_lake(c,j)
print*,'cv_lake(c,j),lake_icefrac(c,j),t_lake(c,j),cfus,ocvts(c)', &
Expand All @@ -2054,8 +2054,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & !
+ hfus*h2osoi_liq(c,j) !&
! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term
if(debug_print) then
if (abs(xlat_d-51.393).lt.0.1 .and. &
abs(xlon_d-261.117).lt.0.1)then
if (abs(xlat_d-52.1152).lt.0.1 .and. &
abs(xlon_d-260.405).lt.0.1)then
print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d
print *,' j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j)
print *,' cv(c,j),t_soisno(c,j),hfus,ocvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ocvts(c)
Expand Down Expand Up @@ -2520,8 +2520,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & !
! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term
fin(c) = fin(c) + phi(c,j)
if(debug_print) then
if (abs(xlat_d-51.393).lt.0.1 .and. &
abs(xlon_d-261.117).lt.0.1)then
if (abs(xlat_d-52.1152).lt.0.1 .and. &
abs(xlon_d-260.405).lt.0.1)then
print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d
print *,' new cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c)', &
j,cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c)
Expand All @@ -2543,8 +2543,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & !
+ hfus*h2osoi_liq(c,j) !&
! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term
if(debug_print) then
if (abs(xlat_d-51.393).lt.0.1 .and. &
abs(xlon_d-261.117).lt.0.1)then
if (abs(xlat_d-52.1152).lt.0.1 .and. &
abs(xlon_d-260.405).lt.0.1)then
print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d
print *,'new j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j)
print *,'new cv(c,j),t_soisno(c,j),hfus,ncvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ncvts(c)
Expand All @@ -2567,8 +2567,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & !
c = pcolumn(p)
errsoi(c) = (ncvts(c)-ocvts(c)) / dtime - fin(c)
if(debug_print) then
if (abs(xlat_d-51.393).lt.0.1 .and. &
abs(xlon_d-261.117).lt.0.1)then
if (abs(xlat_d-52.1152).lt.0.1 .and. &
abs(xlon_d-260.405).lt.0.1)then
print *,'xlat_d,xlon_d',xlat_d,xlon_d
print *,'errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c)', &
errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c)
Expand Down Expand Up @@ -5653,34 +5653,23 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd,

t_lake3d(i,1) = tsfc(i)
t_grnd2d(i) = tsfc(i)

! initial lake temperature
if (lake_icefrac3d(i,1) <= 0.) then
! no ice
t_lake3d(i,1) = max(tfrz,t_lake3d(i,1))
t_grnd2d(i) = t_lake3d(i,1)
elseif (lake_icefrac3d(i,1) > 0. .and. lake_icefrac3d(i,1) < 1.) then
! fractional ice
t_lake3d(i,1) = tfrz
t_lake3d(i,1) = max(tfrz,tsfc(i))
t_grnd2d(i) = max(tfrz,tsfc(i))
endif

do k = 2, nlevlake
if(z_lake3d(i,k).le.depth_c) then
t_lake3d(i,k) = t_lake3d(i,1)+(277.2_kind_lake-t_lake3d(i,1))/depth_c*z_lake3d(i,k)
if (lake_icefrac3d(i,1) <= 0.) then
! no ice
t_lake3d(i,k) = max(tfrz,t_lake3d(i,k))
elseif (lake_icefrac3d(i,1) > 0. .and. lake_icefrac3d(i,1) < 1.) then
! fractional ice
t_lake3d(i,k) = tfrz
endif
t_lake3d(i,k) = tsfc(i)+(277.2_kind_lake-tsfc(i))/depth_c*z_lake3d(i,k)
else
t_lake3d(i,k) = 277.2_kind_lake
end if
if (lake_icefrac3d(i,k) <= 0.) then
t_lake3d(i,k) = max(tfrz,t_lake3d(i,k))
endif
enddo

! initial t_soisno3d
! in snow on ice
! in snow
if(snowdp2d(i) > 0.) then
do k = snl2d(i)+1, 0
t_soisno3d(i,k) =min(tfrz,tsfc(i))
Expand Down

0 comments on commit 180c43b

Please sign in to comment.