NCL Home > Documentation > Functions > Meteorology, Crop

daylight_fao56

Compute maximum number of daylight hours as described in FAO 56.

Available in version 6.4.0 and later.

Prototype

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

	function daylight_fao56 (
		jday [*] : integer,  
		lat      : numeric   
	)

Arguments

jday

A integer scalar or one-dimensional array containing day of year.

lat

A scalar or one-dimensional array containing latitudes (degrees).

Return value

If both jday and lat are scalars then a scalar is returned. Otherwise, a two- or three-dimensional array is returned. If jday(ntim) and lat(nlat), the returned array will be (ntim,nlat). If lat(nlat,mlon), the returned array will be (ntim,nlat,mlon). The returned arrays will contain metadata where applicable.

Description

Computes maximum number of daylight hours as describe in the Food and Agriculture Organization (FAO) Irrigation and Drainage Paper 56 entitled: Crop evapotranspiration - Guidelines for computing crop water requirement. Specifically, see equation 34 of Chapter 3.

See Also

Crop & Evapotranspiration functions

Examples

Example 1: Replicate example 10 in Chapter 3.


  jday  = 246
  lat   = -20.0
  sunmax = daylight_fao56(jday, lat)   ;  11.7 hours
  print(sunmax)
The output is:

     Variable: sunmax
     Type: float
     Total Size: 4 bytes
                 1 values
     Number of Dimensions: 2
     Dimensions and sizes:	[1] x [1]
     Coordinates: 
     Number Of Attributes: 4
       long_name :	maximum day light hours: FAO_56
       units :	hours/day
       url :	http://www.fao.org/docrep/X0490E/x0490e07.htm
       info :	FAO 56; EQN 34

     (0,0)	11.66559

Example 2: Consider lat(lat) and jday(time)

    lat     = (/ -20, 0, 45 /)
    lat@units = "degrees_north"
    lat!0   = "lat"
    lat&lat =  lat

    time    = (/ 15, 180, 246, 306 /)
    time@long_name = "julian day"
    time!0    = "time"
    time&time =  time  
    SUNMAX    = daylight_fao56(time, lst)   
    printVarSummary(SUNMAX,0)

The output would be

     Variable: SUNMAX
     Type: float
     Total Size: 48 bytes
                 12 values
     Number of Dimensions: 2
     Dimensions and sizes:	[jday | 4] x [lat | 3]
     Coordinates: 
                 jday: [246..246]
                 lat: [-20..-20]
     Number Of Attributes: 5
       jday :	246
       long_name :	maximum day light hours: FAO_56
       units :	hours/day
       url :	http://www.fao.org/docrep/X0490E/x0490e07.htm
       info :	FAO 56; EQN 34
p> Example 3: Read latitudes from a file; create a 'time' varuiable (here, 'jday') for each day of the year; caalculate the daylight hours for each daya of the year.
   diri   = "./"
   fili   = "orog_fx_GFDL-ESM2M_historical_r0i0p0.nc"
   f      = addfile(diri+fili, "r")
   lat    = f->lat                        ; lat[*], lat: [-89.494..89.494]

; create a 'time' array

   jday   = ispan(1,365,1)                ; every day of year
   jday@long_name = "day oy year"
   jday!0 = "jday"                        ; make a coordinate variable
   jday&jday = jday

; calculate 'radext' 

   daylight = daylight_fao56(jday, lat)  

   printVarSummary(daylight)
   print("daylight: min="+min(daylight)+"  max="+max(daylight))
The output looks like.
     Variable: daylight
     Type: double
     Total Size: 262800 bytes
                 32850 values
     Number of Dimensions: 2
     Dimensions and sizes:	[jday | 365] x [lat | 90]
     Coordinates: 
                 jday: [1..365]
                 lat: [-89.49438202247192..89.49438202247192]
     Number Of Attributes: 5
       jday :	1
       long_name :	maximum day light hours: FAO_56
       units :	hours/day
       url :	http://www.fao.org/docrep/X0490E/x0490e07.htm
       info :	FAO 56; EQN 34; daylight_fao56
     (0)	maximum day light hours: FAO_56: min=0   max=23.79594197617022