Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLM Lake Model and update Flake #26

Merged
merged 62 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
cbbc106
Updated Flake physics and modified related files
YihuaWu-NOAA Aug 8, 2022
a343c92
Merge pull request #45 from HelinWei-NOAA/flake.v9
HelinWei-NOAA Aug 10, 2022
23290c3
add clm lake
SamuelTrahanNOAA Aug 11, 2022
0f2b5a7
bug fixes
SamuelTrahanNOAA Aug 16, 2022
ab90e24
lsm_ruc bugfix: flag_for_using_flake => flag_for_using_lake_model
SamuelTrahanNOAA Aug 18, 2022
be305d5
various snow bug fixes
SamuelTrahanNOAA Aug 25, 2022
0c1f949
rainnc and rainc do not exist
SamuelTrahanNOAA Aug 25, 2022
0ecd620
remove bad unit conversion
SamuelTrahanNOAA Aug 25, 2022
bbe1a16
unit conversion issue
SamuelTrahanNOAA Aug 25, 2022
9a07ae9
LAKEDEBUG is now clm_lake_debug namelist parameter
SamuelTrahanNOAA Aug 25, 2022
757a4eb
tweaks for salty lakes
SamuelTrahanNOAA Aug 26, 2022
9470375
fix bugs in salty code and add Caspian & Dead seas
SamuelTrahanNOAA Aug 26, 2022
4056217
fix some bugs and make some more
SamuelTrahanNOAA Sep 16, 2022
2014d7b
set roughness length over ice & water in clm lake model
SamuelTrahanNOAA Sep 19, 2022
789ddb9
several fixes to initialization
SamuelTrahanNOAA Oct 11, 2022
3acd145
more updates from tanya
SamuelTrahanNOAA Oct 17, 2022
8339050
rework variables and add fractional ice
SamuelTrahanNOAA Oct 20, 2022
217a8bf
bug fixes to get fractional ice working
SamuelTrahanNOAA Oct 20, 2022
c34a3d3
bug fixes for restart (not enough though)
SamuelTrahanNOAA Oct 24, 2022
5709bfa
merge upstream ufs/dev
SamuelTrahanNOAA Nov 21, 2022
e079dc7
revert some changes
SamuelTrahanNOAA Nov 28, 2022
405fc85
remove flake changes
SamuelTrahanNOAA Nov 28, 2022
c4980ce
put some changes back in
SamuelTrahanNOAA Nov 29, 2022
e41e718
put flake back in
SamuelTrahanNOAA Nov 30, 2022
f44c410
skin_temperature_from_clm_lake_model -> skin_temperature_from_lake_model
SamuelTrahanNOAA Dec 1, 2022
7c9a217
Merge remote-tracking branch 'community/ufs/dev' into clm_lake_revert.v9
SamuelTrahanNOAA Dec 5, 2022
b214ab4
correction to a comment in clm_lake.f90
SamuelTrahanNOAA Mar 1, 2023
05e87ec
restart works with FV3_HRRR suite
SamuelTrahanNOAA Mar 2, 2023
aa57582
do not freeze great salt lakes
SamuelTrahanNOAA Mar 2, 2023
b3a0586
address reviewer comments
SamuelTrahanNOAA Mar 2, 2023
ce8643f
comment to resolve reviewer confusion
SamuelTrahanNOAA Mar 2, 2023
169ff90
merge upstream ufs/dev
SamuelTrahanNOAA Mar 2, 2023
f9e049e
coare changes and bug fixes from tanya
SamuelTrahanNOAA Mar 2, 2023
ac3303b
Merge branch 'clm_lake_revert.v9' of ssh://github.com/SamuelTrahanNOA…
SamuelTrahanNOAA Mar 2, 2023
06d4d9e
further updates from tanya
SamuelTrahanNOAA Mar 2, 2023
a029c28
disable wordy warning without LAKEDEBUG
SamuelTrahanNOAA Mar 2, 2023
9031ba4
Merge remote-tracking branch 'sam/clm_lake_revert.v9' into clm_lake_m…
SamuelTrahanNOAA Mar 2, 2023
078bf74
use 64 bits for lake and disable broken coare code
SamuelTrahanNOAA Mar 3, 2023
eb64c3d
Merge branch 'clm_lake_revert.v9' of ssh://github.com/SamuelTrahanNOA…
SamuelTrahanNOAA Mar 3, 2023
4eb73a5
Merge branch 'clm_lake_merge_upstream' into clm_lake_revert.v9
SamuelTrahanNOAA Mar 3, 2023
52f820a
clm lake: loops use ints & return if there is nothing to do
SamuelTrahanNOAA Mar 9, 2023
a97690a
clm lake meta: need lkm
SamuelTrahanNOAA Mar 9, 2023
1036acf
do not set wet(i) in random locations
SamuelTrahanNOAA Mar 17, 2023
74d8461
merge upstream
SamuelTrahanNOAA Mar 17, 2023
3de0f93
merge ufs/dev
SamuelTrahanNOAA Apr 3, 2023
40e1e26
con_tpp => con_ttp
SamuelTrahanNOAA Apr 3, 2023
e036ea0
merge remote
SamuelTrahanNOAA Apr 3, 2023
fe1d584
fix syntax error
SamuelTrahanNOAA Apr 4, 2023
1a2be70
use integer constant for integer comparison
SamuelTrahanNOAA Apr 4, 2023
b9f1087
skip clm_lake_run if there are no lake points in the thread
SamuelTrahanNOAA Apr 4, 2023
b7cb04a
integer, not logical
SamuelTrahanNOAA Apr 4, 2023
2daa88d
Merge remote-tracking branch 'upstream/ufs/dev' into clm_lake_revert.v9
SamuelTrahanNOAA Apr 11, 2023
0acedb5
Merge remote-tracking branch 'upstream/ufs/dev' into clm_lake_revert.v9
SamuelTrahanNOAA Apr 14, 2023
9b19c53
Merge branch 'clm_lake_revert.v9' of ssh://github.com/SamuelTrahanNOA…
SamuelTrahanNOAA Apr 14, 2023
cf604b5
remove test code from clm_lake.f90
SamuelTrahanNOAA Apr 14, 2023
5e00d36
Merge remote-tracking branch 'upstream/ufs/dev' into clm_lake_revert.v9
SamuelTrahanNOAA Apr 18, 2023
6a15a0a
remove repeated constants
SamuelTrahanNOAA Apr 19, 2023
783af0e
remove repeated constants and redundant variable
SamuelTrahanNOAA Apr 19, 2023
07a375e
Merge branch 'clm_lake_revert.v9' of ssh://github.com/SamuelTrahanNOA…
SamuelTrahanNOAA Apr 19, 2023
3929f9f
remove redundant .not.have_2m in sfc_diag.f
SamuelTrahanNOAA Apr 19, 2023
37dd7a5
explain why kind_lake exists
SamuelTrahanNOAA Apr 19, 2023
d474c27
Merge remote-tracking branch 'upstream/ufs/dev' into clm_lake_revert.v9
SamuelTrahanNOAA Apr 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions physics/GFS_MP_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ subroutine GFS_MP_generic_post_run(
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, &
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, &
fh_dfi_radar,index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, prevsq, &
errmsg, errflg)
iopt_lake, iopt_lake_clm, lkm, use_lake_model, errmsg, errflg)
!
use machine, only: kind_phys
use calpreciptype_mod, only: calpreciptype
implicit none

integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
integer, intent(in) :: imp_physics_nssl
integer, intent(in) :: imp_physics_nssl, iopt_lake_clm, iopt_lake, lkm
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, exticeden
integer, intent(in) :: index_of_temperature,index_of_process_mp
integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:)

integer :: dfi_radar_max_intervals
real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour
Expand Down Expand Up @@ -228,6 +228,13 @@ subroutine GFS_MP_generic_post_run(
dgraupelprv(:) = tem * graupelprv(:)
diceprv(:) = tem * iceprv(:)
end if
else if(lkm>0 .and. iopt_lake==iopt_lake_clm) then
do i=1,im
if(use_lake_model(i)>0) then
raincprv(i) = rainc(i)
rainncprv(i) = frain * rain1(i)
end if
end do
end if

if (cal_pre) then ! hchuang: add dominant precipitation type algorithm
Expand Down
28 changes: 28 additions & 0 deletions physics/GFS_MP_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,34 @@
dimensions = ()
type = logical
intent = in
[lkm]
standard_name = control_for_lake_model_execution_method
long_name = control for lake model execution: 0=no lake, 1=lake, 2=lake+nsst
units = flag
dimensions = ()
type = integer
intent = in
[iopt_lake]
standard_name = control_for_lake_model_selection
long_name = control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[iopt_lake_clm]
standard_name = clm_lake_model_control_selection_value
long_name = value that indicates clm lake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
32 changes: 29 additions & 3 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ subroutine GFS_phys_time_vary_init (
zwtxy, xlaixy, xsaixy, lfmassxy, stmassxy, rtmassxy, woodxy, stblcpxy, fastcpxy, &
smcwtdxy, deeprechxy, rechxy, snowxy, snicexy, snliqxy, tsnoxy , smoiseq, zsnsoxy, &
slc, smc, stc, tsfcl, snowd, canopy, tg3, stype, con_t0c, lsm_cold_start, nthrds, &
errmsg, errflg)
lkm, use_lake_model, lakefrac, lakedepth, iopt_lake, iopt_lake_clm, iopt_lake_flake, &
lakefrac_threshold, lakedepth_threshold, errmsg, errflg)

