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

tested if solar forcing was an issue: #40

Merged
merged 1 commit into from
Jul 11, 2024
Merged
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
49 changes: 49 additions & 0 deletions side_testing/check_solar.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
library(hector)
library(ggplot2)

# Setting up file paths
COMP_DATA_DIR <- file.path(here::here(), "comparison_data")
SCRIPTS_DIR <- file.path(here::here(), "scripts")
RESULTS_DIR <- file.path(here::here(), "results")

CO2_PATH <- file.path(COMP_DATA_DIR,
"Supplementary_Table_UoM_GHGConcentrations-1-1-0_annualmeans_v23March2017.csv")
TEMP_PATH <-
file.path(COMP_DATA_DIR,
"HadCRUT.5.0.2.0.analysis.summary_series.global.annual.csv")

OHC_PATH <- file.path(COMP_DATA_DIR, "OHC_ensemble_Kuhlbrodt_etal_2022.csv")


INI_FILE <- system.file("input/hector_ssp245.ini", package = "hector")
SOLAR_FILE <- here::here("side_testing",
"hector_inputs",
"hector_ssp245_solar.ini")
YRS <- 1750:2300
VARS <- GMST()


source(file.path(SCRIPTS_DIR, "major_functions.R"))

default_data <- run_hector(INI_FILE,
params = NULL,
vals = NULL,
yrs = YRS,
vars = VARS)
default_data$scenario <- "Default"

solar_data <- run_hector(SOLAR_FILE,
params = NULL,
vals = NULL,
yrs = YRS,
vars = VARS)
solar_data$scenario <- "With solar forcing"

temp_data <- get_temp_data(TEMP_PATH, include_unc = F)

comb_data <- rbind(default_data, solar_data, temp_data)

ggplot(data = comb_data, aes(x = year, y = value, col = scenario)) +
geom_line()


Binary file added side_testing/hector_inputs/.DS_Store
Binary file not shown.
390 changes: 390 additions & 0 deletions side_testing/hector_inputs/hector_ssp245_solar.ini

Large diffs are not rendered by default.

276 changes: 276 additions & 0 deletions side_testing/hector_inputs/tables/ar6_historical_constraint.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
; historical from ar6
; hectordata 0.0.0.9000
; commit 973edbec8b34a20
; date Thu Nov 17 17:42:00 2022
; UNITS:, W/m2
Date,RF_tot_constrain
1750,0.29756832829343
1751,0.286266210509893
1752,0.26143723156581
1753,0.22423577922106
1754,0.184177951263024
1755,0.139594933196907
1756,-0.114236470408888
1757,0.0424867237261421
1758,0.18615277991695
1759,0.268224658548362
1760,0.300466537080801
1761,0.303081321076319
1762,-0.718953663205658
1763,-0.439127442426087
1764,-0.0167081250528877
1765,0.106302416652438
1766,-0.219144941084392
1767,-0.261866534123459
1768,0.0720760468816915
1769,0.260264888082283
1770,0.186941016601666
1771,0.248894134166424
1772,0.301363603348031
1773,0.29112144561803
1774,0.247996759600568
1775,0.223745172915525
1776,0.209034517481103
1777,0.210629852161059
1778,0.253285399358598
1779,0.331593446657186
1780,0.36869647352268903
1781,0.375199189291663
1782,0.354045072667146
1783,-1.67091745641655
1784,-3.79329036441763
1785,-1.4332107360094
1786,-0.516540805435524
1787,-0.0707645549723163
1788,0.193440150457736
1789,0.353091321750534
1790,0.40563368542043
1791,0.409865706505716
1792,0.399964350078653
1793,0.371122257786018
1794,0.324059356816519
1795,0.294536587536076
1796,0.122499877242158
1797,-0.0151953530346514
1798,0.0824345592295064
1799,0.179981068108658
1800,0.22902586814922
1801,0.276506937850886
1802,0.308997725479244
1803,0.334230810772674
1804,0.343196404147288
1805,0.327745220273423
1806,0.318735026109401
1807,0.29746532423012
1808,0.266834858235871
1809,-3.69197371162075
1810,-2.53610914380461
1811,-0.752938832552258
1812,-0.0811020283048241
1813,0.158023488169614
1814,0.243612732647097
1815,-3.61155369412795
1816,-4.69408423892097
1817,-1.57045284110811
1818,-0.33309003950265
1819,0.0869139749480436
1820,0.209563251604527
1821,0.131312582934945
1822,0.127342222490011
1823,-0.241133817017888
1824,0.041877156154016
1825,0.22197252988314
1826,0.316698363114002
1827,0.358122246605193
1828,0.361090238282733
1829,0.360628708075089
1830,0.339260805370805
1831,-2.37701160970229
1832,-1.56888051312843
1833,-0.386502346490063
1834,0.0509361230975482
1835,-1.73468938712666
1836,-1.01534907321983
1837,-0.0778639081590797
1838,0.260570932909818
1839,0.36265497357204
1840,0.377060687752876
1841,0.356246832106129
1842,0.328233462468465
1843,0.307153716576488
1844,0.291595805244126
1845,0.282012171580596
1846,0.0980966919494134
1847,0.166828299964033
1848,0.259626745044065
1849,0.309506444783968
1850,0.330573173486921
1851,0.340821685649772
1852,0.341398901841913
1853,0.150341871694166
1854,0.0900640237442857
1855,0.232693211158731
1856,0.241974741275506
1857,0.0610756282548541
1858,0.224181980016586
1859,0.315953089881431
1860,0.353000828060412
1861,0.277788992409557
1862,-0.537983130831677
1863,-0.130356436159427
1864,0.196266661396181
1865,0.299371603632662
1866,0.340887321515749
1867,0.342884573018746
1868,0.350764377710576
1869,0.377857932353126
1870,0.375190955562687
1871,0.394513965885742
1872,0.387405381701872
1873,0.127455086744586
1874,0.268984909398822
1875,0.279353381270153
1876,0.281683800381646
1877,0.322359499045028
1878,0.335290099286013
1879,0.332550128824511
1880,0.295453771007912
1881,0.317241293493722
1882,0.366982527654241
1883,-0.342921695205167
1884,-1.76623178075425
1885,-0.495433575556382
1886,0.0584775656224174
1887,0.128797743307213
1888,0.283444289318954
1889,0.350247294294797
1890,0.163258548595196
1891,0.0572050674031852
1892,0.286505096628909
1893,0.439932747585831
1894,0.449882257363621
1895,0.435054180739088
1896,0.413653805977252
1897,0.387295559607382
1898,0.376296350584558
1899,0.347274454877185
1900,0.339334662223399
1901,0.331694252287587
1902,0.0991691557157709
1903,-0.599713484742594
1904,-0.121548837806503
1905,0.218511248646372
1906,0.340981015029536
1907,0.13329726180818
1908,0.278007287973524
1909,0.325796473005325
1910,0.297694911656168
1911,0.300784491284828
1912,-0.283521906559721
1913,-0.199670062786848
1914,0.153958609593459
1915,0.382038487200863
1916,0.421617774911794
1917,0.434293350798798
1918,0.449111939479283
1919,0.488735541160009
1920,0.42987415722428
1921,0.493895451236012
1922,0.340817383086549
1923,0.359556786228573
1924,0.465389724384107
1925,0.489350355682275
1926,0.50646745505676
1927,0.506875366308973
1928,0.452696746600377
1929,0.224766680644475
1930,0.477797214346462
1931,0.534851090487314
1932,0.37943754223044
1933,0.510727918598949
1934,0.51799847308973
1935,0.528004936238453
1936,0.561884802635581
1937,0.554261753182864
1938,0.60173020730031
1939,0.57032141391451
1940,0.520841138337772
1941,0.501564329360191
1942,0.475286256026022
1943,0.464872712466813
1944,0.487595560302761
1945,0.604181381486513
1946,0.640887058322145
1947,0.640581886439904
1948,0.630054711959746
1949,0.665480598379133
1950,0.587848310529736
1951,0.552024615629804
1952,0.538355436923028
1953,0.520261174132122
1954,0.525887364453035
1955,0.520844444515006
1956,0.541069873174516
1957,0.574587491392714
1958,0.613839973826166
1959,0.57602812446895
1960,0.536675799725466
1961,0.463667642558856
1962,0.264327856647978
1963,-0.668736887612652
1964,-0.396074819002629
1965,-0.0768941533529485
1966,0.415946173122402
1967,0.189793860895515
1968,0.331746198724609
1969,0.436893927070503
1970,0.418944029116874
1971,0.284737261149823
1972,0.392233069028374
1973,0.547735049819863
1974,0.455921294021705
1975,0.263639935178371
1976,0.494557868565099
1977,0.663437129246077
1978,0.786271638594812
1979,0.843821740440933
1980,0.857550522571526
1981,0.91034216300612
1982,0.53003972178417
1983,0.192163227402298
1984,0.632302488385552
1985,0.918400386825284
1986,0.972051479625749
1987,1.07221869222474
1988,1.24235855367021
1989,1.40777934802107
1990,1.41618514460756
1991,0.654347199421066
1992,-0.39680356970908
1993,0.566546789532499
1994,1.22849420069283
1995,1.51674825687423
1996,1.64210301198028
1997,1.55895898086688
1998,1.69994097218484
1999,1.93355022574648
2000,2.02557893057251
2001,2.04229341328736
2002,2.00722302833322
2003,1.93456912413338
2004,1.95740357682401
2005,1.90430929551338
2006,1.88466986643859
2007,1.94246873379536
2008,2.05169276112923
2009,2.12821174804192
2010,2.23690363312659
2011,2.2897895942441
2012,2.35742109029523
2013,2.52599096296346
2014,2.55824234562296
2015,2.62144376542819
2016,2.6310035236805702
2017,2.66115935109899
2018,2.6954156039762
2019,2.74577704374432
Loading
Loading