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

Update TIMES source code to v4.7.8 #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions source/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# do not attempt any end-of-line conversion
* -text
# Exclude files from archive
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore

# These files are in the GAMS language
*.gms linguist-language=GAMS
*.mod linguist-language=GAMS
Expand All @@ -8,6 +13,7 @@
*.def linguist-language=GAMS
*.dsc linguist-language=GAMS
*.cli linguist-language=GAMS
*.ecb linguist-language=GAMS
*.etl linguist-language=GAMS
*.ier linguist-language=GAMS
*.lin linguist-language=GAMS
Expand Down
34 changes: 34 additions & 0 deletions source/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve TIMES
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Provide information for reproducing the bug, as much in detail as possible:
- Which TIMES feature used in your model appears to be triggering the bad behavior?
- What exactly is the manifested incorrect or undesirable behaviour?
- Which steps would be needed to be able to reproduce the bad behavior?

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Test case**
If possible, attach a ZIP file containing the TIMES input files (*.DD, \*.RUN) and the listing file (\*.LST) for a test case reproducing the issue.

**Versions (please complete the following information):**
- GAMS version used (e.g. GAMS 27.3)
- TIMES version used (see version info in QA_Check.log)
- Operating system (if not Windows)

**Additional context**
Add any other context about the problem here.
22 changes: 22 additions & 0 deletions source/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea for ETSAP-TIMES
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a modeling issue? Please describe.**
A clear and concise description of what the modeling issue is. Ex.: I'm always frustrated when [...]

**Describe the solution you'd like to have implemented**
A clear and concise description of the new or improved functionality:
- If applicable, describe the new input attribute(s) needed for the new feature(s)
- Describe what should happen when the new or improved feature(s) are used

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
99 changes: 98 additions & 1 deletion source/Version.log
Original file line number Diff line number Diff line change
Expand Up @@ -2749,4 +2749,101 @@ Modified files: (reason)
initsys.mod : Increased version number to 4.7.3
setglobs.gms : (1)
coef_obj.mod : (1)
mod_vars.cli : (2)
mod_vars.cli : (2)

-----------------------------------------------------------------------------------------
TIMES Version 4.7.4
-----------------------------------------------------------------------------------------
Date: 13-Oct-2023 [AL]: Maintenance release
1) Fixed bug related to zero new capacities when deriving logit market shares
2) Fixed bug related to zero SHAPE values for NCAP_CPX
3) Cosmetic improvements

Modified files: (reason)
initsys.mod : Increased version number to 4.7.4
ppmain.mod : (3)
coef_shp.mod : (2)
eqobjvar.mod : (3)
eqobjels.mod : (3)
eqobjvar.rpt : (3)
equ_ext.abs : (3)
rpt_ext.ecb : (1)

-----------------------------------------------------------------------------------------
TIMES Version 4.7.5
-----------------------------------------------------------------------------------------
Date: 28-Oct-2023 [AL]: Maintenance release
1) Fixed divide by zero error in certain condition of PASTI with ILED within active horizon
2) Added support for NCAP_ICOM for past investments
3) Cosmetic improvements

Modified files: (reason)
initsys.mod : Increased version number to 4.7.5
ppmain.mod : (1)
cal_cap.mod : (2)
bndmain.mod : (3)
bnd_stg.mod : (3)
initmty.vda : (3)
eqactups.vda : (3)

-----------------------------------------------------------------------------------------
TIMES Version 4.7.6
-----------------------------------------------------------------------------------------
Date: 15-Nov-2023 [AL]: Maintenance release
1) Fixed bug in ECB extension when defining multiple markets with Logit choices
2) Added stochastic support for flexible STS storage option (STSFLX)
3) Cosmetic improvements

Modified files: (reason)
initsys.mod : Increased version number to 4.7.6
maindrv.mod : (3)
setglobs.gms : (3)
eqstgtss.mod : (2)
eqdamage.mod : (3)
preshape.gms : (3)
solve.stp : (3)
prepret.dsc : (3)
recurrin.stc : (3)
ppm_ext.ecb : (1)

-----------------------------------------------------------------------------------------
TIMES Version 4.7.7
-----------------------------------------------------------------------------------------
Date: 27-Dec-2023 [AL]: Maintenance release
1) Fixed divide by zero issue in the ECB extension
2) Performance improvement for EQ_PEAK in large models
3) Added optional output attribute for process units
4) Cosmetic improvements

Modified files: (reason)
initsys.mod : Increased version number to 4.7.7
initmty.mod : (4)
units.def : (3)
setglobs.gms : (2)
pp_lvlpk.mod : (2)
pp_shapr.mod : (2)
pp_reduce.red : (2)
eqpeak.mod : (2)
cal_ire.mod : (2)
err_stat.mod : (4)
rpt_ext.ecb : (1)
solsetv.v3 : (3)

-----------------------------------------------------------------------------------------
TIMES Version 4.7.8
-----------------------------------------------------------------------------------------
Date: 19-Jan-2024 [AL]: Maintenance QA release
1) Added QA checks against invalid attributes
2) Improved topology check for auxiliary IRE flows
3) Small performance/cosmetic improvements

Modified files: (reason)
initsys.mod : Increased version number to 4.7.8
ppmain.mod : (1),(2)
setglobs.gms : (1)
pp_lvlpk.mod : (3)
eqpeak.mod : (3)
cal_fflo.mod : (3)
pp_qack.mod : (1)
init_ext.vda : (2)
pp_prelv.vda : (3)
7 changes: 4 additions & 3 deletions source/bnd_stg.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

* set bounds at process activity level
TRACKP(RP(R,P))$((NOT PRC_VINT(R,P))$PRC_MAP(R,'STG',P)) = YES;
STG%2_BND(R,T,P,C,S,BD)$((NOT TOP(R,P,C,'%2'))$RP_STG(R,P)) = 0;

$IF %STAGES% == YES LOOP(SW_T(T%SWD%),

%VAR%_%1.LO(RTP_VINTYR(R,T,T,P),C,S%SWD%)$(RPCS_VAR(R,P,C,S)$TRACKP(R,P)) $= %2_BND(R,T,P,C,S,'LO');
%VAR%_%1.UP(RTP_VINTYR(R,T,T,P),C,S%SWD%)$(RPCS_VAR(R,P,C,S)$TRACKP(R,P)) $= %2_BND(R,T,P,C,S,'UP');
%VAR%_%1.FX(RTP_VINTYR(R,T,T,P),C,S%SWD%)$(RPCS_VAR(R,P,C,S)$TRACKP(R,P)) $= %2_BND(R,T,P,C,S,'FX');
%VAR%_%1.LO(RTP_VINTYR(R,T,T,P),C,S%SWD%)$(RPCS_VAR(R,P,C,S)$TRACKP(R,P)) $= STG%2_BND(R,T,P,C,S,'LO');
%VAR%_%1.UP(RTP_VINTYR(R,T,T,P),C,S%SWD%)$(RPCS_VAR(R,P,C,S)$TRACKP(R,P)) $= STG%2_BND(R,T,P,C,S,'UP');
%VAR%_%1.FX(RTP_VINTYR(R,T,T,P),C,S%SWD%)$(RPCS_VAR(R,P,C,S)$TRACKP(R,P)) $= STG%2_BND(R,T,P,C,S,'FX');

$IF %STAGES% == YES );
OPTION CLEAR=TRACKP;
4 changes: 2 additions & 2 deletions source/bndmain.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ $ BATINCLUDE bnd_flo.%1
*-----------------------------------------------------------------------------
* limit on storage
*-----------------------------------------------------------------------------
$ BATINCLUDE bnd_stg.%1 SIN STGIN 0
$ BATINCLUDE bnd_stg.%1 SOUT STGOUT -INF
$ BATINCLUDE bnd_stg.%1 SIN IN 0
$ BATINCLUDE bnd_stg.%1 SOUT OUT -INF

