UW-Hydro / VIC

The Variable Infiltration Capacity (VIC) Macroscale Hydrologic Model
http://vic.readthedocs.io
MIT License
260 stars 383 forks source link

Segmentation fault when running image driver with LAKES = TRUE (cells with and without lakes) #928

Open ednisle opened 1 year ago

ednisle commented 1 year ago

Hello, I am trying to run VIC with the image driver for the submeridional lowlands (45000 km2, Argentina) with cells of ~5 km *5 km. The region has numerous lakes and wetlands, whose representation implies that there are cells with and without lake/wetland. I got the following error when trying to run the model on a certain year:

Invalid MIT-MAGIC-COOKIE-1 keyVIC Driver : Image VIC Version : 5.0.1 February 1, 2017 VIC Git Tag : Compiled : by root on edna-MS-7A15 (LINUX) Oct 11 2022 21:36:34 Compiler : gcc version : 9.4.0

Variable Infiltration Capacity (VIC) macroscale hydrologic model version 5.0.1, Copyright (C) 2016 Computational Hydrology Group, Dept. of Civil and Environmental Engineering, University of Washington. VIC comes with ABSOLUTELY NO WARRANTY. This is free software, you may redistribute it under certain conditions; see LICENSE.txt for details.

Report Bugs and Issues to : https://github.com/UW-Hydro/VIC/issues VIC Users Email Listserve : vic_users@u.washington.edu

[INFO] ../shared_all/src/vic_log.c:139: Logging to stderr [DEBUG] ../shared_image/src/get_global_domain.c:98: 5881 active grid cells found in run_cell in the parameter file. [edna-MS-7A15:385101] Process received signal [edna-MS-7A15:385101] Signal: Segmentation fault (11) [edna-MS-7A15:385101] Signal code: Address not mapped (1) [edna-MS-7A15:385101] Failing at address: 0x7ffcf0fe6000 [edna-MS-7A15:385101] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x143c0)[0x7f89cd7983c0] [edna-MS-7A15:385101] [ 1] ./vic_image.exe(+0x1ff9d)[0x5646cfdb1f9d] [edna-MS-7A15:385101] [ 2] ./vic_image.exe(+0x47dd1)[0x5646cfdd9dd1] [edna-MS-7A15:385101] [ 3] ./vic_image.exe(+0x1b952)[0x5646cfdad952] [edna-MS-7A15:385101] [ 4] ./vic_image.exe(+0xb2aef)[0x5646cfe44aef] [edna-MS-7A15:385101] [ 5] ./vic_image.exe(+0x4d8ab)[0x5646cfddf8ab] [edna-MS-7A15:385101] [ 6] ./vic_image.exe(+0x4dbca)[0x5646cfddfbca] [edna-MS-7A15:385101] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f89cd5b60b3] [edna-MS-7A15:385101] [ 8] ./vic_image.exe(+0x3e2e)[0x5646cfd95e2e] [edna-MS-7A15:385101] End of error message Violación de segmento

This error occurs only when LAKES = TRUE, otherwise the model runs successfully for all times. To find out if the problem was in having cells with and without wetland, I tried to run the model with a domain of 4 cells with lake/wetland and the model ran but until the penultimate time:

[ERROR] ../shared_image/src/get_nc_field.c:48: errno: NetCDF: Index exceeds dimension bound: Error getting values for CHANNEL_IN in /home/edna/Escritorio/datos_BBSS/forcing_file_2003.nc

It's very weird because I have a single netcdf forcing and the variables (PREC, AIR_TEMP..., CHANNEL_IN) share the same time dimension (the model runs successfully when LAKES=FALSE).

KMarkert commented 1 year ago

Try using gcc version 8.* That seemed to have fixed the issue for me. I suspect newer versions of gcc have stricter memory safety features that throw seg faults with the lake model.