pro condensed_water_parameterization3 common cond_input, lwp,ze,temp,vdop,vap,z common cond_output, iwc, lwc, frac common cond_output2, re_liq, re_ice ccm3_liquid_profile=fltarr(n_elements(z)) & liquid_wt=fltarr(n_elements(z)) lwc=fltarr(n_elements(z)) & iwc=fltarr(n_elements(z)) re_liq=fltarr(n_elements(z)) & re_ice=fltarr(n_elements(z)) common seedit, seed ;print, ze if n_elements(seed) eq 0 then seed=1.e8*systime(/julian) rms_flag=0 for j=0,n_elements(z)-1 do begin if ze[j] gt -9999. then begin ccm3_ice_frac=ccm3_cloud_iceliquid_fraction_param_function(temp[j]) ;print, z[j], ' is height going into liquid param' ccm3_liquid_profile[j]=(1.-ccm3_ice_frac)*ccm3_liquid_water_param_function(z[j], vap) endif endfor ; What fraction of the lwp occurs at temps colder than freezing based on the CCM3 profile? warm_water=0. & j=0. & total_sqrtZ_warm=0. & ccm3_cold_water=0. for j=0,n_elements(z)-1 do begin if temp[j] gt 273. and ze[j] gt -9999. then begin warm_water=warm_water+ccm3_liquid_profile[j] total_sqrtZ_warm=total_sqrtZ_warm+(sqrt(ze[j])) endif if temp[j] le 273. and ze[j] gt -9999. then begin ccm3_cold_water=ccm3_cold_water+ccm3_liquid_profile[j] endif endfor warm_water_path=lwp*(warm_water/(total(ccm3_liquid_profile))) cold_water_path=lwp-warm_water_path ; so now distribute the warm water path vertically based on square root of Z for j=0,n_elements(z)-1 do begin if temp[j] gt 273. and ze[j] gt -9999. then begin lwc[j]=((sqrt(ze[j]))/total_sqrtZ_warm)*(warm_water_path/90.) ; if rms_flag eq 1 then begin ; lwc[j]=lwc[j]+((randomn(seed,/normal))*lwc[j]) ; if lwc[j] le 0.0 then lwc[j]=((sqrt(ze[j]))/total_sqrtZ_warm)*(warm_water_path/90.) ;print, ((randomn(seed,/normal))*lwc[j]) ,lwc[j], format='(e17.9,1x,e17.9)' ; endif if lwc[j] lt 1.e-4 then lwc[j]=0.0 endif else begin if ze[j] gt -9999. then lwc[j]=(cold_water_path*(ccm3_liquid_profile[j]/ccm3_cold_water))/90. if rms_flag eq 1 then begin lwc[j]=lwc[j]+((2.*randomn(seed,/normal))*lwc[j]) if lwc[j] le 0.0 then lwc[j]=(cold_water_path*(ccm3_liquid_profile[j]/ccm3_cold_water))/90. endif if lwc[j] lt 1.e-4 then lwc[j]=0.0 endelse if 10.*alog10(ze[j]) lt 0.0 and ze[j] gt -9999. and lwc[j] ge 1.e-4 then begin re_liq[j]=19.5*exp(0.0384*(10.*alog10(ze[j]))) re_liq[j]=re_liq[j]+(0.20*re_liq[j]) endif else begin if ze[j] gt -9999. and lwc[j] ge 1.e-4 then re_liq[j]=15. ; was 8.4 6/29/05 endelse rold=re_liq[j] ; if rms_flag eq 1 then begin ; re_liq[j]=re_liq[j]+((randomn(seed,/normal))*re_liq[j]) ; if re_liq[j] le 0.0 then re_liq[j]=rold ; endif endfor ; now convert the liquid profile to a weighting function ; if lwp gt 0.0 and lwp lt 1.e4 then begin ;for j=0,n_elements(z)-1 do begin ; if ze[j] gt -9999. then begin ;if total(ccm3_liquid_profile) gt 0.0 then begin ; liquid_wt[j]=ccm3_liquid_profile[j]/total(ccm3_liquid_profile) ;endif else begin ; liquid_wt[j]=0.0 ;endelse ;lwc[j]=(liquid_wt[j]*(lwp))/90. ; assume 90m range gates; ; ;if 10.*alog10(ze[j]) lt 0.0 then begin ; re_liq[j]=19.5*exp(0.0384*(10.*alog10(ze[j]))) ;endif else begin ; re_liq[j]=8.4 ;endelse ;re_liq[j]=5.0 ;print, liquid_wt[j],lwc[j],re_liq[j],((3./2.)*lwc[j]/re_liq[j])*90.,' is the liquid wt, lwc, and re' ; endif ;endfor ; endif ; now determine the ice water content from the regression data. Assume all water warmer than -15c and the regression below applies ; to all ice at colder temps bz=-2.0 & ba=1.7 ;IDL> print, r1 this is based on most data from 2000 iop with temp not in cc ; 0.509637 0.640465 0.0502367 ;IDL> print, rmul1 ; 0.660524 ;IDL> print, mlr_coeff1 ; 1.95209e-008 ; 1.64473e-007 ;-4.37153e-010 ;IDL> print, mlr_const1 ; 1.07064e-007 ; 9/17/2004 ;IDL> print, mlr_coeff1 ; 8.76098e-008 ; 2.67518e-010 ;IDL> print, mlr_const1 ;-1.52032e-008 ;coef=-1.52032e-008 & coef=[coef,8.76098e-008] & coef=[coef,2.67518e-010]; & coef=[coef,-4.37153e-010] coef=-8.434e-009 & coef=[coef,6.721e-008] & coef=[coef,2.409e-010]; & coef=[coef,-4.37153e-010] ; changed using King correction 6/10/2005 bz=-2.4 & ba=1.0 & bm=1.8 & bi=0.6 ;print, ze for j=0,n_elements(z)-1 do begin if ze[j] gt -9999. and temp[j] lt 273. and z[j] gt 2000. then begin if temp[j] gt 268. and 10.*alog10(ze[j]) gt 10. then begin zzz=10.^(10./10.) endif else begin zzz=ze[j] ;0.631 ; remove 2 db for removal of liquid - this is a test 6/24/2005 ;print, 'adjusting z in cond2' endelse if vdop[j] lt 0. then vdop[j]=0.5 ;z_temp=((ze[j]))^0.6 ;v_temp=vdop[j]*((zzz))^(ba/(6.+bz)) v_temp=vdop[j]*(((zzz)))^((ba/((6.+bz)))) ;v_temp2=vdop[j]*(((zzz/0.25)))^((ba/((6.+bz)))) ;t_temp=611.*exp(((2.5e6)/461.5)*((1./273.)-(1./temp[j]))) ;t_temp=temp[j] t_temp=611.*exp(((2.5e6)/461.5)*((1./273.)-(1./temp[j]))) ;iwc[j]=coef[0]+(coef[1]*v_temp)+(coef[2]*t_temp) ; commented out for new physical param 8/11/05 ;iwc_test=coef[0]+(coef[1]*v_temp2)+(coef[2]*t_temp) fofvz=alog10((0.251)*((zzz*1.e-12)/0.00164)*((5135./(vdop[j]*100.))^1.18)) iwc[j]=10.^(((-2.22)+(0.638*fofvz)+((-7.18e-5)*t_temp))) ;print, zzz, vdop[j],iwc[j],iwc2, ' is old iwc and physical iwc' ;stop iwc[j]=iwc[j]*1.e6 ; converts to g/m3 if iwc[j] lt 0. or lwp le 10. then begin iwc[j]=liu_illingworth_cirrus_regression(10.*alog10(ze[j]), temp[j], 'mid') ;print, 'iwc lt 0 or lwp le 0 - using L&I in cond2' ;ice_fraction[l,j]=1. ;iwc_source[l,j]=landi_index endif if rms_flag eq 1 then begin iwc[j]=iwc[j]+((randomn(seed,/normal))*iwc[j]) if iwc[j] le 0.0 then iwc[j]=coef[0]+(coef[1]*v_temp)+(coef[2]*t_temp) endif ;print, j,iwc[j],10.*alog10(zzz),10.*alog10(ze[j]),temp[j],vdop[j] ;re_ice[j]=15. re_ice[j]=ccm3_cloud_ice_re_param_function(exp(-z[j]/5500.)) re_ice[j]=re_ice[j]+(re_ice[j]*0.10) ; a test to decrease the optical depth 6/24/05 ;print, 're ice is ',re_ice[j],exp(-z[j]/5500.) ; if rms_flag eq 1 then begin ; re_ice[j]=re_ice[j]+((randomn(seed,/normal))*re_ice[j]) ; if re_ice le 0.0 then re_ice[j]=ccm3_cloud_ice_re_param_function(exp(-z[j]/5500.)) ; endif endif else begin iwc[j]=0.0 re_ice[j]=0. endelse endfor ;for j=0,n_elements(re_liq)-1 do begin ;if re_liq[j] gt 0.0 then re_liq[j]=re_liq[j]+(re_liq[j]*0.20) ;endfor return end