FUNCTION determine_ndays_in_month, month, year, status, NO_PAR_CHECK = no_par_check
; Description: This function returns the number of days in the month "month" taking into
; account if the associated year "year" is a leap year or not. The input
; parameters "month" and "year" may be scalars, vectors, or arrays.
;
; Input Parameters:
;
; month - INTEGER/LONG SCALAR/VECTOR/ARRAY - A scalar/vector/array containing a set of
; numbers that represent the month numbers
; for which the number of days in the month
; are required. Month numbers run from "1"
; through to "12".
; year - INTEGER/LONG SCALAR/VECTOR/ARRAY - A scalar/vector/array, with the same number
; of elements as the input parameter "month",
; containing a set of numbers that represent
; the years corresponding to the month numbers
; in "month".
; status - ANY - A variable which will be used to contain the output status of the
; function on returning (see output parameters below).
;
; Output Parameters:
;
; status - INTEGER - If the function successfully processed the input parameters, then
; "status" is returned with a value of "1", otherwise it is returned
; with a value of "0".
;
; Return Value:
;
; The return variable is a SCALAR/VECTOR/ARRAY (the same as the input parameter "month")
; of INTEGER type where the value of each element represents the number of days in the
; month for the corresponding elements of the input parameters "month" and "year". If
; an element of "month" does not represent a valid month number, then the corresponding
; element in the return variable is set to "0".
;
; Keywords:
;
; If the keyword NO_PAR_CHECK is set (as "/NO_PAR_CHECK"), then the function will not
; perform parameter checking on the input parameters, reducing function overheads.
;
; Author: Dan Bramich (dan.bramich@hotmail.co.uk)
;
; History:
;
; 05/12/2011 - Module modified to accept scalar, vector, and array input (dmb).
; 31/12/2009 - Module created (dmb).
;Set the default output parameter values
;Perform parameter checking if not instructed otherwise
;Check that "month" is of the correct number type
;Check that "year" is of the correct number type, and that it has the same number of elements
;as "month"
;Set up the output set of numbers of days in the month
;Determine the number of days in the month for each input month, except where the month is
;February
;If there is at least one input month that is February
;If all input months are February
;Determine the number of days in the month for each input month and year combination,
;given that the input month is February
;If not all input months are February
;Determine the number of days in the month for each input month and year combination,
;given that the input month is February
;Set "status" to "1"
;Return the number of days in the month for each input month and year combination