-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifications.R
199 lines (152 loc) · 12.2 KB
/
notifications.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
"Notifications and warning / info texts"
# General info texts ####
output$title <- renderUI({
output = tagList()
output[[1]] <- HTML("Extended Smooth Pathway Model (ESPM)<br><span style = 'font-size:20px;'>Calculating Paris compatible emission paths and targets using the example of the EU</span>")
output[[2]] <- actionLink("link_info_general", "", icon = icon("info-circle"), style = "font-size:20px; margin-top:20px; margin-left:10px;")
output[[3]] <- hidden(div(class = "info-box", style = "left:330px; width:500px;", id = "info_general",
HTML("
The Extended Smooth Pathway Model (ESPM) is a model to determine emission paths which are in line with the Paris Agreement. It consists of two calculation steps: (1) Determination of a <b>national budget</b> and (2) derivation of plausible <b>national emission paths</b> from this budget. A <b>brief background</b> paper on the <b>ESPM</b> can be found <a href = 'https://www.klima-retten.info/PDF/ESPM_Background.pdf', target = '_blank'>here</a>.<br /><br />
This app focuses on the EU. A <b>weighting model</b> is offered to determine its <b>emission budget</b>. The weighting is based on the EU's share of global emissions and of global population in the year 2019. The weighted key is then applied to the global budget to determine the EU's budget 2020 - 2100. <br /><br />
The scenario types used to determine the emission paths differ in their <b>assumptions</b> about the <b>annual emission changes</b> (see plot 'Annual emission change rates' and corresponding help text).<br /> <br />
An important question concerns the possibility of future <b>negative emissions</b>. The app allows you specify the potential for net negative emissions. Please refer to the notes in the corresponding help text.<br /><br />
More information about the ESPM, other tools, and publications at: <a href = 'http://www.save-the-climate.info', target = '_blank'>www.save-the-climate.info</a>.<br /><br />
We would also like to point out our web apps for calculating Paris-compatible budgets and emission paths for all countries of the world:
<ul>
<li>CO2 budgets and linear emission paths for all countries in the world: <a href = 'http://national-budgets.climate-calculator.info', target = '_blank'>http://national-budgets.climate-calculator.info</a></li>
<li>Emission paths that adhere to a predefined budget: <a href = 'http://paths.climate-calculator.info', target = '_blank'>http://paths.climate-calculator.info</a></li>
</ul><br /><br />
"),
actionLink("close_info_general", icon = icon("window-close"), label = "Close")))
return(output)
})
showModal(modalDialog(
title = "The Extended Smooth Pathway Model (ESPM)",
HTML("
The Extended Smooth Pathway Model (ESPM) is a model to determine emission paths which are in line with the Paris Agreement. It consists of two calculation steps: (1) Determination of a <b>national budget</b> and (2) derivation of plausible <b>national emission paths</b> from this budget. A <b>brief background</b> paper on the <b>ESPM</b> can be found <a href = 'https://www.klima-retten.info/PDF/ESPM_Background.pdf', target = '_blank'>here</a>.<br /><br />
This app focuses on the EU. A <b>weighting model</b> is offered to determine its <b>emission budget</b>. The weighting is based on the EU's share of global emissions and of global population in the year 2019. The weighted key is then applied to the global budget to determine the EU's budget 2020 - 2100. <br /><br />
The scenario types used to determine the emission paths differ in their <b>assumptions</b> about the <b>annual emission changes</b> (see plot 'Annual emission change rates' and corresponding help text).<br /> <br />
An important question concerns the possibility of future <b>negative emissions</b>. The app allows you specify the potential for net negative emissions. Please refer to the notes in the corresponding help text.<br /><br />
More information about the ESPM, other tools, and publications at: <a href = 'http://www.save-the-climate.info', target = '_blank'>www.save-the-climate.info</a>.<br /><br />
We would also like to point out our web apps for calculating Paris-compatible budgets and emission paths for all countries of the world:
<ul>
<li>CO2 budgets and linear emission paths for all countries in the world: <a href = 'http://national-budgets.climate-calculator.info', target = '_blank'>http://national-budgets.climate-calculator.info</a></li>
<li>Emission paths that adhere to a predefined budget: <a href = 'http://paths.climate-calculator.info', target = '_blank'>http://paths.climate-calculator.info</a></li>
</ul><br /><br />
"),
easyClose = FALSE,
footer = modalButton("Close")
))
# Scenario type ####
observeEvent(input$link_info_scenario_type, {
shinyjs::toggle("info_scenario_type")
})
output$box_info_scenario_type <- renderUI({
hidden(div(class = "info-box", style = "left:330px;", id = "info_scenario_type", HTML("
Scenario types differ regarding the annual emission changes associated with them (see plot 'Annual emission change rates'). Get more information on scenario types here:
<ul><li><a href = 'https://www.klima-retten.info/Downloads/RM-Scenario-Types_short.pdf', target = '_blank'>Short description</a></li>
<li><a href = 'https://www.klima-retten.info/Downloads/RM-Scenario-Types.pdf', target = '_blank'>Comprehensive mathematical description</a></li></ul><br><br>
The 2020 starting change rate used in this web app is the change in emissions from 2018 to 2019.<br><br>
"),
actionLink("close_info_scenario_type", icon = icon("window-close"), label = "Close")
))
})
observeEvent(input$close_info_scenario_type, {
shinyjs::hide("info_scenario_type")
})
# General ####
observeEvent(input$link_info_general, {
shinyjs::toggle("info_general")
})
observeEvent(input$close_info_general, {
shinyjs::hide("info_general")
})
# Global emission budget ####
observeEvent(input$link_info_budget, {
shinyjs::toggle("info_budget")
})
output$base_data_for_display <- renderTable(
tibble(
"Data" = c("Annual emissions EU27", "Annual global emissions"),
"1990" = c(3.80, ""),
"2019" = c(2.91, 40.9),
"Unit" = c("Gt", "Gt")
), bordered = T
)
output$box_info_budget <- renderUI({
hidden(div(class = "info-box", style = "left:380px; width:650px;", id = "info_budget",
HTML("
Regarding the global emission budget, we refer in particular to the <a href = 'https://www.ipcc.ch/report/ar6/wg1/downloads/report/IPCC_AR6_WGI_SPM.pdf', target = '_blank'>IPCC Report AR6/WGI</a> from 2021. According to this report, compliance with the 1.5°C limit corresponds with a probability of 67% to a remaining CO2 budget of 400 Gt. <a href ='https://www.klima-retten.info/PDF/IPCC_AR6_Remaining_Carbon_Budgets.pdf', target = '_blank'>Here</a> we have summarized the statements of the IPCC. The following table summarizes the main results:<br /><br />
"),
tags$img(src = "table_ipcc_emission_budgets.png", width = "400px"), tags$br(), tags$br(),
HTML("
The higher the selected budget, the greater the risk that dangerous tipping points in the climate system will be exceeded.
"), tags$br(), tags$br(),
actionLink("close_info_budget", icon = icon("window-close"), label = "Close")))
})
observeEvent(input$close_info_budget, {
shinyjs::hide("info_budget")
})
# EU emission budget ####
observeEvent(input$link_info_eu_budget, {
shinyjs::toggle("info_eu_budget")
})
output$box_info_eu_budget <- renderUI({
hidden(div(class = "info-box", style = "left:390px;; width:500px;", id = "info_eu_budget",
tableOutput("base_data_for_display"),
HTML("<ul><li>Source for EU emissions: <a href = 'https://www.eea.europa.eu/data-and-maps/data/data-viewers/greenhouse-gases-viewer', target = '_blank'>EEA</a>. The figures used here include land use, land use change and forestry (LULUCF) and 'international transport'.</li><li>Source for global emissions: <a href = 'https://www.globalcarbonproject.org/', target = '_blank'>Global Carbon Project</a></li></ul>"),
HTML("A weighting model is offered to determine the EU's emission budget. The weighting is based on the EU's share of global emissions and of global population. The weighted key is then applied to the global budget to determine the EU's budget 2020 - 2100.<br /><br />"),
HTML("The emission paths presented here may show a small divergence in relation to the emission budget specified. This is due to technical reasons: In some cases, the optimization algorithm does not yield a solution, so that the underlying budget has to be varied. These deviations do not exceed 5% of the budget. The budget which is actually used is displayed in the table above the emission paths.<br /><br />"),
actionLink("close_info_eu_budget", icon = icon("window-close"), label = "Close")))
})
observeEvent(input$close_info_eu_budget, {
shinyjs::hide("info_eu_budget")
})
# Author & Contact ####
observeEvent(input$link_author, {
shinyjs::toggle("info_contact")
})
observeEvent(input$close_author, {
shinyjs::hide("info_contact")
})
output$box_contact <- renderUI({
hidden(div(class = "author-box", id = "info_contact", HTML("<img src = 'daniel_wiegand.gif', style = 'float:left; width:200px; margin-right:20px'>
Programmed by Daniel Wiegand. All code to create this website is available on my <a href = 'https://github.com/danielwiegand/espm', target= '_blank'>GitHub page</a>. For comments and suggestions contact me on daniel.a.wiegand [at] posteo.de.<br><br>
For further information regarding the Extended Smooth Pathway Model, refer to <a href = 'http://save-the-climate.info', target= '_blank'>www.save-the-climate.info</a>.<br>
"),
actionLink("close_author", icon = icon("window-close"), label = "Close", style = "float:right;")))
})
# Negative emissions ####
output$box_info_negative_emissions <- renderUI({
hidden(div(class = "info-box", style = "left:390px; width:500px;", id = "info_negative_emissions",
HTML("
An important question concerns the possibility of future negative emissions. The app allows you specify the potential
for net negative emissions by specifying a percentage that is applied to the current EU emissions. This percentage then
determines the minimum value of the emission paths by 2100.<br /><br />If net negative emissions are allowed, the EU budget
may be temporarily exceeded. This overshoot will then be offset by net negative emissions by 2100. However, it should be
noted that overshoot can also lead to dangerous tipping points in the climate system being exceeded. Also, it should be
pointed out that the costs of actively capturing CO2 are still unclear and that there are major methodological and substantive
problems in quantifying sinks.<br /><br />The actual overshoot
per scenario type is displayed in the table above the emission paths.<br /><br />
Negative CO2 emissions will be necessary to compensate for other greenhouse gases like methane and nitrous oxide, e.g. from agriculture, in order to achieve climate neutrality. These negative CO2 emissions are not considered here and must be provided additionally.<br /><br />
"),
actionLink("close_info_negative_emissions", icon = icon("window-close"), label = "Close")))
})
observeEvent(input$link_info_negative_emissions, {
shinyjs::toggle("info_negative_emissions")
})
observeEvent(input$close_info_negative_emissions, {
shinyjs::hide("info_negative_emissions")
})
# Warning: Too high budget ####
# observeEvent(input$go, {
# if(input$global_emission_budget_gt_2020 > 680 & input$max_negative_emissions_perc > 0) {
# showNotification("You have combined a relatively large global budget with possible net negative emissions. Please note that the resulting emission overshoot increases the risk of exceeding tipping points in the climate system.",
# type = "warning",
# duration = 15)
# } else if(input$global_emission_budget_gt_2020 >= 800 & input$max_negative_emissions_perc == 0) {
# showNotification("You have chosen a relatively high global budget. Please note the higher risk that tipping points in the climate system can be exceeded.",
# type = "warning",
# duration = 15)
# }
# })