Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocean output Time and xtime discrepancy #6710

Open
elynnwu opened this issue Oct 25, 2024 · 0 comments
Open

Ocean output Time and xtime discrepancy #6710

elynnwu opened this issue Oct 25, 2024 · 0 comments

Comments

@elynnwu
Copy link
Contributor

elynnwu commented Oct 25, 2024

@golaz had a v3.LR.piControl run with custom ocean output that should be 5-daily:

<stream name="timeSeriesStatsCustomOutput"
        type="output"
        precision="single"
        io_type="pnetcdf"
        useMissingValMask="true"
        filename_template="v3.LR.piControl.mpaso.hist.am.timeSeriesStatsCustom.$Y-$M-$D.nc"
        filename_interval="00-01-00_00:00:00"
        reference_time="01-01-01_00:00:00"
        output_interval="00-00-05_00:00:00"
        clobber_mode="truncate"
        packages="timeSeriesStatsCustomAMPKG">

    <var name="xtime"/>
    <var name="ssh"/>
...

We're seeing a discrepancy in Time vs. xtime. All output variables use Time as the dimension, for example:

	float timeCustom_avg_ssh(Time, nCells) ;
		timeCustom_avg_ssh:units = "m" ;
		timeCustom_avg_ssh:long_name = "sea surface height" ; 

but Time has non-uniform output:

Time = 173861.5, 173867.5, 173873.5, 173879.5, 173882, 173888 ;

or in xarray cftime:

array([cftime.DatetimeNoLeap(477, 5, 2, 12, 22, 30, 0, has_year_zero=True),
       cftime.DatetimeNoLeap(477, 5, 8, 12, 22, 30, 0, has_year_zero=True),
       cftime.DatetimeNoLeap(477, 5, 14, 12, 22, 30, 0, has_year_zero=True),
       cftime.DatetimeNoLeap(477, 5, 20, 12, 22, 30, 0, has_year_zero=True),
       cftime.DatetimeNoLeap(477, 5, 23, 0, 22, 30, 0, has_year_zero=True),
       cftime.DatetimeNoLeap(477, 5, 29, 0, 22, 30, 0, has_year_zero=True)]

However, the corresponding xtime is indeed 5-daily as specified:

 xtime =
  "0477-05-06_00:00:00",
  "0477-05-11_00:00:00",
  "0477-05-16_00:00:00",
  "0477-05-21_00:00:00",
  "0477-05-26_00:00:00",
  "0477-05-31_00:00:00" ;

though the xtime start/endCustom is questionable:

 xtime_startCustom =
  "0477-04-29_00:30:00",
  "0477-05-06_00:30:00",
  "0477-05-13_00:30:00",
  "0477-05-20_00:30:00",
  "0477-05-20_00:30:00",
  "0477-05-27_00:30:00" ;

 xtime_endCustom =
  "0477-05-06_00:00:00",
  "0477-05-11_00:00:00",
  "0477-05-16_00:00:00",
  "0477-05-21_00:00:00",
  "0477-05-26_00:00:00",
  "0477-05-31_00:00:00" ;

We assume xtime to be correct and represents the end of the interval, but we're wondering what exactly does Time represent and that perhaps all variables should have xtime as its dimension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant