Home > atmlab > scattering > Liu_Database.m

Liu_Database

PURPOSE ^

Liu_Database extracts the DDA calculations for randomly oriented ice

SYNOPSIS ^

function Data =Liu_Database(f,T,nshape,d_max)

DESCRIPTION ^

  Liu_Database extracts the DDA calculations for randomly oriented ice
  particles with some different shapes which are defined in Liu Database ( Liu, G. (2008) ) 
  "A DATABASE OF MICROWAVE SINGLE-SCATTERING PROPERTIES FOR NONSPHERICAL ICE PARTICLES. Bulletin of the American Meteorological Society, 89(10), 1563-1570."

  To use this function download and compile the Liu database from http://cirrus.met.fsu.edu/research/scatdb.html                               
   
  The rules and limits of using the Database are explaind in the scatdb.c file. 
  For example the frequency shoud be between 3e9 and 340e9 Hz.
  
  The function takes frequency (f), temperature (T), vector of shape id (nshape),
  vector of maximum diameter (d_max), and returns an array of scattering properties. 
  

 FORMAT   Data =Liu_Database(f,T,nshape,d_max)
        
 OUT      Data          Array of Liu_DDA single scattering data

 IN       f             Frequency                        [Hz]
          T             Temperature                      [K]
          nshape        a vector of shape ids which its element should be an
                        integer number between 0 and 10
          d_max         a vector of maximum diameters    [um]

History: 2013-12-02  Created by Maryam Jamali

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

Liu_Database.m

SOURCE CODE ^

0001 %  Liu_Database extracts the DDA calculations for randomly oriented ice
0002 %  particles with some different shapes which are defined in Liu Database ( Liu, G. (2008) )
0003 %  "A DATABASE OF MICROWAVE SINGLE-SCATTERING PROPERTIES FOR NONSPHERICAL ICE PARTICLES. Bulletin of the American Meteorological Society, 89(10), 1563-1570."
0004 %
0005 %  To use this function download and compile the Liu database from http://cirrus.met.fsu.edu/research/scatdb.html
0006 %
0007 %  The rules and limits of using the Database are explaind in the scatdb.c file.
0008 %  For example the frequency shoud be between 3e9 and 340e9 Hz.
0009 %
0010 %  The function takes frequency (f), temperature (T), vector of shape id (nshape),
0011 %  vector of maximum diameter (d_max), and returns an array of scattering properties.
0012 %
0013 %
0014 % FORMAT   Data =Liu_Database(f,T,nshape,d_max)
0015 %
0016 % OUT      Data          Array of Liu_DDA single scattering data
0017 %
0018 % IN       f             Frequency                        [Hz]
0019 %          T             Temperature                      [K]
0020 %          nshape        a vector of shape ids which its element should be an
0021 %                        integer number between 0 and 10
0022 %          d_max         a vector of maximum diameters    [um]
0023 %
0024 %History: 2013-12-02  Created by Maryam Jamali
0025 
0026 
0027 
0028 function  Data =Liu_Database(f,T,nshape,d_max)
0029 
0030 format shortE
0031 n=length(nshape);
0032 m=length(d_max);
0033 
0034 if f < 3e9 || f >340e9
0035    error('Only frequencies 3e9 < f < 340e9 are allowed.')
0036 end
0037 
0038 if T < 233.15 || T >273.15
0039    error('Only temperatures 233.15 < t_grid < 273.15 are allowed.')
0040 end
0041 
0042 for i =1:n
0043     if ((nshape(i)~=0) && (nshape(i)~=1) && (nshape(i)~=2) && (nshape(i)~=3) && (nshape(i)~=4)...
0044         && (nshape(i)~=5) && (nshape(i)~=6) && (nshape(i)~=7) && (nshape(i)~=8) && (nshape(i)~=9) ...
0045         && (nshape(i)~=10) && (nshape(i)~=11) )
0046        error('Only nshape 0,1,2,3,4,5,6,7,8,9,or 10 are allowed.')
0047     end
0048 end 
0049 
0050 
0051 delete ( sprintf('output_Liu.txt') )
0052 shape      =  cell(n);
0053 Data_basic =  zeros(13*m,4,n);
0054 
0055 for i=1:n
0056     if     nshape(i)==0
0057              shape{i}='long hexagonal column';
0058     elseif nshape(i)==1
0059              shape{i}='short hexagonal column';
0060     elseif nshape(i)==2
0061              shape{i}='block hexagonal column';
0062     elseif nshape(i)==3
0063              shape{i}='thick hexagonal plate';
0064     elseif nshape(i)==4
0065              shape{i}='thin hexagonal plate';
0066     elseif nshape(i)==5
0067              shape{i}='3-bullet rosette';
0068     elseif nshape(i)==6
0069              shape{i}='4-bullet rosette';
0070     elseif nshape(i)==7
0071              shape{i}='5-bullet rosette';
0072     elseif nshape(i)==8
0073              shape{i}='6-bullet rosette';
0074     elseif nshape(i)==9
0075              shape{i}='sector-like snowflake';
0076     elseif nshape(i)==10
0077              shape{i}='dendrite snowflake';
0078     end
0079         
0080       for j= 1: length (d_max)
0081           unix ( sprintf('./rddb -f %-3.3f -t %-3.3f -s %1.0f -d %d >>output_Liu.txt', f/1e9, T, nshape(i), d_max(j) ) )
0082       end
0083     
0084     Data_basic(:,:,i) = importdata ( sprintf('output_Liu.txt') );
0085     delete(sprintf('output_Liu.txt') )
0086 
0087 end
0088 
0089 
0090 Data=cell(1,n);
0091 
0092 for  i = 1:n
0093     
0094     Data{1,i}.pshape            =  shape{i};
0095     Data{1,i}.frequency         =  f;
0096     Data{1,i}.abs_cross(:,1)    =  Data_basic(2:13:end-11,1,i);
0097     Data{1,i}.sca_cross(:,1)    =  Data_basic(2:13:end-11,2,i);
0098     Data{1,i}.bac_cross(:,1)    =  Data_basic(2:13:end-11,3,i);
0099     Data{1,i}.g(:,1)            =  Data_basic(2:13:end-11,4,i);
0100     Data{1,i}.d_e(:,1)          =  Data_basic(3:13:end-10,1,i);
0101     Data{1,i}.d_max(:,1)        =  Data_basic(1:13:end-12,4,i);
0102     Data{1,i}.control(:,1)      =  Data_basic(3:13:end-10,2,i);
0103     
0104 end
0105 
0106

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005