diff --git a/dapper/mods/Stommel/clima.py b/dapper/mods/Stommel/clima.py index 9027e307..94351ab7 100644 --- a/dapper/mods/Stommel/clima.py +++ b/dapper/mods/Stommel/clima.py @@ -25,22 +25,28 @@ BurnIn=0) # 1 observation/year # Create default Stommel model model = stommel.StommelModel() -#Heat air fluxes +#Switch on heat exchange with atmosphere. +#Start with default stationary atm. temperature. functions = stommel.default_air_temp(N) +#Add linear warming trend. Increase taking place over period T_warming and warming over this +#period is 3C over equator and 6C over pole. trend = interp1d(np.array([0.,T_warming]), np.array([[0.,6.],[0.,3.]]), fill_value='extrapolate', axis=1) trended = [stommel.add_functions(func, trend) for func in functions] +#Switch on heat flux. model.fluxes.append(stommel.TempAirFlux(trended)) -#Salinity air fluxes +#Default stationary salinity flux with atm. functions = stommel.default_air_salt(N) +#Switch on atm. fluxes. model.fluxes.append(stommel.SaltAirFlux(functions)) -#Melt flux +#Add fresh water from melting as constant rate over the period T_warming/ melt_rate = -stommel.V_ice * np.array([1.0/(model.dx[0,0]*model.dy[0,0]), 0.0]) / T_warming #ms-1 functions = stommel.default_air_ep(N) +#Add melting rate to the default rate (=0) and switch Evaporation-Percipitation fluxe (EP). functions = [stommel.merge_functions(T_warming, lambda t:func(t)+melt_rate, func) for func in functions] model.fluxes.append(stommel.EPFlux(functions)) -# Initial conditions +# Default initial conditions x0 = model.x0 #Variance Ocean temp[2], ocean salinity[2], temp diffusion parameter, #salt diffusion parameter, transport parameter @@ -53,7 +59,7 @@ } # Observational variances R = np.array([1.0, 1.0, 0.1, 0.1])**2 # C2,C2,ppt2,ppt2 -# Observation +# Default bservation Obs = model.obs_ocean() # Create model. HMM = modelling.HiddenMarkovModel(Dyn, Obs, tseq, X0) @@ -67,6 +73,7 @@ fig, ax = stommel.time_figure(tseq) stommel.plot_truth(ax, xx, yy) +#Add equilibrium based on unperturbed initial conditions. model.ens_member=0 stommel.plot_eq(ax, tseq, model) diff --git a/dapper/mods/Stommel/clima_forcing.py b/dapper/mods/Stommel/clima_forcing.py index 65bcf5db..99454771 100644 --- a/dapper/mods/Stommel/clima_forcing.py +++ b/dapper/mods/Stommel/clima_forcing.py @@ -17,36 +17,47 @@ def exp_clima_forcing(N=100, seed=1000): T_warming=100*stommel.year #Data assimilation period in this or other experiments. Tda = 20 * stommel.year - # Timestepping. Timesteps of 1 day, running for 10 year. + # Timestepping. Timesteps of 1 day, running for 200 year. tseq = modelling.Chronology(stommel.year, kko=np.array([],dtype=int), T=200*stommel.year, BurnIn=0) # 1 observation/year #Create model model = stommel.StommelModel() #Heat air fluxes + #Start with default stationary atm. temperature. functions = stommel.default_air_temp(N) + #Add linear warming with 6C/T_warming over the pole and 3C/T_warming over the equatior. trend = interp1d(np.array([0.,T_warming]), np.array([[0.,6.],[0.,3.]]), fill_value='extrapolate', axis=1) trended = [stommel.add_functions(func, trend) for func in functions] + #Add random temperature perturbations with std dev. of 2C noised = [stommel.add_noise(func, seed=seed+n*20+1, sig=np.array([2.,2.])) for n,func in enumerate(trended)] + #For time