JGCRI / trackingC

Where does fossil fuel C end up, and how does that change with changing parameters?
MIT License
3 stars 0 forks source link

Airborne fraction trend #44

Closed leeyap closed 2 years ago

leeyap commented 2 years ago

Following the discussion in #37, here is code that calculates the airborne fraction decadal trend from 1960-2020 by scenario and computation method.

Interesting to note that the mathematical definition returns trend numbers very similar to those in van Marle et al., although with a much lower error, but the carbon tracking method's trends are much smaller values.

leeyap commented 2 years ago
> clean_trend
# A tibble: 10 x 5
   ssp    computation       trend     error   p.value
   <chr>  <chr>             <dbl>     <dbl>     <dbl>
 1 ssp126 ClassicAF     -0.0281   0.000137  0        
 2 ssp245 ClassicAF     -0.0282   0.000140  0        
 3 ssp370 ClassicAF     -0.0277   0.000146  0        
 4 ssp460 ClassicAF     -0.0320   0.000134  0        
 5 ssp585 ClassicAF     -0.0266   0.000147  0        
 6 ssp126 EmissFraction -0.000867 0.0000273 3.50e-218
 7 ssp245 EmissFraction -0.000946 0.0000272 2.06e-259
 8 ssp370 EmissFraction -0.000542 0.0000270 3.33e- 89
 9 ssp460 EmissFraction -0.000447 0.0000274 1.36e- 59
10 ssp585 EmissFraction -0.000929 0.0000263 3.18e-268
bpbond commented 2 years ago

It'd be interesting to put our results in the context of Figure 4 of Van Marle et al. 2022:

41586_2021_4376_Fig4_HTML

leeyap commented 2 years ago

Is "slope of LULCC emissions" computed like we did the AF trend?

bpbond commented 2 years ago

@leeyap I think it would be, yes.

leeyap commented 2 years ago

Will push up in a bit, but results:

  ssp     trend   error   avg
  <chr>   <dbl>   <dbl> <dbl>
1 ssp126 -0.144 0.00124  1.66
2 ssp245 -0.142 0.00127  1.67
3 ssp370 -0.133 0.00124  1.68
4 ssp460 -0.172 0.00133  1.63
5 ssp585 -0.133 0.00123  1.70

This doesn't feel right per the chart above. I took the mean luc_emissions by scenario over all runs to find the "avg" values, and used the same method as above for the trend. But using those values plots us off the chart, and not where our AF trend tells us we should be.

bpbond commented 2 years ago

I get a slope of -0.011 PgC/yr:

luc

leeyap commented 2 years ago

What were your lm arguments?

bpbond commented 2 years ago

Just luc_data %>% filter(year %in% 1960:2020) %>% lm(luc_emissions ~ year) basically.

leeyap commented 2 years ago

Oh, silly mistake on my part, I was computing the values per decade.

  ssp    luc_trend    error   avg
  <chr>    <dbl>    <dbl> <dbl>
1 ssp126 -0.0144 0.000124  1.66
2 ssp245 -0.0142 0.000127  1.65
3 ssp370 -0.0133 0.000124  1.67
4 ssp460 -0.0172 0.000133  1.66
5 ssp585 -0.0133 0.000123  1.69

So we still have a weird thing happening - the LUC values put us out of the range of the graph in the top left, but our AF trend color bar would be bottom right, or towards the center if we use the carbon tracking values.

leeyap commented 2 years ago

Tasks:

leeyap commented 2 years ago

@bpbond Not sure if I did this incorrectly, but here is the decadal AF trend across all runs for the non-carbon-tracking method:

image

These are just the values of each SSP's trend, although I don't know why each one doesn't have exactly 500 runs.

run_number computation       af_trend   error  p.value
       <int> <chr>                <dbl>   <dbl>    <dbl>
1          1 Airborne fraction  -0.0281 0.00311 9.34e-13
2          2 Airborne fraction  -0.0281 0.00311 9.34e-13
3          3 Airborne fraction  -0.0281 0.00311 9.34e-13
4          4 Airborne fraction  -0.0281 0.00311 9.34e-13
5          5 Airborne fraction  -0.0281 0.00311 9.34e-13
6          6 Airborne fraction  -0.0281 0.00311 9.34e-13

For runs 1-500, 501-1000, etc, the trend number was the same across runs.

bpbond commented 2 years ago

Hmm. @leeyap this is coming out of lines 591-?

af_trend <- plot_data %>%
   filter(year %in% 1960:2020) %>%
   group_by(run_number, def) %>%
   do(mod = lm(med ~ year, data = .)) %>%
   summarize(run_number = run_number,
             def = def,
             broom::tidy(mod))

If yes what is med above?

bpbond commented 2 years ago

...if it's the median value of a group of runs (e.g. by scenario) then I think we need to back up and use the individual-run AF values.

leeyap commented 2 years ago

Ah, okay, this looks better: image So this is the trend across all runs, not accounting for differences across SSPs

bpbond commented 2 years ago

WOOOO! That is great! Dang, we may have a new manuscript figure.

leeyap commented 2 years ago

I think I'm set here - I updated figure captions/labels/axes to make things more clear for our presentation next week. Does the AF trend info and Rmd look good to you?

bpbond commented 2 years ago

Lazy scientist: could you re-send me the cleaned up html file?

Never mind!

bpbond commented 2 years ago

Looks great. See #47 but then merge when ready!