Meteorology.hxx

00001 // Copyright (C) 2003-2007, ENPC - INRIA - EDF R&D
00002 // Author(s): Vivien Mallet
00003 //
00004 // This file is part of AtmoData library, a tool for data processing in
00005 // atmospheric sciences.
00006 //
00007 // AtmoData is developed in the INRIA - ENPC joint project-team CLIME and in
00008 // the ENPC - EDF R&D joint laboratory CEREA.
00009 //
00010 // AtmoData is free software; you can redistribute it and/or modify it under
00011 // the terms of the GNU General Public License as published by the Free
00012 // Software Foundation; either version 2 of the License, or (at your option)
00013 // any later version.
00014 //
00015 // AtmoData is distributed in the hope that it will be useful, but WITHOUT ANY
00016 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
00018 // details.
00019 //
00020 // For more information, visit the AtmoData home page:
00021 //      http://cerea.enpc.fr/polyphemus/atmodata.html
00022 
00023 
00024 #ifndef ATMODATA_FILE_METEOROLOGY_HXX
00025 
00026 namespace AtmoData
00027 {
00028 
00029   template<class TU, class TV, class TTp, class T, class TG>
00030   void ComputeRichardson(Data<TU, 4, TG>& ZonalWind,
00031                          Data<TV, 4, TG>& MeridionalWind,
00032                          Data<TTp, 4, TG>& PotentialTemperature,
00033                          Data<T, 4, TG>& Richardson,
00034                          T wind_threshold = 0.001);
00035 
00036   template<class TU, class TV, class TTp, class T, class TG>
00037   void ComputeRichardson(Data<TU, 4, TG>& ZonalWind,
00038                          Data<TV, 4, TG>& MeridionalWind,
00039                          Data<TTp, 4, TG>& PotentialTemperature,
00040                          Data<T, 3, TG>& Richardson,
00041                          T wind_threshold = 0.001);
00042 
00043   template<class TU, class TTp, class T, class TG>
00044   void ComputeRichardson(Data<TU, 3, TG>& WindModule,
00045                          Data<TTp, 3, TG>& SurfacePotentialTemperature,
00046                          Data<TTp, 4, TG>& PotentialTemperature,
00047                          Data<T, 3, TG>& SurfaceRichardson,
00048                          T wind_threshold = 0.001);
00049 
00050   template<class TR, class TU, class TTp, class T, class TG>
00051   void ComputeRichardson(Data<TR, 2, TG>& Roughness,
00052                          Data<TU, 3, TG>& WindModule,
00053                          Data<TTp, 3, TG>& SurfacePotentialTemperature,
00054                          Data<TTp, 4, TG>& PotentialTemperature,
00055                          Data<T, 3, TG>& SurfaceRichardson,
00056                          T wind_threshold = 0.001);
00057 
00058   template<class TT, class TP, class T, class TG>
00059   void ComputePotentialTemperature(Data<TT, 4, TG>& Temperature,
00060                                    Data<TP, 4, TG>& Pressure,
00061                                    Data<T, 4, TG>& PotentialTemperature,
00062                                    T P0 = 101325., T cp = 1005.,T r = 287.0);
00063 
00064   template<class TT, class TP, class T, class TG>
00065   void ComputePotentialTemperature(Data<TT, 3, TG>& Temperature,
00066                                    Data<TP, 3, TG>& Pressure,
00067                                    Data<T, 3, TG>& PotentialTemperature,
00068                                    T P0 = 101325., T cp = 1005.,T r = 287.0);
00069 
00070   template<class TT, class TP, class T, class TG>
00071   void ComputeTemperature(Data<TT, 4, TG>& PotentialTemperature,
00072                           Data<TP, 4, TG>& Pressure,
00073                           Data<T, 4, TG>& Temperature,
00074                           T P0 = 101325., T cp = 1005.,T r = 287.0);
00075 
00076   template<class TT, class TP, class T, class TG>
00077   void ComputeTemperature(Data<TT, 3, TG>& PotentialTemperature,
00078                           Data<TP, 3, TG>& Pressure,
00079                           Data<T, 3, TG>& Temperature,
00080                           T P0 = 101325., T cp = 1005.,T r = 287.0);
00081 
00082   template<class TT, class TP, class T, class TG>
00083   void ComputeSaturationHumidity(Data<TT, 3, TG>& Temperature,
00084                                  Data<TP, 3, TG>& Pressure,
00085                                  Data<T, 3, TG>& SaturationHumidity);
00086 
00087   template<class TT, class TP, class T, class TG>
00088   void ComputeSaturationHumidity(Data<TT, 4, TG>& Temperature,
00089                                  Data<TP, 4, TG>& Pressure,
00090                                  Data<T, 4, TG>& SaturationHumidity);
00091 
00092   template<class TS, class TT, class TP, class T, class TG>
00093   void ComputeRelativeHumidity(Data<TS, 4, TG>& SpecificHumidity,
00094                                Data<TT, 4, TG>& Temperature,
00095                                Data<TP, 4, TG>& Pressure,
00096                                Data<T, 4, TG>& RelativeHumidity);
00097 
00098   template<class TS, class TT, class TP, class T, class TG>
00099   void ComputeRelativeHumidity(Data<TS, 3, TG>& SpecificHumidity,
00100                                Data<TT, 3, TG>& Temperature,
00101                                Data<TP, 3, TG>& Pressure,
00102                                Data<T, 3, TG>& RelativeHumidity);
00103 
00104   template<class TH, class TS, class TW, class TL, class T, class TG>
00105   void ComputeSurfaceHumidity_diag(Data<TH, 4, TG>& SpecificHumidity,
00106                                    Data<TS, 3, TG>& SaturationHumidity,
00107                                    Data<TW, 3, TG>& SoilWater,
00108                                    Data<TL, 3, TG>& LUC, int sea_index,
00109                                    Data<T, 3, TG>& SurfaceHumidity,
00110                                    T veg = 1.0, T theta_cap = 0.323);
00111 
00112   template<class TS, class TP, class T, class TG>
00113   void ComputeCriticalRelativeHumidity(Data<TS, 3, TG>& SurfacePressure,
00114                                        Data<TP, 4, TG>& Pressure,
00115                                        Data<T, 4, TG>&
00116                                        CriticalRelativeHumidity,
00117                                        T coeff0 = 2., T coeff1 = sqrt(3.));
00118 
00119   template<class TS, class TP, class T, class TG>
00120   void ComputeCriticalRelativeHumidity_extended(Data<TS, 3, TG>&
00121                                                 SurfacePressure,
00122                                                 Data<TP, 4, TG>& Pressure,
00123                                                 Data<T, 4, TG>&
00124                                                 CriticalRelativeHumidity,
00125                                                 T coeff0 = 1.1,
00126                                                 T coeff1 = sqrt(1.3),
00127                                                 T a0 = 0., T a1 = 1.1);
00128 
00129   template<class TB, class TS, class TP, class T, class TG>
00130   void ComputeCriticalRelativeHumidity(Data<TB, 3, TG>& BoundaryLayerHeight,
00131                                        Data<TS, 3, TG>& SurfacePressure,
00132                                        Data<TP, 4, TG>& Pressure,
00133                                        Data<T, 4, TG>&
00134                                        CriticalRelativeHumidity,
00135                                        T coeff0 = 2., T coeff1 = sqrt(3.),
00136                                        T BL_CRH = 0.98);
00137 
00138   template<class TP, class T, class TG>
00139   void ComputeCriticalRelativeHumidity(Data<TP, 4, TG>& Pressure,
00140                                        Data<T, 4, TG>&
00141                                        CriticalRelativeHumidity,
00142                                        T CRH_0 = 0.75, T CRH_1 = 0.95,
00143                                        T CRH_2 = 0.95,
00144                                        T P_0 = 70000., T P_1 = 40000.);
00145 
00146   template<class TR, class TC, class T, class TG>
00147   void ComputeCloudFraction(Data<TR, 4, TG>& RelativeHumidity,
00148                             Data<TC, 4, TG>& CriticalRelativeHumidity,
00149                             Data<T, 4, TG>& CloudFraction);
00150 
00151   template<class TP, class TR, class TC, class T, class TG>
00152   void ComputeCloudFraction(Data<TP, 3, TG>& BoundaryLayerHeight,
00153                             Data<TR, 4, TG>& RelativeHumidity,
00154                             Data<TC, 4, TG>& CriticalRelativeHumidity,
00155                             Data<T, 4, TG>& CloudFraction);
00156 
00157   template<class TU, class TV, class T, class TG>
00158   void ComputeModule(Data<TU, 4, TG>& U, Data<TV, 4, TG>& V,
00159                      Data<T, 4, TG>& Module);
00160 
00161   template<class TU, class TV, class T, class TG>
00162   void ComputeModule(Data<TU, 4, TG>& U, Data<TV, 4, TG>& V,
00163                      Data<T, 3, TG>& Module);
00164 
00165   template<class TU, class TV, class T, class TG>
00166   void ComputeModule(Data<TU, 3, TG>& U, Data<TV, 3, TG>& V,
00167                      Data<T, 3, TG>& Module);
00168 
00169   template<class TC, class TP, class T, class TG>
00170   void ComputeCloudiness(Data<TC, 4, TG>& CloudFraction,
00171                          Data<TP, 4, TG>& Pressure,
00172                          Grid<TG>& GridZ_interf,
00173                          Data<int, 4>& LowIndices,
00174                          Data<int, 4>& MediumIndices,
00175                          Data<int, 4>& HighIndices,
00176                          Data<T, 3, TG>& LowCloudiness,
00177                          Data<T, 3, TG>& MediumCloudiness,
00178                          Data<T, 3, TG>& HighCloudiness,
00179                          T P_0 = 80000., T P_1 = 45000.);
00180 
00181   template <class TP, class TH, class T, class TG>
00182   void ComputeCloudHeight(Data<TP, 4, TG>& Pressure,
00183                           Data<TH, 4, TG>& RelativeHumidity,
00184                           T (CriticalRelativeHumidity)(const T&, const T&,
00185                                                        const T&),
00186                           Data<T, 3, TG>& CloudHeight);
00187 
00188   template <class TP, class TH, class TCRH, class T, class TG>
00189   void ComputeCloudHeight(Data<TH, 4, TG>& RelativeHumidity,
00190                           Data<TCRH, 4, TG>& CriticalRelativeHumidity,
00191                           Data<T, 3, TG>& CloudHeight);
00192 
00193   template <class T, class TG>
00194   void ComputeCloudHeight(Data<int, 4>& LowIndices,
00195                           Data<int, 4>& MediumIndices,
00196                           Data<int, 4>& HighIndices,
00197                           Grid<TG>& GridZ_interf,
00198                           Data<T, 3, TG>& CloudHeight);
00199 
00200   template<class T, class TLC, class TC>
00201   void ComputeTotalCloudiness(Data<TLC, 3, T>& LowCloudiness,
00202                               Data<TLC, 3, T>& MediumCloudiness,
00203                               Data<TLC, 3, T>& HighCloudiness,
00204                               Data<TC, 3, T>& Cloudiness);
00205 
00206   template <class TLC, class TC>
00207   TC ComputeTotalCloudiness(TLC low_cloudiness, TLC medium_cloudiness,
00208                             TLC high_cloudiness);
00209 
00210   template <class T>
00211   string ComputePasquillStabilityClass(T surface_wind, T solar_radiation,
00212                                        T cloudiness, bool isday);
00213 
00214 
00215   template <class Ta, class Tb, class TSP,
00216             class T, class TG>
00217   void ComputePressure(Data<Ta, 1, TG>& alpha, Data<Tb, 1, TG>& beta,
00218                        Data<TSP, 3, TG>& SurfacePressure,
00219                        Data<T, 4, TG>& Pressure, T P0 = 101325.);
00220 
00221   template<class TPS, class TP, class TT, class T, class TG>
00222   void ComputeHeight(Data<TPS, 3, TG>& SurfacePressure,
00223                      Data<TP, 4, TG>& Pressure,
00224                      Data<TT, 4, TG>& Temperature,
00225                      Grid<T>& Height, T g = 9.80665, T r = 287.0);
00226 
00227   template<class TP, class TT, class T, class TG>
00228   void ComputeInterfHeight(Data<TP, 4, TG>& Pressure,
00229                            Data<TT, 4, TG>& Temperature,
00230                            Grid<T>& Height, bool ground_set = false,
00231                            T g = 9.80665, T r = 287.0);
00232 
00233   template<class TP, class TT, class T, class TG>
00234   void ComputeMiddleHeight(Data<TP, 4, TG>& Pressure,
00235                            Data<TT, 4, TG>& Temperature,
00236                            Grid<T>& InterfHeight, Grid<T>& MiddleHeight,
00237                            T g = 9.80665, T r = 287.0);
00238 
00239   template <class TT, class TH, class T, class TG>
00240   void ComputeVirtualTemperature(Data<TT, 4, TG>& Temperature,
00241                                  Data<TH, 4, TG>& SpecificHumidity,
00242                                  Data<T, 4, TG>& VirtualTemperature,
00243                                  T c = 0.608);
00244 
00245 }  // namespace AtmoData.
00246 
00247 
00248 // Fortran functions.
00249 #ifdef POLYPHEMUS_SINGLE_UNDERSCORE
00250 #undef POLYPHEMUS_DOUBLE_UNDERSCORE
00251 #elif defined(__GNUG__) && __GNUG__ < 4 && !defined(__INTEL_COMPILER)
00252 #undef POLYPHEMUS_DOUBLE_UNDERSCORE
00253 #define POLYPHEMUS_DOUBLE_UNDERSCORE
00254 #endif
00255 
00256 #ifdef POLYPHEMUS_DOUBLE_UNDERSCORE
00257 #define _compute_relative_humidity compute_relative_humidity__
00258 #else
00259 #define _compute_relative_humidity compute_relative_humidity_
00260 #endif
00261 
00262 extern "C"
00263 {
00264   void _compute_relative_humidity(double*, double*, double*, double*);
00265 }
00266 
00267 
00268 #define ATMODATA_FILE_METEOROLOGY_HXX
00269 #endif

Generated on Tue Nov 17 11:51:45 2009 for AtmoData by  doxygen 1.5.1