Skip to content

model2netcdf.ED2 Fails if output files missing "AVG_SOIL_TEMP" aka "Soiltemp" #2623

@mccabete

Description

@mccabete

Bug Description

model2netcdf.ED2 fails if -T- file is missing the variable "AVG_SOIL_TEMP", known as "Soiltemp" in the pecan standard. It fails specifically at this line.

To Reproduce

Steps to reproduce the behavior:

  1. Run met2model.ED2() on an ED2 generated -T- file that has no "AVG_SOIL_TEMP" data.
  2. See error

Expected behavior

The function's assigning Soiltemp the value -999 would mean that the .nc file it produces would have "missing values" of -999 for Soiltemp.

Error message

2020-06-02 16:00:40 WARN   [model2netcdf.ED2.R#278: PEcAn.logger::logger.warn] : 
   Could not find AVG_SOIL_TEMP in ed hdf5 output. 
Error in array(0, ncol(soiltemp)) : 'dims' cannot be of length 0

Machine (please complete the following information):

  • Server BU test-pecan, Tess' personal build. Up to date with develop.

Additional context

I tried an if(soiltemp != -999){} around the code chunk from line 520 to line 579, but it messed up the dimensions during the write-out step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions