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

land surface upgrades for HR2 #78

Merged
merged 78 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
5cf7176
Merge branch 'ufs/dev' into small_cloud_tuning_GT_gjf
Oct 17, 2022
15e44c8
Merge branch 'bugfix/rrfs-debug-mode-no-smoke' into ufs-dev-PR6
Oct 18, 2022
8e9eecb
Merge branch 'small_cloud_tuning_GT_gjf' into ufs-dev-PR1
Oct 19, 2022
3197ea0
Merge pull request #47 from ufs-community/ufs/dev
HelinWei-NOAA Oct 26, 2022
a089102
Merge pull request #973 from grantfirl/ufs-dev-PR6
Oct 26, 2022
b366011
Merge branch 'main' into ufs-dev-PR1
Oct 27, 2022
8f6f1a0
Merge pull request #972 from dustinswales/add_ci_tests
Oct 27, 2022
f90350a
Merge pull request #974 from grantfirl/ufs-dev-PR1
Nov 1, 2022
751d5c7
Set fv3atm fork used in CI to NCAR, from NOAA-EMC
Nov 1, 2022
35f5e89
Merge branch 'feature/lnd_noahmp_new' into ufs-dev-PR10
Nov 3, 2022
97034ed
Merge branch 'delta_srw210' into ufs-dev-PR14
Nov 3, 2022
c348f3e
Merge pull request #977 from grantfirl/ufs-dev-PR10
grantfirl Nov 8, 2022
a733073
Merge branch 'main' into ufs-dev-PR14
Nov 8, 2022
a015160
Merge branch 'feature/mp_cloud' into ufs-dev-PR19
Nov 8, 2022
a4aac03
adding soil color data
HelinWei-NOAA Nov 11, 2022
6374c88
Merge pull request #978 from grantfirl/ufs-dev-PR14
grantfirl Nov 15, 2022
c65aa90
Merge branch 'main' into ufs-dev-PR19
Nov 15, 2022
312f63e
Merge pull request #982 from grantfirl/ufs-dev-PR19
grantfirl Nov 21, 2022
320e76d
Merge pull request #51 from ufs-community/ufs/dev
HelinWei-NOAA Nov 29, 2022
6ef8805
Merge branch 'NCAR:main' into main
wzzheng90 Nov 30, 2022
d2fd9d0
Merge pull request #54 from HelinWei-NOAA/fix_tq2m_diagnoahmp
HelinWei-NOAA Dec 2, 2022
1ab0505
merge with noahmp_table branch
HelinWei-NOAA Dec 2, 2022
ae748c9
fixed inout in meta files
HelinWei-NOAA Dec 30, 2022
a5a1a8a
Merge pull request #57 from ufs-community/ufs/dev
HelinWei-NOAA Feb 9, 2023
a376995
Merge pull request #59 from ufs-community/ufs/dev
HelinWei-NOAA Mar 13, 2023
7c750ea
Merge pull request #61 from ufs-community/ufs/dev
HelinWei-NOAA Mar 30, 2023
e540c0e
Merge branch 'soil_color' into hr2_landupdate1
HelinWei-NOAA Mar 31, 2023
bb01472
Merge pull request #62 from HelinWei-NOAA/hr2_landupdate1
HelinWei-NOAA Mar 31, 2023
a33db44
the raw soil color data
HelinWei-NOAA Mar 31, 2023
cbf3802
add iopt_diag for 2m t/q diagnostic option
HelinWei-NOAA Apr 3, 2023
1d9cdbe
move noahmp table reading to noahmpdrv_ini
HelinWei-NOAA Apr 12, 2023
3d226e7
keep the current NoahMP table values
HelinWei-NOAA Apr 12, 2023
bec07e2
fixed a typo
HelinWei-NOAA Apr 13, 2023
87cb6b5
add canopy heat and optional to noahmpdrv
barlage Apr 13, 2023
b37af3b
Merge pull request #63 from barlage/add_optional
HelinWei-NOAA Apr 13, 2023
d98defa
modify a few terms in vegetation diag3
barlage Apr 17, 2023
f5f98c4
Merge pull request #64 from barlage/diag3_mods
HelinWei-NOAA Apr 17, 2023
a405865
add veg and bare qsfc to output
barlage Apr 18, 2023
8f2078c
include wet leaf contribution factor
zhichang-guo Apr 19, 2023
5edc131
include wet leaf contribution factor
zhichang-guo Apr 19, 2023
c1ce88b
remove cvw and wlcf
barlage Apr 20, 2023
6b9c79a
add back second check
barlage Apr 20, 2023
2ca652b
Merge pull request #66 from barlage/wet_leaf
HelinWei-NOAA Apr 25, 2023
054413a
document thermalz0 scheme
barlage Apr 28, 2023
52752a9
Merge branch 'hr2_land1' into z0h_document
barlage Apr 28, 2023
c39a6a5
add z0m option to account for phenology
barlage May 1, 2023
3ca1cb4
revert z0m option to original for testing
barlage May 1, 2023
c92f164
add gfs stability inside noahmp; remove dependence on sfc_diff
barlage May 1, 2023
5c438fd
add z0m to hvt ratio to mptable
barlage May 1, 2023
54b406e
use blumel99 approach for bare soil for chen09 trs option
barlage May 1, 2023
591791c
use log averaging for z0m
barlage May 1, 2023
e046059
modify compositing for trs = chen09 and tessel
barlage May 1, 2023
8ccdf65
add limits to rb
barlage May 1, 2023
60fb0e8
lower glacier snow limit to 100mm
barlage May 1, 2023
63aed7c
bug fix for mixing ratio calculation in canres
barlage May 1, 2023
12d8ab5
fix bug in infil for infiltration limit
barlage May 1, 2023
9525a16
add canopy heat to mptable for tuning
barlage May 1, 2023
6ab1b96
add two changes missed in previous update
barlage May 1, 2023
36e3892
fix inout on ustar in sfcdif 1 and 2
barlage May 1, 2023
2fc95fe
remove zvfun and gdx effect from sfcdif3
barlage May 1, 2023
4fcd86a
Merge pull request #70 from barlage/hr2_accumulate
HelinWei-NOAA May 1, 2023
e193bb9
Merge pull request #72 from ufs-community/ufs/dev
HelinWei-NOAA May 8, 2023
160b60d
Merge pull request #73 from ufs-community/ufs/dev
HelinWei-NOAA Jun 1, 2023
ec589d1
multiply canopy heat by fveg to conform to solution assumption
barlage Jun 2, 2023
71e5d03
Merge pull request #74 from barlage/canhs_fix
HelinWei-NOAA Jun 2, 2023
5e7c283
update .github/workflows/ci_fv3_ccpp_prebuild.yml
HelinWei-NOAA Jun 5, 2023
7ed89c4
Merge branch 'hr2_land1' of github.com:HelinWei-NOAA/ccpp-physics int…
HelinWei-NOAA Jun 5, 2023
363c82c
addressing comments from reviewers
HelinWei-NOAA Jun 5, 2023
5b50134
remove soil color comment
HelinWei-NOAA Jun 7, 2023
a99876b
to address issues on ep_2 epsm1 and fv
HelinWei-NOAA Jun 9, 2023
7edf992
update some data type
HelinWei-NOAA Jun 14, 2023
07a38c6
fixed rstoch data type
HelinWei-NOAA Jun 15, 2023
f477bbb
delete some printout statements in sfcsub.f
HelinWei-NOAA Jun 16, 2023
ebe97e9
Merge pull request #76 from ufs-community/ufs/dev
HelinWei-NOAA Jun 27, 2023
85e3edb
noahmp table needed to be read in GFS_phys_time_vary.fv3
HelinWei-NOAA Jun 28, 2023
0a873da
initialize soil color in case no input data
HelinWei-NOAA Jun 29, 2023
e9803fc
Merge pull request #78 from ufs-community/ufs/dev
HelinWei-NOAA Jul 10, 2023
680e841
use log to replace both alog and dlog
HelinWei-NOAA Jul 11, 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
10 changes: 9 additions & 1 deletion physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%vtype_save', Sfcprop%vtype_save)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%stype' , Sfcprop%stype)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%stype_save', Sfcprop%stype_save)

