A repository storing our code to go from era5 hourly data, taken with era5cli, to daily data that is usable by ESMValTool.
- This code is run from a linux environment, so the
path.home()variable might differ from yours. - You do need correct data from a leap and non-leap year
- This code works, but it is slow and there are improvements to be made for sure.
- use the era5cli bash script in
era5-hourly-to-daily/data_to_be_cmorized/cmor.shand get the correct years and variables - make sure you have data that is already correct, 2 datasets per variable: 1 non-leap year and 1 leap year.
- go into:
py_cmor.pythen from the top line to the bottom:- make sure the
rename_dictis correct and has the variables you want, in 'era5': 'cmip variable name' - check
home_dir - check the
conversion_dict, if you are not sure what it is for your variable, you can always set it to 1 and then change accordingly when testing your results - In this section:
# Build time boundswe set the time bounds for 'tas' differently this is because of this reason - In the final 'if-block' of the function you need to check if you want the file name to be of 'Eday' or 'day' or maybe even 'CFDay'
- then in the final block
if __name__ == "__main__":check your home folder again
- make sure the
- from the command line in
era5-hourly-to-daily/runpy_cmor.pywith:python py_cmor.sh &to make sure it becomes a background task. - The data should then appear in the
era5-hourly-to-daily/cmorized_outputfolder - You can check the
testing_values.ipynbnotebook to visually check your data, it also has some other built in checks- here you need to check the home folders again
- and the
correct_data_dict - you can change the
test_variablesbeware that the plot that is generated is hardcoded to be 2x2, so 4 variables.
For questions or if you need some data to test it on, please reach out to the eWaterCycle team!