SPHY Manual - All versions
  • 📚Readme
  • manual
    • SPHY manual 3.1
      • Introduction
      • Theory
        • Background
        • Modules
        • Reference and potential evaporation
        • Dynamic vegetation processes
        • Snow processes
        • Glacier processes
        • Soil water processes
        • Soil erosion processes
        • Routing
      • Applications
        • Irrigation management in lowland areas
        • Snow- and glacier-fed river basins
        • Flow forecasting
        • Soil erosion and sediment transport
      • Installation of SPHY
        • Installing SPHY as a stand-alone application
          • Miniconda
          • SPHY v3.1 source code
      • Build your own SPHY-model
        • Select projection extent and resolution
        • Clone map
        • DEM and Slope
        • Delineate catchment and create local drain direction map
        • Preparing stations map and sub-basin.map
        • Glacier table
        • Soil hydraulic properties
        • Other static input maps
        • Meteorological forcing map series
        • Open water evaporation
        • Dynamic vegetation module
        • Soil erosion model input
          • MMF
          • Soil erosion model calibration
          • Soil erosion model output
        • Sediment transport
      • Reporting and other utilities
        • Reporting
        • NetCDF
      • References
      • Copyright
      • Appendix 1: Input and Output
      • Appendix 2: Input and Output description
      • Appendix 3: Soil erosion model input
        • MUSLE
        • INCA
        • SHETRAN
        • DHVSM
        • HSFP
    • SPHY manual 3.0
      • Introduction
      • Theory
        • Background
        • Modules
        • Reference and potential evaporation
        • Dynamic vegetation processes
        • Snow processes
        • Glacier processes
        • Soil water processes
        • Soil erosion processes
        • Routing
      • Applications
        • Irrigation management in lowland areas
        • Snow- and glacier-fed river basins
        • Flow forecasting
      • Installation of SPHY
        • General
        • Installing SPHY as a stand-alone application
          • Miniconda
          • SPHY v3.1 source code
      • Build your own SPHY-model
        • Select projection extent and resolution
        • Clone map
        • DEM and Slope
        • Delineate catchment and create local drain direction map
        • Preparing stations map and sub-basin.map
        • Glacier fraction map
        • Soil hydraulic properties
        • Other static input maps
        • Meteorological forcing map series
        • Open water evaporation
        • Dynamic vegetation module
        • Soil erosion model input
          • MUSLE
          • MMF
          • INCA
          • SHETRAN
          • DHVSM
          • HSFP
          • Soil erosion model calibration
          • Soil erosion model output
        • Sediment transport
        • Applications
        • Reporting
        • NetCDF
      • References
      • Copyright
      • Appendix 1: Input and Output
Powered by GitBook
On this page
  1. manual
  2. SPHY manual 3.1
  3. Reporting and other utilities

NetCDF

PreviousReportingNextReferences

Last updated 1 year ago

The SPHY model allows the climate forcing to be read directly from NetCDF format instead of the usual daily pcraster map input. The model runs will slow down when using the NetCDF input, because each time step the data need to be interpolated onto the model grid. It is advisable to use the common pcraster map input instead of the NetCDF input in case model calibration, when many model runs are needed using the same climate period and extent. However, the NetCDF input can be useful for scenario model runs, for instance in climate change impact assessments.

The NetCDF input can be used for precipitation and temperature (daily average, minimum and maximum). Here we explain how to use the NetCDF input for precipitation. All steps are identical for each of the three temperature inputs. To use the NetCDF input, first the precNetcdfFLAG should be set to 1. The location of the NetCDF file should be indicated under precNetcdf, which is the file with a *.nc extension. The input variable precNetcdfInput is used to give some specific information about how the data are stored in the NetCDF file, each element is separated by a comma (“,”). The information can be obtained by reading the NetCDF file in R, python or other programming or GIS software. The information includes:

  • Variable name: This is the variable name given in the NetCDF file. For precipitation this can include precipitation, pcp, prec, etc. For temperature this can include temp, tavg, tmin, tmax, avgtemp, mintemp, maxtemp, etc.

  • X-coordinate: The x-coordinate is a variable stored in the NetCDF file. In case of a rectangular grid, this is often indicated with an X, lon or longitude. In case of a rotated grid, this is often indicated with rlon.

  • Y-coordinate: The y-coordinate is a variable stored in the NetCDF file. In case of a rectangular grid, this is often indicated with an Y, lat or latitude. In case of a rotated grid, this is often indicated with rlat.

  • Interpolation method: There are three interpolation methods implemented: linear, cubic or nearest neighbor. It is suggested to use linear or nearest neighbor interpolation for precipitation input. The cubic interpolation technique may result in negative values in case the NetCDF input includes many 0 values and occasional positive values. For temperature input, all three interpolation techniques can be used. For more information on the difference between the three interpolation techniques see:

  • Multiplication factor: Often precipitation NetCDF data are stored in mm * 10 format. This to decrease the size of the NetCDF files. In that case a multiplication factor of 0.1 is needed to let the model know that the data first need to be multiplied by 0.1 before further processing.

  • EPSG code NetCDF file: The coordinate system of the NetCDF file is most likely different than the coordinate system of the SPHY project. The coordinate system of the NetCDF file is needed to make the necessary transformations of the coordinates and data interpolation. The coordinate system of the NetCDF file can be found by reading the NetCDF in R, python or any GIS program. Each coordinate system is linked to a so-called EPSG code. For instance, the WGS84 coordinate system has EPSG code 4326. In that case, the input will be “epsg:4326”. The code can be found in the following website: . NetCDF file often use rotated pole coordinates. In that case the word “rotated” should be provided. To make the necessary transformations to the coordinates, the NetCDF script will search for the grid_north_pole_latitude and grid_north_pole_longitude variables inside the NetCDF file. Beware, the script will crash in case these variables do not exist.

  • EPSG code model domain: Similar to the EPSG code of the NetCDF file, the same needs to be provided of the model domain. See above for information on how to find the EPSG code of the model domain.

The NetCDF input can be for example:

precNetcdfInput = pcp,X,Y,linear,0.1,epsg:25830,epsg:25830

  • Variable name: pcp

  • X-coordinate: X

  • Y-coordinate: Y

  • Interpolation method: linear

  • Multiplication factor: 0.1

  • EPSG code NetCDF file: epsg:25830

  • EPSG code model domain: epsg:25830

precNetcdfInput = precipitation,rlon,rlat,linear,1,rotated,epsg:25830

  • Variable name: precipitation

  • X-coordinate: rlon

  • Y-coordinate: rlat

  • Interpolation method: linear

  • Multiplication factor: 1

  • EPSG code NetCDF file: rotated

  • EPSG code model domain: epsg:25830

https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html
https://spatialreference.org/