*-----------------------------------------------------------------------------
* limit on total installation of new capacity
Expand Down
4 changes: 1 addition & 3 deletions source/cal_cap.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* CAL_NCOM: the term associated with invest/decommission commodities in the EQ_COMxxx
SUM(RPC_CAPFLO(R,V,P,C)$COEF_%2COM(R,V,T,P,C), COEF_%2COM(R,V,T,P,C) *
%3
G_YRFR(R,S) * (%VARV%_NCAP%4(R,V,P %SWS%)$T(V)
$ IF '%2'=='O' + NCAP_PASTI(R,V,P)$PASTYEAR(V)
)
G_YRFR(R,S) * (%VARV%_NCAP%4(R,V,P %SWS%)$T(V)+NCAP_PASTI(R,V,P)$PASTYEAR(V))
)
*$OFFLISTING
25 changes: 12 additions & 13 deletions source/cal_fflo.mod
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright (C) 2000-2023 Energy Technology Systems Analysis Programme (ETSAP)
* Copyright (C) 2000-2024 Energy Technology Systems Analysis Programme (ETSAP)
* This file is part of the IEA-ETSAP TIMES model generator, licensed
* under the GNU General Public License v3.0 (see file NOTICE-GPLv3.txt).
*=============================================================================*
* CAL_FFLO the code associated with the flow variable in the EQ_COMxxx
* %1 - 'IN/OUT' for consumption/production
** %2 - 'I/O' for for invest/decommission checks (for now - NO LONGER USED)
** %2 - 'I/O' for invest/decommission checks (no longer used)
* %3 - * Peak multiplier
* %4 - Peak by flow contribution
*=============================================================================*
*GaG Questions/Comments:
* - VAR_FLOs according to whether c-in-PCG otherwise RPS_S1
*-----------------------------------------------------------------------------
$IF %REDUCE% == 'YES' $GOTO REDUCE
$IF %REDUCE% == YES $GOTO REDUCE
$SET SHP1 "" SET SHG ",P,CG3,C"
$IF DEFINED RTP_FFCS $SET SHP1 "*(%SHFF%S(R,V%SHG%%SOW%))"
$SET SHP1 "*(%SHFF%X(R,V,T%SHG%)$PRC_VINT(R,P))%SHP1%"
*-----------------------------------------------------------------------------
*V05c 980923 - check that commodity not just capacity related
SUM(TOP(RP_FLO(R,P),C,'%1')$(NOT RPC_EMIS(R,P,C)),
SUM(RTPCS_VARF(R,T,P,C,TS),
SUM(RTP_VINTYR(R,V,T,P), %VAR%_FLO(R,V,T,P,C,TS %SOW%)
SUM((RTP_VINTYR(R,V,T,P),RTPCS_VARF(R,T,P,C,TS)),
* equation coarser than variable or equation finer than variable
*M2T* consider COM_TS shape too, so both TS_MAP and TS_BELOW both embedded
%3) * RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS)))
* consider COM_TS shape too, so both TS_MAP and RS_BELOW embedded
%VAR%_FLO(R,V,T,P,C,TS %SOW%) * RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS)) %3)
) +
* [AL] Handle RPC_EMIS flows separately; They cannot be NOFLO
* Handle RPC_EMIS flows separately; They cannot be NOFLO
SUM(TOP(RPC_EMIS(RP_FLO(R,P),C),'%1'),
SUM((FS_EMIS(R,P,CG3,COM2,C),RTPCS_VARF(R,T,P,COM2,TS))$RS_TREE(R,S,TS),
SUM(RTP_VINTYR(R,V,T,P),%VAR%_FLO(R,V,T,P,COM2,TS %SOW%) *
Expand All @@ -35,18 +35,17 @@ $EXIT
*-----------------------------------------------------------------------------
$LABEL REDUCE
* [UR] model reduction %REDUCE% is set in *.run
*[AL] Sum over non-vintaged processes
* Sum over non-vintaged processes
SUM(TOP(RP_FLO(R,P),C,'%1')$(NOT PRC_VINT(R,P)),
SUM((RTP_VINTYR(R,V(T),T,P),RTPCS_VARF(R,T,P,C,TS)),
$ BATINCLUDE cal_red.red C COM TS P T '' T
* equation coarser than variable or equation finer than variable
%3 * RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS)))
* RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS)) %3)%4
) +

