Skip to content

Add GRAMM initial-condition editing and CustomInit generation - #97

Open
Borealis-Thoon wants to merge 1 commit into
GralDispersionModel:V2701from
Borealis-Thoon:codex/gramm-initial-conditions
Open

Borealis-Thoon wants to merge 1 commit into
GralDispersionModel:V2701from
Borealis-Thoon:codex/gramm-initial-conditions

Conversation

@Borealis-Thoon

Copy link
Copy Markdown

GRAMM input generation writes fixed temperature and humidity values to IIN.dat and takes latitude from the GRAL control. The GUI does not expose CustomInit.txt, so users must prepare situation-specific initial conditions by hand.

A new Topography > GRAMM input > Initial conditions... dialog provides:

  • A separate GRAMM latitude, air/surface/soil temperatures, relative humidity, neutral-layer height and the IIN temperature gradient. Existing IIN values survive later control-file generation. A button copies the current GRAL latitude when requested.
  • A table indexed by the actual rows of meteopgt.all, with editable temperature, humidity, snow, inversion and gradient values. Temperature and humidity appear first among the editable columns.
  • CSV template export and import with explicit situation numbers. Blank cells select GRAMM defaults. The GUI converts Celsius to kelvin and humidity percent to a fraction when saving CustomInit.txt.
  • Loading of an existing CustomInit file, optional generation, and disabling with a retained file. Replacements keep timestamped backups and use a temporary file followed by replacement.

GRAMM chooses the CustomInit row by weather-situation number, not by a timestamp. Hourly input therefore requires one meteopgt.all situation per hour in the same order. These are sea-level reference initial conditions; the feature does not provide continuous hourly boundary forcing during a simulation. ERA5 mode disables CustomInit generation and explains that distinction.

Saving checks row count, order, units and numeric ranges. Files generated by this dialog are checked against the current meteopgt.all before starting GRAMM. Unmarked hand-written files retain the engine's previous launch behavior. Existing wind fields are not modified by saving initial conditions.

Validation on Windows x64 with .NET 10:

  • 17,758 checks across en-US, de-DE and ko-KR cultures, including an 8,760-row annual table, CSV import ordering, invalid inputs, backups and preservation during ordinary control-file generation.
  • Files produced by the GUI are read by the actual unmodified GRAMM CustomAirSoilInit parser, including a non-first situation and default sentinels.
  • The actual dialog saves edited grid values, loads persisted settings and disables generation in ERA5 mode. Rendered layouts were inspected at 1050- and 850-pixel window widths.
  • Three GUI-generated temperature/humidity situations were used in full GRAMM runs on the AscendingBridge example terrain.

The implementation uses GRAMM's existing input format and requires no GRAMM parser change. Tests and usage notes are in tests/GrammInitialConditions. This PR targets V2701 and is independent of #95 and #96.

@MarkusKuntner

Copy link
Copy Markdown
Member

CustomInit is rarely used, has not been thoroughly validated, and should therefore be reserved for users who are conducting scientific research and know exactly what they are doing. For this reason, there is intentionally no graphical input option available to the user.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants