Home > atmlab > tests > make_check_qarts.m

make_check_qarts

PURPOSE ^

MAKE_CHECK_QARTS Runs a number of qarts related scripts

SYNOPSIS ^

function make_check_qarts( do_fortran )

DESCRIPTION ^

 MAKE_CHECK_QARTS   Runs a number of qarts related scripts

    The function runs some of the scripts in atmlab/demo, including in some
    cases a comparsion to older results. The tests cover also Qpack2.

 FORMAT   make_check_qarts( [do_fortran] )

 OPT   do_fortran   Performs checks requiring compilation of ARTS
                    with Fortran support. Default is false.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

DOWNLOAD ^

make_check_qarts.m

SOURCE CODE ^

0001 % MAKE_CHECK_QARTS   Runs a number of qarts related scripts
0002 %
0003 %    The function runs some of the scripts in atmlab/demo, including in some
0004 %    cases a comparsion to older results. The tests cover also Qpack2.
0005 %
0006 % FORMAT   make_check_qarts( [do_fortran] )
0007 %
0008 % OPT   do_fortran   Performs checks requiring compilation of ARTS
0009 %                    with Fortran support. Default is false.
0010 
0011 % 2005-06-21   Created by Patrick Eriksson.
0012 
0013 
0014 function make_check_qarts( do_fortran )
0015 %
0016 if nargin == 0, do_fortran = false; end
0017 
0018 
0019 %= Handle verbosity
0020 %
0021 va = atmlab( 'VERBOSITY', 0 );
0022 vf = atmlab( 'FMODEL_VERBOSITY', 0 );
0023 
0024 
0025 %= qarts_abstable_demo
0026 %
0027 try
0028   qarts_abstable_demo;
0029 catch
0030   reset_verbosity( va, vf );
0031   fprintf('\n=== Error while running *qarts_abstable_demo* ===\n\n');
0032   rethrow(lasterror);
0033 end
0034 disp( 'Done: qarts_abstable_demo')
0035 
0036 
0037 
0038 %= qarts_ppath_demo
0039 %
0040 try
0041   ppath = qarts_ppath_demo(600e3,113);
0042 catch
0043   reset_verbosity( va, vf );
0044   fprintf('\n=== Error while running *qarts_ppath_demo* ===\n\n');
0045   rethrow(lasterror);
0046 end
0047 %
0048 if abs( ppath.np ~= 120 )
0049   reset_verbosity( va, vf );
0050   error('Unexpected result from *qarts_ppath_demo*');
0051 else
0052   disp( 'Done: qarts_ppath_demo')
0053 end
0054 
0055 
0056 
0057 %= qarts_demo 1 and 2
0058 %
0059 y0 = [ 4.115 27.94 ];
0060 dy = 1e-2;
0061 %
0062 try
0063   [Q,f,y] = qarts_demo;
0064 catch
0065   reset_verbosity( va, vf );
0066   fprintf('\n=== Error while running *qarts_demo* ===\n\n');
0067   rethrow(lasterror);
0068 end
0069 %
0070 if any( abs( [min(y) max(y)] - y0 ) > dy )
0071   reset_verbosity( va, vf );
0072   error('Unexpected result from *qarts_demo*');
0073 else
0074   disp( 'Done: qarts_demo')
0075 end
0076 %
0077 y0 = [ 3.16 21.84 ];
0078 try
0079   [Q,f,y] = qarts_demo2;
0080 catch
0081   reset_verbosity( va, vf );
0082   fprintf('\n=== Error while running *qarts_demo2* ===\n\n');
0083   rethrow(lasterror);
0084 end
0085 %
0086 if any( abs( [min(y) max(y)] - y0 ) > dy )
0087   reset_verbosity( va, vf );
0088   error('Unexpected result from *qarts_demo2*');
0089 else
0090   disp( 'Done: qarts_demo2')
0091 end
0092 
0093 
0094 
0095 %= qarts_backend_demo
0096 %
0097 try
0098   [f,y] = qarts_backend_demo( 0, 0 );
0099 catch
0100   reset_verbosity( va, vf );
0101   fprintf('\n=== Error while running *qarts_backend_demo* ===\n\n');
0102   rethrow(lasterror);
0103 end
0104 %
0105 if abs( y(end) - 291.03 ) > 0.01
0106   reset_verbosity( va, vf );
0107   error('Unexpected result from *qarts_backend_demo*');
0108 else
0109   disp( 'Done: qarts_backend_demo')
0110 end
0111 
0112 
0113 
0114 %= Qarts with DOIT
0115 %
0116 y0 = [ 152.78 -0.21 ];
0117 dy = 1e-2;
0118 %
0119 try
0120   [Q,f,ztan,y_c,y] = qarts_scattering_demo( [], 'doit' );
0121 catch
0122   reset_verbosity( va, vf );
0123   fprintf('\n=== Error while running *qarts_scatting_demo* ===\n\n');
0124   rethrow(lasterror);
0125 end
0126 %
0127 if any( abs( y(end+[-1:0])' - y0 ) > dy )
0128   reset_verbosity( va, vf );
0129   error('Unexpected result from *qarts_scattering_demo* with DOIT.');
0130 else
0131   disp( 'Done: qpack_scattering_demo with DOIT')
0132 end
0133 
0134 
0135 %= OEM
0136 %
0137 try
0138   X = arts_oem_demo;
0139 catch
0140   reset_verbosity( va, vf );
0141   fprintf('\n=== Error while running *arts_oem_demo* ===\n\n');
0142   rethrow(lasterror);
0143 end
0144 %
0145 disp( 'Done: arts_oem_demo')
0146 
0147 
0148 
0149 %= Qpack2, 1 and 2
0150 %
0151 try
0152   L2 = qpack2_demo;
0153 catch
0154   reset_verbosity( va, vf );
0155   fprintf('\n=== Error while running *qpack2_demo* ===\n\n');
0156   rethrow(lasterror);
0157 end
0158 %
0159 if any( [L2.cost] > 1.2 )
0160   reset_verbosity( va, vf );
0161   error('Unexpected result from *qpack2_demo*');  
0162 else
0163   disp( 'Done: qpack2_demo')
0164 end
0165 %
0166 try
0167   L2 = qpack2_demo2;
0168 catch
0169   reset_verbosity( va, vf );
0170   fprintf('\n=== Error while running *qpack2_demo2* ===\n\n');
0171   rethrow(lasterror);
0172 end
0173 %
0174 if any( [L2.cost] > 1.2 )
0175   reset_verbosity( va, vf );
0176   error('Unexpected result from *qpack2_demo2*');  
0177 else
0178   disp( 'Done: qpack2_demo2')
0179 end
0180 
0181 
0182 %= T-matrix
0183 %
0184 if do_fortran
0185 try
0186   f_grid  = [ 100e9; 200e9 ];
0187   t_grid  = [ 275 : 25 : 350 ]';
0188   za_grid = [ 0 : 20 : 180 ]';
0189   aa_grid = [ 0 : 60 : 360 ]';
0190   N       = complex_refr_indexFromFunc( f_grid, t_grid, ...
0191                                         @eps_water_liebe93, @sqrt);  
0192   D = tmatrix( [], f_grid, t_grid, za_grid, aa_grid, N, ...
0193                'spheroidal', {'horizontally_aligned'}, 150e-6, [1.001;2] );
0194 catch 
0195   reset_verbosity( va, vf );
0196   fprintf('\n=== Error while running *qpack2_demo2* ===\n\n');
0197   rethrow(lasterror);
0198 end
0199 %
0200 disp( 'Done: Call of tmatrix.m')
0201 end
0202 
0203 
0204 %== Finished
0205 %
0206 reset_verbosity( va, vf );
0207 disp( 'Ready !!!' )
0208 %
0209 return
0210 
0211 
0212 
0213 
0214 %-----------------------------------------------------------------------------
0215 
0216 function reset_verbosity( va, vf )
0217   atmlab( 'VERBOSITY', va );
0218   atmlab( 'FMODEL_VERBOSITY', vf );
0219 return

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