star-meteo

Time varying meteorological data
git clone git://git.meso-star.fr/star-meteo.git
Log | Files | Refs | README | LICENSE

stardis_smeteo_library.h (2118B)


      1 /* Copyright (C) 2025 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is dismshbuted in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef STARDIS_SMETEO_LIBRARY_H
     17 #define STARDIS_SMETEO_LIBRARY_H
     18 
     19 #include <star/scem.h>
     20 #include <rsys/rsys.h>
     21 
     22 struct stardis_smeteo_lib_desc {
     23   const char* filename;
     24   struct smeteo_desc smeteo_desc;
     25   double max_convection_coef;
     26   double Tsrf_range[2]; /* Range of surface temperatures [K] */
     27   double Trad_range[2]; /* Range of radiative temperatures [K] */
     28 
     29   /* Algorithm for computing the solar position */
     30   enum scem_sun_algo algo;
     31 
     32   /* Number of seconds elapsed since the epoch until January 1, 1850, local time
     33    * at the location of the smeteo file. Since the epoch is defined in
     34    * UTC+00:00, this number of seconds is also defined in UTC+00:00. The
     35    * day_1850 field in the smeteo file can therefore be used to calculate the
     36    * number of seconds to add to this member variable in order to convert the
     37    * smeteo time to UTC+00:00 */
     38   time_t jan_1_1850;
     39 };
     40 #define STARDIS_SMETEO_LIB_DESC_NULL__ {0}
     41 static const struct stardis_smeteo_lib_desc STARDIS_SMETEO_LIB_DESC_NULL =
     42   STARDIS_SMETEO_LIB_DESC_NULL__;
     43 
     44 struct stardis_smeteo_lib;
     45 
     46 extern LOCAL_SYM void
     47 stardis_smeteo_lib_ref_get
     48   (struct stardis_smeteo_lib* lib);
     49 
     50 extern LOCAL_SYM void
     51 stardis_smeteo_lib_ref_put
     52   (struct stardis_smeteo_lib* lib);
     53 
     54 extern LOCAL_SYM void
     55 stardis_smeteo_lib_get_desc
     56   (const struct stardis_smeteo_lib* lib,
     57    struct stardis_smeteo_lib_desc* desc);
     58 
     59 #endif /* STARDIS_SMETEO_LIBRARY_H */