NCAR / ADF

A unified collection of python scripts used to generate standard plots from CAM outputs.
Creative Commons Attribution 4.0 International
35 stars 29 forks source link

Adding mods to derive PRECT #260

Closed bstephens82 closed 10 months ago

bstephens82 commented 11 months ago

from PRECC+PRECL if PRECT is not in the cam.h0 files. This code could be extended to other variables.

brianpm commented 11 months ago

Just to note that #240 is a similar modification to allow RESTOM to be derived. The implementation there is quite different. I'd recommend we encourage doing these kinds of simple derivations in a consistent manner. I like @bstephens82 's approach of just having a derive_variable method. I'm not sure how I feel about doing the derivation with ncap2, but I'm open to it if others think this is better than using python tools.

bstephens82 commented 11 months ago

Just to note that #240 is a similar modification to allow RESTOM to be derived. The implementation there is quite different. I'd recommend we encourage doing these kinds of simple derivations in a consistent manner. I like @bstephens82 's approach of just having a derive_variable method. I'm not sure how I feel about doing the derivation with ncap2, but I'm open to it if others think this is better than using python tools.

Ah, I had heard RESTOM might be another variable this could be applied to, but didn't realize it had already been implemented. I figured for each variable that could be derived, we would need to add another "recipe" in derive_variable. In the case of PRECT using ncap2 was just one of the shortest routes I could come up with. Feel free to modify or suggest other methods. Is the idea to avoid using NCO operators where possible?

brianpm commented 11 months ago

Yeah, I think adding "recipes" for each variable is the right way to go.

We do use NCO to make time series files, but we have discussed that having NCO as a dependency might not be great for portability. I'm not opposed to using it in the short term, but we might need to revisit in the future.

I guess my point was mostly to note that we should somehow combine this PR and #240 to allow both PRECT and RESTOM to be generated when the requirements are met.

brianpm commented 11 months ago

I also notice that #232 mentions similar functionality, so should also be harmonized with this one and #240.

justin-richling commented 11 months ago

Also I believe this is mentioned (PRECT specifically) in Julie's issue #228, so hopefully this can close that issue out as well