call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%scolor' , Sfcprop%scolor)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%scolore_save', Sfcprop%scolor_save)

call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%uustar' , Sfcprop%uustar)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%oro' , Sfcprop%oro)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%oro_uf' , Sfcprop%oro_uf)
Expand Down Expand Up @@ -1531,7 +1535,7 @@ module GFS_checkland
!! \htmlinclude GFS_checkland_run.html
!!
subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_guess, &
flag_init, flag_restart, frac_grid, isot, ivegsrc, stype, vtype, slope, &
flag_init, flag_restart, frac_grid, isot, ivegsrc, stype,scolor, vtype, slope, &
dry, icy, wet, lake, ocean, oceanfrac, landfrac, lakefrac, slmsk, islmsk, &
zorl, zorlw, zorll, zorli, fice, errmsg, errflg )

Expand All @@ -1554,6 +1558,8 @@ subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_
integer, intent(in ) :: isot
integer, intent(in ) :: ivegsrc
integer, intent(in ) :: stype(:)
integer, intent(in ) :: scolor(:)

integer, intent(in ) :: vtype(:)
integer, intent(in ) :: slope(:)
logical, intent(in ) :: dry(:)
Expand Down Expand Up @@ -1598,6 +1604,8 @@ subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_
write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, flag_iter(i) :', i, blkno, flag_iter(i)
write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, flag_guess(i) :', i, blkno, flag_guess(i)
write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, stype(i) :', i, blkno, stype(i)

write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, scolor(i) :', i, blkno, scolor(i)
write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, vtype(i) :', i, blkno, vtype(i)
write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, slope(i) :', i, blkno, slope(i)
write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, dry(i) :', i, blkno, dry(i)
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_debug.meta
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,13 @@
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[vtype]
standard_name = vegetation_type_classification
long_name = vegetation type for lsm
Expand Down
11 changes: 6 additions & 5 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ subroutine GFS_phys_time_vary_init (
real(kind_phys), intent(in) :: canopy(:)
real(kind_phys), intent(in) :: tg3(:)
integer, intent(in) :: stype(:)

real(kind_phys), intent(in) :: con_t0c

integer, intent(in) :: nthrds
Expand Down Expand Up @@ -469,8 +470,8 @@ subroutine GFS_phys_time_vary_init (
!$OMP shared(isbarren_table,isice_table,isurban_table) &
!$omp shared(iswater_table,laim_table,sla_table,bexp_table) &
!$omp shared(stc,smc,slc,tg3,snowxy,tsnoxy,snicexy,snliqxy) &
!$omp shared(zsnsoxy,STYPE,SMCMAX_TABLE,SMCWLT_TABLE,zs,dzs) &
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
!$omp shared(DWSAT_TABLE,DKSAT_TABLE,PSISAT_TABLE,smoiseq) &
!$omp shared(zsnsoxy,stype,smcmax_table,smcwlt_table,zs,dzs) &
!$omp shared(dwsat_table,dksat_table,psisat_table,smoiseq) &
!$OMP shared(smcwtdxy,deeprechxy,rechxy,errmsg,errflg) &
!$OMP private(vegtyp,masslai,masssai,snd,dzsno,dzsnso,isnow) &
!$OMP private(soiltyp,bexp,smcmax,smcwlt,dwsat,dksat,psisat,ddz)
Expand Down Expand Up @@ -742,7 +743,7 @@ subroutine GFS_phys_time_vary_timestep_init (
kice, ialb, isot, ivegsrc, input_nml_file, use_ufo, nst_anl, frac_grid, fhcyc, phour, &
lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, &
tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, &
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype, shdmin, shdmax, snowd, &
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype,scolor, shdmin, shdmax, snowd, &
cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, &
do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf, errmsg, errflg)

Expand Down Expand Up @@ -789,7 +790,7 @@ subroutine GFS_phys_time_vary_timestep_init (
zorli(:), zorll(:), zorlo(:), weasd(:), snoalb(:), &
canopy(:), vfrac(:), shdmin(:), shdmax(:), &
snowd(:), cv(:), cvb(:), cvt(:), oro(:), oro_uf(:), slmsk(:)
integer, intent(inout) :: vtype(:), stype(:), slope(:)
integer, intent(inout) :: vtype(:), stype(:),scolor(:), slope(:)

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down Expand Up @@ -925,7 +926,7 @@ subroutine GFS_phys_time_vary_timestep_init (
frac_grid, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, tsfc, &
tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, &
zorli, zorll, zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, &
stype, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
stype, scolor, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg)
endif
endif
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_phys_time_vary.fv3.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,13 @@
dimensions = (horizontal_dimension)
type = integer
intent = inout
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_dimension)
type = integer
intent = inout
[shdmin]
standard_name = min_vegetation_area_fraction
long_name = min fractional coverage of green vegetation
Expand Down
14 changes: 8 additions & 6 deletions physics/GFS_surface_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ module GFS_surface_generic_post
!> \section arg_table_GFS_surface_generic_post_init Argument Table
!! \htmlinclude GFS_surface_generic_post_init.html
!!
subroutine GFS_surface_generic_post_init (vtype, stype, slope, vtype_save, stype_save, slope_save, errmsg, errflg)
subroutine GFS_surface_generic_post_init (vtype, stype,scolor, slope, vtype_save, stype_save,scolor_save, slope_save, errmsg, errflg)

integer, dimension(:), intent(in) :: vtype_save, stype_save, slope_save
integer, dimension(:), intent(out) :: vtype, stype, slope
integer, dimension(:), intent(in) :: vtype_save, stype_save,scolor_save, slope_save
integer, dimension(:), intent(out) :: vtype, stype, scolor,slope

! CCPP error handling
character(len=*), intent(out) :: errmsg
Expand All @@ -37,6 +37,7 @@ subroutine GFS_surface_generic_post_init (vtype, stype, slope, vtype_save, stype
! Restore vegetation, soil and slope type
vtype(:) = vtype_save(:)
stype(:) = stype_save(:)
scolor(:) = scolor_save(:)
slope(:) = slope_save(:)

end subroutine GFS_surface_generic_post_init
Expand All @@ -53,7 +54,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, &
nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, paha, ep, ecan, etran, edir, waxy, &
runoff, srunoff, runof, drain, tecan, tetran, tedir, twa, lheatstrg, h0facu, h0facs, zvfun, hflx, evap, hflxq, hffac, &
isot, ivegsrc, islmsk, vtype, stype, slope, vtype_save, stype_save, slope_save, errmsg, errflg)
isot, ivegsrc, islmsk, vtype, stype,scolor, slope, vtype_save, stype_save,scolor_save, slope_save, errmsg, errflg)

implicit none

Expand Down Expand Up @@ -85,8 +86,8 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
real(kind=kind_phys), dimension(:), intent(out) :: hflxq
real(kind=kind_phys), dimension(:), intent(out) :: hffac

integer, intent(in) :: isot, ivegsrc, islmsk(:), vtype_save(:), stype_save(:), slope_save(:)
integer, intent(out) :: vtype(:), stype(:), slope(:)
integer, intent(in) :: isot, ivegsrc, islmsk(:), vtype_save(:), stype_save(:),scolor_save(:), slope_save(:)
integer, intent(out) :: vtype(:), stype(:),scolor(:), slope(:)

! CCPP error handling variables
character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -274,6 +275,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
! Restore vegetation, soil and slope type
vtype(:) = vtype_save(:)
stype(:) = stype_save(:)
scolor(:) = scolor_save(:)
slope(:) = slope_save(:)

end subroutine GFS_surface_generic_post_run
Expand Down
28 changes: 28 additions & 0 deletions physics/GFS_surface_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
dimensions = (horizontal_dimension)
type = integer
intent = out
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_dimension)
type = integer
intent = out
[slope]
standard_name = surface_slope_classification
long_name = sfc slope type for lsm
Expand All @@ -43,6 +50,13 @@
dimensions = (horizontal_dimension)
type = integer
intent = in
[scolor_save]
standard_name = soil_color_classification_save
long_name = soil color for lsm save
units = index
dimensions = (horizontal_dimension)
type = integer
intent = in
[slope_save]
standard_name = surface_slope_classification_save
long_name = sfc slope type for lsm save
Expand Down Expand Up @@ -988,6 +1002,13 @@
dimensions = (horizontal_loop_extent)
type = integer
intent = out
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_loop_extent)
type = integer
intent = out
[slope]
standard_name = surface_slope_classification
long_name = sfc slope type for lsm
Expand All @@ -1009,6 +1030,13 @@
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[scolor_save]
standard_name = soil_color_classification_save
long_name = soil color for lsm save
units = index
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[slope_save]
standard_name = surface_slope_classification_save
long_name = sfc slope type for lsm save
Expand Down
31 changes: 18 additions & 13 deletions physics/GFS_surface_generic_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ module GFS_surface_generic_pre
!> \section arg_table_GFS_surface_generic_pre_init Argument Table
!! \htmlinclude GFS_surface_generic_pre_init.html
!!
subroutine GFS_surface_generic_pre_init (nthreads, im, slmsk, isot, ivegsrc, stype, vtype, slope, &
vtype_save, stype_save, slope_save, errmsg, errflg)
subroutine GFS_surface_generic_pre_init (nthreads, im, slmsk, isot, ivegsrc, stype,scolor, vtype, slope, &
vtype_save, stype_save,scolor_save, slope_save, errmsg, errflg)

