pro append_cldmicro_to_5minavg common five_min_data_input2, hrfrac5,jday5,height5,dbz5,nppts5,npts5,cbase5,ctop5, $ vel5, width5,temp5, pressure5, n_layers5,bzl15,tzl15,btl15,ttl15,bzl25,tzl25,btl25,ttl25, $ bzl35,tzl35,btl35,ttl35,bzl45,tzl45,btl45,ttl45,fluxclear5,solrat5,lwp5,vceil5,vap5 common cldmicro_output, iwc_out, re_ice_out, icemicro_error, iwc_source, ice_size_source, ice_tau_solar, $ ice_omega_solar, ice_g_solar,ice_tau_ir,ice_omega_ir, ice_g_ir,ice_rad_param_source, lwc_out, re_liq_out, liqmicro_error, $ lwc_source, liq_size_source, liq_tau_solar, liq_omega_solar, liq_g_solar, liq_tau_ir, liq_omega_ir, $ liq_g_ir,liq_rad_param_source, ice_fraction, rap_solar_wl, rap_ir_wl ; the raprad solar band centers: rap_solar_wl=[2.563000e-1,2.779478e-1,2.951274e-1,3.173065e-1, $ 3.451361e-1,3.850000e-1,4.297729e-1,4.848632e-1,5.288400e-1, $ 0.5448,5.580500e-1,5.858000e-1,6.150000e-01,6.458500e-1, $ 6.754386e-1,6.943129e-1,7.235312e-1,7.670463e-1,8.179684e-1, $ 8.667137e-1,9.319378e-1,1.010325,1.119966,1.355064, $ 1.564696,1.789124,2.059131,2.214327,2.638542, $ 3.318655,3.813210,4.298329] ; these are the band edges for the IR ;rap_ir_wl_edges=[4.546,4.878,5.128,5.405,5.714,6.061,6.452,6.897,7.407,8.333,9.009,10.309,12.500,$ ;13.889,16.667,20.000,26.316,35.714,62.50] rap_ir_wl=[3.589742e+00,4.023917e+00,4.323063e+00,4.626068e+00,5.181624e+00,6.156156e+00, $ 6.975501e+00,7.834411e+00,8.866918e+00,9.639834e+00,1.119960e+01,1.324042e+01,1.597937e+01, $ 1.793651e+01,3.000000e+01,5.200000e+02] ;for j=0,n_elements(rap_ir_wl_edges)-2 do begin ;rap_ir_wl=(rap_ir_wl_edges[j]+rap_ir_wl_edges[j+1])/2. ;endfor fname='c:\mace\sgpfivemin\sgp.average.5min.20000309.000000_working.cdf' site='sgp' if site eq 'sgp' or site eq 'nsa' then land_flag=1 if site eq 'twp' then land_flag=0 get_5min_avg, fname ; pull in any cloud property retrieval files for this day. The cloud effective size and water ; content and estimates of uncertainty in the time height array of the 5 minute file. dz=height5[10]-height5[9] ; this is for use later on (should be in meters) n_ciret=2 & n_stret=1 ciret1_fname=' ' if ciret1_fname ne ' ' then get_ciret1_5min, ciret1_fname, hrfrac5, jday5, height5, ciret1_iwc5, $ ciret1_dge5, ciret1_error_frac, ciret1_tau5, ciret1_omega5, ciret1_g5 ciret2_fname=' ' if ciret2_fname ne ' ' then get_ciret2_5min, ciret2_fname, hrfrac5, jday5, height5, ciret2_iwc5,$ ciret2_dge5, ciret2_error_frac, ciret2_tau5, ciret2_omega5, ciret2_g5 stret1_fname=' ' if stret1_fname ne ' ' then get_stret1_5min, stret1_fname, hrfrac5, jday5, height5, stret1_lwc5, stret1_re5, stret1_error_frac, $ stret1_tau5, stret1_omega5, stret1_g5 ; source indexes for the cloud microphysics: ciret1_index=1 ; ciret1 - mace et al 1998 iwc and rei index 1 ciret2_index=2 ; ciret2 - mace et al 2001 iwc and rei index 2 ccm3_param_index=3 ; ccm3 parameterization landi_index=4 ; Liu and Illingworth iwc regression retrieval stret1_index=5 ; Dong et al 1998 parameterization stret2_idnex=6 ; Dong and Mace 2001 retrieval frisch98_index=7 ; frisch et al 1998 lwc retrieval ; source indexs for cloud optical properties fu_solar_index=1 fu_ir_index=2 fuliou_index=4 ebertcurry_index=5 ccm3_rad_index=3 chyleck_index=6 ; run through the cloudmask and assign microphysical values as appropriate iwc_out=dbz5 & iwc5=dbz5 & iwc5[*,*]=-9999. re_ice_out=dbz5 & ice_size5=dbz5 & ice_size5[*,*]=-9999. icemicro_error=dbz5 & icemicro_error[*,*]=-9999. iwc_source=intarr(n_elements(hrfrac5),n_elements(height5)) ice_size_source=intarr(n_elements(hrfrac5),n_elements(height5)) ice_tau_solar=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_solar_wl)) ; the 32 is for the raprad solar bands ice_omega_solar=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_solar_wl)) ice_g_solar=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_solar_wl)) ice_tau_ir=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_ir_wl)) ; the 16 is for the raprad ir bands ice_omega_ir=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_ir_wl)) ice_g_ir=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_ir_wl)) ice_rad_param_source=intarr(n_elements(hrfrac5),n_elements(height5),2) ; solar and ir lwc_out=dbz5 & lwc5=dbz5 & lwc5[*,*]=-9999. re_liq_out=dbz5 & re5=dbz5 & re5[*,*]=-9999. liqmicro_error=dbz5 & liqmicro_error[*,*]=-9999. lwc_source=intarr(n_elements(hrfrac5),n_elements(height5)) liq_size_source=intarr(n_elements(hrfrac5),n_elements(height5)) liq_tau_solar=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_solar_wl)) ; the 32 is for the raprad bands liq_omega_solar=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_solar_wl)) liq_g_solar=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_solar_wl)) liq_tau_ir=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_ir_wl)) ; the 18 is for the raprad ir bands liq_omega_ir=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_ir_wl)) liq_g_ir=fltarr(n_elements(hrfrac5),n_elements(height5),n_elements(rap_ir_wl)) liq_rad_param_source=intarr(n_elements(hrfrac5),n_elements(height5),2) ; solar and ir ice_fraction=fltarr(n_elements(hrfrac5),n_elements(height5)) ; run through the data twice looking for clouds. first time thorugh assign the best ; retrieval value as appropriate. The 2nd time through assign defualt or regression ; values. for j=0, n_elements(jday5)-1 do begin for k=0,n_elements(height5)-1 do begin if dbz5[j,k] gt -9999. then begin if n_elements(ciret1_error_frac) gt 0 then begin if ciret1_error_frac[j,k] ne -9999. then begin iwc5[j,k]=ciret1_iwc5[j,k] dge5[j,k]=ciret1+dge5[j,k] icemicro_error[j,k]=ciret1_error_frac[j,k] endif endif if n_elements(ciret2_error_frac) gt 0 then begin if ciret2_error_frac[j,k] ne -9999. and ciret2_error_frac[j,k] lt ciret1_error_frac[j,k] then begin iwc5[j,k]=ciret2_iwc5[j,k] dge5[j,k]=ciret2+dge5[j,k] icemicro_error[j,k]=ciret2_error_frac[j,k] endif endif if n_elements(stret1_error_frac) gt 0 then begin if stret1_error_frac[j,k] ne -9999. then begin lwc5[j,k]=stret1_lwc5[j,k] re5[j,k]=stret1_re5[j,k] liqmicro_error[j,k]=stret1_error_frac[j,k] endif endif endif endfor endfor num_layers=intarr(n_elements(jday5)) ;;;; put default microphysics to areas where no retrievals are found for j=0, n_elements(jday5)-1 do begin if max(dbz5[j,*]) gt -9999. then begin ; determine what kind of layers we might have. Insert Wang and Sassens characterizations here max_layer_dbz=fltarr(10) & max_layer_temp=fltarr(10) & min_layer_temp=fltarr(10) max_layer_dbz_temp=fltarr(10) & adiab_dbz_ratio=fltarr(10) layer_base=fltarr(10) & layer_top=fltarr(10) & base_temp=fltarr(10) max_coverage=fltarr(10) & npts_layer=intarr(10) & nppts_layer=intarr(10) layer_base_index=intarr(10) & layer_top_index=intarr(10) & layer_dbzsq=fltarr(10) k=0 & num_layers[j]=0 while k le n_elements(height5)-1 do begin if dbz5[j,k] gt -9999. and lwc[j,k] eq -9999. and iwc[j,k] eq -9999. then begin ; we are at a layer base num_layers[j]=num_layers[j]+1 max_layer_dbz[num_layers[j]-1]=-9999. & max_layer_temp[num_layers[j]-1]=-9999. min_layer_temp[num_layers[j]-1]=-9999. max_layer_dbz_temp[num_layers[j]-1]=-9999. & adiab_dbz_ratio[num_layers[j]-1]=0. npts_layer[num_layers[j]-1]=0 & nppts_layer[num_layers[j]-1]=0 & max_coverage[num_layers[j]-1]=-9999. layer_base[num_layers[j]-1]=height5[k] & base_temp[num_layers[j]-1]=temp5[j,k] layer_base_index[num_layers[j]-1]=k while dbz5[j,k] gt -9999. do begin layer_dbzsq[num_layers[j]-1]=layer_dbzsq[num_layers[j]-1]+((10.^(dbz5[j,k]/10.))^0.5) npts_layer[num_layers[j]-1]=npts_layer[num_layers[j]-1]+npts5[j,k] nppts_layer[num_layers[j]-1]=nppts_layer[num_layers[j]-1]+nppts5[j,k] if float(npts5[j,k])/float(nppts5[j,k]) gt max_coverage[num_layers[j]-1] then $ max_coverage[num_layers[j]-1]=float(npts5[j,k])/float(nppts5[j,k]) if dbz5[j,k] gt max_layer_dbz[num_layers[j]-1] then $ max_layer_dbz_temp[num_layers[j]-1]=temp5[j,k] if dbz5[j,k] gt max_layer_dbz[num_layers[j]-1] then $ max_layer_dbz[num_layers[j]-1]=dbz5[j,k] if temp5[j,k] gt max_layer_temp[num_layers[j]-1] then $ max_layer_temp[num_layers[j]-1]=temp5[j,k] if temp5[j,k] lt min_layer_temp[num_layers[j]-1] then $ min_layer_temp[num_layers[j]-1]=temp5[j,k] if float(npts5[j,k])/float(nppts5[j,k]) gt max_frac[num_layers[j]-1] then $ max_frac[num_layers[j]-1]=float(npts5[j,k])/float(nppts5[j,k]) adiab_dbz=-71.+(0.3*T)-((5.3e-3)*(base_temp^2))+ $ ((height5[k]-layer_base)*(20.+((1.8e-2)*(base_temp))+((2.4e-3)*(base_temp^2)))) adiab_dbz_ratio[num_layers[j]-1]=adiab_dbz_ratio[num_layers[j]-1]+(dbz5[j,k]/adiab_dbz) k=k+1 layer_top[num_layers[j]-1]=height5[k] & layer_top_index[num_layers[j]-1]=k endwhile adiab_dbz_ratio[num_layers[j]-1]=adiab_dbz_ratio[num_layers[j]-1]/float(k) if abs(layer_base[num_layers[j]-1]-layer_top[num_layers[j]-1]) lt 200. then num_layers[j]=num_layers[j]-1 endif ; if dbz5[j,k] gt -9999. and lwc[j,k] eq -9999. and iwc[j,k]=-9999. then begin k=k+1 endwhile ;do while k le n_elements(height)-1 do begin ;;; now classify the layers based on their characteristics for l=0,num_layers[j] do begin ; type 1 warm non precip stratus single layer if max_layer_temp[l] gt 273. and min_layer_temp[l] gt 268. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] lt 1.25 $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) lt 90. then begin ; the layer is type 1 layer_type[j,l]=1 ; warm liquid stratus, non precip. endif ; type 1 ; type 2 cold low level stratus with liquid, non precip if max_layer_temp[l] lt 273. and min_layer_temp[l] gt 263. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] lt 1.25 $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) lt 90. then begin ; the layer is type 2 layer_type[j,l]=2 ; cold low level stratus with liquid, non precip endif ; type 2 ; type 3 warm low level stratus, with precip if max_layer_temp[l] gt 273. and min_layer_temp[l] gt 268. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] gt 1.25 $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) gt 90. then begin ; the layer is type 3 layer_type[j,l]=3 ; warm low level stratus, with precip endif ; type 3 ; type 4 cold low level stratus, with precip if max_layer_temp[l] lt 273. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] gt 1.25 $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) gt 90. then begin ; the layer is type 4 layer_type[j,l]=4 ; cold low level stratus, with precip, lowest layer endif ; type 4 ; type 5 warm low level broken clouds, non precip if max_layer_temp[l] gt 273. and min_layer_temp[l] gt 268. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] lt 1.25 $ and max_coverage[l] lt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) lt 90. then begin ; the layer is type 5 layer_type[j,l]=5 ; warm low level broken, non precip, lowest layer endif ; type 5 ; type 6 cold low level less than overcast clouds, non precip if max_layer_temp[l] lt 273. and min_layer_temp[l] gt 263. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] lt 1.25 $ and max_coverage[l] lt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) lt 90. then begin ; the layer is type 6 layer_type[j,l]=6 ; cold low level broken, non precip endif ; type 6 ; type 7 deeper low level broken clouds, non precip if layer_top_height[l]-layer_base_height[l] lt 5000. $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) lt 90. then begin ; the layer is type 7 layer_type[j,l]=7 ; deeper low level broken clouds, non precip endif ; type 7 ; type 8 deep broken clouds, non precip if layer_top_height[l]-layer_base_height[l] gt 5000. $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) lt 90. then begin ; the layer is type 8 layer_type[j,l]=8 ; deep broken clouds, non precip endif ; type 8 ; type 9 deep liquid or mixed precip if layer_top_height[l]-layer_base_height[l] gt 5000. $ and liq5[j] gt 0. $ and layer_base_height[l] lt 3000. $ and vceil5 gt 0. and abs(vceil5[j]-layer_base_height[l]) gt 90. then begin ; the layer is type 6 layer_type[j,l]=9 ; deep liquid or mixed precip endif ; type 9 ; type 10 warm non precip alto stratus single layer if max_layer_temp[l] gt 273. and min_layer_temp[l] gt 268. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] lt 1.25 $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] gt 3000. then begin ; the layer is type 10 layer_type[j,l]=10 ; warm liquid stratus, lowest layer, non precip. endif ; type 10 ; type 11 cold non precip alto stratus single layer if max_layer_temp[l] lt 273. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] lt 1.25 $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] gt 3000. then begin ; the layer is type 11 layer_type[j,l]=11 ; cold liquid alto stratus, lowest layer, non precip endif ; type 11 ; type 12 cold precip alto stratus if max_layer_temp[l] lt 273. $ and layer_top_height[l]-layer_base_height[l] lt 5000. $ and adiab_dbz_ratio[l] gt 1.25 $ and max_coverage[l] gt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] gt 3000. then begin ; the layer is type 12 layer_type[j,l]=12 ; cold liquid alto stratus, with precip endif ; type 12 ; type 13 cold precip alto cu if max_layer_temp[l] lt 273. $ and layer_top_height[l]-layer_base_height[l] lt 2000. $ and adiab_dbz_ratio[l] lt 1.25 $ and max_coverage[l] lt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] gt 3000. then begin ; the layer is type 13 layer_type[j,l]=13 ; cold liquid alto cu, non precip endif ; type 13 ; type 14 cold precip alto cu if max_layer_temp[l] lt 273. $ and layer_top_height[l]-layer_base_height[l] gt 1000. $ and adiab_dbz_ratio[l] gt 1.25 $ and max_coverage[l] lt 0.8 $ and liq5[j] gt 0. $ and layer_base_height[l] gt 3000. then begin ; the layer is type 12 layer_type[j,l]=14 ; cold liquid alto cu, non precip endif ; type 14 ; type 15 upper trop cirrus, single layer if max_layer_temp[l] lt 273. $ and layer_top_height[l]-layer_base_height[l] gt 1000. $ and max_layer_dbz_temp[l] lt 240. $ and max_coverage[l] gt 0.8 $ and l eq 0 then begin ; the layer is type 15 layer_type[j,l]=15 ; upper trop cirrus, single layer endif ; type 15 endfor ;for l=0,num_layers[j] do begin ; have looped through the layers and assigned type. Now assign microphysics and radiative properties for ll=0,num_layers[j] do begin ; determine the surface pressure kkk=0 while pressure5[j,kkk] le 0 do begin kkk=kkk+1 endwhile p_sfc=pressure5[j,kkk] ; go by cloud type class and apply best logic available. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 1 $ ; warm stratus or layer_type[j,ll] eq 10 $ ; warm alto stratus then begin ; move up from bottom and calcualte or assign the microphysics as appropriate for l=layer_base_index[0],layer_top_index[0] do begin if stret1_lwc5[j,l] ne -9999. then begin lwc_out[j,l]=stret1_lwc5[j,l] & lwc_source[j,l]=dong98_index re_liq_out[j,l]=stret1_re5[j,l] & liq_size_source[j,l]=dong98_index endif else begin ; calculate the microphysics ;now need the parameterization of re lwc_out[j,l]=liq5[j]*(((10.^(dbz5[j,k]/10.))^0.5)/(layer_dbzsq[num_layers[j]-1])) lwc_source[j,l]=frisch98_index p_ratio=pressure5[j,l]/p_sfc re_liq_out[j,l]=ccm3_cloud_liquid_re_param_function(temp[j,l], p_ratio, land_flag) liq_size_source[j,l]=ccm3_param_index ice_fraction[j,l]=0. endelse endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 2 then begin ; cold stratus ; move up from bottom and calcualte or assign the microphysics as appropriate for l=layer_base_index[0],layer_top_index[0] do begin if stret1_lwc5[j,l] ne -9999. then begin lwc_out[j,l]=stret1_lwc5[j,l] & lwc_source[j,l]=dong98_index re_liq_out[j,l]=stret1_re5[j,l] & liq_size_source[j,l]=dong98_index endif else begin ; calculate the microphysics ;now need the parameterization of re lwc_out[j,l]=liq5[j]*(((10.^(dbz5[j,k]/10.))^0.5)/(layer_dbzsq[num_layers[j]-1])) lwc_source[j,l]=frisch98_index p_ratio=pressure5[j,l]/p_sfc re_liq_out[j,l]=ccm3_cloud_liquid_re_param_function(temp[j,l], p_ratio, land_flag) liq_size_source[j,l]=ccm3_param_index ice_fraction[j,l]=0. endelse endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 3 then begin ; warm low level stratus with precip ; move up from bottom and calcualte or assign the microphysics as appropriate for l=layer_base_index[0],layer_top_index[0] do begin if stret1_lwc5[j,l] ne -9999. then begin lwc_out[j,l]=ccm3_liquid_water_param_function(height5[l], vap5[j,l]) lwc_source[j,l]=ccm3_param_index p_ratio=pressure5[j,l]/p_sfc re_liq_out[j,l]=ccm3_cloud_liquid_re_param_function(temp[j,l], p_ratio, land_flag) liq_size_source[j,l]=ccm3_param_index ice_fraction[j,l]=0. endif endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 4 $ ; cold low level stratus with precip or layer_type[j,ll] eq 7 $ ; deeper low level broken clouds, non precip or layer_type[j,ll] eq 8 $ ; deep broken clouds, non precip or layer_type[j,ll] eq 9 $ ; deep liquid or mixed precip or layer_type[j,ll] eq 11 $ ; cold AS or layer_type[j,ll] eq 12 $ ; cold AS then begin ; move up from bottom and calcualte or assign the microphysics as appropriate ; need to calcualte the ice and liquid fraction in each level for l=layer_base_index[0],layer_top_index[0] do begin ; ensure we start at the base of the layer as defined by the ceilometer if height5[l]-vceil5[j] gt -45. then begin ; this accounts for cases when vceil is -9999. ;if stret1_lwc5[j,l] ne -9999. then begin lwc_out[j,l]=ccm3_liquid_water_param_function(height5[l], vap5[j,l]) lwc_source[j,l]=ccm3_param_index ice_fraction[j,l]=ccm3_cloud_iceliquid_fraction_param_function(temp5[j,l]) iwc_out[j,l]=ice_fraction[j,l]*lwc_out[j,l] iwc_source[j,l]=ccm3_param_index lwc_out[j,l]=(1.-ice_fraction[j,l])*lwc_out[j,l] p_ratio=pressure5[j,l]/p_sfc re_liq_out[j,l]=ccm3_cloud_liquid_re_param_function(temp[j,l], p_ratio, land_flag) re_ice_out[j,l]=ccm3_cloud_ice_re_param_function(p_ratio) liq_size_source[j,l]=ccm3_param_index ice_size_source[j,l]=ccm3_param_index endif else begin ; use -8888. to indeicate likely height bins with precip. lwc_out[j,l]=-8888. & lwc_source[j,l]=0 & ice_fraction[j,l]=-8888. & iwc_out[j,l]=-8888. iwc_source[j,l]=0 & lwc_out[j,l]=-8888. & re_liq_out[j,l]=-8888. & re_ice_out[j,l]=-8888. liq_size_source[j,l]=0 & ice_size_source[j,l]=0 endelse ;endif endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 15 $ ; cirrus then begin ; move up from bottom and calcualte or assign the microphysics as appropriate for l=layer_base_index[0],layer_top_index[0] do begin if ciret1_iwc5[j,l] ne -9999. then begin iwc_out[j,l]=ciret1_iwc5[j,l] & iwc_source[j,l]=ciret_source_index[j,l] re_ice_out[j,l]=ciret1_re5[j,l] & ice_size_source[j,l]=ciret_source_index[j,l] endif else begin lwc_out[j,l]=ccm3_liquid_water_param_function(height5[l], vap5[j,l]) lwc_source[j,l]=ccm3_param_index ice_fraction[j,l]=ccm3_cloud_iceliquid_fraction_param_function(temp5[j,l]) iwc_out[j,l]=ice_fraction[j,l]*lwc_out[j,l] iwc_source[j,l]=ccm3_param_index lwc_out[j,l]=(1.-ice_fraction[j,l])*lwc_out[j,l] p_ratio=pressure5[j,l]/p_sfc re_liq_out[j,l]=ccm3_cloud_liquid_re_param_function(temp[j,l], p_ratio, land_flag) re_ice_out[j,l]=ccm3_cloud_ice_re_param_function(p_ratio) liq_size_source[j,l]=ccm3_param_index ice_size_source[j,l]=ccm3_param_index endelse endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; endfor ; for ll=0,num_layers[j] do begin ; now that microphysics are assigned, assign the radiative properties to all cloudy levels ; loop through the layers again. for ll=0,num_layers[j] do begin ; The possible parameterizations to use are ;Ice: fu_solar_index=1 & fu_ir_index=2 ebertcurry_index=5 ;liquid; ccm3_rad_index=3 (solar) & chyleck_index=6 (IR) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 1 $ ; warm stratus, , or layer_type[j,ll] eq 2 $ ; cold non precip stratus or layer_type[j,ll] eq 3 $ ; precip warm stratus or layer_type[j,ll] eq 10 $ ; warm non precip alto then begin ; parameterize the radiative properties in each level for l=layer_base_index[0],layer_top_index[0] do begin if lwc_out[j,l] gt 0. and re_liq_out[j,l] gt 0. then begin ; loop through the raprad solar bands for iii=0,n_elements(rap_solar_wl)-1 do begin ccm3_radiative_param_shortwave, rap_solar_wl[iii], (lwc_out[j,l]*dz), $ re_liq_out[j,l], liq_tau_solar[j,l], liq_omega_solar[j,l], liq_g_solar[j,l] liq_rad_param_source[j,l,1]=3 endfor for iii=0,n_elements(rap_ir_wl)-1 do begin ccm3_liquid_radiative_param_longwave, rap_ir_wl[iii], (lwc_out[j,l]*dz), $ re_liq_out[j,l], liq_tau_ir[j,l], liq_omega_ir[j,l], liq_g_ir[j,l] liq_rad_param_source[j,l,2]=3 endfor endif endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 4 $ ; cold low level stratus with precip or ice or layer_type[j,ll] eq 7 $ ; deeper low level broken clouds, non precip or layer_type[j,ll] eq 8 $ ; deep broken clouds, non precip or layer_type[j,ll] eq 9 $ ; deep liquid or mixed precip or layer_type[j,ll] eq 11 $ ; cold AS or layer_type[j,ll] eq 12 $ ; cold AS then begin ; parameterize the radiative properties in each level for l=layer_base_index[0],layer_top_index[0] do begin if lwc_out[j,l] gt 0. and re_liq_out[j,l] gt 0. then begin ; loop through the raprad solar bands for iii=0,n_elements(rap_solar_wl)-1 do begin ccm3_radiative_param_shortwave, rap_solar_wl[iii], (lwc_out[j,l]*dz), $ re_liq_out[j,l], liq_tau_solar[j,l], liq_omega_solar[j,l], liq_g_solar[j,l] ebert_curry_radiative_param_shortwave, rap_solar_wl[iii], (iwc_out[j,l]*dz), $ re_ice_out[j,l], ice_tau_solar[j,l], ice_omega_solar[j,l], ice_g_solar[j,l] liq_rad_param_source[j,l,1]=3 ice_rad_param_source[j,l,1]=5 endfor for iii=0,n_elements(rap_ir_wl)-1 do begin ccm3_liquid_radiative_param_longwave, rap_ir_wl[iii], (lwc_out[j,l]*dz), $ re_liq_out[j,l], liq_tau_ir[j,l], liq_omega_ir[j,l], liq_g_ir[j,l] ebert_curry_radiative_param_longwave, rap_ir_wl[iii], (iwc_out[j,l]*dz), $ re_ice_out[j,l], ice_tau_ir[j,l], ice_omega_ir[j,l], ice_g_ir[j,l] liq_rad_param_source[j,l,2]=3 ice_rad_param_source[j,l,2]=5 endfor endif endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if layer_type[j,ll] eq 15 $ ; cirrus then begin ; parameterize the radiative properties in each level for l=layer_base_index[0],layer_top_index[0] do begin if if_out[j,l] gt 0. and re_ice_out[j,l] gt 0. then begin ; use fu's cirrus parameterizations for retrievals and ccm3 for non retrievals if iwc_source[j,l] ne 3 and ice_size_source[j,l] ne 3 then begin ; retreivals are being used. Use the non-ccm3 radiative property parameterizations fu_radiative_param_shortwave, wl, iwc, dge, beta, omega, g for iii=0,n_elements(rap_solar_wl)-1 do begin fu_radiative_param_shortwave, rap_solar_wl[iii], (iwc_out[j,l]), $ re_ice_out[j,l], ice_tau_solar[j,l], ice_omega_solar[j,l], ice_g_solar[j,l] ice_tau_solar[j,l]=ice_tau_solar[j,l]*dz ice_rad_param_source[j,l,1]=fu_solar_index endfor for iii=0,n_elements(rap_ir_wl)-1 do begin fu_radiative_param_longwave, rap_ir_wl[iii], (iwc_out[j,l]), $ re_ice_out[j,l], ice_tau_ir[j,l], ice_omega_ir[j,l], ice_g_ir[j,l] ice_tau_ir[j,l]=ice_tau_ir[j,l]*dz ice_rad_param_source[j,l,2]=fu_ir_index endfor endif else begin ; if iwc_source[j,l] ne 3 and ice_size_source[j,l] ne 3 then begin for iii=0,n_elements(rap_solar_wl)-1 do begin ebert_curry_radiative_param_shortwave, rap_solar_wl[iii], (iwc_out[j,l]*dz), $ re_ice_out[j,l], ice_tau_solar[j,l], ice_omega_solar[j,l], ice_g_solar[j,l] ice_rad_param_source[j,l,1]=ebert_curry_index endfor for iii=0,n_elements(rap_ir_wl)-1 do begin ebert_curry_radiative_param_longwave, rap_ir_wl[iii], (iwc_out[j,l]*dz), $ re_ice_out[j,l], ice_tau_ir[j,l], ice_omega_ir[j,l], ice_g_ir[j,l] ice_rad_param_source[j,l,2]=ebert_curry_index endfor endelse ; if iwc_source[j,l] ne 3 and ice_size_source[j,l] ne 3 then begin endif endfor endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; endfor ;for ll=0,num_layers[j] do begin (rad properties) endif ; if n_layers5[j] gt 0 then begin endfor ;for j=0, n_elements(jday5) do begin ;stret2_fname='' ; now output the microphysical and radiative properties to files append_5minfiles, five_fname end