Skip to content

Fix time derivative#242

Merged
rouson merged 22 commits into
mainfrom
fix-time-derivative
Apr 15, 2025
Merged

Fix time derivative#242
rouson merged 22 commits into
mainfrom
fix-time-derivative

Conversation

@rouson

@rouson rouson commented Feb 24, 2025

Copy link
Copy Markdown
Contributor

When ready for merging, this pull request will fix an issue identified in the calculation of the desired module outputs, which are time derivatives of a subset of the model inputs, in the demonstration applications (demo/app). As before, the derivatives are estimated using a first-order-accurate finite difference formula, but the time steps are to be read from a new time data JSON object in a new input file that can be written from and read into a new time_data_t derived type.

  • Adjust the tensor-statistics.F90 demo app to read a set of names of variables from the training data set,
  • Switch from the simple SB04 training data set to the production Thompson training data set,
  • Replace the current dt calculation in tensor-statistics a time_data_t constructor (file reader), and
  • Update the time derivative calculations, and
  • Compute new histograms to determine whether they resemble those computed previously as expected.

@rouson rouson force-pushed the fix-time-derivative branch from 7dbe1e9 to f0f426e Compare April 15, 2025 17:39
rouson added 22 commits April 15, 2025 11:08
This commit updates demo/app/tensor-statistics.F90 to read
the model input and output tensor names from
training_configuration.json to faciliatate varying the list
(e.g., to switch between the simple SB04 microphysics to the
production Thompon microphysics).  The updates mirror
previously-commited changes in
demo/app/train-cloud-microphysics.F90.
This update eliminates a name clash caused by other recent versions
of the Assert utility.
This commit fixes an issue that was most likely introduced when
the bin-filling algorithm was bifurcated into one version below
a performance threshold of 80 bins and another version at or above
the threshold.  The histogram_t bin_frequency_ component was being
defined only above the threshold.  This commit defines the
component outside (after) the performance-threshold conditional
branching so the definition happens regardless of which branch
executes.
This commit switches the variable name "potential-temperature" to
"potential_temperature" in the plot-raw-histograms gnuplot script
to match a recent change in the gnuplot file.
This commit finishes the process of adjusting the reading of model
input tensors and desired model output tensors so that both are
specified by and read from the "tensor names" object in the
training_configuration.json file.
This commit
1. Supports constructing an array of file names for tensor inputs
   and a corresponding array of file names for tensor outputs.
2. Adds a "training data file names" object to the
   "training_configuration.json" file and a corresponding derived
   derived type.
With this commit,

./build/run-fpm.sh run tensor-statistics -- --bins 20

will build up an array of training-data file names from information
in a "training data file names" JSON object inside the
training_configuration.json file.  Currently, the tensor-statistics
program reads training data only from the first file in the array,
computes corresponding input/ouput tensor component histograms, and
writes the histograms toa gnuplot (*.plt) files.  Known issue:
the plots for the input-tensor component histograms appear to be
correct, but the output-tensor component histograms are all zeros.

To Do
-----
1. Investigate the reason output-tensor values are all zero.
2. Accumulate tensors across the full suite of training-data files.
3. Fix the time-derivative calculation by incorporating the new
   time_data_t type into the time derivative calculation.
Running demo/app/tensor-statistics.F90 now builds and terminates
normally with -DASSERTIONS.
@rouson rouson force-pushed the fix-time-derivative branch from f0f426e to 3f83c8b Compare April 15, 2025 18:08
@rouson rouson marked this pull request as ready for review April 15, 2025 18:11
@rouson rouson merged commit ee1baad into main Apr 15, 2025
@rouson rouson deleted the fix-time-derivative branch April 15, 2025 18:48
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.

1 participant