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

Fix harvest-related values on surface datasets for smallville and other cases with all_veg #1019

Merged
merged 2 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<test name="ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropQianGs.cheyenne_gnu.clm-monthly">
<phase name="RUN">
<status>FAIL</status>
<issue>#158</issue>
<issue>#203</issue>
</phase>
</test>

Expand Down
10 changes: 9 additions & 1 deletion tools/mksurfdata_map/src/mksurfdat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ program mksurfdat
type(pct_pft_type), allocatable :: pctnatpft_max(:) ! % of grid cell maximum PFTs of the time series
type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs
type(pct_pft_type), allocatable :: pctcft_max(:) ! % of grid cell maximum CFTs of the time series
real(r8) :: harvest_initval ! initial value for harvest variables
real(r8), pointer :: harvest1D(:) ! harvest 1D data: normalized harvesting
real(r8), pointer :: harvest2D(:,:) ! harvest 1D data: normalized harvesting
real(r8), allocatable :: pctgla(:) ! percent of grid cell that is glacier
Expand Down Expand Up @@ -568,7 +569,14 @@ program mksurfdat
ndiag=ndiag, pctlnd_o=pctlnd_pft, pctnatpft_o=pctnatpft, pctcft_o=pctcft)

! Create harvesting data at model resolution
call mkharvest_init( ns_o, spval, harvdata, mksrf_fhrvtyp )
if (all_veg) then
! In this case, we don't call mkharvest, so we want the harvest variables to be
! initialized reasonably.
harvest_initval = 0._r8
else
harvest_initval = spval
end if
call mkharvest_init( ns_o, harvest_initval, harvdata, mksrf_fhrvtyp )
if ( .not. all_veg )then

call mkharvest( ldomain, mapfname=map_fharvest, datfname=mksrf_fhrvtyp, &
Expand Down