XSe = nmp.zeros((nz,nby)) XSe[:,:] = nmp.flipud(nmp.rot90(XS[:,:nz])) # Removing value for first year to all years: vy1 = nmp.zeros(nz) ; vy1[:] = XTe[:,0] for jy in range(nby): XTe[:,jy] = XTe[:,jy] - vy1[:] vy1 = nmp.zeros(nz) ; vy1[:] = XSe[:,0] for jy in range(nby): XSe[:,jy] = XSe[:,jy] - vy1[:] z0 = vdepth[0] zK = max(vdepth) [ rmin, rmax, rdf ] = bt.get_min_max_df(XTe,40) bp.plot("vert_section")(vyears[:], vdepth[:nz], XTe[:,:], XTe[:,:]*0.+1., rmin, rmax, rdf, cpal='bbr2', xmin=yr1, xmax=yr2+1., dx=ixtics, lkcont=False, zmin = z0, zmax = zK, l_zlog=True, cfignm=path_fig+'hov_temperature_'+CONFRUN+'_'+coce, cbunit=r'$^{\circ}$C', cxunit='', czunit='Depth (m)', ctitle=CONFRUN+': Spatially-averaged temperature evolution, '+voceans_u[jo]+', ('+str(int(yr1))+'-'+str(int(yr2))+')', cfig_type=fig_type, lforce_lim=True, i_cb_subsamp=2) XSe = 1000.*XSe [ rmin, rmax, rdf ] = bt.get_min_max_df(XSe,40) bp.plot("vert_section")(vyears[:], vdepth[:nz], XSe[:,:], XSe[:,:]*0.+1., rmin, rmax, rdf, cpal='bbr2', xmin=yr1, xmax=yr2+1., dx=ixtics, lkcont=False, zmin = z0, zmax = zK, l_zlog=True, cfignm=path_fig+'hov_salinity_'+CONFRUN+'_'+coce, cbunit=r'10$^{-3}$PSU', cxunit='', czunit='Depth (m)',
yr2 = float(int(max(vyear))) cbasin = bo.voce2treat[jb] print '\n *** Basin: ' + cbasin imask[:, :] = 0 Lfinite = nmp.isfinite(Xheat[jb, :, :]) idx_good = nmp.where(Lfinite) imask[idx_good] = 1 # time record to consider to chose a min and a max for colorbar: jt_ini = 5 if Nby <= 10: jt_ini = 1 if Nby == 1: jt_ini = 0 [rmin, rmax, rdf] = bt.get_min_max_df(Xheat[jb, jt_ini:, :], 40) bp.plot("vert_section")( vyear[:], vlat[:], nmp.flipud(nmp.rot90(Xheat[jb, :, :])), nmp.flipud(nmp.rot90(imask[:, :])), rmin, rmax, rdf, cpal='RdBu', xmin=yr1, xmax=yr2 + 1., dx=ittic, lkcont=False, zmin=vlat[0],
if not l3d: print ' ERROR: '+sys.argv[0]+' => variable '+cv+' are here but '+cv_depth+' was not there!' sys.exit(0) VY, ZY = bt.monthly_2_annual(vtime, nmp.flipud(nmp.rot90(X2d[jv2d,:,:]))) y1 = int(VY[0]) ; y2 = int(VY[nbr/12-1]) ittic = bt.iaxe_tick(nbr/12) # Anomaly with regards to first year: vini = nmp.zeros(nblev) ; vini[:] = ZY[:,0] for jy in range(nbr/12): ZY[:,jy] = ZY[:,jy] - vini[:] [ rmin, rmax, rdf ] = bt.get_min_max_df(ZY,40) bp.plot_vert_section(VY-0.5, vdepth[:], ZY, ZY*0.+1., rmin, rmax, rdf, cpal='bbr2', xmin=y1, xmax=y2, dx=ittic, lkcont=True, zmin = vdepth[0], zmax = max(vdepth), l_zlog=True, cfignm=cfn, cbunit=r''+list_units[jv], czunit='Depth (m)', ctitle=CRUN+': '+cln, cfig_type='svg', lforce_lim=True, i_sub_samp=2) else: # Normal variables!
js = js + 1 #if not nmp.isnan(Xheat[joce,1,js]): lfound=True if Xheat[joce, 1, js] != rmiss_val: lfound = True je = Nlat lfound = False while not lfound: je = je - 1 #if not nmp.isnan(Xheat[joce,1,je]): lfound=True if Xheat[joce, 1, je] != rmiss_val: lfound = True dyh = dy / 2 ymin = (int(vlat[js] / dyh) - 1) * dyh ymax = (int(vlat[je] / dyh) + 1) * dyh # min and max for field: [rmin, rmax, rdf] = bt.get_min_max_df(Xheat[joce, jt_ini:, js + 1:je - 1], 40) bp.plot("hovmoeller")(vyear[:], vlat[:], nmp.flipud(nmp.rot90(Xheat[joce, :, :])), mask, rmin, rmax, rdf, c_y_is='latitude', cpal='RdBu_r', tmin=yr1, tmax=yr2 + 1., dt=ittic, lkcont=True, ymin=ymin,
print '' imask = nmp.zeros(Nlat*Nby); imask.shape = [ Nby, Nlat ] for jb in range(nbasins): cbasin = bo.voce2treat[jb]; print '\n *** Basin: '+cbasin imask[:,:] = 0 Lfinite = nmp.isfinite(Xheat[jb,:,:]) ; idx_good = nmp.where(Lfinite) imask[idx_good] = 1 [ rmin, rmax, rdf ] = bt.get_min_max_df(Xheat[jb,5:,:],40) #print ' After get_min_max_df => rmin, rmax, rdf = ', rmin, rmax, rdf bp.plot("vert_section")(vyear[:], vlat[:], nmp.flipud(nmp.rot90(Xheat[jb,:,:])), nmp.flipud(nmp.rot90(imask[:,:])), rmin, rmax, rdf, cpal='jet', xmin=vyear[0], xmax=vyear[Nby-1], dx=ittic, lkcont=False, zmin = vlat[0], zmax = vlat[Nlat-1], l_zlog=False, cfignm=path_fig+'MHT_'+CONFRUN+'_'+cbasin, cbunit='PW', cxunit='', czunit=r'Latitude ($^{\circ}$N)', ctitle=CONFRUN+': Northward advective meridional heat transport, '+cbasin, cfig_type=fig_type, lforce_lim=False, i_sub_samp=2, l_z_increase=True) # Salt transport #imask[:,:] = 0