# make\_ERA5 and ONLINE

**URL:** <https://forum.croco-ocean.org/t/make-era5-and-online/7520>\
**Category:** croco tools (pre/post-processing)\
**Tags:** forcing\
**Created:** [December 15, 2025, 9:06am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520 "2025-12-15T09:06:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hqcmax](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/hqcmax/32/760_2.png) [@hqcmax](https://forum.croco-ocean.org/u/hqcmax)\
**Post date:** [December 15, 2025, 9:06am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/1 "2025-12-15T09:06:50Z")

</div>

Dear scholars, I have encountered a problem with the creation of the forcing field. The problem is as follows:

1. Firstly, I wanted to use the offline method to create the frc or blk files, which involves using the make\_ERA5.m function. However, after creating the files, the program crashed when running the second step. Upon checking the rst.nc file, I found that the field temperature had dropped to **-3\*10^32**! I suspect there might be an issue with the heat flux creation. So, I checked the frc file and found that the parameters shflux, swflux, sst, sss, dqsstd, and sward were all empty. But the blk file contained tair, rhum, prate, and radlw\_in. Is this reasonable? However, the shortwave and longwave radiation in the blk file cannot cause the ocean to lose temperature instantly, even without sensible heat flux.

2. The second problem is that since I couldn’t solve the issue of instantaneous temperature loss, I thought of using the online interpolation method. In the cpp, I turned ONLINE and ERA\_ECMWF on. But I don’t know how to properly set the path and format for downloading data in the croco.in file. This is what caused the problem: /home/CROCO/croco\_tools-v2.0.0/Aforc\_ERA5/path\_to\_my\_run\_dir/DATA/ERA5\_native\_RUN\_test/T2M\_Y2025M01.nc  
erreur tool\_decompdate : impossible de determiner le mois  
erreur tool\_decompdate : impossible de determiner le mois

I would appreciate it if scholars with relevant experience could offer valuable suggestions. Thank you 🤝.

---

<div class="post-metadata">

**Author:** ![Jellyfish](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@Jellyfish](https://forum.croco-ocean.org/u/Jellyfish)\
**Post date:** [December 15, 2025, 10:23am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/2 "2025-12-15T10:23:33Z")

</div>

Hi,

I can only help with the second question.  
In **croco.in** , the path only needs to point to the **directory** where the downloaded files are stored.  
For example, suppose you have a directory containing multiple monthly files:  
`/media/test/DATA/Benguela/`  
with files such as (individual files):  
`LSM_Y2013M01.nc TSM_Y2013M01.nc ...`  
(one file for each year and month).  
At the end of your `croco.in` file, you should specify the online forcing parameters as follows:  
`online: byear bmonth recordsperday byearend bmonthend / data path 2013 1 4 2013 3 /media/test/DATA/Benguela/`  
In this case, you only need to specify the starting year (`byear = 2013`) and month (`bmonth = 1`) and the ending year and month (March 2013). The forcing has 4 records per day but it can change depending how your files are structured.

Below these parameters, you simply provide the path to the directory containing the files (`/media/test/DATA/Benguela/`). The model will automatically search for and read the appropriate files from this directory.  
However, you must ensure that the months specified match the period of your model run.

---

<div class="post-metadata">

**Author:** ![hqcmax](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/hqcmax/32/760_2.png) [@hqcmax](https://forum.croco-ocean.org/u/hqcmax)\
**Post date:** [December 16, 2025, 3:53am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/3 "2025-12-16T03:53:30Z")

</div>

Thank you for your reply！ Following your instructions, I set croco.in and cpp.h. In the in file, I set it as:

- online: byear bmonth recordsperday byearend bmonthend / data path  
2025 1 4 2025 3  
/home/CROCO/croco-v2.0.1/RUN\_test/DATA/ERA5\_Beng/

- and in the cpp.h file, I set it as:  
# define ONLINE  
# ifdef ONLINE  
# undef AROME  
# define ERA\_ECMWF  
# define BULK\_MONTH\_1DIGIT  
# endif

- But the same problem occurred again:  
Open Meteo file :

/home/CROCO/croco- v2.0.1/RUN\_test/DATA/ERA5\_Beng/T2M\_Y2025M1.nc  
erreur tool\_decompdate : impossible de determiner le mois  
erreur tool\_decompdate : impossible de determiner le mois  
erreur tool\_decompdate : impossible de determiner le mois

- Have you encountered similar problems before?

- Thank you very much for your enthusiastic response.  
Best wishes!

---

<div class="post-metadata">

**Author:** ![Jellyfish](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@Jellyfish](https://forum.croco-ocean.org/u/Jellyfish)\
**Post date:** [December 16, 2025, 9:35am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/4 "2025-12-16T09:35:58Z")

</div>

Hi again,

In my case, the issue was due to inconsistent time steps between the input files. Did you run the example simulation provided in the tutorial? We could use those files as a reference to help identify the problem.

Also, could you please share your `croco.in` file?

P.S: Just to be sure…Change the name of the file from T2M\_Y2025M1.nc to T2M\_Y2025_M01_.nc (sometimes the model wants the MM nomenclature)

Best regards,

---

<div class="post-metadata">

**Author:** ![hqcmax](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/hqcmax/32/760_2.png) [@hqcmax](https://forum.croco-ocean.org/u/hqcmax)\
**Post date:** [December 16, 2025, 11:14am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/5 "2025-12-16T11:14:23Z")

</div>

- Thank you again for your response！  
I will attach my croco.in file. The issue you mentioned here is about the time step of the input file. Is it referring to the downloaded ERA5 or something else?  
[croco\_in.txt](https://forum.croco-ocean.org/uploads/short-url/1Irb7xUoJjIp9YN47lSYQTA4sJW.txt) (9.4 KB)
- Since I referred to other scholars and enabled #define BULK\_MONTH\_1DIGIT, there is no need to rename T2M\_Y2025M1 to T2M\_Y2025M01. This way is a bit more convenient, but I also tried using T2M\_Y2025M01, but the problems occurred were the same as before.
- Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Jellyfish](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@Jellyfish](https://forum.croco-ocean.org/u/Jellyfish)\
**Post date:** [December 16, 2025, 11:44am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/6 "2025-12-16T11:44:44Z")

</div>

Yes. The model is very sensitive to the time steps.  
Do you have the same `yorig` in the ERA5 files as in `croco.in`, and are the time steps set to 4 hours in your ERA5 files?  
Sometimes it is really a simple thing that breaks everything 😄

---

<div class="post-metadata">

**Author:** ![hqcmax](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/hqcmax/32/760_2.png) [@hqcmax](https://forum.croco-ocean.org/u/hqcmax)\
**Post date:** [December 16, 2025, 11:46am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/7 "2025-12-16T11:46:10Z")

</div>

Thank you for your reply! 🤝  
A simple mistake:I modified the reference time in ERA5\_convert.py to “days since 1900-01-01” and it was able to run, although a new crash error occurred.  
Best wishes! 😁

---

<div class="post-metadata">

**Author:** ![Jellyfish](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@Jellyfish](https://forum.croco-ocean.org/u/Jellyfish)\
**Post date:** [December 16, 2025, 11:47am UTC](https://forum.croco-ocean.org/t/make-era5-and-online/7520/8 "2025-12-16T11:47:23Z")

</div>

Welcome to ocean modelling. If it runs on the first try, something is wrong 😄 (my case)
