Help Request: Error Running genForcing.py with Croton Test Case

22 views
Skip to first unread message

Fatemeh Shirkhanloo

unread,
Apr 27, 2025, 3:10:54 PMApr 27
to wrf-hydro_users

Dear WRF-Hydro community,

I am trying to run the genForcing.py script to generate forcings for the Croton test case.
I have prepared my Croton.txt configuration file carefully based on the standard structure.

Here are the key steps I have followed:

  • Installed and activated a fresh Conda environment (wrfhydro_env).

  • Installed esmpy, mpi4py, and other required Python packages.

  • Corrected the configuration file by ensuring that:

    • [Input], [Output], [Retrospective], [Forecast], [Geospatial], [Regridding], [Interpolation], [BiasCorrection], [Downscaling], and [SuppForcing] sections are properly populated.

    • Parameters such as AnAFlag, LookBack, ForecastInputHorizons, and ForecastInputOffsets are explicitly defined.

Despite this, I still encounter the following error when executing:

(wrfhydro_env) [fatemehs@login1 WrfHydroForcing]$ python genForcing.py Croton.txt
Traceback (most recent call last):
  File "/home/fatemehs/WrfHydroForcing/genForcing.py", line 111, in main
    inputForcingMod = forcingInputMod.initDict(job_meta,WrfHydroGeoMeta)
  File "/home/fatemehs/WrfHydroForcing/core/forcingInputMod.py", line 598, in initDict
    InputDict[force_key].userFcstHorizon = ConfigOptions.fcst_input_horizons[force_tmp]
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/fatemehs/WrfHydroForcing/genForcing.py", line 140, in <module>
    main()
  File "/home/fatemehs/WrfHydroForcing/genForcing.py", line 113, in main
    err_handler.err_out_screen_para(job_meta, mpi_meta)
  File "/home/fatemehs/WrfHydroForcing/core/err_handler.py", line 37, in err_out_screen_para
    err_msg_out = 'ERROR: RANK - ' + str(MpiConfig.rank) + ' : ' + err_msg
TypeError: can only concatenate str (not "ConfigOptions") to str



It seems that ConfigOptions.fcst_input_horizons is still being read as NoneType, although I have defined ForecastInputHorizons = [60] in my configuration file.
Also, there appears to be an additional issue with error handling in err_handler.py when exceptions occur.

Would anyone be able to help with:

  • Why fcst_input_horizons is not recognized?

  • Whether any corrections are needed in the structure of the configuration file?

  • How to fix the second error regarding string concatenation inside err_handler.py?

I would truly appreciate any help or suggestions.

Best regards,
Fatemeh Shirkhanloo

Reply all
Reply to author
Forward
0 new messages