JGCRI / an2month

Use CMIP 5 data to approximate monthly data from annual data.
0 stars 0 forks source link

Xanthos unit conversion & Cassandra #7

Closed kdorheim closed 5 years ago

kdorheim commented 5 years ago

Do we want to incorporate the Xanthos unit conversions into downscaling_component_api or should it be done in a separate step?

rplzzz commented 5 years ago

This turned out to be a little more subtle than I had expected. In retrospect, what we should have done was to leave all matters of unit conversion out of this package, handling it instead in the interface code in the coupling framework. However, seeing as how we have the conversion code here, I wasn't really keen to reimplement it elsewhere, so I decided to make what we have work for us.

I tried a couple of different ways of doing this. In the end, the best strategy turned out to be to remove the matrix transpose at the end of the output. Now the caller can pass the matrix it gets back to pr_conversion, if desired, and this package doesn't have to know about the difference in matrix conventions (grid cells in rows vs. grid cells in columns) between the two code bases.

Apparently, the whole business seems to work. Here are the first 12 months of temperature for the first grid cell in the list, as seen on the output side of the fldgen component in Cassandra: image If memory serves, this grid cell is somewhere in the Aleutian Islands, so having its highest temperatures being somewhere around 44F (displayed temperatures are in Kelvin) during the Northern hemisphere summer seems plausible to me. I'm going to call this working.