implicit none

! Interface variables
integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny, levs, iaermdl
logical, intent(in) :: h2o_phys, iaerclm, lsm_cold_start
integer, intent(in) :: idate(:)
real(kind_phys), intent(in) :: fhour
integer, intent(in) :: idate(:), iopt_lake, iopt_lake_clm, iopt_lake_flake
real(kind_phys), intent(in) :: fhour, lakefrac_threshold, lakedepth_threshold
real(kind_phys), intent(in) :: xlat_d(:), xlon_d(:)

integer, intent(in) :: lkm
integer, intent(inout) :: use_lake_model(:)
real(kind=kind_phys), intent(in ) :: lakefrac(:), lakedepth(:)

integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:)
real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:)
real(kind_phys), intent(in) :: ozpl(:,:,:), h2opl(:,:,:)
Expand Down Expand Up @@ -670,6 +675,27 @@ subroutine GFS_phys_time_vary_init (
endif noahmp_init
endif lsm_init

!Lake model
if(lkm>0 .and. iopt_lake>0) then
! A lake model is enabled.
do i = 1, im
!if (lakefrac(i) > 0.0 .and. lakedepth(i) > 1.0 ) then

! The lake data must say there's a lake here (lakefrac) with a depth (lakedepth)
if (lakefrac(i) > lakefrac_threshold .and. lakedepth(i) > lakedepth_threshold ) then
! This is a lake point. Inform the other schemes to use a lake model, and possibly nsst (lkm)
use_lake_model(i) = lkm
cycle
else
! Not a valid lake point.
use_lake_model(i) = 0
endif
enddo
else
! Lake model is disabled or settings are invalid.
use_lake_model = 0
endif

is_initialized = .true.

contains
Expand Down
67 changes: 67 additions & 0 deletions physics/GFS_phys_time_vary.fv3.meta
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,73 @@
dimensions = ()
type = integer
intent = in
[lkm]
standard_name = control_for_lake_model_execution_method
long_name = control for lake model execution: 0=no lake, 1=lake, 2=lake+nsst
units = flag
dimensions = ()
type = integer
intent = in
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_dimension)
type = integer
intent = inout
[lakefrac]
standard_name = lake_area_fraction
long_name = fraction of horizontal grid area occupied by lake
units = frac
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
[lakedepth]
standard_name = lake_depth
long_name = lake depth
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
[iopt_lake]
standard_name = control_for_lake_model_selection
long_name = control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[iopt_lake_clm]
standard_name = clm_lake_model_control_selection_value
long_name = value that indicates clm lake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[iopt_lake_flake]
standard_name = flake_model_control_selection_value
long_name = value that indicates flake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[lakefrac_threshold]
standard_name = lakefrac_threshold_for_enabling_lake_model
long_name = fraction of horizontal grid area occupied by lake must be greater than this value to enable a lake model
units = frac
dimensions = ()
type = real
kind = kind_phys
intent = in
[lakedepth_threshold]
standard_name = lake_depth_threshold_for_enabling_lake_model
long_name = lake depth must be greater than this value to enable a lake model
units = m
dimensions = ()
type = real
kind = kind_phys
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
6 changes: 3 additions & 3 deletions physics/GFS_radiation_surface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ subroutine GFS_radiation_surface_run ( &
lsm_ruc, xlat, xlon, slmsk, lndp_type, n_var_lndp, sfc_alb_pert,&
lndp_var_list, lndp_prt_list, landfrac, snodl, snodi, sncovr, &
sncovr_ice, fice, zorl, hprime, tsfg, tsfa, tisfc, coszen, &
cplice, min_seaice, min_lakeice, lakefrac, use_flake, &
cplice, min_seaice, min_lakeice, lakefrac, use_lake_model, &
alvsf, alnsf, alvwf, alnwf, facsf, facwf, &
semis_lnd, semis_ice, semis_wat, snoalb, use_cice_alb, con_ttp, &
albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, &
Expand All @@ -69,7 +69,7 @@ subroutine GFS_radiation_surface_run ( &
logical, intent(in) :: frac_grid, lslwr, lsswr, use_cice_alb, cplice
integer, intent(in) :: lsm, lsm_noahmp, lsm_ruc, lndp_type, n_var_lndp
real(kind=kind_phys), intent(in) :: min_seaice, min_lakeice, con_ttp
logical, dimension(:), intent(in) :: use_flake
integer, dimension(:), intent(in) :: use_lake_model

real(kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, slmsk, &
sfc_alb_pert, lndp_prt_list, &
Expand Down Expand Up @@ -154,7 +154,7 @@ subroutine GFS_radiation_surface_run ( &
!> - Call module_radiation_surface::setemis(),to set up surface
!! emissivity for LW radiation.
call setemis (lsm, lsm_noahmp, lsm_ruc, frac_grid, cplice, &
use_flake, lakefrac, xlon, xlat, slmsk, &
use_lake_model, lakefrac, xlon, xlat, slmsk, &
! frac_grid, min_seaice, xlon, xlat, slmsk, &
snodl, snodi, sncovr, sncovr_ice, zorl, tsfg, &
tsfa, hprime, semis_lnd, semis_ice, semis_wat,&
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_radiation_surface.meta
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@
type = real
kind = kind_phys
intent = in
[use_flake]
standard_name = flag_for_using_flake
long_name = flag indicating lake points using flake model
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_loop_extent)
type = logical
type = integer
intent = inout
[alvsf]
standard_name = vis_albedo_strong_cosz
Expand Down
8 changes: 5 additions & 3 deletions physics/GFS_surface_composites_inter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ module GFS_surface_composites_inter
!!
subroutine GFS_surface_composites_inter_run (im, dry, icy, wet, semis_wat, semis_lnd, semis_ice, &
adjsfcdlw, gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat,&
adjsfcusw, adjsfcdsw, adjsfcnsw, errmsg, errflg)
adjsfcusw, adjsfcdsw, adjsfcnsw, use_lake_model, errmsg, errflg)

implicit none

! Interface variables
integer, intent(in ) :: im
logical, dimension(:), intent(in ) :: dry, icy, wet
logical, dimension(:), intent(in ) :: dry, icy
logical, dimension(:), intent(inout) :: wet
real(kind=kind_phys), dimension(:), intent(in ) :: semis_wat, semis_lnd, semis_ice, &
adjsfcdlw, adjsfcdsw, adjsfcnsw
real(kind=kind_phys), dimension(:), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat
real(kind=kind_phys), dimension(:), intent(out) :: adjsfcusw
integer, dimension(:), intent(in) :: use_lake_model

! CCPP error handling
character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -68,4 +70,4 @@ subroutine GFS_surface_composites_inter_run (im, dry, icy, wet, semis_wat, semis

end subroutine GFS_surface_composites_inter_run

end module GFS_surface_composites_inter
end module GFS_surface_composites_inter
11 changes: 9 additions & 2 deletions physics/GFS_surface_composites_inter.meta
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
units = flag
dimensions = (horizontal_loop_extent)
type = logical
intent = in
intent = inout
[semis_wat]
standard_name = surface_longwave_emissivity_over_water
long_name = surface lw emissivity in fraction over water
Expand Down Expand Up @@ -116,6 +116,13 @@
type = real
kind = kind_phys
intent = in
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand All @@ -130,4 +137,4 @@
units = 1
dimensions = ()
type = integer
intent = out
intent = out
Loading