cedadev / swallow

Swallow - a Birdhouse WPS for running the NAME Trajectory code.
Other
0 stars 1 forks source link

investigate longitude periodicity issues where global domain fails in general forward / air history runs #58

Closed alaniwi closed 1 year ago

alaniwi commented 1 year ago

Error from model is:

 FATAL ERROR in processing domain "Dispersion Domain": |X Max - X Min| must be
 less than the coordinate periodicity 360 (use "X Unbounded" option for
 unbounded domains)
alaniwi commented 1 year ago

After discussing with Andrew: in the model input file, there is a domain specification:

Domains:
Name,              H Unbounded?,  H-Coord,          X Min,          X Max,          Y Min,          Y Max, Z Unbounded?, Z-Coord,   Z Max, T Unbounded?,       Start Time,       End Time, Max Travel Time,
Dispersion Domain,           No, Lat-Long, -180.0, 180.0, -90.0, 90.0,           No,   m asl, 30000.0,           No, 01/01/2022 00:00, 01/01/2022 12:00,        infinity,

We should set H Unbounded to Yes for global domain. Then the columns for XMin, X Max, Y Min, Y Max can be removed entirely, or else empty cells in those locations.

We will want to do this in a common way for the different run types. Probably it should just work based on lon, lat values for the user input (whether from the bounding box tool or the dropdown), and then have python code detects when the domain is obviously trying to be global, and then sets the boolean flag for "H Unbounded" accordingly. This would then ensure the same behaviour for each of these input methods. It would then pass through a boolean into the jinja templating that can be used with a simple conditional statement.

We should first test with running the model interactively before implementing this in the WPS, just to check that this really is the fix, but it seems extremely likely.

alaniwi commented 1 year ago

Global domain is working fine with this fix.

If the output domain is also global then it can be hard to detect the tracer on the plots for short runs where wind speeds are low, but it is clearly producing a suitable output field. (Output file excludes gridpoints where there is no tracer.)