Skip to content

Commit

Permalink
Initialize harvest variables to 0 when using all_veg
Browse files Browse the repository at this point in the history
I'm hopeful that this will address #203
  • Loading branch information
billsacks committed May 20, 2020
1 parent bb3f8e8 commit 633be0e
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 633be0e

Please sign in to comment.