Add functionality to MALI ocean-data interpolation script#742
Conversation
Make filename read-in line more robust (allows for more general specification of year, e.g. zero-padded); Co-pilot generated changes to ensure that script also works for monthly data, as opposed to just annually-average data.
| #xtime = np.array([xt],dtype=('S',64)) | ||
| # << NOTE >>: may need to eventually use: "xtime.data.tobytes().decode()" but not sure yet | ||
| # monthly xtime strings (one per month), used when not time averaging | ||
| self.xtimeMonthly = self.DS['xtime_startMonthly'].values |
There was a problem hiding this comment.
Is xtime_startMonthly in all monthly average MPAS-O history files? I don't recognize the name, but maybe it is automatically generated by the time-averager in MPAS-O. Did you do any preprocessing of the MPAS-O history files or did your run of this script work successfully with the unmodified history files?
There was a problem hiding this comment.
Good question.
char xtime_startMonthly(Time, StrLen) ;
char xtime_endMonthly(Time, StrLen) ;
... are in all timeSeriesStatsMonthly mpas-o output files (for the Max, Min files their names are altered accordingly).
But I did NO modification of these files prior to running this script. I appears to have worked on them as is.
Note that I have spot checked the outputs from this using ncdump and they look reasonable in the sense that there are a lot of zeroes and (fewer sets of) non-zeroes for the field ismip6shelfMelt_3dThermalForcing, which look like physically reasonable ocean temperature values. But we can let this PR sit until we test them to make sure. I just don't know enough about what these fields should look like or how to check them further
Minor changes to allow for: