UW-Hydro / VIC

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

[BUG] Running image driver with Lakes/Wetlands causes Segmentation Fault #915

Closed KMarkert closed 2 years ago

KMarkert commented 2 years ago

Overview

I am attempting to run VIC using the image driver and simulate lakes/wetlands. When executing the model, it is initialized and begins running the time steps, however, the model then crashes with a Segmentation fault. Since the model gets to running the timesteps it makes me believe the parameters are formatted correctly and the CHANNEL_IN forcings is defined (however still not completely sure about the formatting for the parameters). The model runs fine when not using lake/wetland model.

Model output with error

[DEBUG] ../shared_image/src/vic_image_run.c:57: Running timestep 0: dmy:
        day         : 1
        day_in_year : 1
        seconds     : 0
        month       : 1
        year        : 1980

[20510ec60f53:01389] *** Process received signal ***
[20510ec60f53:01389] Signal: Segmentation fault (11)
[20510ec60f53:01389] Signal code: Address not mapped (1)
[20510ec60f53:01389] Failing at address: 0x7ffc76fbb000
Segmentation fault

VIC version

$ vic_image.exe -v
VIC Driver  : Image
VIC Version : 5.0.1 February 1, 2017
VIC Git Tag : VIC.5.1.0.rc1-5-ga177
Compiled    : by  on buildkitsandbox (LINUX) Oct 25 2021 06:31:26
Compiler    : gcc
 version    : 9.3.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 

Compiler info

I am using the image driver so I believe the compiler is mpicc but including gcc info just in case.

$ mpicc -v     
mpicc for MPICH version 3.4.2
$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

OS info

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Lake parameters in global config

#######################################################################
# Lake Simulation Parameters
# These need to be un-commented and set to correct values only when running lake model (LAKES is not FALSE)
#######################################################################
LAKES  TRUE    # Lake parameter path/file
LAKE_PROFILE   FALSE   # TRUE = User-specified depth-area parameters in lake parameter file; FALSE = VIC computes a parabolic depth-area profile
EQUAL_AREA TRUE   # TRUE = grid cells are from an equal-area projection; FALSE = grid cells are on a regular lat-lon grid
RESOLUTION 39.0625   # Grid cell resolution (degrees if EQUAL_AREA is FALSE, km^2 if EQUAL_AREA is TRUE); ignored if LAKES is FALSE

I am happy to share any additional information to help debug the error. Thanks!

KMarkert commented 2 years ago

Closing as this was a user error. I tested running the model using the Findley Lake example data and model completed successfully.

Turns out that if the a grid cell defined as a lake runs out of water (lake depth = 0), it will provide the Segmentation fault error.

ednisle commented 1 year ago

does this mean that vic cannot represent lakes that dry up? I am running the model with the classic driver, which allows me to see the results of the cells in which the model is executed for all times, as well as the cell in which the simulation is cut until the last available time. I was able to notice that the segmentation error occurred in the first cell in which basin_depth and depth_in (basin_depth*0.98) were less than 0.6 m, when channel_in = 0 (for all times), resulting in increased lake temperature, increased latent and sensible heat, decrease of the depth and area lake and finally the drying of the cell.