; ;jeff snider, univeristy of wyoming, march 2006 ; pro set_common, j_updraft, w_passed ; common constants, gascon, rho_h2o, mw_nh42so4, rho_nh42so4, sigma_0, $ sigma_t, dsigmadmolality_nh42so4, dsigmadmolality_nacl, mw_h2o, $ mw_nacl, rho_nacl, tkmelt, c_nh42so4, a_nh42so4, c_nacl, a_nacl, $ cp_air_o, cp_h2o_o, mw_air, gravity, p0, alpha, beta_local, $ gascon_h2o, cw_h2o_o, tk_o, lv_o, ew_o, tk_aerosol, salt_type, $ epsilon, c_twomey, k_twomey, aerosol_type, right_tail, $ gascon_air, tc_base, tk_base, p_base, h_start, hmax, $ r0, dt, rmin, rmax, coef, epsilon_aerosol, specific_volume_meas, $ nchan, mw_salt, rho_salt, a_salt, c_salt, specific_volume_base, $ dsigmadmolality_salt, rho_insoluble, volume_insoluble_to_soluble, $ mixrat_tot_1,r_1,geo_sigma_1,mixrat_tot_2,r_2,geo_sigma_2, $ tk_start,p_start,sratio_start,mixrat_tot_3,r_3,geo_sigma_3 ; if j_updraft eq 0 then begin w_passed = 10.d endif else if j_updraft eq 1 then begin w_passed = 5.0d endif else if j_updraft eq 2 then begin w_passed = 2.0d endif else if j_updraft eq 3 then begin w_passed = 1.0d endif else if j_updraft eq 4 then begin w_passed = 0.5d endif ; ;.lognorm or twomey ; aerosol_type = 'lognorm' ; ;.set to "1" if you want concentration for particles larger than largest ;.size included in the ccn spectrum (see ccn_spectrum.pro) ; right_tail = 1 ; ;.density of the insoluble material ; rho_insoluble = 1700.d ; ;mass condensation coefficient ; beta_local = 1.0d ; ;soluble mass fraction ; epsilon_aerosol = 1.0d ; salt_type = 'nh42so4' ;choices are ammonium sulfate and sodium chloride alpha = 1.0d ;thermal accommodation coefficient p0 = 101325.d ;reference pressure for gas kinetic properties and model initilization gravity = 9.81d mw_air = 0.028964d ew_o = 610.7d ;evaluated at tk_o cp_h2o_o = 1869.4d ;evaluated at tk_o and 800 mb cp_air_o = 1005.2d ;evaluated at tk_o and 800 mb cw_h2o_o = 4218.0d tk_o = 273.15d ;reference temperature for thermodynamic constants (heat capacities, latent heat, sat. vap. pressure) lv_o = 2500800.d gascon = 8.3144d rho_h2o = 997.1d mw_nh42so4 = 0.13214d rho_nh42so4 = 1769.d sigma_0 = 7.61d-2 sigma_t = 1.55d-4 dsigmadmolality_nh42so4 = 2.17d-3 dsigmadmolality_nacl = 1.62d-3 mw_h2o = 0.018015d mw_nacl = 0.05844d rho_nacl = 2165.d tkmelt = 273.15d ;melting temp. of water - used for converting between C and K c_nh42so4 = [-2.715d-3, 3.113d-5, -2.336d-6, 1.412d-8] a_nh42so4 = [5.92d-3, -5.036d-6, 1.024d-8, 0.000d-8] c_nacl = [-6.366d-3, 8.624d-5, -1.158d-5, 1.518d-7] a_nacl = [7.41d-3, -3.741d-5, 2.252d-6, -2.06d-8] gascon_air = gascon/mw_air ;specific gas constant gaz pour l'air sec gascon_h2o = gascon/mw_h2o ;specific gas constant gaz pour la vapeur d'eau epsilon = mw_h2o / mw_air ; ;temperature used for kohler thermodynamics ; tk_aerosol = 298.15d ; ;cloud base state ; tc_base = 10.d p_base = 0.9d5 tk_base = tc_base + tkmelt r_v_base = epsilon * ew_jeff(tk_base) / (p_base - ew_jeff(tk_base)) specific_volume_base = (tk_base/p_base)*(gascon_air + r_v_base*gascon_h2o) ; ;starting state, put into common block via *start_moist_isentrope_from_cloudbase* ; sratio_start = 0.95d start_moist_isentrope_from_cloudbase ; ;state at the location of aerosol/ccn measurement ; rh_meas_ratio = 0.0d tc_meas = 25.d tk_meas = tc_meas + tkmelt p_meas = 0.9d5 e_meas = rh_meas_ratio * ew_jeff(tk_meas) r_v_meas = epsilon * e_meas / (p_meas - e_meas) specific_volume_meas = (tk_meas/p_meas)*(gascon_air + r_v_meas*gascon_h2o) ; ;describe the aerosol: For "lognorm" the assumption in *ccn_spectrum* ;is that aerosol are expressed as a number mixing ratio per kg of dry air ; r_1 = 0.021d-6 geo_sigma_1 = 1.53d mixrat_tot_1 = 10000.d6 * specific_volume_meas r_2 = 0.0435d-6 geo_sigma_2 = 2.04d mixrat_tot_2 = 1000.d6 * specific_volume_meas r_3 = 0.4d-6 geo_sigma_3 = 2.0d mixrat_tot_3 = 0.d6 * specific_volume_meas ; ;for "twomey" "c_twomey" is the concentration at the state where the ;CCN measurements are made (see Johnson, 1981) ; c_twomey = 100.d6 k_twomey = 0.7d ; ;other initial conditions ; r0 = 1.3d-6 ;Taille limite des goutelettes prises en compte pour le calcul de la concentration ; hmax = 300.d ;height extent of simulation (m) ; ;numerics ; coef = 1.09d ;ri+1/ri ratio ; dt = 0.10d ;big time step for energetics of parcel ; ;thermodynamic constants for salt solutions ; if salt_type ne 'nacl' and salt_type ne 'nh42so4' then begin print, '*set_common* ',salt_type, ' no data for requested salt' stop endif ; if salt_type eq 'nacl' then begin mw_salt = mw_nacl rho_salt = rho_nacl a_salt = a_nacl c_salt = c_nacl dsigmadmolality_salt = dsigmadmolality_nacl endif else if salt_type eq 'nh42so4' then begin mw_salt = mw_nh42so4 rho_salt = rho_nh42so4 a_salt = a_nh42so4 c_salt = c_nh42so4 dsigmadmolality_salt = dsigmadmolality_nh42so4 endif ; ;.The conversion from dry size to salt (or insoluble) size is made via the factor "volume_insoluble_to_soluble" ; volume_insoluble_to_soluble = rho_salt*(1.d - epsilon_aerosol)/(rho_insoluble*epsilon_aerosol) ; ;. min and max size ; rmin = (1.d-22 / (rho_salt*4.d*!pi/3.d))^(1.d/3.d) rmax = (1.d-14 / (rho_salt*4.d*!pi/3.d))^(1.d/3.d) ; return ; end