Q_ek = Q_ek.transpose('time', 'lat', 'lon') Q_ek.values[:, eqi, :] = 0 #w_ek_mean = w_ek.mean(dim='time') # Q_ek_mean = Q_ek.mean(dim='time') #Q_ek_v_mean = Q_ek_v.mean(dim='time') #Q_ek_f_mean = Q_ek_f.mean(dim='time') # #Q_ek = Q_ek.where(np.abs(lats) > 0) # Compute monthly anomaly if anom_flag: Q_net_surf, Q_net_surf_clim = st.anom(Q_net_surf) thf, thf_clim = st.anom(thf) sst, sst_clim = st.anom(sst) Q_ek, Q_ek_clim = st.anom(Q_ek) #Q_ek_f,Q_ek_f_clim = st.anom(Q_ek_f) # Remove linear trend if detr: sst = sst.fillna(0.) sst = xr.DataArray(signal.detrend(sst, axis=0), dims=sst.dims, coords=sst.coords) # h = h.fillna(0.) # h = xr.DataArray(signal.detrend(h, axis=0), dims=h.dims, coords=h.coords)
u_ek = xr.DataArray(u_ek, dims=sst.dims, coords=sst.coords) v_ek = xr.DataArray(v_ek, dims=sst.dims, coords=sst.coords) Q_ek = -Cbar * (u_ek * dSSTdx + v_ek * dSSTdy) #eqi = np.where(lats==0) #Q_ek = Q_ek.transpose('time','lat','lon') #Q_ek.values[:,eqi,:] = 0 Q_ek_mean = Q_ek.mean(dim='time') Q_ek = Q_ek.where(np.abs(lats) > 0) # Compute monthly anomaly if anom_flag: Q_net_surf, Q_net_surf_clim = st.anom(Q_net_surf) thf, thf_clim = st.anom(thf) sst, sst_clim = st.anom(sst) Q_ek, Q_ek_clim = st.anom(Q_ek) sst_ECCO, sst_ECCO_clim = st.anom(sst_ECCO) Tmxl_ECCO, Tmxl_ECCO_clim = st.anom(Tmxl_ECCO) h, h_clim = st.anom(h) # Remove linear trend if detr: sst = sst.fillna(0.) sst = xr.DataArray(signal.detrend(sst, axis=0), dims=sst.dims, coords=sst.coords) # h = h.fillna(0.)
# v_ek = -(1/(rho*f3D*hbar3D))*taux # u_ek = xr.DataArray(u_ek, dims=sst.dims, coords=sst.coords) # v_ek = xr.DataArray(v_ek, dims=sst.dims, coords=sst.coords) # Q_ek = -Cbar*(u_ek*dSSTdx + v_ek*dSSTdy) # #eqi = np.where(lats==0) # #Q_ek = Q_ek.transpose('time','lat','lon') # #Q_ek.values[:,eqi,:] = 0 # Q_ek_mean = Q_ek.mean(dim='time') # Q_ek = Q_ek.where(np.abs(lats) > 0) h_anom, h_clim = st.anom(h) h_clim_std = h_clim.std(dim='month') h_bar = h_clim.mean(dim='month') # Compute monthly anomaly if anom_flag: Qs,Qs_clim = st.anom(Qs) #thf,thf_clim = st.anom(thf) sst,sst_clim = st.anom(sst) #Q_ek,Q_ek_clim= st.anom(Q_ek) # sst_ECCO,sst_ECCO_clim= st.anom(sst_ECCO) # Tmxl_ECCO,Tmxl_ECCO_clim= st.anom(Tmxl_ECCO)
c_p = 3850 dt = 30 * 3600 * 24 #C = rho*c_p*h #C_anom, C_clim = st.anom(C) #Cbar = C_clim.mean(dim='month') Cbar = rho * c_p * hbar #Cbar = C.mean(dim='time') #if dataname == 'ECCO': # Cbar = rho*c_p*delz_sum h_anom, h_clim = st.anom(h) h_clim_std = h_clim.std(dim='month') h_bar = h_clim.mean(dim='month') # Compute monthly anomaly if anom_flag: Q_net_surf, Q_net_surf_clim = st.anom(Q_net_surf) thf, thf_clim = st.anom(thf) sst, sst_clim = st.anom(sst) ta, ta_clim = st.anom(ta) #Q_ek,Q_ek_clim= st.anom(Q_ek) sst_ECCO, sst_ECCO_clim = st.anom(sst_ECCO) Tmxl_ECCO, Tmxl_ECCO_clim = st.anom(Tmxl_ECCO) # Remove linear trend
# v_ek = xr.DataArray(v_ek, dims=sst.dims, coords=sst.coords) # Q_ek = -Cbar*(u_ek*dSSTdx + v_ek*dSSTdy) # #eqi = np.where(lats==0) # #Q_ek = Q_ek.transpose('time','lat','lon') # #Q_ek.values[:,eqi,:] = 0 # Q_ek_mean = Q_ek.mean(dim='time') # Q_ek = Q_ek.where(np.abs(lats) > 0) # Compute monthly anomaly if anom_flag: #Q_net_surf,Q_net_surf_clim = st.anom(Q_net_surf) thf, thf_clim = st.anom(thf) sst, sst_clim = st.anom(sst) #Q_ek,Q_ek_clim= st.anom(Q_ek) sst_ECCO, sst_ECCO_clim = st.anom(sst_ECCO) Tmxl_ECCO, Tmxl_ECCO_clim = st.anom(Tmxl_ECCO) # Remove linear trend if detr: sst = sst.fillna(0.) sst = xr.DataArray(signal.detrend(sst, axis=0), dims=sst.dims, coords=sst.coords) # h = h.fillna(0.) # h = xr.DataArray(signal.detrend(h, axis=0), dims=h.dims, coords=h.coords)
# v_ek = -(1/(rho*f3D*hbar3D))*taux # u_ek = xr.DataArray(u_ek, dims=sst.dims, coords=sst.coords) # v_ek = xr.DataArray(v_ek, dims=sst.dims, coords=sst.coords) # Q_ek = -Cbar*(u_ek*dSSTdx + v_ek*dSSTdy) # #eqi = np.where(lats==0) # #Q_ek = Q_ek.transpose('time','lat','lon') # #Q_ek.values[:,eqi,:] = 0 # Q_ek_mean = Q_ek.mean(dim='time') # Q_ek = Q_ek.where(np.abs(lats) > 0) h_anom, h_clim = st.anom(h) h_clim_std = h_clim.std(dim='month') h_bar = h_clim.mean(dim='month') # Compute monthly anomaly if anom_flag: Qs, Qs_clim = st.anom(Qs) #thf,thf_clim = st.anom(thf) sst, sst_clim = st.anom(sst) tendT_mxl, tendT_mxl_clim = st.anom(tendT_mxl) #Q_ek,Q_ek_clim= st.anom(Q_ek) # sst_ECCO,sst_ECCO_clim= st.anom(sst_ECCO) # Tmxl_ECCO,Tmxl_ECCO_clim= st.anom(Tmxl_ECCO) # Remove linear trend
# #Q_ek = Q_ek.transpose('time','lat','lon') # #Q_ek.values[:,eqi,:] = 0 # Q_ek_mean = Q_ek.mean(dim='time') # Q_ek = Q_ek.where(np.abs(lats) > 0) # h_anom, h_clim = st.anom(h) # h_clim_std = h_clim.std(dim='month') # h_bar = h_clim.mean(dim='month') # Compute monthly anomaly if anom_flag: Q_net_surf,Q_net_surf_clim = st.anom(Q_net_surf) thf,thf_clim = st.anom(thf) sst,sst_clim = st.anom(sst) #Q_ek,Q_ek_clim= st.anom(Q_ek) ps,ps_clim= st.anom(ps) sst_ECCO,sst_ECCO_clim= st.anom(sst_ECCO) Tmxl_ECCO,Tmxl_ECCO_clim= st.anom(Tmxl_ECCO) # Remove linear trend if detr: sst = sst.fillna(0.) sst = xr.DataArray(signal.detrend(sst, axis=0), dims=sst.dims, coords=sst.coords) #ps = ps.fillna(0.) #ps = xr.DataArray(signal.detrend(ps, axis=0), dims=ps.dims, coords=ps.coords)
#C = rho*c_p*h #C_anom, C_clim = st.anom(C) #Cbar = C_clim.mean(dim='month') Cbar = rho * c_p * hbar # h_anom, h_clim = st.anom(h) # h_clim_std = h_clim.std(dim='month') # h_bar = h_clim.mean(dim='month') # Compute monthly anomaly if anom_flag: Qs, Qs_clim = st.anom(Qs) #thf,thf_clim = st.anom(thf) sst, sst_clim = st.anom(sst) #tendT_mxl, tendT_mxl_clim = st.anom(tendT_mxl) #Q_ek,Q_ek_clim= st.anom(Q_ek) # sst_ECCO,sst_ECCO_clim= st.anom(sst_ECCO) # Tmxl_ECCO,Tmxl_ECCO_clim= st.anom(Tmxl_ECCO) # Remove linear trend if detr: sst = sst.fillna(0.) sst = xr.DataArray(signal.detrend(sst, axis=0), dims=sst.dims, coords=sst.coords) # h = h.fillna(0.)
# #Q_ek.values[:,eqi,:] = 0 # Q_ek_mean = Q_ek.mean(dim='time') # Q_ek = Q_ek.where(np.abs(lats) > 0) # h_anom, h_clim = st.anom(h) # h_clim_std = h_clim.std(dim='month') # h_bar = h_clim.mean(dim='month') # Q_ek = Q_ek.transpose('time', 'lat', 'lon') # Compute monthly anomaly if anom_flag: Q_net_surf, Q_net_surf_clim = st.anom(Q_net_surf) thf, thf_clim = st.anom(thf) sst, sst_clim = st.anom(sst) err_sst, err_sst_clim = st.anom(err_sst) err_thf, err_thf_clim = st.anom(err_thf) #Q_ek,Q_ek_clim= st.anom(Q_ek) sst_ECCO, sst_ECCO_clim = st.anom(sst_ECCO) Tmxl_ECCO, Tmxl_ECCO_clim = st.anom(Tmxl_ECCO) # Remove linear trend if detr: sst = sst.fillna(0.) sst = xr.DataArray(signal.detrend(sst, axis=0), dims=sst.dims, coords=sst.coords)