Closed alaniwi closed 1 year ago
(that commit was me not Ag)
Added plotting for general forward model (see above), subject to testing.
Need to do plots for met extract run, but it is not using ADAQ python, so need to adapt the plotting in the base class, which assumes that the plotting will be doing so. Need to think about the best way to do this - maybe include the plotting python scripts in a directory of the swallow repo.
Probably we want to change run_adaq_scripts
to run_plotting_scripts
, and have a boolean (set in the sub-class and passed through from the base class to the plotting routine) that determines whether it is an ADAQ script, and if it is then it picks it up from the adaq_home, otherwise it picks it up from the relevant directory of the swallow repo.
We have decided that no plots are required for met extract runs, so we can assume that plotting will be done from ADAQ where applicable. We just need to test the plots from general forward run once the segfaulting issue is dealt with.
Plots are generally okay, but for some input values they are not. Need to check domain issues, and ask Andrew if reason is still unclear.
Seems to be picky with the model levels. In various tests, if the first two levels are 0, 100m then it is happy. With anything else, it doesn't produce any output.
Following tests with all source region 0-50m (from Harwell fixed location, default run dates + times), though more anecdotally still get something similar with a deeper source region
no plots produced with any of these sets of model levels
0, 10, 20, 30 0, 10, 20, 30 0, 10, 20, 30, 40 0, 10, 20, 30, 100 0, 50, 100 0, 90, 100 0, 90, 110 0, 110, 150, 230, 470, 1345
plots produced fine with any of these sets of model levels
0, 100
0, 100, 200
0, 100, 110
0, 100, 150, 230, 470, 1345
This was resolved after discussion with Andrew. It turns out that the input file for the plotting had a hard-coded 50m height (single element list), which has to match the interface level(s) at which the fields are to be plotted. I have changed it to calculate the values based on the actual model levels in the user input, and to use the full list. It was more convenient to do the height calculation in swallow on the assumption that it is always the arithmetic mean of the levels, rather than extract it from the NAME output (although it is also available there). Andrew thinks that this is a safe enough assumption, so I will close the issue, although he'll let us know if after consultation with colleagues he believes there to be any potential rounding issues.
So far only trajectory run does plotting. Andrew will be supplying examples for the other run types.