Skip to content

Commit

Permalink
fixed division by zero in preloop and updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidhoPIK committed May 23, 2024
1 parent 8050353 commit e2f3698
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### changed
- **14_yields** fix division by zero in preloop of managementcalib_aug19
- **22_land_conservation and default.cfg** Added options for baseline protection
- **15_food, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying food substitution scenarios and exogeneous food intake scenarios
- **70_livestock, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying feed substitution with SCP scenarios
Expand Down
4 changes: 2 additions & 2 deletions modules/14_yields/managementcalib_aug19/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ if ((s14_calib_ir2rf = 1),
* Calibrate newly calibrated yields to FAO yields
i14_modeled_yields_hist2(i,knbe14)
= (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib("y1995",j,knbe14,w)) /
sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14))>0)
sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14))>0.00001)
+ (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * f14_yields("y1995",j,knbe14,w)) /
sum((cell(i,j),w), i14_croparea_total("y1995",w,j)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14))=0);
sum((cell(i,j),w), i14_croparea_total("y1995",w,j)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14))<0.00001);

i14_yields_calib(t,j,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) /
i14_modeled_yields_hist2(i,knbe14)) *
Expand Down

0 comments on commit e2f3698

Please sign in to comment.