; ;jeff snider, univeristy of wyoming, march 2006 ; pro scrit, salt_size, insoluble_size, sratio_crit, activation_size ; 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 ; tk = tk_aerosol ; ;reject requests with unrealistic values of salt_size ; if salt_size lt 0.d then begin print,'*scrit* ',salt_size stop endif ; if salt_type eq 'nacl' then begin wet_size = (4.d*salt_size^3.d + insoluble_size^3.d)^(1.d/3.d) endif else if salt_type eq 'nh42so4' then begin wet_size = (2.d*salt_size^3.d + insoluble_size^3.d)^(1.d/3.d) endif ; crit_flag = 1 sratio_bdry, crit_flag, wet_size, salt_size, insoluble_size, sratio, loop_count, mw_on_mtot, rho_solution, $ water_activity, molality, wgtf, sigma, kelvin sratio_new = sratio sratio_old = 0.99d * sratio count = 0 ; ;calculate the critical supersaturation ; while sratio_new gt sratio_old do begin count = count + 1 crit_flag = 1 wet_size = wet_size*1.01d sratio_bdry, crit_flag, wet_size, salt_size, insoluble_size, sratio, loop_count, mw_on_mtot, rho_solution, $ water_activity, molality, wgtf, sigma, kelvin sratio_old = sratio_new sratio_new = sratio endwhile ; ;print, format = '(2i10,x,e12.3,2(x,f9.7),x,e12.3,x,f9.5,x,e12.3,2(x,f9.5))', count, loop_count, salt_size, sratio_old, sratio_new, $ ; 2.*(sratio_new-sratio_old)/(sratio_old+sratio_new), water_activity, wet_size, molality, wgtf ; sratio_crit = sratio_old activation_size = wet_size ; ;print, format = '(x,f9.5,x,e12.3,x,f9.5,x,e12.3,2(x,f9.5),x,f9.1)', sratio_old, salt_size, water_activity, wet_size, molality, wgtf, rho_solution ; return ; end