*[AL] Sum over vintaged processes
SUM((TOP(PRC_VINT(RP_FLO(R,P)),C,'%1'),RTPCS_VARF(R,T,P,C,TS)),
* Sum over vintaged processes
SUM((TOP(PRC_VINT(RP_FLO(R,P)),C,'%1'),RTPCS_VARF(R,T,P,C,TS))%4,
$ BATINCLUDE cal_red.red C COM TS P T '' V SUM 'RTP_VINTYR(R,V,T,P),' %3
* equation coarser than variable or equation finer than variable
* RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS))
) +

21 changes: 8 additions & 13 deletions source/cal_ire.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,27 @@ $IF DEFINED RTP_FFCS $SET MX "(%SHFF%S(R,V,P,C,C%SOW%))*"
*V0.9 022100 - handle the fact that called 2x for aux
$SET IE '%3'
$IF '%IE%'=='' $SET IE "'%1'"
$IF '%1' == 'EXP'
$IF '%2' == 'OUT' $GOTO AUXONLY
$IF '%1' == 'IMP'
$IF '%2' == 'IN' $GOTO AUXONLY
$IF '%1%2' == 'EXPOUT' $GOTO AUXONLY
$IF '%1%2' == 'IMPIN' $GOTO AUXONLY
* actual exchange
*V05c 980923 - check that commodity not just capacity related
*V05c 981016 - change RTPCS_VARFs to ts
SUM((RPC_IRE(%6R,P%7,C,'%1'),RTPCS_VARF(R,T,P,C,TS)),
SUM((RPC_IRE(%6R,P%7,C,'%1'),RTPCS_VARF(R,T,P,C,TS))$RS_FR(R,S,TS),
SUM(RTP_VINTYR(R,V,T,P),
(%VAR%_IRE(R,V,T,P,C,TS,'%1'%SOW%)$(NOT RPC_AIRE(R,P,C))+(%VAR%_ACT(R,V,T,P,TS%SOW%)*PRC_ACTFLO(R,V,P,C))$RPC_AIRE(R,P,C)
)%4
) *
RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS))
) * RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS))
) +