implicit none

! Interface variables
integer, intent(in) :: nthreads, im, isot, ivegsrc
real(kind_phys), dimension(:), intent(in) :: slmsk
integer, dimension(:), intent(inout) :: vtype, stype, slope
integer, dimension(:), intent(out) :: vtype_save, stype_save, slope_save
integer, dimension(:), intent(inout) :: vtype, stype, scolor,slope
integer, dimension(:), intent(out) :: vtype_save, stype_save,scolor_save, slope_save

! CCPP error handling
character(len=*), intent(out) :: errmsg
Expand All @@ -49,22 +49,23 @@ subroutine GFS_surface_generic_pre_init (nthreads, im, slmsk, isot, ivegsrc, sty
! Save current values of vegetation, soil and slope type
vtype_save(:) = vtype(:)
stype_save(:) = stype(:)
scolor_save(:) = scolor(:)
slope_save(:) = slope(:)

call update_vegetation_soil_slope_type(nthreads, im, isot, ivegsrc, islmsk, vtype, stype, slope)
call update_vegetation_soil_slope_type(nthreads, im, isot, ivegsrc, islmsk, vtype, stype,scolor, slope)

end subroutine GFS_surface_generic_pre_init

!> \section arg_table_GFS_surface_generic_pre_run Argument Table
!! \htmlinclude GFS_surface_generic_pre_run.html
!!
subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot, ivegsrc, stype, vtype, slope, &
subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot, ivegsrc, stype, scolor,vtype, slope, &
prsik_1, prslk_1, tsfc, phil, con_g, sigmaf, work3, zlvl, &
drain_cpl, dsnow_cpl, rain_cpl, snow_cpl, lndp_type, n_var_lndp, sfc_wts, &
lndp_var_list, lndp_prt_list, &
z01d, zt1d, bexp1d, xlai1d, vegf1d, lndp_vgf, &
cplflx, flag_cice, islmsk_cice, slimskin_cpl, &
wind, u1, v1, cnvwind, smcwlt2, smcref2, vtype_save, stype_save, slope_save, &
wind, u1, v1, cnvwind, smcwlt2, smcref2, vtype_save, stype_save,scolor_save, slope_save, &
errmsg, errflg)

