Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into flake
  • Loading branch information
YihuaWu-NOAA committed Apr 15, 2021
2 parents aa73104 + e20ad29 commit 3163fbc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion physics/GFS_surface_composites.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ end subroutine GFS_surface_composites_pre_finalize
!! \htmlinclude GFS_surface_composites_pre_run.html
!!
subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx, cplwav2atm, &
landfrac, lakefrac, lakedepth, oceanfrac, frland, dry, icy, use_flake, ocean, wet, &
landfrac, lakefrac, lakedepth, oceanfrac, frland, dry, icy, use_flake, ocean, wet, &
hice, cice, snowd, snowd_wat, snowd_lnd, snowd_ice, tprcp, tprcp_wat, &
tprcp_lnd, tprcp_ice, uustar, uustar_wat, uustar_lnd, uustar_ice, &
weasd, weasd_wat, weasd_lnd, weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_wat, &
Expand Down
33 changes: 26 additions & 7 deletions physics/flake_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SUBROUTINE flake_driver_run ( &
! ---- Inputs
im, ps, t1, q1, wind, &
dlwflx, dswsfc, weasd, lakedepth, &
lake, xlat, delt, zlvl, elev, &
use_flake, xlat, delt, zlvl, elev, &
wet, flag_iter, yearlen, julian, imon, &
! ---- in/outs
snwdph, hice, tsurf, fice, T_sfc, hflx, evap, &
Expand Down Expand Up @@ -95,7 +95,7 @@ SUBROUTINE flake_driver_run ( &

real (kind=kind_phys), intent(in) :: julian

logical, dimension(im), intent(in) :: flag_iter, wet, lake
logical, dimension(im), intent(in) :: flag_iter, wet, use_flake

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down Expand Up @@ -187,6 +187,10 @@ SUBROUTINE flake_driver_run ( &
REAL (KIND = kind_phys) :: &
lake_depth_max, T_bot_2_in, T_bot_2_out, dxlat,tb,tr,tt,temp,Kbar, DelK


REAL (KIND = kind_phys) :: x, y !temperarory variables used for Tbot and Tsfc
!initilizations

INTEGER :: i,ipr,iter

LOGICAL :: lflk_botsed_use
Expand All @@ -212,7 +216,7 @@ SUBROUTINE flake_driver_run ( &

do i = 1, im
if (flag(i)) then
if( lake(i) ) then
if( use_flake(i) ) then
T_ice(i) = 273.15
T_snow(i) = 273.15
fetch(i) = 2.0E+03
Expand All @@ -237,9 +241,23 @@ SUBROUTINE flake_driver_run ( &
! else
! T_sfc(i) = tsurf(i)
! endif
T_sfc(i) = 0.2*tt + 0.8* tsurf(i)
T_sfc(i) = 0.1*tt + 0.9* tsurf(i)
endif
!
! Add empirical climatology of lake Tsfc and Tbot to the current Tsfc and Tbot
! to make sure Tsfc and Tbot are warmer than Tair in Winter or colder than Tair
! in Summer

x = 0.03279*julian
if(xlat(i) .ge. 0.0) then
y = ((((0.0034*x-0.1241)*x+1.6231)*x-8.8666)*x+17.206)*x-4.2929
T_sfc(i) = T_sfc(i) + 0.3*y
tb = tb + 0.05*y
else
y = ((((0.0034*x-0.1241)*x+1.6231)*x-8.8666)*x+17.206)*x-4.2929
T_sfc(i) = T_sfc(i) - 0.3*y
tb = tb - 0.05*y
endif

T_bot(i) = tb
T_B1(i) = tb

Expand Down Expand Up @@ -275,7 +293,7 @@ SUBROUTINE flake_driver_run ( &
! print*,'inside flake driver'
! print*, julian,xlat(i),w_albedo(I),w_extinc(i),lakedepth(i),elev(i),tb,tt,tsurf(i),T_sfc(i)

endif !lake fraction and depth
endif !lake
endif !flag
enddo
1001 format ( 'At icount=', i5, ' x = ', f5.2,5x, 'y = ', &
Expand All @@ -288,7 +306,7 @@ SUBROUTINE flake_driver_run ( &
! call lake interface
do i=1,im
if (flag(i)) then
if( lake(i) ) then
if( use_flake(i) ) then
dMsnowdt_in = weasd(i)/delt
I_atm_in = dswsfc(i)
Q_atm_lw_in = dlwflx(i)
Expand Down Expand Up @@ -391,3 +409,4 @@ END SUBROUTINE flake_driver_run

!---------------------------------
end module flake_driver
2 changes: 1 addition & 1 deletion physics/flake_driver.meta
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
kind = kind_phys
intent = in
optional = F
[lake]
[use_flake]
standard_name = flag_nonzero_lake_surface_fraction
long_name = flag indicating presence of some lake surface area fraction
units = flag
Expand Down

0 comments on commit 3163fbc

Please sign in to comment.