CH-Earth / summa

Structure for Unifying Multiple Modeling Alternatives:
http://www.ral.ucar.edu/projects/summa
GNU General Public License v3.0
80 stars 105 forks source link

`SUMMA` crashes when paths in `fileManager` text file miss `/` at the end #561

Open kasra-keshavarz opened 6 months ago

kasra-keshavarz commented 6 months ago

Bug Report

Apparently, SUMMA crashes when the paths in the fileManager text file miss the / at the end. The error I receive is the following:

$ ./summa.exe -g 93 1 -m ./settings/fileManager_1month.txt > ./answers/1.1.1.run.txt
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG
STOP 1

This normally shouldn't happen. I guess.

Here is the setting file for fileManager that I am using:

controlVersion       'SUMMA_FILE_MANAGER_V3.0.0'                           !  file manager version (defined string)
simStartTime         '1988-01-01 01:00'                                    ! 
simEndTime           '1988-01-31 23:00'                                    ! 
tmZoneInfo           'utcTime'                                             ! 

! These need to be updated
settingsPath         '/home/kasra.keshavarz1/pbhmCourse_student/4_high_performance_computing/settings/' !  setting path
outputPath           '/home/kasra.keshavarz1/pbhmCourse_student/4_high_performance_computing/output/'    !  output path

! This may need to be updated
forcingPath          '/work/TALC/enci619.05_2024w/hpc_forcing' !  forcing path

! This can remain unchanged
decisionsFile        'modelDecisions.txt'                                  !  model decision file
outputControlFile    'outputControl_wb.txt'                                !  output control specs
globalHruParamFile   'localParamInfo.txt'                                  !  local parameters
globalGruParamFile   'basinParamInfo.txt'                                  !  basin parameters
attributeFile        'local_attribute_camels.nc'                           !  local attributes
trialParamFile       'ParamTrial.camels.direct_calib_15.nc'                !  trial parameters
forcingListFile      'forcingFileList.txt'                                 !  forcing file list
initConditionFile    'warmState_1988010100.nc'                             !  initial conditions
outFilePrefix        'camels_nldas_1month'                                 !  output_prefix ('_' appended)
vegTableFile         'VEGPARM.TBL'                                         ! 
soilTableFile        'SOILPARM.TBL'                                        ! 
generalTableFile     'GENPARM.TBL'                                         ! 
noahmpTableFile      'MPTABLE.TBL'                                         ! 
! history Sat Sep 26 16:49:40 2020: convert_summa_config_v2_v3.py fileManager.txt
andywood commented 6 months ago

Can you send the output from executing this without redirecting output into another file?
We see the error message but not what leads up to it. I don't think it has crashed, but rather trapped the error (such as file not found) and stopped. e.g., run: ./summa.exe -g 93 1 -m ./settings/fileManager_1month.txt

kasra-keshavarz commented 6 months ago

Thank you Andy, and sorry for the oversight in documenting the error message. I have pasted the error in the following:

$ ./summa.exe -g 93 1 -m ./settings/fileManager_1month.txt
 GRU-Parallelization run activated. 1 GRUs are selected for simulation.
file_master is './settings/fileManager_1month.txt'.
   1 controlVersion: SUMMA_FILE_MANAGER_V3.0.0
   2 simStartTime: 1988-01-01 01:00
   3 simEndTime: 1988-01-31 23:00
   4 tmZoneInfo: utcTime
   5 settingsPath: /home/kasra.keshavarz1/pbhmCourse_student/4_high_performance_computing/settings/
   6 outputPath: /home/kasra.keshavarz1/pbhmCourse_student/4_high_performance_computing/output/
   7 forcingPath: /work/TALC/enci619.05_2024w/hpc_forcing
   8 decisionsFile: modelDecisions.txt
   9 outputControlFile: outputControl_wb.txt
  10 globalHruParamFile: localParamInfo.txt
  11 globalGruParamFile: basinParamInfo.txt
  12 attributeFile: local_attribute_camels.nc
  13 trialParamFile: ParamTrial.camels.direct_calib_15.nc
  14 forcingListFile: forcingFileList.txt
  15 initConditionFile: warmState_1988010100.nc
  16 outFilePrefix: camels_nldas_1month
  17 vegTableFile: VEGPARM.TBL
  18 soilTableFile: SOILPARM.TBL
  19 generalTableFile: GENPARM.TBL
  20 noahmpTableFile: MPTABLE.TBL
 id variable requested in outputControl, will be skipped: variable=hruId

FATAL ERROR: summa_paramSetup/ffile_info/FileNotFound[file='/work/TALC/enci619.05_2024w/hpc_forcingnldasForcing_198801.nc']

Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG
STOP 1
wknoben commented 6 months ago

It seems that the fileManager you shared does have the final / in forcingPath. Did you already fix this after running into the error, or is there some sort of odd bug where it eats the final / in the path?

forcingPath          '/work/TALC/enci619.05_2024w/hpc_forcing/' !  forcing path

Expecting the final / has been default behaviour for a long time. I imagine it's not hard to check for this and append a / if needed.

kasra-keshavarz commented 6 months ago

Sorry for the inconsistency, I revised my first post. It should be accurate now.

andywood commented 6 months ago

Wouter is correct, this works as expected -- SUMMA doesn't crash, it exits. The error message shows you that you should put the '/' at the end of the directory path in the fileManager. It's a convention, although if someone wanted to they could easily add some code to include a '/' on the end of whatever is entered in the directory path names or with slightly more effort check to see if a '/' exists first.