use surface_perturbation, only: cdfnor
Expand All @@ -77,8 +78,8 @@ subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot,

real(kind=kind_phys), intent(in) :: con_g
real(kind=kind_phys), dimension(:), intent(in) :: vfrac, prsik_1, prslk_1
integer, dimension(:), intent(inout) :: vtype, stype, slope
integer, dimension(:), intent(out) :: vtype_save(:), stype_save(:), slope_save(:)
integer, dimension(:), intent(inout) :: vtype, stype,scolor, slope
integer, dimension(:), intent(out) :: vtype_save(:), stype_save(:),scolor_save(:), slope_save(:)

real(kind=kind_phys), dimension(:), intent(inout) :: tsfc
real(kind=kind_phys), dimension(:,:), intent(in) :: phil
Expand Down Expand Up @@ -159,9 +160,10 @@ subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot,
! Save current values of vegetation, soil and slope type
vtype_save(:) = vtype(:)
stype_save(:) = stype(:)
scolor_save(:) = scolor(:)
slope_save(:) = slope(:)

call update_vegetation_soil_slope_type(nthreads, im, isot, ivegsrc, islmsk, vtype, stype, slope)
call update_vegetation_soil_slope_type(nthreads, im, isot, ivegsrc, islmsk, vtype, stype,scolor, slope)

