Thanks for your patience!
I copied the function ‘sc_compute’ from file ‘new_marginaldamages.jl’ into notebook. (The compute_scco2
function just calls the ‘sc_compute’ function.) The ‘sc_compute’ function calls other functions, some of which then calls other functions. So I also copied functions:
function getindexfromyear
function add_marginal_emissions!
function get_marginal_model
function _compute_sc_from_mm
function _fund_sc_post_trial
@defcomp emissionspulse begin
I copied all of file defmcs.jl
into notebook. The first two lines of the file are:
import Mimi.compinstance
fund_default_mcs = @defsim begin
I am not sure what the first line does but I left it in.
I revised the second line to fund_rev_mcs = @defsim begin. The last 3 lines of the file are:
function getmcs()
return deepcopy(fund_default_mcs)
end
I changed the first 2 of these lines to:
function getmcsrev()
return deepcopy(fund_rev_mcs).
I don’t know what 'return deepcopy means, but I thought it best to change ‘default’ to ‘rev’.
The only change to the RV I made was “climatesensitivity = Normal(1.5,0.00000000000000001)”.
In function compute_sc I changed “simdef = getmcs()” to “simdef = getmcsrev()” which corresponds to the function line of the copied and revised dfmcs.fl file.
To calculate the SCCO2 with Monte Carlo with a changed climate sensitivity of 1.5 I ran:
SCCO2FileName = “scCO2_ecs1_5.csv”
file1 = open(SCCO2FileName, “w”)
m = MimiFUND.get_model()
SCCO2 = MimiFUND.compute_sc(m; gas = :CO2, year = 2020, eta = 0.0, prtp = 0.03, equity_weights = false, equity_weights_normalization_region = 0, last_year = 2400, pulse_size = 1e7, return_mm = true, n = 100, trials_output_filename = “/Users/Ken/Documents/JuliaFUND/scCO2_ecs1_5.csv”);
This runs without errors. This print command “print(mean(SCCO2.sc),” ",median(SCCO2.sc), " “,mode(SCCO2.sc))” gave:
10.687570241976385 9.034459619378786 2.975231737754152
However, the file scCO2_ecs1_5.csv should have displays climate sensitivities of 1.5 as per my modified defmcs. It actualy displays 100 larger CS, of median 3.28 and average 3.48 !! So my attempt to calculate SCC with a modified CS failed. Can you please tell me where I went wrong?
I also investigated the marginal model returned by ;
marg_mco2 = SCCO2.mm[:emissions, :mco2]
for i = 71:451
print(marg_mco2[i],", ")
end
The incremental emissions of CO2 should be a million tonnes CO2 from 10 years starting 2020, but the maximum emissions returned in any year was 3.22e-12 !
My notebook file is at: https://www.dropbox.com/s/wuh5kupkgptepbb/FUND%20Random%20Variables%20for%20SCCO2.ipynb?dl=0