#!/usr/bin/env python

## Just run code in recipes, use it carefully
## example: use netcdf4 to make cache file. Since python is faster than ncl.
#;DIAG_NORCPM; RUNTHESECODES: print('    no codes run here.')

import xarray as xr
p1fn = "NUG_FF_const_UV_SON_1980-2000.nc"
p2fn = "NUG_FF_const_UV_SON_2000-2020.nc"
outfile = "NUG_FF_const_dUV_SON_P2-P1.nc"

p1ds = xr.open_dataset(p1fn)
p2ds = xr.open_dataset(p2fn)
difds = p2ds-p1ds
difds.to_netcdf(outfile)


