mult_inf_range = np.arange(1.01,1.110,0.01) ntemp_range = np.arange(1,5,1) total_analysis_rmse = np.zeros( (len(mult_inf_range),len(ntemp_range)) ) total_analysis_sprd = np.zeros( (len(mult_inf_range),len(ntemp_range)) ) total_forecast_rmse = np.zeros( (len(mult_inf_range),len(ntemp_range)) ) total_forecast_sprd = np.zeros( (len(mult_inf_range),len(ntemp_range)) ) for iinf , mult_inf in enumerate( mult_inf_range ) : for intemp , ntemp in enumerate( ntemp_range ) : conf.DAConf['InfCoefs']=np.array([mult_inf,0.0,0.0,0.0,0.0]) conf.DAConf['NTemp']=int(ntemp) results.append( ahm.assimilation_hybrid_run( conf ) ) print('Multiplicative Inflation',mult_inf) print('Tempering iteraations',ntemp) print('Analisis RMSE: ',np.mean(results[-1]['XASRmse'])) print('Forecast RMSE: ',np.mean(results[-1]['XFSRmse'])) print('Analisis SPRD: ',np.mean(results[-1]['XASSprd'])) print('Forecast SPRD: ',np.mean(results[-1]['XFSSprd'])) total_analysis_rmse[iinf,intemp] = np.mean(results[-1]['XASRmse']) total_forecast_rmse[iinf,intemp] = np.mean(results[-1]['XFSRmse']) total_analysis_sprd[iinf,intemp] = np.mean(results[-1]['XASSprd']) total_forecast_sprd[iinf,intemp] = np.mean(results[-1]['XFSSprd']) f=open(out_filename,'wb') pickle.dump([results,mult_inf_range,ntemp_range,total_analysis_rmse,total_forecast_rmse,total_analysis_sprd,total_forecast_sprd],f)
'Twin'] = True #When True, model configuration will be replaced by the model configuration in the nature run. conf.ModelConf['Coef'] = np.array( [8.0] ) #Coefficient of parametrized forcing (polynom coefficients starting from coef[0]*x^0 + coef[1]*x ... ) conf.DAConf[ 'AddaptiveTemp'] = True #Enable addaptive tempering time step in pseudo time. conf.DAConf['NTemp'] = 1 #Number of temper iterations conf.DAConf['InfCoefs'] = np.array([1.6, 0.0, 0.0, 0.0, 0.0]) conf.DAConf[ 'RejuvParam'] = 0.0 #Global particle rejuvenestion (For the ETPF only) results = gmm.assimilation_gm_run(conf) print('Multiplicative Inflation', conf.DAConf['InfCoefs'][0]) print('Tempering iteraations', conf.DAConf['NTemp']) print('Analisis RMSE: ', np.mean(results['XASRmse'])) print('Forecast RMSE: ', np.mean(results['XFSRmse'])) print('Analisis SPRD: ', np.mean(results['XASSprd'])) print('Forecast SPRD: ', np.mean(results['XFSSprd'])) conf.DAConf['InfCoefs'] = np.array([1.06, 0.0, 0.0, 0.0, 0.0]) conf.DAConf[ 'BridgeParam'] = 0.4 #Global particle rejuvenestion (For the ETPF only) results = hym.assimilation_hybrid_run(conf) print('Multiplicative Inflation', conf.DAConf['InfCoefs'][0]) print('Tempering iteraations', conf.DAConf['NTemp']) print('Analisis RMSE: ', np.mean(results['XASRmse'])) print('Forecast RMSE: ', np.mean(results['XFSRmse'])) print('Analisis SPRD: ', np.mean(results['XASSprd'])) print('Forecast SPRD: ', np.mean(results['XFSSprd']))