Sub annual definition

107 views
Skip to first unread message

Pietro Pelizzari

unread,
May 27, 2018, 5:10:36 AM5/27/18
to message_ix
Dear message_ix community,

I am trying to implement the definition of sub-annual time slices in the model. I'm beginning from Austria tutorial. Unfortunately, when I try to solve the model, I get an error about temporal resolution ("There is a problem in the definition of the temporal resolution!"). 

I defined the division like this:

horizon = range(2010, 2041, 10)
firstyear = horizon[0]

scenario.add_set("year", horizon)
scenario.add_set("cat_year", ["firstmodelyear", firstyear])

season=['Winter','Summer']

scenario.add_set('time',season)

scenario.add_set("lvl_temporal", "season")

for seas in season:
    scenario.add_set("map_temporal_hierarchy", ["season", seas, "year"])

duration_time = {
    'time': season,
    'value': [0.5]*2,
    'unit': 'y',
    }

scenario.add_par('duration_time',duration_time)

I do not understand why I get such an error. I think it is related to the fact that the sum of the season's duration (0.5 + 0.5) is not equal to the year duration (1). 

I looked into the GAMS file with the parameters integrity check. I think that my problem is related to the following lines of code: 

loop(lvl_temporal,
    loop(time2,
        check = 1$( sum( time$( map_temporal_hierarchy(lvl_temporal,time,time2) ),
            duration_time(time) ) ne duration_time(time2) ) ;
    ) ;
) ;
if (check,
    abort "There is a problem in the definition of the temporal resolution!" ;
);

Thank you in advance to anyone who can give me a hint and an example with sub-annual definition implemented.

Looking forward to it.

Best regards,

Pietro 

HUPPMANN Daniel

unread,
May 29, 2018, 9:57:21 AM5/29/18
to Pietro Pelizzari, message_ix

Hi Pietro,

 

Thanks for identifying this issue – indeed, a bug because of an overzealous consistency check.

 

See this PR https://github.com/iiasa/message_ix/pull/14, which should fix the issue. Can you check out my branch and check if this works as expected now? Please comment on the PR in GitHub whether this works.

 

Best,

Daniel

--
You received this message because you are subscribed to the Google Groups "message_ix" group.
To unsubscribe from this group and stop receiving emails from it, send an email to message_ix+...@googlegroups.com.
To post to this group, send email to messa...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/message_ix/0f4cfb75-523f-4380-94a1-13c268f6b74f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages