NCL Home > Documentation > Functions > Crop, Meteorology

precip_rain_snow

Partition monthly precipitation totals into rain and snow amount using an empirical relationship.

Available in version 6.6.0 and later.

Prototype

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  ; This library is automatically loaded
                                                             ; from NCL V6.2.0 onward.
                                                             ; No need for user to explicitly load.

	function precip_rain_snow (
		prc    : numeric,  
		tmp    : numeric,  
		train  : numeric,  
		tsnow  : numeric   
	)

Arguments

prc

Monthly precipitation total amount.

tmp

Monthly mean temperature. It must have the same size and shape as prc.

train

Rain temperature threshold with the same units as tmp This can be a scalar or array. If an array, it must have the same size and shape as tmp. A value equivalent to train=3.3C (38F, 276K) is commonly used.

tsnow

Snow temperature threshold. This can be a scalar or array. If an array, it must have the same size and shape as tmp. tsnow varies by elevation. At elevations below 1000m, tsnow=-10.0C (14F, 263K) is suggested while for elevations above 1000m tsnow=-1.0C (30.2F, 272K) may be more appropriate.

Return value

A variable of type 'list' containing two arrays rain and snow. Each returned array will have the same size and shape as prc.

Description

In many archives, precipitation amount is available as one quantity consisting of rain and (melted) snow amount. For certain applications separate estimates are needed. Using temperature thresholds for both snow and rain, precip_rain_snow will partition the total precipitation (prc) into snow ('prc_snow') and rain ('prc_rain') amounts.

This is based on an empirical relationship. Where tmp is greater than train the prc is considered to be all rain. Where tmp is less than tsnow the prc is considered to be all snow. Between tsnow and train, the amount of precipitation that is snow decreases linearly from 100 percent to 0 percent of total precipitation. For tmp within the tsnow and train temperature range:

     prc_snow = prc*[(train-tmp)/(train-tsnow)]
     prc_rain = prc-prc_snow
All appropriate metadata are returned.

Rather than use fixed constants for train and/or tsnow, the user may wish to create an array for train and/or tsnow that is a function of elevation, latitude and longitude. However, the array size and shape must conform to tmp.


References:
   McCabe, G.J., and S.L. Markstrom, 2007
   A Monthly Water-Balance Model Driven By A Graphical User Interface
   U.S. Geological Survey Open-File report 2007-1088, 6 pp.

   Wolock, D.M., and McCabe, G.J., 1999 
   Effects of potential climatic change on annual runoff in the conterminous United States 
   Journal of the American Water Resources Association, v. 35, p. 1,341-1,350.

See Also

Crop and Evapotranspiration functions

Examples

Example 1: For illustration, set a constant prc and linearly vary tmp such that the values span -20C to 10C.

  train = 3.3              ; suggested values for degC                   
  tsnow = -10.0

  N     = 31
  prc   = new( N, float)
  prc   = 100              ; set constant for illustration
  prc@units = "mm"

; MIX: set all tmp => all-snow, mix (snow and rain), all-rain

  tmp   = fspan(-20,10,N)
  tmp@units = "degC"
  RS    = precip_rain_snow(prc, tmp, train, tsnow)   
  prain = RS[0]            ; explicitly extract for clarity and convenience
  psnow = RS[1]
  delete( RS )             
  print(sprintf("%5.2f", tmp)  +"  "+sprintf("%5.2f", prc)+"   " \
       +sprintf("%5.2f", prain)+"  "+sprintf("%5.2f", psnow))

The edited output is:

       tmp     prc    prain   psnow 
     -20.00  100.00    0.00  100.00      all snow
     -19.00  100.00    0.00  100.00
     -18.00  100.00    0.00  100.00
     -17.00  100.00    0.00  100.00
     -16.00  100.00    0.00  100.00
     -15.00  100.00    0.00  100.00
     -14.00  100.00    0.00  100.00
     -13.00  100.00    0.00  100.00
     -12.00  100.00    0.00  100.00
     -11.00  100.00    0.00  100.00
     -10.00  100.00    0.00  100.00
      -9.00  100.00    7.52   92.48      linear change 
      -8.00  100.00   15.04   84.96
      -7.00  100.00   22.56   77.44
      -6.00  100.00   30.08   69.92
      -5.00  100.00   37.59   62.41
      -4.00  100.00   45.11   54.89
      -3.00  100.00   52.63   47.37
      -2.00  100.00   60.15   39.85
      -1.00  100.00   67.67   32.33
       0.00  100.00   75.19   24.81
       1.00  100.00   82.71   17.29
       2.00  100.00   90.23    9.77
       3.00  100.00   97.74    2.26
       3.30  100.00  100.00    0.00      all rain
       4.00  100.00  100.00    0.00
       5.00  100.00  100.00    0.00
       6.00  100.00  100.00    0.00
       7.00  100.00  100.00    0.00
       8.00  100.00  100.00    0.00
       9.00  100.00  100.00    0.00
      10.00  100.00  100.00    0.00

Example 2: Consider prc(time,lat,lon) and tmp(time,lat,lon) with scalar train and tsnow

  train = 3.3                ; suggested values for degC                   
  tsnow = -10.0
  RS    = precip_rain_snow(prc, tmp, train, tsnow)  
  prain = RS[0]              ; explicitly extract for clarity and convenience
  psnow = RS[1]
  delete( RS )             
  printVarSummary(prain)   ; prain(time,lat,lon)
  printVarSummary(psnow)   ; psnow(time,lat,lon)

Example 3: A user may have created arrays where the threshold settings are functions of latitude, longitude and elevation: train(lat,lon) and tsnow(lat,lon). The precip_rain_snow function requires that if train and tsnow are not scalars, these arguments must conform to tmp. Here, the user must explicity perform that task using conform:

  TRAIN = conform(tmp, train, (/1,2/))
  TSNOW = conform(tmp, tsnow, (/1,2/))
  RS    = precip_rain_snow(prc, tmp, TRAIN, TSNOW)   
  prain = RS[0]                 ; explicitly extract for clarity and convenience
  psnow = RS[1]
  delete( [/RS, TRAIN, TSNOW/] )             
  printVarSummary(prain)       ; prain(time,lat,lon)
  printVarSummary(psnow)       ; psnow(time,lat,lon)

Example 4: Similar to Example 3: Consider prc(time,nsta) and tmp(time,nsta) with user created arrays where the threshold settings are functions of individual station locations and elevations: train(nsta) and tsnow(nsta).

  TRAIN = conform(tmp, train, 1)      ; TRAIN(time,nsta)
  TSNOW = conform(tmp, tsnow, 1)      ; TSNOW(time,nsta)
  RS    = precip_rain_snow(prc, tmp, TRAIN, TSNOW)   
  prain = RS[0]                        ; explicitly extract for clarity and convenience
  psnow = RS[1]
  delete( [/RS, TRAIN, TSNOW/] )             
  printVarSummary(prain)             ; prain(time,nsta)
  printVarSummary(psnow)             ; psnow(time,nsta)