00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00024 #ifndef jacobian_h
00025 #define jacobian_h
00026
00027 #include <map>
00028 #include <iostream>
00029 #include <stdexcept>
00030 #include "matpackI.h"
00031 #include "array.h"
00032 #include "mystring.h"
00033 #include "make_array.h"
00034 #include "bifstream.h"
00035 #include "interpolation.h"
00036 #include "logic.h"
00037 #include "methods.h"
00038 #include "ppath.h"
00039 #include "agenda_class.h"
00040
00041
00042
00045 class RetrievalQuantity {
00046 public:
00047
00049 RetrievalQuantity() : mmaintag(),
00050 msubtag(),
00051 mmode(),
00052 manalytical(-1),
00053 mperturbation(0.),
00054 mgrids()
00055 { }
00056
00057
00060 RetrievalQuantity(const RetrievalQuantity& x) :
00061 mmaintag(x.mmaintag),
00062 msubtag(x.msubtag),
00063 mmode(x.mmode),
00064 manalytical(x.manalytical),
00065 mperturbation(x.mperturbation),
00066 mgrids(x.mgrids)
00067 { }
00068
00070 RetrievalQuantity(const String& maintag,
00071 const String& subtag,
00072 const String& mode,
00073 const Index& analytical,
00074 const Numeric& perturbation,
00075 const MakeArray<Vector>& grids ) :
00076 mmaintag(maintag),
00077 msubtag(subtag),
00078 mmode(mode),
00079 manalytical(analytical),
00080 mperturbation(perturbation),
00081 mgrids(grids)
00082 {
00083
00084 }
00085
00087 const String& MainTag() const { return mmaintag; }
00088 void MainTag( const String& mt ) { mmaintag = mt; }
00090 const String& Subtag() const { return msubtag; }
00091 void Subtag( const String& st ) { msubtag = st; }
00093 const String& Mode() const { return mmode; }
00094 void Mode( const String& m ) { mmode = m; }
00096 const Index& Analytical() const { return manalytical; }
00097 void Analytical( const Index& m ) { manalytical = m; }
00099 const Numeric& Perturbation() const { return mperturbation; }
00100 void Perturbation( const Numeric& p ) { mperturbation = p; }
00102 const ArrayOfVector& Grids() const { return mgrids; }
00103 void Grids( const ArrayOfVector& g ) { mgrids = g; }
00104
00105 private:
00106
00107 String mmaintag;
00108 String msubtag;
00109 String mmode;
00110 Index manalytical;
00111 Numeric mperturbation;
00112 ArrayOfVector mgrids;
00113 };
00114
00118 ostream& operator << (ostream& os, const RetrievalQuantity& ot);
00119
00120 typedef Array<RetrievalQuantity> ArrayOfRetrievalQuantity;
00121
00122
00123
00124
00125
00126 void calc_nd_field( Tensor3View& nd,
00127 const VectorView& p,
00128 const Tensor3View& t);
00129
00130 bool check_retrieval_grids( ArrayOfVector& grids,
00131 ostringstream& os,
00132 const Vector& p_grid,
00133 const Vector& lat_grid,
00134 const Vector& lon_grid,
00135 const Vector& p_retr,
00136 const Vector& lat_retr,
00137 const Vector& lon_retr,
00138 const String& p_retr_name,
00139 const String& lat_retr_name,
00140 const String& lon_retr_name,
00141 const Index& dim);
00142
00143 void get_perturbation_gridpos( ArrayOfGridPos& gp,
00144 const Vector& atm_grid,
00145 const Vector& jac_grid,
00146 const bool& is_pressure);
00147
00148 void get_perturbation_limit( ArrayOfIndex& limit,
00149 const Vector& pert_grid,
00150 const Vector& atm_limit);
00151
00152 void get_perturbation_range( Range& range,
00153 const Index& index,
00154 const Index& length);
00155
00156 void jacobian_from_path_to_rgrids(
00157 MatrixView ib_q_jacs,
00158 const Index& nbdone,
00159 const ArrayOfTensor4& diy_dq,
00160 const Index& iq,
00161 const Index& atmosphere_dim,
00162 const ArrayOfPpath& ppath_array,
00163 const RetrievalQuantity& jacobian_quantity );
00164
00165 void perturbation_field_1d( VectorView field,
00166 const ArrayOfGridPos& p_gp,
00167 const Index& p_pert_n,
00168 const Range& p_range,
00169 const Numeric& size,
00170 const Index& method);
00171
00172 void perturbation_field_2d( MatrixView field,
00173 const ArrayOfGridPos& p_gp,
00174 const ArrayOfGridPos& lat_gp,
00175 const Index& p_pert_n,
00176 const Index& lat_pert_n,
00177 const Range& p_range,
00178 const Range& lat_range,
00179 const Numeric& size,
00180 const Index& method);
00181
00182 void perturbation_field_3d( Tensor3View field,
00183 const ArrayOfGridPos& p_gp,
00184 const ArrayOfGridPos& lat_gp,
00185 const ArrayOfGridPos& lon_gp,
00186 const Index& p_pert_n,
00187 const Index& lat_pert_n,
00188 const Index& lon_pert_n,
00189 const Range& p_range,
00190 const Range& lat_range,
00191 const Range& lon_range,
00192 const Numeric& size,
00193 const Index& method);
00194
00195 void polynomial_basis_func(
00196 Vector& b,
00197 const Vector& x,
00198 const Index& poly_coeff );
00199
00200 #endif // jacobian_h