Skip to content

Add functionality to MALI ocean-data interpolation script#742

Open
stephenprice wants to merge 1 commit into
MPAS-Dev:masterfrom
stephenprice:stephenprice/glc/add-functionality-to-ocean-interp-script
Open

Add functionality to MALI ocean-data interpolation script#742
stephenprice wants to merge 1 commit into
MPAS-Dev:masterfrom
stephenprice:stephenprice/glc/add-functionality-to-ocean-interp-script

Conversation

@stephenprice

Copy link
Copy Markdown
Contributor

Minor changes to allow for:

  1. Allow more general specification for ocean output file year (e.g. zero-padded, like year '0059')
  2. Co-pilot generated changes to ensure that the script works to generate monthly outputs of interpolated values (previous functionality worked to interpolate annual averages from monthly mpas-o outputs; new functionality also allows for the creation of monthly resolved, interpolated outputs)

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@matthewhoffman matthewhoffman self-assigned this Jul 23, 2026
@matthewhoffman
matthewhoffman removed the request for review from trhille July 23, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants