plt.title('MW on density axis longitudinally integrated on auxgrd (in Sv)') plt.ylabel('density') ax = utils_plt.plot_MOC(lat_auxgrd, db, dMWxint_auxgrd, nlevels=40, plttype='pcolor', to_newfigure=False) plt.plot(lat_mgrd, np.nanmax(np.nanmax(sig2,0),1), 'm-', label='maximal density (on mgrd)') #plt.yticks(ticks_vol_reg) #plt.gca().set_yticklabels(ticks_dens) plt.xlim([-36,90]) plt.legend(loc='lower left') plt.subplot(3,1,3) plt.plot(lat_auxgrd, np.nansum(dMWxint_auxgrd,axis=0), '.-k') plt.colorbar() plt.xlim([-36,90]) plt.ylabel('sum over whole density-axis (in Sv)') plt.xlabel('latitude') utils_plt.print2pdf(fig, path_fig+'dMOC_tripple'+varname_binning) # ----------------------------------------------------------------------------- # 5 subplots showing densities, Temperature and MW against depth and density axis # ----------------------------------------------------------------------------- lat = 85 lon = 30 plt.figure() plt.suptitle('location: lat={:d} lon={:d}'.format(lat, lon)) plt.subplot(1,5,1) ax = plt.gca(); ax.invert_yaxis() plt.plot(sig2[:,lat,lon], MW_mgrd.z_w_top, '.-r', label='sigma 2')
plt.plot(lat_mgrd, np.nanmax(np.nanmax(sig2, 0), 1), 'm-', label='maximal density (on mgrd)') #plt.yticks(ticks_vol_reg) #plt.gca().set_yticklabels(ticks_dens) plt.xlim([-36, 90]) plt.legend(loc='lower left') plt.subplot(3, 1, 3) plt.plot(lat_auxgrd, np.nansum(dMWxint_auxgrd, axis=0), '.-k') plt.colorbar() plt.xlim([-36, 90]) plt.ylabel('sum over whole density-axis (in Sv)') plt.xlabel('latitude') utils_plt.print2pdf(fig, path_fig + 'dMOC_tripple' + varname_binning) # ----------------------------------------------------------------------------- # 5 subplots showing densities, Temperature and MW against depth and density axis # ----------------------------------------------------------------------------- lat = 85 lon = 30 plt.figure() plt.suptitle('location: lat={:d} lon={:d}'.format(lat, lon)) plt.subplot(1, 5, 1) ax = plt.gca() ax.invert_yaxis() plt.plot(sig2[:, lat, lon], MW_mgrd.z_w_top, '.-r', label='sigma 2') plt.plot(RHO[:, lat, lon], MW_mgrd.z_w_top, '.-m', label='in-situ density') plt.title('Dens against depth')
path_fig = '../figures/160711/' # ======================================================================================= # Calculated on model grid # ======================================================================================= # ----------------------------------------------------------------------------------------- # MOC_mgrd_W fig, ax = utils_plt.plot_MOC(lat_mgrd, ncdat.z_w_top, MOC_mgrd_W, nlevels=10, plttype='pcolor+contour') plt.plot(lat_mgrd, HT_mgrd_xmax) # plot seafloor #! it's the T-grid!!! plt.title('MOC mgrd W') plt.xlim([-36, 90]) utils_plt.print2pdf(fig, path_fig + 'MOC_mgrd_W') # ----------------------------------------------------------------------------------------- # dMOC_mgrid_W(in Sv) fig, ax = utils_plt.plot_MOC(lat_mgrd, db, dMOC_mgrd_W, nlevels=10, plttype='pcolor+contour') plt.title('dMOC mgrd W (sigma2)') plt.suptitle('density binning from {} to {} in {} steps'.format( dbc.min(), dbc.max(), len(dbc))) plt.xlim([-36, 73]) plt.yticks(ticks_vol) plt.gca().set_yticklabels(ticks_dens) #utils_plt.print2pdf(fig, path_fig+'dMOC_mgrd_W_sig2')
MOC_model, nlevels=40, plttype='pcolor+contour') plt.plot(lat_auxgrd, HT_auxgrd_xmax) # plot seafloor plt.title('MOC model') plt.xlim([-36, 90]) #utils_plt.print2pdf(fig, 'testfigures/MOC_model') # ======================================================================================= # Calculated on model grid # ======================================================================================= # ----------------------------------------------------------------------------------------- # BSF on model grid fig, map = utils_plt.plot_BSF(BSF_mgrd, 'U', nlevels=100) plt.title('BSF mgrd on U grid') utils_plt.print2pdf(fig, 'testfigures/BSF_mgrd_U') # ----------------------------------------------------------------------------------------- # MOC_mgrd_W fig, ax = utils_plt.plot_MOC(lat_mgrd, ncdat.z_w_top, MOC_mgrd_W, nlevels=10, plttype='pcolor+contour') plt.plot(lat_mgrd, HT_mgrd_xmax) # plot seafloor #! it's the T-grid!!! plt.title('MOC mgrd W') plt.xlim([-36, 90]) utils_plt.print2pdf(fig, path_fig + 'MOC_mgrd_W') # ----------------------------------------------------------------------------------------- # MOC_mgrd_V fig, ax = utils_plt.plot_MOC(lat_mgrd, ncdat.z_t,
import matplotlib.pyplot as plt import matplotlib as ml import CESM_utils_plt as utils_plt plt.ion() # enable interactive mode path_fig = '../figures/160711/' # ======================================================================================= # CCSM4 representations # ======================================================================================= # ----------------------------------------------------------------------------------------- # BSF on geographical grid calculated by model BSF_model = utils_mask.mask_ATLANTIC(ncdat.BSF.isel(time=0), ncdat.REGION_MASK) fig, map = utils_plt.plot_BSF(BSF_model, 'T', nlevels=10) plt.title('BSF model on T grid') utils_plt.print2pdf(fig, path_fig + 'BSF_model_T') # ----------------------------------------------------------------------------------------- # MOC on geographical grid calculated by model MOC_model = ncdat.MOC.isel(time=0, transport_reg=1, moc_comp=0) #MOC_model = MOC_model - MOC_model[:,-1] # normalisation fig, ax = utils_plt.plot_MOC(MOC_model.lat_aux_grid, MOC_model.moc_z, MOC_model, nlevels=10, plttype='pcolor+contour') plt.plot(lat_auxgrd, HT_auxgrd_xmax) # plot seafloor plt.title('MOC model') plt.xlim([-36, 90]) utils_plt.print2pdf(fig, path_fig + 'MOC_model') # =======================================================================================
import matplotlib as ml import CESM_utils_plt as utils_plt plt.ion() # enable interactive mode path_fig = '../figures/160711/' # ======================================================================================= # CCSM4 representations # ======================================================================================= # ----------------------------------------------------------------------------------------- # BSF on geographical grid calculated by model BSF_model = utils_mask.mask_ATLANTIC(ncdat.BSF.isel(time=0), ncdat.REGION_MASK) fig, map = utils_plt.plot_BSF(BSF_model, 'T', nlevels = 10) plt.title('BSF model on T grid') utils_plt.print2pdf(fig, path_fig+'BSF_model_T') # ----------------------------------------------------------------------------------------- # MOC on geographical grid calculated by model MOC_model = ncdat.MOC.isel(time=0, transport_reg=1, moc_comp=0) #MOC_model = MOC_model - MOC_model[:,-1] # normalisation fig, ax = utils_plt.plot_MOC(MOC_model.lat_aux_grid, MOC_model.moc_z, MOC_model, nlevels=10, plttype='pcolor+contour') plt.plot(lat_auxgrd,HT_auxgrd_xmax) # plot seafloor plt.title('MOC model') plt.xlim([-36,90]) utils_plt.print2pdf(fig, path_fig+'MOC_model') # ======================================================================================= # Calculated on model grid # ======================================================================================= # ----------------------------------------------------------------------------------------- # BSF on model grid
import matplotlib as ml import CESM_utils_plt as utils_plt plt.ion() # enable interactive mode path_fig = '../figures/160711/' # ======================================================================================= # Calculated on model grid # ======================================================================================= # ----------------------------------------------------------------------------------------- # MOC_mgrd_W fig, ax = utils_plt.plot_MOC(lat_mgrd, ncdat.z_w_top, MOC_mgrd_W, nlevels=10, plttype='pcolor+contour') plt.plot(lat_mgrd,HT_mgrd_xmax) # plot seafloor #! it's the T-grid!!! plt.title('MOC mgrd W') plt.xlim([-36,90]) utils_plt.print2pdf(fig, path_fig+'MOC_mgrd_W') # ----------------------------------------------------------------------------------------- # dMOC_mgrid_W(in Sv) fig, ax = utils_plt.plot_MOC(lat_mgrd, db, dMOC_mgrd_W, nlevels=10, plttype='pcolor+contour') plt.title('dMOC mgrd W (sigma2)') plt.suptitle('density binning from {} to {} in {} steps'.format(dbc.min(), dbc.max(), len(dbc))) plt.xlim([-36,73]) plt.yticks(ticks_vol) plt.gca().set_yticklabels(ticks_dens) #utils_plt.print2pdf(fig, path_fig+'dMOC_mgrd_W_sig2') # ======================================================================================= # Calculated on auxiliary (geographical) grid # ======================================================================================= # -----------------------------------------------------------------------------------------
MOC_model = ncdat.MOC.isel(time=0, transport_reg=1, moc_comp=0) MOC_model = MOC_model - MOC_model[:,-1] # normalisation fig, ax = utils_plt.plot_MOC(MOC_model.lat_aux_grid, MOC_model.moc_z, MOC_model, nlevels=40, plttype='pcolor+contour') plt.plot(lat_auxgrd,HT_auxgrd_xmax) # plot seafloor plt.title('MOC model') plt.xlim([-36,90]) #utils_plt.print2pdf(fig, 'testfigures/MOC_model') # ======================================================================================= # Calculated on model grid # ======================================================================================= # ----------------------------------------------------------------------------------------- # BSF on model grid fig, map = utils_plt.plot_BSF(BSF_mgrd, 'U', nlevels=100) plt.title('BSF mgrd on U grid') utils_plt.print2pdf(fig, 'testfigures/BSF_mgrd_U') # ----------------------------------------------------------------------------------------- # MOC_mgrd_W fig, ax = utils_plt.plot_MOC(lat_mgrd, ncdat.z_w_top, MOC_mgrd_W, nlevels=10, plttype='pcolor+contour') plt.plot(lat_mgrd,HT_mgrd_xmax) # plot seafloor #! it's the T-grid!!! plt.title('MOC mgrd W') plt.xlim([-36,90]) utils_plt.print2pdf(fig, path_fig+'MOC_mgrd_W') # ----------------------------------------------------------------------------------------- # MOC_mgrd_V fig, ax = utils_plt.plot_MOC(lat_mgrd, ncdat.z_t, MOC_mgrd_V, nlevels=100, plttype='pcolor+contour') plt.plot(lat_mgrd,HT_mgrd_xmax) # plot seafloor plt.title('MOC mgrd V') plt.xlim([-36,90]) #utils_plt.print2pdf(fig, path_fig+'MOC_mgrd_V') # -----------------------------------------------------------------------------------------
path_fig = '../figures/160711/' # ======================================================================================= # BSF / MOC # ======================================================================================= var = MV[0,:,:] var[190:300,-65:-45] = np.zeros_like(var[190:300,-65:-45]) fig, map = utils_plt.plot_BSF(var, 'T', nlevels = 10) # ----------------------------------------------------------------------------------------- # BSF on geographical grid calculated by model BSF_model = utils_mask.mask_ATLANTIC(ncdat.BSF.isel(time=0), ncdat.REGION_MASK) fig, map = utils_plt.plot_BSF(BSF_model, 'T', nlevels = 10) plt.title('BSF model on T grid') utils_plt.print2pdf(fig, path_fig+'BSF_model_T') # ----------------------------------------------------------------------------------------- # BSF on model grid fig, map = utils_plt.plot_BSF(BSF_mmgrd, 'U', nlevels=100) plt.title('BSF mgrd on U grid') utils_plt.print2pdf(fig, 'testfigures/BSF_mgrd_U') # ----------------------------------------------------------------------------------------- # MOC on geographical grid calculated by model MOC_model = ncdat.MOC.isel(time=0, transport_reg=1, moc_comp=0) #MOC_model = MOC_model - MOC_model[:,-1] # normalisation fig, ax = utils_plt.plot_MOC(MOC_model.lat_aux_grid, MOC_model.moc_z, MOC_model, nlevels=10, plttype='pcolor+contour') plt.plot(lat_auxgrd,HT_auxgrd_xmax) # plot seafloor plt.title('MOC model') plt.xlim([-36,90]) utils_plt.print2pdf(fig, path_fig+'MOC_model')
plt.ion() # enable interactive mode path_fig = '../figures/160711/' # ======================================================================================= # BSF / MOC # ======================================================================================= var = MV[0, :, :] var[190:300, -65:-45] = np.zeros_like(var[190:300, -65:-45]) fig, map = utils_plt.plot_BSF(var, 'T', nlevels=10) # ----------------------------------------------------------------------------------------- # BSF on geographical grid calculated by model BSF_model = utils_mask.mask_ATLANTIC(ncdat.BSF.isel(time=0), ncdat.REGION_MASK) fig, map = utils_plt.plot_BSF(BSF_model, 'T', nlevels=10) plt.title('BSF model on T grid') utils_plt.print2pdf(fig, path_fig + 'BSF_model_T') # ----------------------------------------------------------------------------------------- # BSF on model grid fig, map = utils_plt.plot_BSF(BSF_mmgrd, 'U', nlevels=100) plt.title('BSF mgrd on U grid') utils_plt.print2pdf(fig, 'testfigures/BSF_mgrd_U') # ----------------------------------------------------------------------------------------- # MOC on geographical grid calculated by model MOC_model = ncdat.MOC.isel(time=0, transport_reg=1, moc_comp=0) #MOC_model = MOC_model - MOC_model[:,-1] # normalisation fig, ax = utils_plt.plot_MOC(MOC_model.lat_aux_grid, MOC_model.moc_z, MOC_model, nlevels=10, plttype='pcolor+contour') plt.plot(lat_auxgrd, HT_auxgrd_xmax) # plot seafloor