How to converting ERA5 Dataset to WRF-Hydro Input Format Using MFE

46 views
Skip to first unread message

kingstn

unread,
Jul 3, 2025, 2:26:47 PMJul 3
to wrf-hydro_users

Hello everyone,

I’m currently trying to convert ERA5 reanalysis data into the WRF-Hydro input format (specifically LDASIN/HRLDAS) using the Meteorological Forcing Engine (MFE). Despite multiple attempts, I haven’t been able to successfully generate the required forcing files.

If anyone has experience using MFE to convert ERA5 data into WRF-Hydro format, I’d sincerely appreciate any guidance, tips, or examples you can share.

Thank you very much for your time and support.



Yongxin Zhang

unread,
Jul 5, 2025, 6:36:44 PMJul 5
to negus...@gmail.com, wrf-hydro_users
Hi,

    I have developed and used NCL scripts and C-shell scripts (which call the NCL scripts) for regridding and downscaling the ERA5 reanalysis data to create the LDASIN files that drive WRF-Hydro. The ERA5 variables I have downloaded are monthly data with hourly frequency and one variable per file. They are:

T2m: 2-m temperature
TD2m: 2-m dew point temperature
sp: surface pressure
U10m: 10-m U-wind component
V10m: 10-m V-wind component
tpr: total precipitation rate

msdwlwrf: mean surface download longwave radiation flux

msdwswrf: mean surface download shortwave radiation flux


GHT: geopotential height at the surface

     I did not find 2-m specific humidity in ERA5 reanalysis so I used surface pressure and 2-m dew point temperature to compute specific humidity.

      I downloaded geopotential height at the surface (GHT) so by dividing by 9.8 (gravitational acceleration) I can get the surface height in m.

      My regridding and downscaling process included:

1) creating the weight file from the ERA5 grid to my WRF-Hydro domain;

2) regridding the ERA5 surface height to my WRF-Hydro domain using the weight file (this regridded surface terrain height was used for doing terrain adjustment);

3) regridding each of the ERA5 variables that WRF-Hydro needs to my WRF-Hydro domain; using the differences of the regridded ERA5 surface height and my WRF-Hydro terrain height and the standard lapse rate of 6.49 K/km to adjust T2m and TD2m; using the adjusted T2m and the terrain differences to adjust surface pressure through the hypsometric equation; using the terrain adjusted TD2m and surface pressure to compute Q2m (2-m specific humidity);

4) no terrain adjustment was applied to downward longwave radiation at the surface;

5)  terrain adjustment (accounting for slope effect) was applied to downward shortwave radiation at the surface using the WRF routine, topo_adj.f90.

     The terrain downscaling process is a bit complicated but if you are doing testing only then you don't need to do downscaling and doing regridding is pretty straightforward: as long as you have the ERA5 hourly data either one variable per file or all variables in one file, I have one C-shell script to call the NCL script for doing regridding (after the weight file is created which only needs to do once) and that's it.

       Sorry for the bit of a long email but please let me know if you have any questions and how you want to proceed with this.

Thanks,
Yongxin

**************************************************

kingstn

unread,
Jul 22, 2025, 11:47:57 AMJul 22
to wrf-hydro_users, Yongxin Zhang, kingstn

Thank you, Yongxin Zhang, for your helpful comment.

I was actually able to resolve that issue and proceed past that stage with help from someone else, just before you shared your suggestion. I still appreciate your support!

Now, I’m encountering a new problem — a segmentation fault when running mpirun -np 2 ./wrf_hydro.exe. The error message is:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0xcee78223960 in ???
#1  0xcee78222ac5 in ???
#2  0xcee77e4251f in ???
at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#3  0x5e06afc475de in ???
#4  0x5e06afbfe447 in ???
#5  0x5e06afbfb982 in ???
#6  0xcee77e29d8f in __libc_start_call_main
at ../sysdeps/nptl/libc_start_call_main.h:58
#7  0xcee77e29e3f in __libc_start_main_impl
at ../csu/libc-start.c:392
#8  0x5e06afbfb9b4 in ???
#9  0xffffffffffffffff in ???
#0  0xa0750223960 in ???
#1  0xa0750222ac5 in ???
#2  0xa074fe4251f in ???
at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#3  0x641bf67bf5de in ???
#4  0x641bf6776447 in ???
#5  0x641bf6773982 in ???
#6  0xa074fe29d8f in __libc_start_call_main
at ../sysdeps/nptl/libc_start_call_main.h:58
#7  0xa074fe29e3f in __libc_start_main_impl
at ../csu/libc-start.c:392
#8  0x641bf67739b4 in ???
#9  0xffffffffffffffff in ???

Do you have any idea what might be causing this segmentation fault, or suggestions on how I can debug it?


 

Yongxin Zhang

unread,
Jul 22, 2025, 12:20:47 PMJul 22
to kingstn, wrf-hydro_users
Hi,

     It is great to hear that you have resolved the issue! Thanks for letting us know!

     A segmentation fault issue is always a bit tricky to track down. You used only two processors (i.e., np 2) which may not be enough for running your domain if your domain is large. Also, I am wondering if you have set something like "ulimit -s unlimited" before launching the run. Further, I am wondering if you have checked your forcing (LDASIN) files to see if there are any missing or unphysical values.

Thanks,
Yongxin
Reply all
Reply to author
Forward
0 new messages