; These are the cirrus conditions ; 1. max dbz temp le 0 ; 2. ci top temp le -30 ; 3. ci base temp le 0 ; Condition 1-3 must be met, plus the sum of the points(1-3) ge 15 pro layer_determination,missing,nocloud,reflect,height,temp_k,pnum,cirrus,numlayers,base_idx,top_idx,$ max_dbz_temp,base_temp,top_temp,base_height,top_height ; Missing data flag ;missing=-8888 ; No cloud flag ;nocloud=-9999 ; We require the max dbze to occur at temps colder than 0C ci_max_dbz_temp=273.0 ;Kelvin ; We require the radar echo top to occur at temps colder than -30C ci_top_temp=243.0 ;Kelvin ; We require the cirrus cloud base to be colder than 0C=273 K ci_base_temp=273.0 ;Kelvin ; We require the cirrus cloud base to be equal to or higher than 4.0 km ci_base_height=4.0*1000.0 ;km converted to meters ; Determine if the max dbz in the layer is colder than ci_max_dbz_temp condition1='no' ; Determine if the cloud top is colder than ci_top_temp condition2='no' ; Determine if the cloud base is colder than ci_base_temp condition3='no' ; Determine if the cloud base is higher than min_base_height condition4='no' ;********************************************** ; Get the size of the arrays ;********************************************** numheights=n_elements(height) ;******************************************** ; Convert Reflectivity to dbz ;******************************************** dbz=make_array(/float,numheights,value=missing) result=where(reflect gt missing,count) if count gt 0 then dbz[result]=float(reflect[result])/100.0 result=where(reflect eq nocloud,count) if count gt 0 then dbz[result]=nocloud ;**************************************** ; Cloud layers in the data ;**************************************** ; Arrays to hold the layer base and top indexes base_idx=make_array(/float,20,value=missing) top_idx=make_array(/float,20,value=missing) base_temp=make_array(/float,20,value=missing) top_temp=make_array(/float,20,value=missing) base_height=make_array(/float,20,value=missing) top_height=make_array(/float,20,value=missing) max_dbz_temp=make_array(/float,20,value=missing) numlayers=0 cirrus=make_array(/float,20,value=missing) total_points=make_array(/float,20,value=missing) ; Profiles we are analyzing reflect_profile=dbz height_profile=height result=where(reflect_profile gt missing,count) ; If there is valid data in the profile then continue if count gt 0 then begin ; Find the cloud layers and save them find_layer_idx_ci_ev,missing,reflect_profile,idxb,idxt,numlayer base_idx[0:numlayer-1]=idxb top_idx[0:numlayer-1]=idxt numlayers=numlayer ; Pull out a temperature profile temp_profile=temp_k ; Loop through the layers and determine the characteristics for i=0,numlayer-1 do begin ; Layer max_dbz_temp cloud_dbz=reflect_profile[base_idx[i]:top_idx[i]] cloud_temp=temp_profile[base_idx[i]:top_idx[i]] max_dbz=max(cloud_dbz,max_idx) max_temp=cloud_temp[max_idx] max_dbz_temp[i]=max_temp ; Layer base and top temperature base_temp[i]=temp_profile[base_idx[i]] top_temp[i]=temp_profile[top_idx[i]] ; Layer base and top height base_height[i]=height_profile[base_idx[i]] top_height[i]=height_profile[top_idx[i]] ; *** Determine the points for the layer ; Determine points for the temperature of the max dbz ; in the layer p1=0.0 & t1=ci_max_dbz_temp ; 0C 273K 0 points p2=10.0 & t2=ci_max_dbz_temp-20.0 ;-20C 253K 10 points point_max=p1 + ((p2-p1)/(t2-t1))*(max_dbz_temp[i]-t1) if max_dbz_temp[i] le t1 then condition1='yes' $ else condition1='no' ; Determine points for the temperature of the cloud top p1=0.0 & t1=ci_top_temp ;-30C 243K 0 points p2=10.0 & t2=ci_top_temp-20.0 ;-50C 223K 10 points point_top=p1 + ((p2-p1)/(t2-t1))*(top_temp[i]-t1) if top_temp[i] le t1 then condition2='yes' $ else condition2='no' ; Determine points for temperature of the cloud base p1=0.0 & t1=ci_base_temp ; 0C 273K 0 points p2=10.0 & t2=ci_base_temp-20.0 ;-20C 253K 10 points point_base=p1 + ((p2-p1)/(t2-t1))*(base_temp[i]-t1) if base_temp[i] le t1 then condition3='yes' $ else condition3='no' ; Determine if the cloud base is higher or equal to 4 km if base_height[i] ge ci_base_height then condition4='yes' $ else condition4='no' ; Total up the points total_points[i]=point_max+point_top+point_base ; *** Determine if the layer qualifies as cirrus if condition4 eq 'yes' and $ point_max ge 0 and $ point_top ge 0 and $ point_base ge 0 and $ total_points[i] ge 15 then begin cirrus[i]=1 endif else begin cirrus[i]=0 endelse endfor ; Print the profile do_this='no' if do_this eq 'yes' then begin openw,1,'/Users/u0079358/Documents/fifth_cloudret/flux_closureL/reflect_profile/reflect_profile.'+string(pnum,format='(I04)')+'.txt' close,1 for j=0,numheights-1 do begin openw,1,'/Users/u0079358/Documents/fifth_cloudret/flux_closureL/reflect_profile/reflect_profile.'+string(pnum,format='(I04)')+'.txt',/append resultb=where(idxb eq j,cb) resultt=where(idxt eq j,ct) if cb gt 0 then begin printf,1,'*******************************' printf,1,j,height_profile[j]/1000.0,temp_profile[j],$ reflect_profile[j],'B',base_temp[resultb],$ base_height[resultb]/1000.0,$ format='(I3,1X,F6.2,1X,F9.3,1X,I5,1X,A1,1X,F9.3,1X,F6.2)' endif if ct gt 0 then begin printf,1,j,height_profile[j]/1000.0,temp_profile[j],$ reflect_profile[j],'T',top_temp[resultt],$ top_height[resultt]/1000.0,$ format='(I3,1X,F6.2,1X,F9.3,1X,I5,1X,A1,1X,F9.3,1X,F6.2)' printf,1,'-------------------------------' printf,1,'dbz ',max_dbz_temp[resultt],'<',ci_max_dbz_temp,$ condition1,format='(A4,2X,F7.3,1X,A1,1X,F7.3,1X,A4)' printf,1,'top ',top_temp[resultt],'<',ci_top_temp,$ condition2,format='(A4,2X,F7.3,1X,A1,1X,F7.3,1X,A4)' printf,1,'base',base_temp[resultt],'<',ci_base_temp,$ condition3,format='(A4,2X,F7.3,1X,A1,1X,F7.3,1X,A4)' printf,1,'heig',base_height[resultt],'>',ci_base_height,$ condition4,format='(A4,2X,F8.2,1X,A1,1X,F8.2,1X,A4)' printf,1,'tp',total_points[resultt],'ci?',cirrus[resultt],$ format='(A2,1X,F7.3,1X,A3,F4.2)' printf,1,'*******************************' endif if cb eq 0 and ct eq 0 then begin printf,1,j,height_profile[j]/1000.0,temp_profile[j],$ reflect_profile[j],$ format='(I3,1X,F6.2,1X,F9.3,1X,I5,1X,A1,1X,I3)' endif close,1 endfor endif endif ;end of found radar layers end