Python scripts to download ERA5 datasets from CDS

I would like to share with you my Python scripts to download ECMWF ERA5 reanalysis datasets from the Copernicus Climate Data Store (CDS) https://cds.climate.copernicus.eu, required by the CROCO model to perform simulations with atmospheric forcing. The Git-Hub repository is GitHub - d4viddonoso/ERA5-request-to-CROCO-model: A python scripts to request ERA5 reanalysis datasets from ECMWF servers

Please, let me know if you have any comment or issue using them.

Cheers,
David.

Just wanted to say thanks - this is a lot neater than the code I bashed together so thank you for making this available! Seems to work very well.

Hi Beaufort,

I’m glad to hear that the code is useful to you and I appreciate your feedback :slight_smile:

Regards,
David.

Thank you very much!
Your code was very useful for me too.

However, did you notice any change in the magnitude of the SSR values when comparing ERA-Interim and ERA5 for the same month? I am using ERA5 for an interannual simulation and my simulation is cooling down too much because of the smaller values of SSR in ERA5. I am wondering if this happened to someone else or if I downloaded something wrong when adapting your code. The other variables used for the blk files have the same magnitude in ERA5 and ERA-interim.

Thank you!
All the best,
Caique.

I noticed that you are downloading mean fluxes instead of the surface solar radiation as in the original ERA-interimrequest.py. Is there a reason for that?

Hi Caique, please, take a look into “ERA5_variables.json” file. There you will find the variable SSR (surface net solar radiation [J m-2]), are you using this one to build your bulk files?

Yes, I am using this one to build my bulk files. I searched for the variables that had the same name in the original ERAInterimrequest.py. However, I am having this problem with the magnitude of the SSR… Is there a reason you chose the mean fluxes variables? Maybe this can fix my problem too.

The SSR’s parameter ID (“176.128”) is the same between my code and of “ERA-Interim_request.py”, so the variables should be the same. A good test for you would be to download a little example file of SSR from ERA5 at the CDS website and then compare it with the downloaded using the ERA-Interim code.

And I’m sorry, I’m not pretty sure why you ask me for “mean fluxes variables”, may you explain me that in a more detailed way?

Thank you! I will check that downloading from the CDS website.

I am asking about the mean fluxes because your code is written to download these variables: ‘meets’,‘mntss’,‘msnswrf’,‘msnlwrf’,‘msshf’,‘mslhf’,‘mer’,‘mtpr’. Looking at the json file these are the mean fluxes. Because of that, I was wondering if the SSR was really the correct variable to download.

OK, now I’m understand you. That variables you mentioned are useful if you don’t want use the bulk formula and just create “FORCING_FILES” instead of “BULK_FILES”. You may find more details at https://croco-ocean.gitlabpages.inria.fr/croco_doc/tutos/tutos.10.run.inter.html

Ohhh got it! That is good to know! Thanks!

And, please, let me know how result your test comparing ERA-Interim vs ERA5. I would like to know if my code introduce any difference between these datasets.

Hi! The variables are correct. Apparently, the problem is with the conversion of J/m² to W/m² when using ERA5. The reanalysis I am using uses an accumulation time of 1h while ERA-Interim uses an accumulation time of 1 day. I am still working on correcting the conversions on the reformat_ECMWF.m file

Hi Caique, Did you solve the problem with SSR variable in the case of ERA5? I’m using the msnswrf (ERA5) data to create the SSR reformated file.

Hi Cristian, you don’t need to create SSR from MSNSWRF variable. If you edit and add ‘ssr’ to the list of requested variables at beginning of the script, SSR will be downloaded too.

Hi Caique, do you have news about it? I’m planning to work in this today.

Hi Caique, do you have news about it? I’m planning to work in this today.

Hi Cristian, you don’t need to create SSR from MSNSWRF variable. If you edit and add ‘ssr’ to the list of requested variables at beginning of the script, SSR will be downloaded too.