from climaf.api import *
req_cmip5 = ds(project='CMIP5',
variable='tos',
period='2000',
experiment='historical',
frequency='monthly',
model='*',
version='latest'
)
req_cmip5.explore('choices')
ens_cmip5 = req_cmip5.explore('ensemble')
summary(ens_cmip5)
req_cmip6 = ds(project='CMIP6',
experiment='historical',
model='IPSL-CM6A-LR',
period='2000',
variable='tos',
table='Omon',
realization='*'
)
req_cmip6.explore('choices')
ens_cmip6 = req_cmip6.explore('ensemble')
summary(ens_cmip6)
anm_ens_cmip5 = clim_average(ens_cmip5,'ANM')
anm_ens_cmip6 = clim_average(ens_cmip6,'ANM')
rgrd_anm_ens_cmip5 = regridn(anm_ens_cmip5,
cdogrid='r360x180')
rgrd_anm_ens_cmip6 = regridn(anm_ens_cmip6,
cdogrid='r360x180')
ensmean_cmip5 = ccdo_ens(rgrd_anm_ens_cmip5,
operator='ensavg')
ensmean_cmip6 = ccdo_ens(rgrd_anm_ens_cmip6,
operator='ensavg')
ref = ds(project='ref_climatos', variable='tos',
product='WOA13-v2').explore('resolve')
summary(ref)
rgrd_ref = regridn(clim_average(ref,'ANM'),
cdogrid='r360x180')
Reminder:
implot(ensmean_cmip6)
implot(ensmean_cmip5)
There is obviously a problem with one (or more) of the members of the ensemble.
Here is a way to display the members one by one
iplot_members(rgrd_anm_ens_cmip5, N=1)
iplot_members(rgrd_anm_ens_cmip5, N=1, focus='ocean', min=272, max=302, delta=2)
iplot_members(rgrd_anm_ens_cmip5, N=2, focus='ocean', min=272, max=302, delta=2)
# -- Make a copy of the original ensemble
ok_rgrd_anm_ens_cmip5 = rgrd_anm_ens_cmip5.copy()
# -- Remove BNU-ESM
ok_rgrd_anm_ens_cmip5.pop('BNU-ESM')
# -- Add 273.15 to GFDL-CM2p1 (Celsius to Kelvin)
ok_rgrd_anm_ens_cmip5['GFDL-CM2p1'] = fadd(rgrd_anm_ens_cmip5['GFDL-CM2p1'], 273.15)
# -- Might not have seen that, but MIROC5 mask over continents was set to zero; set it to missing value
# with cdo setctomiss,0
ok_rgrd_anm_ens_cmip5['MIROC5'] = ccdo(rgrd_anm_ens_cmip5['MIROC5'], operator='setctomiss,0')
iplot_members(ok_rgrd_anm_ens_cmip5, N=4, focus='ocean', min=272, max=302, delta=2)
ok_ensmean_cmip5 = ccdo_ens(ok_rgrd_anm_ens_cmip5, operator='ensavg')
bias_ensmean_cmip6 = minus(ensmean_cmip6, rgrd_ref)
bias_ensmean_cmip5 = minus(ok_ensmean_cmip5, rgrd_ref)
implot(bias_ensmean_cmip5)
implot(bias_ensmean_cmip6)
# -- Start by making two plots with plot() !! not iplot() !!
cmip5_plot = plot(bias_ensmean_cmip5, focus='ocean', title='CMIP5 ens. mean',
min=-6, max=6, delta=1, contours=1)
cmip6_plot = plot(bias_ensmean_cmip6, focus='ocean', title='IPSL-CM6A-LR ens. mean',
min=-6, max=6, delta=1, contours=1)
# -- Make the multiplot with cpage()
mp = cpage(fig_lines=[[cmip5_plot,cmip6_plot]])
# -- And display the result in the notebook with iplot
iplot(mp)
NH_cmip5_plot = plot(bias_ensmean_cmip5, focus='ocean', title='CMIP5 ens. mean',
min=-6, max=6, delta=1, contours=1,
proj='NH40')
NH_cmip6_plot = plot(bias_ensmean_cmip6, focus='ocean', title='IPSL-CM6A-LR ens. mean',
min=-6, max=6, delta=1, contours=1,
proj='NH40')
# -- Make the multiplot with cpage()
mp = cpage(fig_lines=[ [cmip5_plot,cmip6_plot], [NH_cmip5_plot, NH_cmip6_plot]])
# -- And display the result in the notebook with iplot
iplot(mp)
help(cpage)
Here: https://climaf.readthedocs.io/en/master/#can-climaf-make-my-scientific-life-easier