1 | % Evaluate the forcing calculated by ecRad for the CKDMIP scenarios |
---|
2 | % against line-by-line |
---|
3 | |
---|
4 | DOMAIN='sw'; |
---|
5 | DATASET='evaluation1'; |
---|
6 | VAR=['flux_up_' DOMAIN]; |
---|
7 | REFDIR='lbl_fluxes'; |
---|
8 | EXPDIR='fluxes'; |
---|
9 | MODELS={'rrtmg','ecckd'}; |
---|
10 | LEGEND={'LBLRTM','RRTMG','ecCKD'}; |
---|
11 | |
---|
12 | gases={'co2','ch4','n2o'}; |
---|
13 | labels={'CO2 concentration (ppmv)','CH4 concentration (ppbv)','N2O concentration (ppbv)'} |
---|
14 | concs={[180 280 415 560 1120 2240],[350 700 1200 1921 2600 3500],[190 270 332 405 540]}; |
---|
15 | ipresent = [3 4 3]; |
---|
16 | if ~exist('ref','var') |
---|
17 | for igas = 1:length(gases) |
---|
18 | conc = concs{igas}; |
---|
19 | for iconc = 1:length(conc) |
---|
20 | if iconc == ipresent(igas) |
---|
21 | scenario_str = 'present'; |
---|
22 | else |
---|
23 | scenario_str = [gases{igas} '-' num2str(conc(iconc))]; |
---|
24 | end |
---|
25 | ref{igas}{iconc} = loadnc([REFDIR '/ckdmip_' DATASET '_' DOMAIN '_fluxes_' scenario_str '.nc']); |
---|
26 | data = ref{igas}{iconc}.(VAR)(1,:,:); |
---|
27 | ref_mean_toa_up{igas}(iconc) = mean(data(:)); |
---|
28 | end |
---|
29 | end |
---|
30 | end |
---|
31 | |
---|
32 | if ~exist('expt','var') |
---|
33 | for igas = 1:length(gases) |
---|
34 | conc = concs{igas}; |
---|
35 | for iconc = 1:length(conc) |
---|
36 | if iconc == ipresent(igas) |
---|
37 | scenario_str = 'present'; |
---|
38 | else |
---|
39 | scenario_str = [gases{igas} '-' num2str(conc(iconc))]; |
---|
40 | end |
---|
41 | for iexpt = 1:length(MODELS) |
---|
42 | expt{iexpt,igas}{iconc} = loadnc([EXPDIR '/ecrad-' MODELS{iexpt} '_' DATASET '_' DOMAIN '_fluxes_' scenario_str '.nc']); |
---|
43 | data = expt{iexpt,igas}{iconc}.(VAR)(1,:,:); |
---|
44 | expt_mean_toa_up{iexpt,igas}(iconc) = mean(data(:)); |
---|
45 | end |
---|
46 | end |
---|
47 | end |
---|
48 | end |
---|
49 | |
---|
50 | clf |
---|
51 | set(gcf,'defaultlinelinewidth',1,'paperposition',[0.5 0.5 30 10]); |
---|
52 | stys = {'b--','r-.'}; |
---|
53 | for igas = 1:length(gases) |
---|
54 | subplot(1,length(gases),igas) |
---|
55 | conc = concs{igas}; |
---|
56 | plot(conc, -ref_mean_toa_up{igas}+ref_mean_toa_up{igas}(ipresent(igas)),'k'); |
---|
57 | hold on |
---|
58 | for iexpt = 1:length(MODELS) |
---|
59 | plot(conc, -expt_mean_toa_up{iexpt,igas}+expt_mean_toa_up{iexpt,igas}(ipresent(igas)),stys{iexpt}); |
---|
60 | end |
---|
61 | if igas == 1 |
---|
62 | set(gca,'xscale','log'); |
---|
63 | legend(LEGEND,'location','northwest'); |
---|
64 | end |
---|
65 | xlabel(labels{igas}) |
---|
66 | ylabel('Instantaneous radiative forcing (W/m2)') |
---|
67 | grid on |
---|
68 | end |
---|
69 | |
---|