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

SET VARIABLE/NAME= fails for ensemble datasets #119

Open
ACManke opened this issue Aug 8, 2022 · 0 comments
Open

SET VARIABLE/NAME= fails for ensemble datasets #119

ACManke opened this issue Aug 8, 2022 · 0 comments

Comments

@ACManke
Copy link
Contributor

ACManke commented Aug 8, 2022

This was reported by Ryo Furue @ryofurue 8/7/2022 @ryofurue

Here is his example script:

! create sample datasets
set data coads_climatology
let myvar = sst[L=@MAX]
save/clobber/file=[myvar1.nc](http://myvar1.nc/) myvar
let myvar = sst[L=@MIN]
save/clobber/file=[myvar2.nc](http://myvar2.nc/) myvar
cancel data/all
cancel var/all

! testing renaming for a single dataset.
set data [myvar1.nc](http://myvar1.nc/)
set var/name=myvar_org myvar
let myvar = myvar_org/2
save/clobber/file=[tmp1.nc](http://tmp1.nc/) myvar
cancel data/all
cancel var/all

! testing renaming for an ensemble.
ensemble a = {"[myvar1.nc](http://myvar1.nc/)", "[myvar2.nc](http://myvar2.nc/)"}
set var/name=myvar_org myvar
let myvar = myvar_org/2
save/clobber/file=[tmp.nc](http://tmp.nc/) myvar

which results in the error,
**ERROR: variable unknown or not in data set: MYVAR_ORG

Variable renaming works by replacing the variable with the desired new name in the data structures that describe a dataset that is open in PyFerret. The solution here would for the code in set_var.F that does SET VARIABLE/NAME check whether the dataset is an ensemble, and change the variable-names in the member files using CD_RENAME_VAR . This would be in addition to the name change in the ensemble dataset.

The same would also apply to Timeseries and Forecast aggregations; and for Union aggregations we'd need to go find the member dataset with the variable to be renamed.

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