do i=1,im
sigmaf(i) = max(vfrac(i), 0.01_kind_phys)
Expand Down Expand Up @@ -191,16 +193,19 @@ subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot,

end subroutine GFS_surface_generic_pre_run

subroutine update_vegetation_soil_slope_type(nthreads, im, isot, ivegsrc, islmsk, vtype, stype, slope)
subroutine update_vegetation_soil_slope_type(nthreads, im, isot, ivegsrc, islmsk, vtype, stype,scolor, slope)

implicit none

integer, intent(in) :: nthreads, im, isot, ivegsrc, islmsk(:)
integer, intent(inout) :: vtype(:), stype(:), slope(:)
integer, intent(inout) :: vtype(:), stype(:),scolor(:), slope(:)
integer :: i

!$OMP parallel do num_threads(nthreads) default(none) private(i) &
!$OMP shared(im, isot, ivegsrc, islmsk, vtype, stype, slope)
!$OMP shared(im, isot, ivegsrc, islmsk, vtype, stype,scolor, slope)

! scolor is a place holder now, how to update soil color based on the mask/veg/sot src

do i=1,im
if (islmsk(i) == 2) then
if (isot == 1) then
Expand Down
30 changes: 29 additions & 1 deletion physics/GFS_surface_generic_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
dimensions = (horizontal_dimension)
type = integer
intent = inout
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_dimension)
type = integer
intent = inout
[vtype]
standard_name = vegetation_type_classification
long_name = vegetation type for lsm
Expand All @@ -71,6 +78,13 @@
dimensions = (horizontal_dimension)
type = integer
intent = out
[scolor_save]
standard_name = soil_color_classification_save
long_name = soil color for lsm save
units = index
dimensions = (horizontal_dimension)
type = integer
intent = out
[vtype_save]
standard_name = vegetation_type_classification_save
long_name = vegetation type for lsm save
Expand Down Expand Up @@ -162,6 +176,13 @@
dimensions = (horizontal_loop_extent)
type = integer
intent = inout
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_loop_extent)
type = integer
intent = inout
[vtype]
standard_name = vegetation_type_classification
long_name = vegetation type for lsm
Expand Down Expand Up @@ -190,6 +211,13 @@
dimensions = (horizontal_loop_extent)
type = integer
intent = out
[scolor_save]
standard_name = soil_color_classification_save
long_name = soil color for lsm save
units = index
dimensions = (horizontal_loop_extent)
type = integer
intent = out
[slope_save]
standard_name = surface_slope_classification_save
long_name = sfc slope type for lsm save
Expand Down Expand Up @@ -470,4 +498,4 @@
units = 1
dimensions = ()
type = integer
intent = out
intent = out
Loading