RHs = np.zeros(len(domsizes))
 Ps = np.zeros(len(domsizes))
 delhs = np.zeros(len(domsizes))
 delhseff = np.zeros(len(domsizes))
 p_LCLs = np.zeros(len(domsizes))
 q_BLms = np.zeros(len(domsizes))
 omega_ms = np.zeros(len(domsizes))
 T_BLcs = np.zeros(len(domsizes))
 p_BLcs = np.zeros(len(domsizes))
 theta_BLcs = np.zeros(len(domsizes))
 
 q_sat = wsatnew(T_s, p_s) #mixing ratio above sea surface (100% saturated)    
 thetae0 = thermo.theta_e(T_s, p_s, q_sat, 0) #theta_e in moist region 
                                             #use surface temperature to get moist adiaba
 
 T_BLtop = findTmoist(thetae0, p_BL) #temperature of boundary layer top 
 T_t = findTmoist(thetae0, p_t) #temperature of tropopause (outflow region)
 #T_BL = (T_s + T_BLtop)/2. #temperature of boundary layer, consistent with well-mixed assumption (linear mixing)
 T_BL = T_s
 #T_BLtop = T_BL
 q_BLsat = wsatnew(T_BL, (p_s + p_BL)/2.)
 q_BLtopsat = wsatnew(T_BLtop, p_BL)
 
 q_FA = wsatnew(T_t, p_t) #free troposphere water vapor mixing ratio
 #q_FA = 0.01
 
 #q_FAd = q_FA
 
 
 #q_FA = 0.001
 
Пример #2
0
for i, zeta in enumerate(zeta_levs):
    if (zeta < zeta_T):
      Tphumb[i] = T_s - gamma_ph*zeta
    else:
      Tphumb[i] = T_s - gamma_ph*zeta_T



Told = np.zeros(plevs.shape)
Tnew = np.zeros(plevs.shape)

for i, p in enumerate(plevs[:-1]):
    Tgm[i+1] = Tgm[i]*(1 + gamma_m*c.Rd*delp/p)
    Tgd[i+1] = Tgd[i]*(1+ gamma_d*c.Rd*delp/p)
    Told[i] = findTmoist.findTmoist(thetae0, p)
    Tnew[i] = findTmoist_new.findTmoist(thetae0, p, q_sat, 0)

   

    
    

plt.figure(1)
plt.plot(Told[:-1], plevs[:-1]/100., color='r', label='Told - root finder moist adiabat')
plt.plot(Tnew[:-1], plevs[:-1]/100., color='b', label='Tnew - root finder moist adiabat')
plt.plot(Tgm[:-1], plevs[:-1]/100., 'g--', label='constant gamma_m')
plt.plot(Tgd[:-1], plevs[:-1]/100., 'k--', label='constant gamma_d')
plt.plot(Tphumb, plevs/100., color ='y', label='pierre humbert profile')
plt.legend()
#plt.gca().invert_yaxis()
plt.show()

    for j, domsize in enumerate(domsizes):
        
    
        l_d = domsize*1000
        print l_d/1e3
        
        r = np.linspace(0, l_d, 1e6)
        
        
        q_sat = wsat(T_s, p_s) #mixing ratio above sea surface (100% saturated)    
        thetae0 = thermo.theta_e(T_s, p_s, q_sat, 0) #theta_e in moist region 
                                                    #use surface temperature to get moist adiaba
        
        T_BLtop = findTmoist(thetae0, p_BL) #temperature of boundary layer top 
        T_t = findTmoist(thetae0, p_t) #temperature of tropopause (outflow region)
        #T_BL = (T_s + T_BLtop)/2. #temperature of boundary layer, consistent with well-mixed assumption (linear mixing)
        T_BL = T_s
        q_BLsat = wsat(T_BL, (p_s + p_BL)/2.)
        #q_BLtopsat = wsat(T_BLtop, p_BL)
        
        q_FA = wsat(T_t, p_t) #free troposphere water vapor mixing ratio
        #q_FA = 0.01
        
        #q_FAd = q_FA
        
        
        #q_FA = 0.001
        
        M_trop = (p_BL - p_t)/g #mass of troposphere in kg m^-2
Пример #4
0
zeta_T = 16

for i, zeta in enumerate(zeta_levs):
    if (zeta < zeta_T):
        Tphumb[i] = T_s - gamma_ph * zeta
    else:
        Tphumb[i] = T_s - gamma_ph * zeta_T

Told = np.zeros(plevs.shape)
Tnew = np.zeros(plevs.shape)

for i, p in enumerate(plevs[:-1]):
    Tgm[i + 1] = Tgm[i] * (1 + gamma_m * c.Rd * delp / p)
    Tgd[i + 1] = Tgd[i] * (1 + gamma_d * c.Rd * delp / p)
    Told[i] = findTmoist.findTmoist(thetae0, p)
    Tnew[i] = findTmoist_new.findTmoist(thetae0, p, q_sat, 0)

plt.figure(1)
plt.plot(Told[:-1],
         plevs[:-1] / 100.,
         color='r',
         label='Told - root finder moist adiabat')
plt.plot(Tnew[:-1],
         plevs[:-1] / 100.,
         color='b',
         label='Tnew - root finder moist adiabat')
plt.plot(Tgm[:-1], plevs[:-1] / 100., 'g--', label='constant gamma_m')
plt.plot(Tgd[:-1], plevs[:-1] / 100., 'k--', label='constant gamma_d')
plt.plot(Tphumb, plevs / 100., color='y', label='pierre humbert profile')
plt.legend()
#plt.gca().invert_yaxis()