$IF SET IREAUXBAL %IREAUXBAL% %2 %5
$LABEL AUXONLY
*V0.5b handle auxillary commodity flows too
*** NOTE: assumes that attribute at the same level as the variable!!!
*V0.5b handle auxiliary commodity flows too
*** NOTE: assumes that attribute at the same level as the variable!!
*V0.9 022100 - do IN/OUT explicitly
SUM((RPC_IRE(%6R,P%7,COM,%IE%),RTPCS_VARF(R,T,P,COM,TS))$IRE_FLOSUM(R,T,P,COM,TS,%IE%,C,'%2'),
SUM((RPC_IRE(%6R,P%7,COM,%IE%),RTPCS_VARF(R,T,P,COM,TS))$(IRE_FLOSUM(R,T,P,COM,TS,%IE%,C,'%2')$RS_FR(R,S,TS)),
IRE_FLOSUM(R,T,P,COM,TS,%IE%,C,'%2') *
SUM(RTP_VINTYR(R,V,T,P), %MX%
(%VAR%_IRE(R,V,T,P,COM,TS,%IE%%SOW%)$(NOT RPC_AIRE(R,P,COM))+(%VAR%_ACT(R,V,T,P,TS%SOW%)*PRC_ACTFLO(R,V,P,COM))$RPC_AIRE(R,P,COM)
)%4
) *
RS_FR(R,S,TS)*(1+RTCS_FR(R,T,COM,S,TS))
) * RS_FR(R,S,TS)*(1+RTCS_FR(R,T,COM,S,TS))
) +
*$OFFLISTING
2 changes: 1 addition & 1 deletion source/coef_shp.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
RVPRL(RTP)$((COEF_RPTI(RTP)>1)$NCAP_CPX(RTP)) = ROUND(NCAP_TLIFE(RTP)-1)+EPS;
COEF_CAP(RTP_CPTYR(R,V(TT),T,P))$RVPRL(R,V,P) =
SUM(OPYEAR(AGE+RVPRL(R,V,P),LIFE),SHAPE(J+(NCAP_CPX(R,V,P)-1),LIFE)) / (RVPRL(R,V,P)+1);
COEF_CAP(R,V,T,P)$COEF_CAP(R,V,T,P) = 1/MAX(1,COEF_CPT(R,V,T,P)/COEF_CAP(R,V,T,P))-1;
COEF_CAP(RTP_CPTYR(R,V,T,P))$NCAP_CPX(R,V,P) = (1/MAX(1,COEF_CPT(R,V,T,P)/COEF_CAP(R,V,T,P)))$COEF_CAP(R,V,T,P)-1;
);
OPTION RTP_CPX <= COEF_CAP;
COEF_CPT(R,V,T,P)$COEF_CAP(R,V,T,P) = COEF_CPT(R,V,T,P)*(COEF_CAP(R,V,T,P)+1);
Expand Down
2 changes: 1 addition & 1 deletion source/eqactups.vda
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $IFI %OBMAC%==YES $macro var_sift(v,s,l) %var%_udp(r,v,t,p,s,l%sow%)*prc_capact(
SUM(PRC_TS(R,P,TS)$RS_BELOW1(R,S,TS),%VAR%_ACT(R,V,T,P,TS%SOW%))$STG_SIFT(RTP,%PGPRIM%,S) +
SUM((TOP(RPC_STG(R,P,C),'OUT'),RPCS_VAR(R,P,C,TS)),%VAR%_SOUT(R,V,T,P,C,TS%SOW%))$ANNUAL(S)$ACTCG(COM) +
(%VAR%_SIN(R,V,T,P,COM,S%SOW%) + %VAR%_ACT(R,V,T,P,S%SOW%))$PRC_TS(R,P,S) + %VAR%_SOUT(R,T,T,P,%PGPRIM%,S%SOW%) -
SUM((TOP(RPC_STG(R,P,C),'OUT'),RTCS_VARC(RTC(R,T,C),TS))$RS_FR(R,S,TS),(STG_SIFT(RTP,C,TS)$(PRC_TS(R,P,S)+ANNUAL(S)$ACTCG(COM))+STG_SIFT(RTP,%PGPRIM%,S))*%VAR%_COMPRD(RTC,TS%SOW%)/COM_IE(RTC,TS)*RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS)))) -
SUM((TOP(RPC_STG(R,P,C),'OUT'),RTCS_VARC(RTC(R,T,C),TS))$RS_FR(R,S,TS),(STG_SIFT(RTP,C,TS)$(PRC_TS(R,P,S)+ANNUAL(S)$ACTCG(COM))+STG_SIFT(RTP,%PGPRIM%,S))*%VAR%_COMPRD(R,T,C,TS%SOW%)/COM_IE(RTC,TS)*RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS)))) -
* Get net sifting, force zero shifting at seasonal level
SUM(BD(L)$LNX(L),
(SUM((TOP(RPC_STG(R,P,C),'OUT'),RPCS_VAR(R,P,C,TS))$RS_FR(R,S,TS),%VAR%_SOUT(R,V,T,P,C,TS%SOW%)*RS_FR(R,S,TS)*(1+RTCS_FR(R,T,C,S,TS))) -
Expand Down
Loading