From 0bc5705a7391f76c0215a44183387d90b6498f16 Mon Sep 17 00:00:00 2001 From: Dimitri Fekas Date: Wed, 26 Nov 2025 11:13:19 +0100 Subject: [PATCH 1/3] static analysis python scripts --- analyze_globals_rw.py | 141 +++++++++++++++++++++++++++++++++++++++ find_globals.py | 38 +++++++++++ generate_flat_context.py | 126 ++++++++++++++++++++++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 analyze_globals_rw.py create mode 100644 find_globals.py create mode 100644 generate_flat_context.py diff --git a/analyze_globals_rw.py b/analyze_globals_rw.py new file mode 100644 index 0000000..acb266b --- /dev/null +++ b/analyze_globals_rw.py @@ -0,0 +1,141 @@ +import subprocess +import os +from collections import defaultdict +from clang.cindex import Index, Config, CursorKind, TypeKind + +# ============ +# Auto-detect libclang via Homebrew +# ============ +llvm_prefix = subprocess.check_output(["brew", "--prefix", "llvm"]).decode().strip() +libclang_path = f"{llvm_prefix}/lib/libclang.dylib" +Config.set_library_file(libclang_path) + +SOURCE = "mainTROLL4.0.cpp" # adjust path as necessary + +# ============ +# Data structures +# ============ +global_vars = {} # name → cursor +reads = defaultdict(set) # function → set(globals) +writes = defaultdict(set) # function → set(globals) +current_function = None + + +# ============ +# Determine if a cursor represents a write +# ============ +def is_write_reference(node): + """ + Determines if this DeclRefExpr is a write, i.e. appears on LHS of assignment + or is the operand of a unary operator like ++ or --. + """ + parent = node.semantic_parent + if not parent: + return False + + # Assignment: LHS is a write + if parent.kind == CursorKind.BINARY_OPERATOR: + tokens = list(parent.get_tokens()) + tok_text = " ".join(t.spelling for t in tokens) + if "=" in tok_text and not "==" in tok_text: + # Identify left-hand side token sequence + if node.extent.start.offset >= tokens[0].extent.start.offset: + return True + + # Unary operator ++var or var++ + if parent.kind == CursorKind.UNARY_OPERATOR: + for t in parent.get_tokens(): + if t.spelling in ("++", "--"): + return True + + return False + + +# ============ +# Recursively traverse AST +# ============ +def analyze(node): + global current_function + + # Entering a function + if node.kind in (CursorKind.FUNCTION_DECL, CursorKind.CXX_METHOD): + prev_func = current_function + current_function = node.spelling + + # Traverse inside function + for c in node.get_children(): + analyze(c) + + current_function = prev_func + return + + # Variable reference + if node.kind == CursorKind.DECL_REF_EXPR: + decl = node.referenced + if decl and decl in global_vars.values(): + gname = decl.spelling + if current_function: + if is_write_reference(node): + writes[current_function].add(gname) + else: + reads[current_function].add(gname) + + # Recurse + for c in node.get_children(): + analyze(c) + + +# ============ +# First pass: collect all global vars +# ============ +index = Index.create() +tu = index.parse(SOURCE, args=["-std=c++17"]) + +for c in tu.cursor.get_children(): + if ( + c.kind == CursorKind.VAR_DECL + and c.semantic_parent.kind == CursorKind.TRANSLATION_UNIT + ): + global_vars[c.spelling] = c + +# ============ +# Second pass: analyze reads/writes +# ============ +for c in tu.cursor.get_children(): + analyze(c) + +# ============ +# Output results +# ============ +print("=== GLOBAL USAGE ANALYSIS ===\n") + +for func in sorted(set(list(reads.keys()) + list(writes.keys()))): + print(f"Function: {func}") + r = sorted(reads[func]) + w = sorted(writes[func]) + if r: + print(" READS:") + for g in r: + print(f" - {g}") + if w: + print(" WRITES:") + for g in w: + print(f" - {g}") + print() + +print("\n=== GLOBAL VARIABLES SUMMARY ===") +for g in sorted(global_vars.keys()): + users_r = [f for f in reads if g in reads[f]] + users_w = [f for f in writes if g in writes[f]] + print(f"{g}:") + if users_r: + print(" Read by:") + for f in users_r: + print(f" - {f}") + if users_w: + print(" Written by:") + for f in users_w: + print(f" - {f}") + if not users_r and not users_w: + print(" (unused?)") + print() diff --git a/find_globals.py b/find_globals.py new file mode 100644 index 0000000..0409c41 --- /dev/null +++ b/find_globals.py @@ -0,0 +1,38 @@ +import subprocess +from clang.cindex import Index, Config, CursorKind + +# --- Find libclang via Homebrew automatically --- +llvm_prefix = subprocess.check_output(["brew", "--prefix", "llvm"]).decode().strip() +libclang_path = f"{llvm_prefix}/lib/libclang.dylib" +Config.set_library_file(libclang_path) + +# --- Path to your main TROLL source file --- +SOURCE = "mainTROLL4.0.cpp" # adjust if needed + + +def find_globals(node, results): + for c in node.get_children(): + # Global variable = VarDecl whose parent is the translation unit + if ( + c.kind == CursorKind.VAR_DECL + and c.semantic_parent.kind == CursorKind.TRANSLATION_UNIT + ): + results.append( + { + "name": c.spelling, + "type": c.type.spelling, + "location": f"{c.location.file}:{c.location.line}", + } + ) + find_globals(c, results) + + +index = Index.create() +tu = index.parse(SOURCE, args=["-std=c++17"]) + +globals_found = [] +find_globals(tu.cursor, globals_found) + +print("=== GLOBAL VARIABLES ===") +for g in globals_found: + print(f"{g['name']:<30} {g['type']:<40} {g['location']}") diff --git a/generate_flat_context.py b/generate_flat_context.py new file mode 100644 index 0000000..020ed35 --- /dev/null +++ b/generate_flat_context.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +import subprocess +import os +import sys +import re +from clang.cindex import Index, Config, CursorKind + +# ------------------------------------------------------- +# Auto-detect libclang installed via Homebrew +# ------------------------------------------------------- +try: + llvm_prefix = subprocess.check_output( + ["brew", "--prefix", "llvm"], text=True + ).strip() +except Exception: + print("ERROR: Cannot run `brew --prefix llvm`.", file=sys.stderr) + sys.exit(1) + +libclang_path = os.path.join(llvm_prefix, "lib", "libclang.dylib") +if not os.path.exists(libclang_path): + print(f"ERROR: libclang not found at {libclang_path}", file=sys.stderr) + sys.exit(1) + +Config.set_library_file(libclang_path) + +# ------------------------------------------------------- +# Input file +# ------------------------------------------------------- +if len(sys.argv) < 2: + print("Usage: python generate_flat_context.py mainTROLL4.0.cpp", file=sys.stderr) + sys.exit(1) + +SOURCE = sys.argv[1] +if not os.path.exists(SOURCE): + print(f"ERROR: source file not found: {SOURCE}", file=sys.stderr) + sys.exit(1) + + +# ------------------------------------------------------- +# Utility to turn clang's "T[N]" into valid "T name[N]" +# ------------------------------------------------------- +array_regex = re.compile(r"^(.*)\[(\d+)\]$") + + +def declare(type_spelling, name): + """ + Convert clang's abstract type spelling into valid C++. + Cases: + "char[256]" -> "char name[256]" + "int[3]" -> "int name[3]" + "unsigned short *[3]" -> "unsigned short * name[3]" + "float **" -> "float ** name" + "vector" -> "std::vector name" + """ + + t = type_spelling.strip() + + # 1. vector → std::vector + if t.startswith("vector<"): + t = "std::" + t + + # 2. Handle array types T[N] + m = array_regex.match(t) + if m: + base_t, size = m.group(1).strip(), m.group(2) + return f"{base_t} {name}[{size}]" + + # 3. If pointer array like "unsigned short *[3]" + # clang emits it as "*[3]" so detect this: + if "*[" in t: + base, arr = t.split("*", 1) + m2 = re.match(r"^\[(\d+)\]$", arr.strip()) + if m2: + size = m2.group(1) + return f"{base.strip()} *{name}[{size}]" + + # 4. Normal scalar or pointer + return f"{t} {name}" + + +# ------------------------------------------------------- +# Collect globals +# ------------------------------------------------------- +globals_found = [] + + +def walk(node): + for c in node.get_children(): + if ( + c.kind == CursorKind.VAR_DECL + and c.semantic_parent is not None + and c.semantic_parent.kind == CursorKind.TRANSLATION_UNIT + ): + globals_found.append(c) + walk(c) + + +# Parse translation unit +index = Index.create() +tu = index.parse(SOURCE, args=["-std=c++17"]) +if not tu: + print("ERROR: Unable to parse file.", file=sys.stderr) + sys.exit(1) + +walk(tu.cursor) + +# ------------------------------------------------------- +# Emit struct +# ------------------------------------------------------- +print("// ================================================================") +print("// AUTO-GENERATED BY generate_flat_context.py") +print("// DO NOT EDIT BY HAND — REGENERATE AFTER ANY GLOBAL CHANGES") +print("// ================================================================") +print("#include \n") +print("struct FlatContext {") + +for g in globals_found: + raw_t = g.type.spelling + name = g.spelling + + loc = f"{g.location.file}:{g.location.line}" if g.location.file else "(unknown)" + decl = declare(raw_t, name) + + print(f" {decl}; // {loc}") + +print("};") From 5ea899d5d3e4b250adb68e7b226e566fab237545 Mon Sep 17 00:00:00 2001 From: Dimitri Fekas Date: Wed, 26 Nov 2025 11:14:05 +0100 Subject: [PATCH 2/3] context init --- context.cpp | 0 context.hpp | 419 ++++++++++++++++++++++++++++++++++++++++++++++++ flatContext.hpp | 273 +++++++++++++++++++++++++++++++ 3 files changed, 692 insertions(+) create mode 100644 context.cpp create mode 100644 context.hpp create mode 100644 flatContext.hpp diff --git a/context.cpp b/context.cpp new file mode 100644 index 0000000..e69de29 diff --git a/context.hpp b/context.hpp new file mode 100644 index 0000000..fa22c51 --- /dev/null +++ b/context.hpp @@ -0,0 +1,419 @@ +#ifndef TROLL_CONTEXT_HPP +#define TROLL_CONTEXT_HPP + +#include + +// +// =============================== +// TROLL Context (Grouped) +// =============================== +// Every global from mainTROLL4.0.cpp +// grouped by subsystem +// + +struct FileIO +{ + char buffer[256]; + char inputfile[256]; + char inputfile_daytimevar[256]; + char inputfile_climate[256]; + char inputfile_soil[256]; + char outputinfo[256]; + char inputfile_inventory[256]; + char inputfile_pointcloud[256]; + char inputfile_SWC[256]; + char inputfile_species[256]; +}; + +struct InputBuffers +{ + char *bufi; + char *bufi_daytimevar; + char *bufi_climate; + char *bufi_soil; + char *buf; + char *bufi_data; + char *bufi_pointcloud; + char *bufi_dataSWC; + char *bufi_species; +}; + +struct OutputConfig +{ + int output_info; + int output_basic[4]; + int output_extended[9]; + int output_visual[2]; + int output_pointcloud; + int output[40]; + + bool _OUTPUT_extended; + bool _OUTPUT_inventory; + int _OUTPUT_pointcloud; +}; + +struct ModelOptions +{ + bool _NONRANDOM; + bool _GPPcrown; + bool _BASICTREEFALL; + bool _SEEDTRADEOFF; + bool _NDD; + bool _CROWN_MM; + bool _sapwood; + bool _seedsadditional; + bool _LL_parameterization; + + bool _FromInventory; + int _LA_regulation; + int _SOIL_LAYER_WEIGHT; + int _WATER_RETENTION_CURVE; +}; + +struct Grid +{ + int sites; + int cols; + int rows; + int nbspp; + + int length_dcell; + int linear_nb_dcells; + int sites_per_dcell; + int nbdcells; + int *site_DCELL; + + float i_sites_per_dcell; +}; + +struct TimeState +{ + int iterperyear; + int nbiter; + int iter; + int nbout; + int freqout; + + int nbdays; + + int nbsteps_varday; + float inv_nbsteps_varday; + float nbhours_covered; +}; + +// +// Climate variables +// +struct Climate +{ + int varday_light; + int varday_vpd; + int varday_T; + int varday_WS; + + int DailyMeanTemperature; + int DailyMeanIrradiance; + int DailyMeanVapourPressureDeficit; + int NightTemperature; + int Rainfall; + int DailyMeanWindSpeed; + + float tnight; + float precip; + float WSDailyMean; + float WDailyMean; + float tDailyMean; + float VPDDailyMean; + + float WDailyMean_year; + float tDailyMean_year; + float VPDDailyMean_year; + float windDailyMean_year; + float Tnight_year; + + float *WDailyMean_all; + float *VPDDailyMean_all; + float *tDailyMean_all; + float *windDailyMean_all; +}; + +// +// Photosynthesis & radiation parameters +// +struct PhotosynthesisParams +{ + float NV, NH, LV, LH; + float timestep; + float p_nonvert; + float Cseedrain; + float nbs0; + float Cair; + float PRESS; + float iCair; + + float crown_gap_fraction; + float shape_crown; + + float Rndd; + float deltaR; + float deltaD; + float BAtot; + + float SWtoPPFD; + float PPFDtoSW; + + float klight; + float kpar; + float phi; + float theta; + float absorptance_leaves; + + float g1; + float g0; + + float pheno_a0; + float pheno_b0; + float pheno_delta; + + float alpha; + float vC; + float H0; + float DBH0; + float CD0; + + float fallocwood; + float falloccanopy; + float dens; + float CD_a; + float CD_b; + float CR_a; + float CR_b; + float CR_min; + + float p_tfsecondary; + float hurt_decay; + + float m; + float m1; +}; + +// +// Lookup tables (temperature, VPD, hydraulic, etc.) +// +struct LookupTables +{ + int nbTbins; + float iTaccuracy; + + float *LookUp_KmT; + float *LookUp_GammaT; + float *LookUp_VcmaxT; + float *LookUp_JmaxT; + float *LookUp_Rleaf; + float *LookUp_flux_absorption; + float *LookUp_flux; + float *LookUp_ExtinctLW; + float *LookUp_VPD; + float *LookUp_T; + float *LookUp_Rstem; + + int LookUp_Crown_site[2601]; + + int nbVPDbins; + float iVPDaccuracy; + float **LookUp_INLR; + float *LookUp_SLOPE; + float *LookUp_GRADN; + + int nbHbins; + float iHaccuracy; + float *LookUp_Wind; +}; + +// +// Soil state +// +struct SoilState +{ + int nblayers_soil; + + float *layer_depth; + float *Sat_SWC; + float *Max_SWC; + float *FC_SWC; + float *Res_SWC; + float *Min_SWC; + float *Ksat; + float *a_vgm; + float *b_vgm; + float *c_vgm; + float *m_vgm; + float *phi_e; + float *b; + + float **SWC3D; + float **soil_phi3D; + float **Ks; + float **KsPhi; + + float **LAI_DCELL; + float *LAI_young; + float *LAI_mature; + float *LAI_old; + + float *Canopy_height_DCELL; + int *HSum_DCELL; + float *TopWindSpeed_DCELL; + float *Interception; + float *Throughfall; + float *Runoff; + float *Leakage; + float *Evaporation; + + float **Transpiration; + + float transpiration_1016; + + float abund_phi_root; + float abund10_phi_root; + float agb_phi_root; +}; + +// +// Tree geometry & canopy maps +// +struct TreeGeometry +{ + int HEIGHT; + int dbhmaxincm; + int RMAX; + int SBORD; + int leafdem_resolution; + + int extent_visual; + int mincol_visual; + int maxcol_visual; + int minrow_visual; + int maxrow_visual; + int minrow_visual_slice; + int maxrow_visual_slice; +}; + +// +// Intraspecific trait distributions (large arrays) +// +struct IntraspecificDistributions +{ + float d_intraspecific_height[10000]; + float d_intraspecific_CR[10000]; + float d_intraspecific_CD[10000]; + float d_intraspecific_P[10000]; + float d_intraspecific_N[10000]; + float d_intraspecific_LMA[10000]; + float d_intraspecific_wsg[10000]; + float d_intraspecific_dbhmax[10000]; + float d_intraspecific_leafarea[10000]; + float d_intraspecific_tlp[10000]; + + int LookUpLAImax; +}; + +// +// Species and seed state +// +struct SpeciesState +{ + int **SPECIES_SEEDS; + double *p_seed; + unsigned int *n_seed; + + double *p_species; + unsigned int *n_species; + + int *SPECIES_GERM; + float *PROB_S; +}; + +// +// Diagnostic counters +// +struct Diagnostics +{ + int nblivetrees; + int nbtrees_n10; + int nbtrees_n30; + + int nbdead_n1; + int nbdead_n10; + int nbdead_n30; + + int nbTreefall1; + int nbTreefall10; + int nbTreefall30; + + int nbtrees_carbstarv_n1; + int nbtrees_carbstarv_n10; + int nbtrees_carbstarv_n30; + + int *nbdbh; + float *layer; +}; + +// +// Point Cloud module +// +struct PointCloud +{ + float mean_beam_pc; + float sd_beam_pc; + float klaser_pc; + float transmittance_laser; + + int iter_pointcloud_generation; +}; + +// +// MPI-related +// +struct MPIState +{ + int mpi_rank; + int mpi_size; + int easympi_rank; +}; + +// +// Global species & time parameters +// +struct GlobalCounters +{ + int S; + int T; +}; + +// +// ===================== +// MAIN CONTEXT +// ===================== +struct Context +{ + FileIO fileio; + InputBuffers buffers; + OutputConfig out; + ModelOptions opt; + Grid grid; + TimeState time; + Climate climate; + PhotosynthesisParams photo; + LookupTables lookup; + SoilState soil; + TreeGeometry geom; + IntraspecificDistributions intra; + SpeciesState species; + Diagnostics diag; + PointCloud pc; + MPIState mpi; + GlobalCounters global; +}; + +#endif \ No newline at end of file diff --git a/flatContext.hpp b/flatContext.hpp new file mode 100644 index 0000000..db5021b --- /dev/null +++ b/flatContext.hpp @@ -0,0 +1,273 @@ +// ================================================================ +// AUTO-GENERATED BY generate_flat_context.py +// ================================================================ +#include + +struct FlatContext +{ + char buffer[256]; // mainTROLL4.0.cpp:116 + char inputfile[256]; // mainTROLL4.0.cpp:116 + char inputfile_daytimevar[256]; // mainTROLL4.0.cpp:116 + char inputfile_climate[256]; // mainTROLL4.0.cpp:116 + char inputfile_soil[256]; // mainTROLL4.0.cpp:116 + char outputinfo[256]; // mainTROLL4.0.cpp:116 + char inputfile_inventory[256]; // mainTROLL4.0.cpp:116 + char inputfile_pointcloud[256]; // mainTROLL4.0.cpp:116 + char *bufi; // mainTROLL4.0.cpp:116 + char *bufi_daytimevar; // mainTROLL4.0.cpp:116 + char *bufi_climate; // mainTROLL4.0.cpp:116 + char *bufi_soil; // mainTROLL4.0.cpp:116 + char *buf; // mainTROLL4.0.cpp:116 + char *bufi_data; // mainTROLL4.0.cpp:116 + char *bufi_pointcloud; // mainTROLL4.0.cpp:116 + char inputfile_SWC[256]; // mainTROLL4.0.cpp:118 + char *bufi_dataSWC; // mainTROLL4.0.cpp:118 + char inputfile_species[256]; // mainTROLL4.0.cpp:121 + char *bufi_species; // mainTROLL4.0.cpp:121 + int output_info; // mainTROLL4.0.cpp:124 + int output_basic[4]; // mainTROLL4.0.cpp:125 + int output_extended[9]; // mainTROLL4.0.cpp:126 + int output_visual[2]; // mainTROLL4.0.cpp:127 + int output_pointcloud; // mainTROLL4.0.cpp:128 + int output[40]; // mainTROLL4.0.cpp:139 + bool _NONRANDOM; // mainTROLL4.0.cpp:148 + bool _GPPcrown; // mainTROLL4.0.cpp:149 + bool _BASICTREEFALL; // mainTROLL4.0.cpp:150 + bool _SEEDTRADEOFF; // mainTROLL4.0.cpp:151 + bool _NDD; // mainTROLL4.0.cpp:152 + bool _CROWN_MM; // mainTROLL4.0.cpp:153 + bool _OUTPUT_extended; // mainTROLL4.0.cpp:154 + bool _OUTPUT_inventory; // mainTROLL4.0.cpp:155 + bool _FromInventory; // mainTROLL4.0.cpp:156 + bool _sapwood; // mainTROLL4.0.cpp:157 + bool _seedsadditional; // mainTROLL4.0.cpp:158 + bool _LL_parameterization; // mainTROLL4.0.cpp:159 + int _LA_regulation; // mainTROLL4.0.cpp:161 + int _OUTPUT_pointcloud; // mainTROLL4.0.cpp:162 + int _SOIL_LAYER_WEIGHT; // mainTROLL4.0.cpp:164 + int _WATER_RETENTION_CURVE; // mainTROLL4.0.cpp:165 + int sites; // mainTROLL4.0.cpp:168 + int cols; // mainTROLL4.0.cpp:169 + int rows; // mainTROLL4.0.cpp:170 + int nbspp; // mainTROLL4.0.cpp:171 + int iterperyear; // mainTROLL4.0.cpp:172 + int nbiter; // mainTROLL4.0.cpp:173 + int iter; // mainTROLL4.0.cpp:174 + int nbout; // mainTROLL4.0.cpp:175 + int freqout; // mainTROLL4.0.cpp:176 + int nbdays; // mainTROLL4.0.cpp:178 + int *gslrand; // mainTROLL4.0.cpp:182 + int *mcov_N_P_LMA; // mainTROLL4.0.cpp:183 + int *mu_N_P_LMA; // mainTROLL4.0.cpp:184 + int covariance_status; // mainTROLL4.0.cpp:185 + int length_dcell; // mainTROLL4.0.cpp:188 + int linear_nb_dcells; // mainTROLL4.0.cpp:189 + int sites_per_dcell; // mainTROLL4.0.cpp:190 + int nbdcells; // mainTROLL4.0.cpp:191 + int *site_DCELL; // mainTROLL4.0.cpp:194 + float i_sites_per_dcell; // mainTROLL4.0.cpp:195 + int HEIGHT; // mainTROLL4.0.cpp:198 + int dbhmaxincm; // mainTROLL4.0.cpp:199 + int RMAX; // mainTROLL4.0.cpp:200 + int SBORD; // mainTROLL4.0.cpp:201 + int leafdem_resolution; // mainTROLL4.0.cpp:202 + float NV; // mainTROLL4.0.cpp:203 + float NH; // mainTROLL4.0.cpp:204 + float LV; // mainTROLL4.0.cpp:205 + float LH; // mainTROLL4.0.cpp:206 + float timestep; // mainTROLL4.0.cpp:207 + float p_nonvert; // mainTROLL4.0.cpp:209 + float Cseedrain; // mainTROLL4.0.cpp:210 + float nbs0; // mainTROLL4.0.cpp:211 + float Cair; // mainTROLL4.0.cpp:212 + float PRESS; // mainTROLL4.0.cpp:214 + float iCair; // mainTROLL4.0.cpp:216 + float crown_gap_fraction; // mainTROLL4.0.cpp:218 + float shape_crown; // mainTROLL4.0.cpp:219 + float Rndd; // mainTROLL4.0.cpp:222 + float deltaR; // mainTROLL4.0.cpp:223 + float deltaD; // mainTROLL4.0.cpp:224 + float BAtot; // mainTROLL4.0.cpp:225 + int extent_visual; // mainTROLL4.0.cpp:228 + int mincol_visual; // mainTROLL4.0.cpp:229 + int maxcol_visual; // mainTROLL4.0.cpp:229 + int minrow_visual; // mainTROLL4.0.cpp:229 + int maxrow_visual; // mainTROLL4.0.cpp:229 + int minrow_visual_slice; // mainTROLL4.0.cpp:229 + int maxrow_visual_slice; // mainTROLL4.0.cpp:229 + int varday_light; // mainTROLL4.0.cpp:234 + int varday_vpd; // mainTROLL4.0.cpp:235 + int varday_T; // mainTROLL4.0.cpp:236 + int varday_WS; // mainTROLL4.0.cpp:237 + int nbsteps_varday; // mainTROLL4.0.cpp:238 + float inv_nbsteps_varday; // mainTROLL4.0.cpp:239 + float nbhours_covered; // mainTROLL4.0.cpp:240 + int DailyMeanTemperature; // mainTROLL4.0.cpp:244 + int DailyMeanIrradiance; // mainTROLL4.0.cpp:245 + int DailyMeanVapourPressureDeficit; // mainTROLL4.0.cpp:246 + int NightTemperature; // mainTROLL4.0.cpp:247 + int Rainfall; // mainTROLL4.0.cpp:248 + int DailyMeanWindSpeed; // mainTROLL4.0.cpp:249 + int nbTbins; // mainTROLL4.0.cpp:253 + float iTaccuracy; // mainTROLL4.0.cpp:254 + float *LookUp_KmT; // mainTROLL4.0.cpp:255 + float *LookUp_GammaT; // mainTROLL4.0.cpp:256 + float *LookUp_VcmaxT; // mainTROLL4.0.cpp:257 + float *LookUp_JmaxT; // mainTROLL4.0.cpp:258 + float *LookUp_Rleaf; // mainTROLL4.0.cpp:260 + float *LookUp_flux_absorption; // mainTROLL4.0.cpp:261 + float *LookUp_flux; // mainTROLL4.0.cpp:262 + float *LookUp_ExtinctLW; // mainTROLL4.0.cpp:263 + float *LookUp_VPD; // mainTROLL4.0.cpp:264 + float *LookUp_T; // mainTROLL4.0.cpp:265 + float *LookUp_Rstem; // mainTROLL4.0.cpp:266 + int LookUp_Crown_site[2601]; // mainTROLL4.0.cpp:268 + int nbVPDbins; // mainTROLL4.0.cpp:270 + float iVPDaccuracy; // mainTROLL4.0.cpp:271 + float **LookUp_INLR; // mainTROLL4.0.cpp:272 + float *LookUp_SLOPE; // mainTROLL4.0.cpp:273 + float *LookUp_GRADN; // mainTROLL4.0.cpp:274 + int nbHbins; // mainTROLL4.0.cpp:275 + float iHaccuracy; // mainTROLL4.0.cpp:276 + float *LookUp_Wind; // mainTROLL4.0.cpp:277 + float tnight; // mainTROLL4.0.cpp:281 + float precip; // mainTROLL4.0.cpp:282 + float WSDailyMean; // mainTROLL4.0.cpp:283 + float WDailyMean; // mainTROLL4.0.cpp:284 + float tDailyMean; // mainTROLL4.0.cpp:285 + float VPDDailyMean; // mainTROLL4.0.cpp:286 + float WDailyMean_year; // mainTROLL4.0.cpp:287 + float tDailyMean_year; // mainTROLL4.0.cpp:288 + float VPDDailyMean_year; // mainTROLL4.0.cpp:289 + float windDailyMean_year; // mainTROLL4.0.cpp:291 + float Tnight_year; // mainTROLL4.0.cpp:293 + float *WDailyMean_all; // mainTROLL4.0.cpp:295 + float *VPDDailyMean_all; // mainTROLL4.0.cpp:296 + float *tDailyMean_all; // mainTROLL4.0.cpp:297 + float *windDailyMean_all; // mainTROLL4.0.cpp:298 + float SWtoPPFD; // mainTROLL4.0.cpp:302 + float PPFDtoSW; // mainTROLL4.0.cpp:304 + float klight; // mainTROLL4.0.cpp:306 + float kpar; // mainTROLL4.0.cpp:307 + float phi; // mainTROLL4.0.cpp:308 + float theta; // mainTROLL4.0.cpp:309 + float absorptance_leaves; // mainTROLL4.0.cpp:310 + float g1; // mainTROLL4.0.cpp:311 + float g0; // mainTROLL4.0.cpp:313 + float pheno_a0; // mainTROLL4.0.cpp:316 + float pheno_b0; // mainTROLL4.0.cpp:317 + float pheno_delta; // mainTROLL4.0.cpp:318 + float alpha; // mainTROLL4.0.cpp:320 + float vC; // mainTROLL4.0.cpp:321 + float H0; // mainTROLL4.0.cpp:322 + float DBH0; // mainTROLL4.0.cpp:323 + float CD0; // mainTROLL4.0.cpp:324 + float fallocwood; // mainTROLL4.0.cpp:325 + float falloccanopy; // mainTROLL4.0.cpp:326 + float dens; // mainTROLL4.0.cpp:327 + float CD_a; // mainTROLL4.0.cpp:328 + float CD_b; // mainTROLL4.0.cpp:329 + float CR_a; // mainTROLL4.0.cpp:330 + float CR_b; // mainTROLL4.0.cpp:331 + float CR_min; // mainTROLL4.0.cpp:332 + float p_tfsecondary; // mainTROLL4.0.cpp:333 + float hurt_decay; // mainTROLL4.0.cpp:334 + float m; // mainTROLL4.0.cpp:335 + float m1; // mainTROLL4.0.cpp:336 + float sigma_height; // mainTROLL4.0.cpp:339 + float sigma_CR; // mainTROLL4.0.cpp:340 + float sigma_CD; // mainTROLL4.0.cpp:341 + float sigma_P; // mainTROLL4.0.cpp:342 + float sigma_N; // mainTROLL4.0.cpp:343 + float sigma_LMA; // mainTROLL4.0.cpp:344 + float sigma_wsg; // mainTROLL4.0.cpp:345 + float sigma_dbhmax; // mainTROLL4.0.cpp:346 + float sigma_leafarea; // mainTROLL4.0.cpp:348 + float sigma_tlp; // mainTROLL4.0.cpp:349 + float corr_CR_height; // mainTROLL4.0.cpp:351 + float corr_N_P; // mainTROLL4.0.cpp:352 + float corr_N_LMA; // mainTROLL4.0.cpp:353 + float corr_P_LMA; // mainTROLL4.0.cpp:354 + float cov_N_P; // mainTROLL4.0.cpp:355 + float cov_N_LMA; // mainTROLL4.0.cpp:356 + float cov_P_LMA; // mainTROLL4.0.cpp:357 + float d_intraspecific_height[10000]; // mainTROLL4.0.cpp:360 + float d_intraspecific_CR[10000]; // mainTROLL4.0.cpp:361 + float d_intraspecific_CD[10000]; // mainTROLL4.0.cpp:362 + float d_intraspecific_P[10000]; // mainTROLL4.0.cpp:363 + float d_intraspecific_N[10000]; // mainTROLL4.0.cpp:364 + float d_intraspecific_LMA[10000]; // mainTROLL4.0.cpp:365 + float d_intraspecific_wsg[10000]; // mainTROLL4.0.cpp:366 + float d_intraspecific_dbhmax[10000]; // mainTROLL4.0.cpp:367 + float d_intraspecific_leafarea[10000]; // mainTROLL4.0.cpp:369 + float d_intraspecific_tlp[10000]; // mainTROLL4.0.cpp:370 + int LookUpLAImax; // mainTROLL4.0.cpp:374 + float **LAI3D; // mainTROLL4.0.cpp:378 + unsigned short *Thurt[3]; // mainTROLL4.0.cpp:380 + int nblayers_soil; // mainTROLL4.0.cpp:383 + float *layer_depth; // mainTROLL4.0.cpp:384 + float *Sat_SWC; // mainTROLL4.0.cpp:391 + float *Max_SWC; // mainTROLL4.0.cpp:392 + float *FC_SWC; // mainTROLL4.0.cpp:393 + float *Res_SWC; // mainTROLL4.0.cpp:394 + float *Min_SWC; // mainTROLL4.0.cpp:395 + float *Ksat; // mainTROLL4.0.cpp:396 + float *a_vgm; // mainTROLL4.0.cpp:397 + float *b_vgm; // mainTROLL4.0.cpp:398 + float *c_vgm; // mainTROLL4.0.cpp:399 + float *m_vgm; // mainTROLL4.0.cpp:400 + float *phi_e; // mainTROLL4.0.cpp:401 + float *b; // mainTROLL4.0.cpp:402 + float **SWC3D; // mainTROLL4.0.cpp:403 + float **soil_phi3D; // mainTROLL4.0.cpp:404 + float **Ks; // mainTROLL4.0.cpp:405 + float **KsPhi; // mainTROLL4.0.cpp:406 + float **LAI_DCELL; // mainTROLL4.0.cpp:407 + float *LAI_young; // mainTROLL4.0.cpp:408 + float *LAI_mature; // mainTROLL4.0.cpp:409 + float *LAI_old; // mainTROLL4.0.cpp:410 + float *Canopy_height_DCELL; // mainTROLL4.0.cpp:411 + int *HSum_DCELL; // mainTROLL4.0.cpp:412 + float *TopWindSpeed_DCELL; // mainTROLL4.0.cpp:413 + float *Interception; // mainTROLL4.0.cpp:414 + float *Throughfall; // mainTROLL4.0.cpp:415 + float *Runoff; // mainTROLL4.0.cpp:416 + float *Leakage; // mainTROLL4.0.cpp:417 + float *Evaporation; // mainTROLL4.0.cpp:418 + float **Transpiration; // mainTROLL4.0.cpp:419 + float transpiration_1016; // mainTROLL4.0.cpp:420 + float abund_phi_root; // mainTROLL4.0.cpp:422 + float abund10_phi_root; // mainTROLL4.0.cpp:423 + float agb_phi_root; // mainTROLL4.0.cpp:424 + int **SPECIES_SEEDS; // mainTROLL4.0.cpp:428 + double *p_seed; // mainTROLL4.0.cpp:429 + unsigned int *n_seed; // mainTROLL4.0.cpp:430 + double *p_species; // mainTROLL4.0.cpp:431 + unsigned int *n_species; // mainTROLL4.0.cpp:432 + int *SPECIES_GERM; // mainTROLL4.0.cpp:434 + float *PROB_S; // mainTROLL4.0.cpp:435 + float mean_beam_pc; // mainTROLL4.0.cpp:438 + float sd_beam_pc; // mainTROLL4.0.cpp:439 + float klaser_pc; // mainTROLL4.0.cpp:440 + float transmittance_laser; // mainTROLL4.0.cpp:441 + int iter_pointcloud_generation; // mainTROLL4.0.cpp:442 + int nblivetrees; // mainTROLL4.0.cpp:475 + int nbtrees_n10; // mainTROLL4.0.cpp:476 + int nbtrees_n30; // mainTROLL4.0.cpp:477 + int nbdead_n1; // mainTROLL4.0.cpp:478 + int nbdead_n10; // mainTROLL4.0.cpp:479 + int nbdead_n30; // mainTROLL4.0.cpp:480 + int nbTreefall1; // mainTROLL4.0.cpp:481 + int nbTreefall10; // mainTROLL4.0.cpp:482 + int nbTreefall30; // mainTROLL4.0.cpp:483 + int nbtrees_carbstarv_n1; // mainTROLL4.0.cpp:491 + int nbtrees_carbstarv_n10; // mainTROLL4.0.cpp:492 + int nbtrees_carbstarv_n30; // mainTROLL4.0.cpp:493 + int *nbdbh; // mainTROLL4.0.cpp:497 + float *layer; // mainTROLL4.0.cpp:498 + int mpi_rank; // mainTROLL4.0.cpp:517 + int mpi_size; // mainTROLL4.0.cpp:518 + int easympi_rank; // mainTROLL4.0.cpp:519 + int S; // mainTROLL4.0.cpp:698 + int T; // mainTROLL4.0.cpp:1011 +}; From 617ffbce15d6c72dce04181bcf12cf62d5fd116b Mon Sep 17 00:00:00 2001 From: Dimitri Fekas Date: Wed, 26 Nov 2025 11:14:16 +0100 Subject: [PATCH 3/3] gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0eaa506..eb13331 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ * !*.cpp +!*.hpp +!*.py !*.md !example/*.txt !.gitignore -