Ignore:
Timestamp:
12/16/16 15:06:34 (8 years ago)
Author:
dubos
Message:

Testing : improved DCMIP31 params & plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configs/testing/python/post_DCMIP31.py

    r502 r512  
    1313    plt.savefig('T850.png') 
    1414 
    15 def plot_dT(nlon,nlat,llm, lon,T,Phi): # perturbation temp, final time 
     15def plot_dT(nlon,nlat,llm, lon,T,p,Phi): # perturbation temp, final time 
    1616    # vertical slice at final time 
    1717    print 'Reading data ...' 
    18     T, Phi =T[-1,:,nlat/2,:], Phi[-1,:,nlat/2,:] 
     18    T,p, Phi = T[-1,:,nlat/2,:], p[-1,:,nlat/2,:], Phi[-1,:,nlat/2,:] 
    1919    print '... done.' 
    2020    Cpd, kappa, g = 1004.5, 0.2857143, 9.80616 
     
    2828        lon2[lev,:] = lon[:] 
    2929 
     30    theta = T*((peq/p)**kappa) 
     31    Thetab = Teq*np.exp(N2*z/g) 
    3032    Tb = G + (Teq-G)*np.exp(N2*z/g) # background temperature 
    3133    plt.figure(figsize=(12,6)) 
    32     plt.contourf(lon2,z,T-Tb, levels=np.arange(-0.08,0.12,0.02) ) 
     34    plt.contourf(lon2,z,theta-Thetab, levels=np.arange(-0.12,0.12,0.02) ) 
    3335    plt.colorbar()  
    34     plt.title('T-Tb') 
     36    plt.title('$\\Theta\'$') 
    3537    axis_longitude() 
    3638    plt.ylabel('z (m)') 
     
    4143nc = cdf.Dataset(gridfile, "r") 
    4244llm, nlon, nlat, ntime = getdims(nc, 'lev','lon','lat','time_counter') 
    43 lon, lat, T850, T, Phi = getvars(nc, 'lon','lat','T850', 'T', 'PHI') 
    44 plot_dT(nlon,nlat,llm, lon,T,Phi) 
     45lon, lat, T850, T, Phi, p = getvars(nc, 'lon','lat','T850', 'T', 'PHI','P') 
     46plot_dT(nlon,nlat,llm, lon,T,p,Phi) 
    4547plot_T850(lon,lat,T850) 
Note: See TracChangeset for help on using the changeset viewer.