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

Allow streams files without a time axis #284

Open
samsrabin opened this issue May 24, 2024 · 3 comments
Open

Allow streams files without a time axis #284

samsrabin opened this issue May 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@samsrabin
Copy link

Some streams files are intended to be static, but that's seemingly not allowed. Instead, every streams file (and, presumably, every variable being read from streams files) must have a time axis. This requires the addition of a "dummy" time axis on files that don't need it.

I think it would be better if a time axis were optional. This would make the code cleaner (avoiding time-related stuff that's not needed), avoid headaches (making an input file but forgetting to add the dummy time axis), and improve strictness (throw an error if a user supplies a streams file with a time axis for an input that's supposed to be static).

As far as what this would look like, I'd think the following arguments to shr_strdata_init_from_inline() would be made optional:

  • stream_yearFirst
  • stream_yearLast
  • stream_yearAlign
  • stream_offset
  • stream_taxmode
  • stream_dtlimit
  • stream_tintalgo

If any of these were provided, then the streams file would require a time axis, and all those arguments would need to be provided.

If those arguments weren't provided but the user-supplied streams file does have a time axis, CDEPS would throw an error.

@uturuncoglu
Copy link
Collaborator

@samsrabin I think this is possible with exiting implementation. See following entry,

taxmode02:               cycle
mapalgo02:               consd
tInterpAlgo02:           lower
readMode02:              single
dtlimit02:               1.5
stream_offset02:         0
yearFirst02:             2022
yearLast02:              2022
yearAlign02:             2022
stream_vectors02:        null
stream_mesh_file02:      INPUT_DATA/ESMFmesh.nc
stream_lev_dimname02:    null
stream_data_files02:     INPUT_DATA/mask.nc
stream_data_variables02: "glmask So_omask"
stream_dst_mask02:       1

In this case, file has time axis but its length is just 1 and CDEPS is cycling it. I am using it for fixed fields like mask, topography etc.

@uturuncoglu
Copy link
Collaborator

uturuncoglu commented May 24, 2024

Of course, the data file still need to have time axis to support this. CDEPS always requires it to read data. I am not sure if we could make those variables optional in the namelist file. BTW, this is ESMF config format which is not used by the CESM as I know. CESM used XML instead.

@samsrabin
Copy link
Author

samsrabin commented May 24, 2024

Yes, it's possible to handle static streams files by just supplying a file with one timestep. We do it in at least three places in CTSM, plus one more that I'm working on now. My point is that it's annoying to have to do, for the reasons I outlined up above.

@ekluzek ekluzek added the enhancement New feature or request label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants