def test_2D_EBM(): '''Can we step forward a 2D lat/lon EBM?''' state = climlab.surface_state(num_lon=4) m = climlab.EBM_annual(state=state) m.step_forward() assert m.state.Ts.shape == (90, 4, 1) # Test the xarray interface m.to_xarray()
def test_2D_insolation(): state = climlab.surface_state(num_lon=4) m = climlab.EBM_annual(state=state) # the answers are the mean of 1D insolation arrays # the mean shouldn't change from 1D to 2D... # there are exactly the same amount of each number in 2D array assert np.mean(m.subprocess['insolation'].insolation) == 299.30467670961832 sfc = m.domains['Ts'] m.add_subprocess('insolation', climlab.radiation.P2Insolation(domains=sfc, **m.param)) assert np.mean(m.subprocess['insolation'].insolation) == 300.34399999999999
def EBM_iceline(): return climlab.EBM_annual(num_points=180, a0=0.3, a2=0.078, ai=0.62)