star-meteo

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

commit 41a97760a75995790084aa02e45f1cabfc0a737f
parent 36e30a029220fd41999badc18748ad234bc8d3cd
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 15 May 2025 12:37:54 +0200

Comment on the LE and day/1850 variables

Define what they mean and their unity.

Diffstat:
Msrc/smeteo.h | 14+++++++++-----
Msrc/smeteo_load.c | 16++++++++--------
2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/smeteo.h b/src/smeteo.h @@ -38,12 +38,16 @@ struct smeteo_entry { struct tm time; double Tsrf; /* Surface temperature [K] */ double Tatm; /* Atmosphere temperature [K] */ - double SWdn; /* Shortwave downward flux [W/m^2] */ - double SWup; /* Shortwave downward flux [W/m^2] */ + double SWdn; /* Shortwave downward flux [W/m^2 of horizontal surface] */ + double SWup; /* Shortwave downward flux [W/m^2 of horizontal surface] */ double Trad; /* Radiative temperature [K] */ double H; /* Convection coefficient [W/K/m^2] */ - double LE; /* ??? */ - double day_1850; /* ??? */ + + /* Latent flux >0 from ground to atmosphere [W/m^2 of horizontal surace ] */ + double LE; + + /* Time as a fraction of a day since 10:30pm on 31 December 1849 */ + double day_1850; }; #define SMETEO_ENTRY_NULL__ {{0},0,0,0,0,0,0,0,0} static const struct smeteo_entry SMETEO_ENTRY_NULL = SMETEO_ENTRY_NULL__; @@ -69,7 +73,7 @@ static const struct smeteo_create_args SMETEO_CREATE_ARGS_DEFAULT = struct logger; struct mem_allocator; -/* Forwar declaration of opaque data types */ +/* Forward declaration of opaque data types */ struct smeteo; BEGIN_DECLS diff --git a/src/smeteo_load.c b/src/smeteo_load.c @@ -143,14 +143,14 @@ parse_line(struct smeteo* smeteo, struct txtrdr* txtrdr) res = parse_double(smeteo, txtrdr, Name, Var, range, &entry.Var); \ if(res != RES_OK) goto error; \ } (void)0 - PARSE_DOUBLE("surface temperature", Tsrf, 0, INF); - PARSE_DOUBLE("atmosphere temperature", Tatm, 0, INF); - PARSE_DOUBLE("shortwave downward flux", SWdn, 0, INF); - PARSE_DOUBLE("shortwave upward flux", SWup, 0, INF); - PARSE_DOUBLE("radiative temperature", Trad, 0, INF); - PARSE_DOUBLE("convection coefficient", H, -INF, INF); - PARSE_DOUBLE("???", LE, -INF, INF); - PARSE_DOUBLE("???", day_1850, 0, INF); + PARSE_DOUBLE("surface temperature [K]", Tsrf, 0, INF); + PARSE_DOUBLE("atmosphere temperature [K]", Tatm, 0, INF); + PARSE_DOUBLE("shortwave downward flux [W/m^2]", SWdn, 0, INF); + PARSE_DOUBLE("shortwave upward flux [W/m^2]", SWup, 0, INF); + PARSE_DOUBLE("radiative temperature [K]", Trad, 0, INF); + PARSE_DOUBLE("convection coefficient [W/K/m^2]", H, -INF, INF); + PARSE_DOUBLE("latent flux [W/m^2]", LE, 0, INF); + PARSE_DOUBLE("number of days since 1850", day_1850, 0, INF); #undef PARSE_DOUBLE res = darray_entry_push_back(&smeteo->entries, &entry);