# Detailed description of the procedures for csagrid

## CSA1S (CSA1D) - simple entry for one-dimensional input

CSA1S (CSA1D) is called to find an approximating cubic spline for one-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use CSA1XS (CSA1XD).
```------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
------------------------------------------------------------------
CALL CSA1S (NI,      | Integer  | Input  |
XI,      | Real     | Input  | NI
YI,      | Real     | Input  | NI
KNOTS,   | Integer  | Input  |
NO,      | Integer  | Input  |
XO,      | Real     | Input  | NO
YO,      | Real     | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = KNOTS * (KNOTS+3)
IER)     | Integer  | Output |

CALL CSA1D (NI,      | Integer  | Input  |
XI,      | Double   | Input  | NI
YI,      | Double   | Input  | NI
KNOTS,   | Integer  | Input  |
NO,      | Integer  | Input  |
XO,      | Double   | Input  | NO
YO,      | Double   | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = KNOTS * (KNOTS+3)
IER)     | Integer  | Output |
------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X coordinates of the input data points.
YI
An array containing function values at the input XI values, that is, YI(L) is the value of the input function at XI(L) for L=1,NI.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS must be at least 4. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
NO
The number of values to be calculated for the output curve.
XO
An array containing the X coordinates of the output curve.
YO
An array containing the calculated function values for the output curve.
NWRK
The size of the WORK array. NWRK must be at least KNOTS*(KNOTS+3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA1XS (CSA1XD) - expanded entry for one-dimensional input

CSA1XS (CSA1XD) is called to find an approximating cubic spline for one-dimensional input data. CSA1XS (CSA1XD) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use CSA1S (CSA1D).
```-------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
-------------------------------------------------------------------
CALL CSA1XS (NI,      | Integer  | Input  |
XI,      | Real     | Input  | NI
YI,      | Real     | Input  | NI
WTS,     | Real     | Input  | NI
KNOTS,   | Integer  | Input  |
SMTH,    | Real     | Input  |
NDERIV,  | Integer  | Input  |
NO,      | Integer  | Input  |
XO,      | Real     | Input  | NO
YO,      | Real     | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = KNOTS * (KNOTS+3)
IER)     | Integer  | Output |

CALL CSA1XD (NI,      | Integer  | Input  |
XI,      | Double   | Input  | NI
YI,      | Double   | Input  | NI
WTS,     | Double   | Input  | NI
KNOTS,   | Integer  | Input  |
SMTH,    | Double   | Input  |
NDERIV,  | Integer  | Input  |
NO,      | Integer  | Input  |
XO,      | Double   | Input  | NO
YO,      | Double   | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = KNOTS * (KNOTS+3)
IER)     | Integer  | Output |
-------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X coordinates of the input data points.
YI
An array containing function values at the input XI values, that is, YI(L) is the value of the input function at XI(L) for L=1,NI.
WTS
An array containing weights for the YI values at the input XI values, that is, WTS(L) is a weight for the value of YI(L) for L=1,NI. If you do not desire to weight the input YI values, then set WTS(1) to -1. The weights in the WTS array are relative and may be set to any non-negative value. When CSA1XS (CSA1XD) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS must be at least 4. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
SMTH
A parameter that controls extrapolation into data sparse regions. If SMTH is zero, then nothing special is done in data sparse regions. A good first choice for SMTH is 1.
NDERIV
Specifies whether you want functional values (NDERIV=0), first derivative values (NDERIV=1), or second derivative values (NDERIV=2).
NO
The number of values to be calculated in the output curve.
XO
An array containing the X coordinates for the output curve.
YO
An array containing the calculated function values of the output curve.
NWRK
The size of the WORK array. NWRK must be at least KNOTS*(KNOTS+3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA2S (CSA2D) - simple entry for two-dimensional input, gridded output

CSA2S (CSA2D) is called to find an approximating cubic spline surface for two-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use CSA2XS (CSA2XD).
```------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
------------------------------------------------------------------
CALL CSA2S (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 2 x NI
UI,      | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 2
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
XO,      | Real     | Input  | NXO
YO,      | Real     | Input  | NYO
UO,      | Real     | Output | NXO x NYO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |

CALL CSA2D (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 2 x NI
UI,      | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 2
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
XO,      | Double   | Input  | NXO
YO,      | Double   | Input  | NYO
UO,      | Double   | Output | NXO x NYO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |
------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y coordinates of the input data points. XI(1,L) is the X coordinate and XI(2,L) is the Y coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is UI(L) is the value of the input function at the coordinate (XI(1,L),XI(2,L)) for L=1,NI.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction and KNOTS(2) specifies the number of knots in the Y direction. Both KNOTS(1) and KNOTS(2) must be at least 4. The larger the values for KNOTS, the closer the approximated curve will come to passing through the input function values.
NXO
The number of X coordinate values in the output grid.
NYO
The number of Y coordinate values in the output grid.
XO
An array containing the X coordinates of the output surface.
YO
An array containing the Y coordinates of the output surface.
UO
An array containing the calculated function values for the output surface. UO(I,J) is the calculated functional value at (XO(I),YO(J)) for I=1,NXO and J=1,NYO.
NWRK
The size of the WORK array. NWRK must be at least KNOTS(1)*KNOTS(2)*(KNOTS(1)*KNOTS(2)+3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA2XS (CSA2XD) - expanded entry for two-dimensional input, gridded output

CSA2XS (CSA2XD) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use CSA2S (CSA2D).
```------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
------------------------------------------------------------------
CALL CSA2XS (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 2 x NI
UI,      | Real     | Input  | NI
WTS,     | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 2
SMTH,    | Real     | Input  |
NDERIV,  | Integer  | Input  | 2
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
XO,      | Real     | Input  | NXO
YO,      | Real     | Input  | NYO
UO,      | Real     | Output | NXO x NYO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |

CALL CSA2XD (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 2 x NI
UI,      | Double   | Input  | NI
WTS,     | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 2
SMTH,    | Double   | Input  |
NDERIV,  | Integer  | Input  | 2
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
XO,      | Double   | Input  | NXO
YO,      | Double   | Input  | NYO
UO,      | Double   | Output | NXO x NYO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |
------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y coordinates of the input data points. XI(1,L) is the X coordinate and XI(2,L) is the Y coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is UI(L) is the value of the input function at the coordinate (XI(1,L),XI(2,L)) for L=1,NI.
WTS
An array containing weights for the UI values at the input XI values, that is, WTS(L) is a weight for the value of UI(L) for L=1,NI. If you do not desire to weight the input UI values, then set WTS(1) to -1. The weights in the WTS array are relative and may be set to any non-negative value. When CSA2XS (CSA2XD) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction and KNOTS(2) specifies the number of knots in the Y direction. Both KNOTS(1) and KNOTS(2) must be at least 4. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
SMTH
A parameter that controls extrapolation into data sparse regions. If SMTH is zero, then nothing special is done in data sparse regions. A good first choice for SMTH is 1.
NDERIV
Specifies which partial derivatives are desired. NDERIV(1) indicates if the 0 th, 1 st, or 2 nd partial in the X direction is desired; NDERIV(2) indicates if the 0 th, 1 st, or 2 nd partial in the Y direction is desired.
NXO
The number of X coordinate values in the output grid.
NYO
The number of Y coordinate values in the output grid.
XO
An array containing the X coordinates of the output surface.
YO
An array containing the Y coordinates of the output surface.
UO
An array containing the calculated function values for the output surface. UO(I,J) is the calculated functional value at (XO(I),YO(J)) for I=1,NXO and J=1,NYO.
NWRK
The size of the WORK array. NWRK must be at least KNOTS(1)*KNOTS(2)*(KNOTS(1)*KNOTS(2)+3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA2LS (CSA2LD) - simple entry for two-dimensional input, list output

CSA2LS (CSA2LD) is called to find an approximating cubic spline surface for two-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use CSA2LXS (CSA2LXD).
```-------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
-------------------------------------------------------------------
CALL CSA2LS (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 2 x NI
UI,      | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 2
NO,      | Integer  | Input  |
XO,      | Real     | Input  | NO
YO,      | Real     | Input  | NO
UO,      | Real     | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |

CALL CSA2LD (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 2 x NI
UI,      | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 2
NO,      | Integer  | Input  |
XO,      | Double   | Input  | NO
YO,      | Double   | Input  | NO
UO,      | Double   | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |
-------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y coordinates of the input data points. XI(1,L) is the X coordinate and XI(2,L) is the Y coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is UI(L) is the value of the input function at the coordinate (XI(1,L),XI(2,L)) for L=1,NI.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction and KNOTS(2) specifies the number of knots in the Y direction. Both KNOTS(1) and KNOTS(2) must be at least 4. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
NO
The number of coordinate values in the output list. NO can be any positive number.
XO
An array containing the X coordinates of the output list.
YO
An array containing the Y coordinates of the output list.
UO
An array containing the calculated function values. UO(L) is the calculated functional value at (XO(L), YO(L)) for L=1,NO.
NWRK
The size of the WORK array. NWRK must be at least KNOTS(1)*KNOTS(2)*(KNOTS(1)*KNOTS(2)+3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA2LXS (CSA2LXD) - expanded entry for two-dimensional input, list output

CSA2LXS (CSA2LXD) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use CSA2LS (CSA2LD).
```--------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
--------------------------------------------------------------------
CALL CSA2LXS (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 2 x NI
UI,      | Real     | Input  | NI
WTS,     | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 2
SMTH,    | Real     | Input  |
NDERIV,  | Integer  | Input  | 2
NO,      | Integer  | Input  |
XO,      | Real     | Input  | NO
YO,      | Real     | Input  | NO
UO,      | Real     | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |

CALL CSA2LXD (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 2 x NI
UI,      | Double   | Input  | NI
WTS,     | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 2
SMTH,    | Double   | Input  |
NDERIV,  | Integer  | Input  | 2
NO,      | Integer  | Input  |
XO,      | Double   | Input  | NO
YO,      | Double   | Input  | NO
UO,      | Double   | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2)
IER)     | Integer  | Output |
--------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y coordinates of the input data points. XI(1,L) is the X coordinate and XI(2,L) is the Y coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is UI(L) is the value of the input function at the coordinate (XI(1,L),XI(2,L)) for L=1,NI.
WTS
An array containing weights for the UI values at the input XI values, that is, WTS(L) is a weight for the value of UI(L) for L=1,NI. If you do not desire to weight the input UI values, then set WTS(1) to -1. The weights in the WTS array are relative and may be set to any non-negative value. When CSA2LXS (CSA2LXD) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction and KNOTS(2) specifies the number of knots in the Y direction. Both KNOTS(1) and KNOTS(2) must be at least 4. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
SMTH
A parameter that controls extrapolation into data sparse regions. If SMTH is zero, then nothing special is done in data sparse regions. A good first choice for SMTH is 1.
NDERIV
Specifies which partial derivatives are desired. NDERIV(1) indicates if the 0 th, 1 st, or 2 nd partial in the X direction is desired; NDERIV(2) indicates if the 0 th, 1 st, or 2 nd partial in the Y direction is desired.
NO
The number of coordinate values in the output list. NO can be any positive number.
XO
An array containing the X coordinates of the output list.
YO
An array containing the Y coordinates of the output list.
UO
An array containing the calculated function values for the output surface. UO(L) is the calculated functional value at (XO(L), YO(L)) for L=1,NO.
NWRK
The size of the WORK array. NWRK must be at least KNOTS(1)*KNOTS(2)*(KNOTS(1)*KNOTS(2)+3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA3S (CSA3D) - simple entry for three-dimensional input, gridded output

CSA3S (CSA3D) is called to find an approximating cubic spline for three-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use CSA3XS (CSA3XD) .
```------------------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
------------------------------------------------------------------------------
CALL CSA3S (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 3 x NI
UI,      | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 3
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
NZO,     | Integer  | Input  |
XO,      | Real     | Input  | NXO
YO,      | Real     | Input  | NYO
ZO,      | Real     | Input  | NZO
UO,      | Real     | Output | NXO x NYO x NZO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |

CALL CSA3D (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 3 x NI
UI,      | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 3
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
NZO,     | Integer  | Input  |
XO,      | Double   | Input  | NXO
YO,      | Double   | Input  | NYO
ZO,      | Double   | Input  | NZO
UO,      | Double   | Output | NXO x NYO x NZO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |
------------------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y - Z coordinates of the input data points. XI(1,L) is the X coordinate, XI(2,L) is the Y coordinate, and XI(2,L) is the Z coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is, UI(L) is the value of the input function at the coordinate (XI(1,L), XI(2,L), XI(3,L)) for L=1,NI.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction, KNOTS(2) specifies the number of knots in the Y direction and KNOTS(3) specifies the number of knots in the Z direction. KNOTS(I) must be at least 4 for I=1,3. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
NXO
The number of X coordinate values in the output grid.
NYO
The number of Y coordinate values in the output grid.
NZO
The number of Z coordinate values in the output grid.
XO
An array containing the X coordinates of the output grid.
YO
An array containing the Y coordinates of the output grid.
ZO
An array containing the Z coordinates of the output grid.
UO
An array containing the calculated function values for the output function. UO(I,J,K) is the calculated functional value at (XO(I), YO(J), ZO(K)) for I=1,NXO and J=1,NYO and K=1,NZO.
NWRK
The size of the WORK array. NWRK must be at least NK*(NK+3) where NK=KNOTS(1)*KNOTS(2)*KNOTS(3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA3XS (CSA3XD) - expanded entry for three-dimensional input, gridded output

CSA3XS (CSA3XD) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use CSA3S (CSA3D).
```-------------------------------------------------------------------------------
Argument  | Type     |  Mode  | Dimension
-------------------------------------------------------------------------------
CALL CSA3XS (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 3 x NI
UI,      | Real     | Input  | NI
WTS,     | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 3
SMTH,    | Real     | Input  |
NDERIV,  | Integer  | Input  | 3
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
NZO,     | Integer  | Input  |
XO,      | Real     | Input  | NXO
YO,      | Real     | Input  | NYO
ZO,      | Real     | Input  | NZO
UO,      | Real     | Output | NXO x NYO x NZO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |

CALL CSA3XD (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 3 x NI
UI,      | Double   | Input  | NI
WTS,     | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 3
SMTH,    | Double   | Input  |
NDERIV,  | Integer  | Input  | 3
NXO,     | Integer  | Input  |
NYO,     | Integer  | Input  |
NZO,     | Integer  | Input  |
XO,      | Double   | Input  | NXO
YO,      | Double   | Input  | NYO
ZO,      | Double   | Input  | NZO
UO,      | Double   | Output | NXO x NYO x NZO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |
-------------------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y - Z coordinates of the input data points. XI(1,L) is the X coordinate, XI(2,L) is the Y coordinate, and XI(3,L) is the Z coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is UI(L) is the value of the input function at the coordinate (XI(1,L), XI(2,L), XI(3,L)) for L=1,NI.
WTS
An array containing weights for the UI values at the input XI values, that is, WTS(L) is a weight for the value of UI(L) for L=1,NI. If you do not desire to weight the input UI values, then set WTS(1) to -1. The weights in the WTS array are relative and may be set to any non-negative value. When CSA3XS (CSA3XD) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction, KNOTS(2) specifies the number of knots in the Y direction and KNOTS(3) specifies the number of knots in the Z direction. KNOTS(I) must be at least 4 for I=1,3. The larger the values for KNOTS, the closer the approximated curve will come to passing through the input function values.
SMTH
A parameter that controls extrapolation into data sparse regions. If SMTH is zero, then nothing special is done in data sparse regions. A good first choice for SMTH is 1.
NDERIV
Specifies which partial derivatives are desired. NDERIV(1) indicates whether the 0 th, 1 st, or 2 nd partial in the X direction is desired; NDERIV(2) indicates whether the 0 th, 1 st, or 2 nd partial in the Y direction is desired; NDERIV(3) indicates whether the 0 th, 1 st, or 2 nd partial in the Z direction is desired.
NXO
The number of X coordinate values in the output grid.
NYO
The number of Y coordinate values in the output grid.
NZO
The number of Z coordinate values in the output grid.
XO
An array containing the X coordinates of the output grid.
YO
An array containing the Y coordinates of the output grid.
ZO
An array containing the Z coordinates of the output grid.
UO
An array containing the calculated function values for the output grid. UO(I,J,K) is the calculated functional value at (XO(I), YO(J), ZO(K)) for I=1,NXO and J=1,NYO and K=1,NZO.
NWRK
The size of the WORK array. NWRK must be at least NK*(NK+3) where NK=KNOTS(1)*KNOTS(2)*KNOTS(3)
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA3LS (CSA3LD) - simple entry for three-dimensional input, list output

CSA3LS (CSA3LD) is called to find an approximating cubic spline for three-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use CSA3LXS (CSA3LXD).
```-------------------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
-------------------------------------------------------------------------------
CALL CSA3LS (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 3 x NI
UI,      | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 3
NO,      | Integer  | Input  |
XO,      | Real     | Input  | NXO
YO,      | Real     | Input  | NYO
ZO,      | Real     | Input  | NZO
UO,      | Real     | Output | NXO x NYO x NZO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |

CALL CSA3LD (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 3 x NI
UI,      | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 3
NO,      | Integer  | Input  |
XO,      | Double   | Input  | NXO
YO,      | Double   | Input  | NYO
ZO,      | Double   | Input  | NZO
UO,      | Double   | Output | NXO x NYO x NZO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |
-------------------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y - Z coordinates of the input data points. XI(1,L) is the X coordinate, XI(2,L) is the Y coordinate and XI(3,L) s the Z coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is UI(L) is the value of the input function at the coordinate (XI(1,L), XI(2,L), XI(3,L)) for L=1,NI.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction, KNOTS(2) specifies the number of knots in the Y direction and KNOTS(3) specifies the number of knots in the Z direction. KNOTS must be at least 4. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
NO
The number of coordinate values in the output list. NO can be any positive number.
XO
An array containing the X coordinates of the output list.
YO
An array containing the Y coordinates of the output list.
ZO
An array containing the Y coordinates of the output list.
UO
An array containing the calculated function values for the output function. UO(L) is the calculated functional value at (XO(L), YO(L), ZO(L)) for L=1,NO.
NWRK
The size of the WORK array. NWRK must be at least NK*(NK+3) where NK=KNOTS(1)*KNOTS(2)*KNOTS(3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## CSA3LXS (CSA3LXD) - expanded entry for three-dimensional input, list output

CSA3LXS (CSA3LXD) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use CSA3LS (CSA3LD).
```-------------------------------------------------------------------------------
Argument | Type     |  Mode  | Dimension
-------------------------------------------------------------------------------
CALL CSA3LXS (NI,      | Integer  | Input  |
XI,      | Real     | Input  | 3 x NI
UI,      | Real     | Input  | NI
WTS,     | Real     | Input  | NI
KNOTS,   | Integer  | Input  | 3
SMTH,    | Real     | Input  |
NDERIV,  | Integer  | Input  | 3
NO,      | Integer  | Input  |
XO,      | Real     | Input  | NO
YO,      | Real     | Input  | NO
ZO,      | Real     | Input  | NO
UO,      | Real     | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Real     | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |

CALL CSA3LXD (NI,      | Integer  | Input  |
XI,      | Double   | Input  | 3 x NI
UI,      | Double   | Input  | NI
WTS,     | Double   | Input  | NI
KNOTS,   | Integer  | Input  | 3
SMTH,    | Double   | Input  |
NDERIV,  | Integer  | Input  | 3
NO,      | Integer  | Input  |
XO,      | Double   | Input  | NO
YO,      | Double   | Input  | NO
ZO,      | Double   | Input  | NO
UO,      | Double   | Output | NO
NWRK,    | Integer  | Input  |
WORK,    | Double   | Input  | NWRK = NK * (NK+3) where
|          |        | NK = KNOTS(1) * KNOTS(2) * KNOTS(3)
IER)     | Integer  | Output |
-------------------------------------------------------------------------------
```
NI
The number of input data points. It must be that NI > 3 and, depending on the size of KNOTS below, NI may have to be larger.
XI
An array containing the X - Y - Z coordinates of the input data points. XI(1,L) is the X coordinate, XI(2,L) is the Y coordinate, and XI(3,L) is the Z coordinate for the input domain for L=1,NI.
UI
An array containing the function values at the input XI values, that is UI(L) is the value of the input function at the coordinate (XI(1,L), XI(2,L), XI(3,L)) for L=1,NI.
WTS
An array containing weights for the UI values at the input XI values, that is, WTS(L) is a weight for the value of UI(L) for L=1,NI. If you do not desire to weight the input UI values, then set WTS(1) to -1. The weights in the WTS array are relative and may be set to any non-negative value. When CSA3LXS (CSA3LXD) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
KNOTS
The number of knots to be used in constructing the approximation spline. KNOTS(1) specifies the number of knots in the X direction, KNOTS(2) specifies the number of knots in the Y direction and KNOTS(3) specifies the number of knots in the Z direction. KNOTS(I) must be at least 4 for I=1,3. The larger the value for KNOTS, the closer the approximated curve will come to passing through the input function values.
SMTH
A parameter that controls extrapolation into data sparse regions. If SMTH is zero, then nothing special is done in data sparse regions. A good first choice for SMTH is 1.
NDERIV
Specifies which partial derivatives are desired. NDERIV(1) indicates whether the 0 th, 1 st, or 2 nd partial in the X direction is desired; NDERIV(2) indicates whether the 0 th, 1 st, or 2 nd partial in the Y direction is desired; NDERIV(3) indicates whether the 0 th, 1 st, or 2 nd partial in the Z direction is desired.
NO
The number of coordinate values in the output list. NO can be any positive number.
XO
An array containing the X coordinates of the output list.
YO
An array containing the Y coordinates of the output list.
ZO
An array containing the Z coordinates of the output list.
UO
An array containing the calculated function values for the output surface. UO(L) is the calculated functional value at (XO(L), YO(L), ZO(L)) for L=1,NO.
NWRK
The size of the WORK array. NWRK must be at least NK*(NK+3) where NK=KNOTS(1)*KNOTS(2)*KNOTS(3).
WORK
A work array dimensioned for NWRK.
IER
An error return value. If IER is returned as 0, then no errors were detected. If IER is non-zero, then refer to the error list in the error table for details.

## c_csa1s (c_csa1d) - simple entry for one-dimensional input

c_csa1s (c_csa1d) is called to find an approximating cubic spline for one-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use c_csa1xs (c_csa1xd).

Function prototype:

```   float *c_csa1s(int,  float [],  float [], int, int,  float [], int *);
double *c_csa1d(int, double [], double [], int, int, double [], int *);
```
Return value:

c_csa1s (c_cas1d) returns a pointer to a linear array of data that is the approximated curve. That is, if out is declared as

```   float *out;
```
and we set:
```  out = c_csa1s(n, x, y, z, knots, no, xo, &ier);
```
then out[i] is the approximated function value at coordinate point xo[i] for 0 <= i < no. The space for out is allocated internal to c_csa1s (c_csa1d) and is no floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa1s (n,       | int       |
xi,      | float []  | n
yi,      | float []  | n
knots,   | int       |
m,       | int       |
xo,      | float []  | m
ier      | int *     |
);

double *c_csa1d (n,      | int       |
xi,      | double [] | n
yi,      | double [] | n
knots,   | int       |
m,       | int       |
xo,      | double [] | m
ier      | int *     |
);
-------------------------------------------------
```
n
The number of input data points. It must be that n > 3 and, depending on the size of knots below, n may have to be larger.
xi
An array containing the abscissae for the input function.
yi
An array containing the functional values of the input function -- yi[k] is the functional value at xi[k] for k=0,n-1.
knots
The number of knots to be used in constructing the approximation spline. knots must be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
m
The number of values to be calculated for the output curve.
xo
An array containing the abscissae for the approximation output values.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa1xs (c_csa1xd) - expanded entry for one-dimensional input

c_csa1xs (c_csa1xd) is called to find an approximating cubic spline for one-dimensional input data. c_csa1xs (c_csa1xd) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use c_csa1s (c_csa1d).

Function prototype:

```  float *c_csa1xs(int, float [], float [], float [], int,
float, int, int, float [], int *);

double *c_csa1xd(int, double [], double [], double [], int,
double, int, int, double [], int *);
```
Return value:

c_csa1xs (c_csa1xd) returns a pointer to a linear array of data that is the approximated curve. That is, if out is declared as

```  float *out;
```
and we set:
```  out = c_csa1s(n, x, y, z, knots, smth, nderiv, no, xo, &ier);
```
then out[i] is the approximated function value at coordinate point xo[i] for 0 <= i < no. The space for out is allocated internal to c_csa1xs (c_csa1xd) and is m floats (doubles) in size.
```--------------------------------------------
Argument | Type      | Size
--------------------------------------------
float *c_csa1xs (n,       | int       |
xi,      | float []  | n
yi,      | float []  | n
wts,     | float []  | n
knots,   | int       |
smth,    | float     |
nderiv,  | int       |
m,       | int       |
xo,      | float []  | m
ier)     | int *     |

double *c_csa1xd (n,      | int       |
xi,      | double [] | n
yi,      | double [] | n
wts,     | double [] | n
knots,   | int       |
smth,    | double    |
nderiv,  | int       |
m,       | int       |
xo,      | double [] | m
ier)     | int *     |
--------------------------------------------
```
n
The number of input data points. It must be that n > 3 and, depending on the size of knots below, n may have to be larger.
xi
An array containing the X coordinates of the input data points.
yi
An array containing function values at the input xi values, that is, yi[l] is the value of the input function at xi[l] for l=0,n-1.
wts
An array containing weights for the yi values at the input xi values, that is, wts[l] is a weight for the value of yi[l] for l=0,n-1. If you do not desire to weight the input yi values, then set wts[0] to -1. The weights in the wts array are relative and may be set to any non-negative value. When c_csa1xs (c_csa1xd) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
knots
The number of knots to be used in constructing the approximation spline. knots must be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
smth
A parameter that controls extrapolation into data sparse regions. If smth is zero, then nothing special is done in data sparse regions. A good first choice for smth is 1.
nderiv
Specifies whether you want functional values (nderiv=0), first derivative values (nderiv=1), or second derivative values (nderiv=2).
m
The number of values to be calculated in the output curve.
xo
An array containing the X coordinates for the output curve.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa2s (c_csa2d) - simple entry for two-dimensional input, gridded output

c_csa2s (c_csa2d) is called to find an approximating cubic spline surface for two-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use c_csa2xs (c_csa2xd).

Function prototype:

```  float *c_csa2s(int, float [], float [], float [], int [],
int, int, float [], float [], int *);

double *c_csa2d(int, double [], double [], double [], int [],
int, int, double [], double [], int *);
```
Return value:

c_csa2s (c_csa2d) returns a pointer to a linear array of data that is the approximated grid stored in row-major order. That is, if out is declared as

```  float *out;
```
and we set:
```  out = c_csa2s(n, x, y, z, knots, no, mo, xo, yo, &ier);
```
then out[i*mo+j] is the approximated function value at coordinate point (xo[i], yo[j]) for 0 <= i < no and 0 <= j < mo. The space for out is allocated internal to c_csa2s (c_csa2d) and is no * mo floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa2s (n,       | int       |
xi,      | float []  | n
yi,      | float []  | n
zi,      | float []  | n
knots,   | int []    | 2
no,      | int       |
mo,      | int       |
xo,      | float []  | no
yo,      | float []  | mo
ier      | int *     |
);

double *c_csa2d (n,      | int       |
xi,      | double [] | n
yi,      | double [] | n
zi,      | double [] | n
knots,   | int []    | 2
no,      | int       |
mo,      | int       |
xo,      | double [] | no
yo,      | double [] | mo
ier      | int *     |
);
-------------------------------------------------
```
n
The number of input data points. It must be that n > 3 and, depending on the size of knots below, n may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the functional values of the input function -- zi[k] is the functional value at (xi[k], yi[k]) for k=0,n-1.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction and knots[1] specifies the number of knots in the Y direction. knots[0] and knots[1] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
no
The number of X coordinate values to be calculated for the output surface.
mo
The number of Y coordinate values to be calculated for the output surface.
xo
An array containing the X coordinate values for the output grid.
yo
An array containing the Y coordinate values for the output grid.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa2xs (c_csa2xd) - expanded entry for two-dimensional input, gridded output

c_csa2xs (c_csa2xd) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use c_csa2s.

Function prototype:

``` float *c_csa2xs(int, float [], float [], float [], float [], int [], float,
int [], int, int, float [], float [], int *);

double *c_csa2xd(int, double [], double [], double [], double [], int [],
double, int [], int, int, double [], double [], int *);
```
Return value:

c_csa2xs (c_csa2xd) returns a pointer to a linear array of data that is the approximated function on a grid stored in row-major order. That is, if out is declared as

```  float *out;
```
and we set:
```  out = c_csa2xs(ni, xi, yi, zi, wts, knots, smth, nderiv,
no, mo, xo, yo, &ier);
```
then out[i*mo+j] is the approximated function value at coordinate point (xo[i], yo[j]) for 0 <= i < no and 0 <= j < mo. The space for out is allocated internal to c_csa2s (c_csa2d) and is no * mo floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa2xs (ni,      | int       |
xi,      | float []  | ni
yi,      | float []  | ni
zi,      | float []  | ni
wts,     | float []  | ni
knots,   | int []    | 2
smth,    | float     |
nderiv   | int []    | 2
no,      | int       |
mo,      | int       |
xo,      | float []  | no
yo,      | float []  | mo
ier      | int *     |
);

double *c_csa2xd (ni,     | int       |
xi,      | double [] | ni
yi,      | double [] | ni
zi,      | double [] | ni
wts,     | double [] | ni
knots,   | int []    | 2
smth,    | double    |
nderiv   | int []    | 2
no,      | int       |
mo,      | int       |
xo,      | double [] | no
yo,      | double [] | mo
ier      | int *     |
);
-------------------------------------------------
```
ni
The number of input data points. It must be that ni > 3 and, depending on the size of knots below, ni may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the functional values of the input function -- zi[k] is the functional value at (xi[k],yi[k]) for k=0,n-1.
wts
An array containing weights for the zi values at the input xi and yi values, that is, wts[k] is a weight for the value of zi[k] for k=0,ni-1. If you do not desire to weight the input yi values, then set wts[0] to -1. The weights in the wts array are relative and may be set to any non-negative value. When c_csa2xs (c_csa2xd) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction and knots[1] specifies the number of knots in the Y direction. knots[0] and knots[1] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
smth
A parameter that controls extrapolation into data sparse regions. If smth is 0., then nothing special is done in data sparse regions. A good first choice for smth is 1.
nderiv
For each of the two coordinate directions, specifies whether you want functional values (nderiv=0), first derivative values (nderiv=1), or second derivative values (nderiv=2). For example, if nderiv[0]=1 and nderiv[1]=1, then the second order mixed partial would be computed.
no
The number of X coordinate values to be calculated for the output surface.
mo
The number of Y coordinate values to be calculated for the output surface.
xo
An array containing the X coordinate values for the output grid.
yo
An array containing the Y coordinate values for the output grid.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa2ls (c_csa2ld) - simple entry for two-dimensional input, list output

c_csa2ls (c_csa2ld) is called to find values of an approximating cubic spline at specified two-dimensional coordinates. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use c_csa2lxs (c_csa2lxd).

Function prototype:

``` float *c_csa2ls(int, float [], float [], float [], int [],
int, float [], float [], int *);

double *c_csa2ld(int, double [], double [], double [], int [],
int, double [], double [], int *);
```
Return value:

c_csa2ls (c_csa2ld) returns a pointer to a linear array of data that contains the approximated values calculated at the input list of coordinate values. That is, if out is declared as

```  float *out;
```
and we set:
```  out = c_csa2ls(n, x, y, z, knots, no, xo, yo, &ier);
```
then out[i] is the approximated function value at coordinate point (xo[i], yo[i]) for 0 <= i < no. The space for out is allocated internal to c_csa2ls (c_csa2ld) and is no floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa2ls (n,       | int       |
xi,      | float []  | n
yi,      | float []  | n
zi,      | float []  | n
knots,   | int       | 2
no,      | int       |
xo,      | float []  | no
yo,      | float []  | no
ier      | int *     |
);

double *c_csa2ld (n,      | int       |
xi,      | double [] | n
yi,      | double [] | n
zi,      | double [] | n
knots,   | int       | 2
no,      | int       |
xo,      | double [] | no
yo,      | double [] | no
ier      | int *     |
);
-------------------------------------------------
```
n
The number of input data points. It must be that n > 3 and, depending on the size of knots below, n may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the functional values of the input function -- zi[k] is the functional value at (xi[k], yi[k]) for k=0,n-1.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction and knots[1] specifies the number of knots in the Y direction. knots[0] and knots[1] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
no
The number of X - Y coordinate values to be calculated for the output array.
xo
An array containing the X coordinate values for the output array.
yo
An array containing the Y coordinate values for the output array.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa2lxs (c_csa2lxd) - expanded entry for two-dimensional input, list output

c_csa2lxs (c_csa2lxd) is called to find values of an approximating cubic spline at specified two-dimensional coordinates. c_csa2lxs (c_csa2lxd) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use c_csa2ls (c_csa2ld).

Function prototype:

``` float *c_csa2lxs(int, float [], float [], float [], float [], int [],
float, int [], int, float [], float [], int *);

double *c_csa2lxd(int, double [], double [], double [], double [], int [],
double, int [], int, double [], double [], int *);
```
Return value:

c_csa2lxs (c_csa2lxs) returns a pointer to a linear array of data that contains the approximated values calculated at the input list of coordinate values. That is, if out is declared as

```  float *out;
```
and we set:
```  out = c_csa2lxs(n, x, y, z, wts, knots, smth, nderiv, no, xo, yo, &ier);
```
then out[i] is the approximated function value at coordinate point (xo[i],yo[i]) for 0 <= i < no. The space for out is allocated internal to c_csa2lxs (c_csa2lxd) and is no floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa2lxs (n,       | int       |
xi,      | float []  | n
yi,      | float []  | n
zi,      | float []  | n
wts,     | float []  | n
knots,   | int []    | 2
smth,    | float     |
nderiv,  | int []    | 2
no,      | int       |
xo,      | float []  | no
yo,      | float []  | no
ier      | int *     |
);

double *c_csa2lxd (n,       | int       |
xi,      | double [] | n
yi,      | double [] | n
zi,      | double [] | n
wts,     | double [] | n
knots,   | int []    | 2
smth,    | double    |
nderiv,  | int []    | 2
no,      | int       |
xo,      | double [] | no
yo,      | double [] | no
ier      | int *     |
);
```
n
The number of input data points. It must be that n > 3 and, depending on the size of knots below, n may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the functional values of the input function -- zi[k] is the functional value at (xi[k],yi[k]) for k=0,n-1.
wts
An array containing weights for the zi values at the input xi and yi values, that is, wts[l] is a weight for the value of zi[l] for l=0,n-1. If you do not desire to weight the input zi values, then set wts[0] to -1. The weights in the wts array are relative and may be set to any non-negative value. When c_csa2lxs (c_csa2lxd) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction and knots[1] specifies the number of knots in the Y direction. knots[0] and knots[1] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
smth
A parameter that controls extrapolation into data sparse regions. If smth is zero, then nothing special is done in data sparse regions. A good first choice for smth is 1.
nderiv
For each of the two coordinate direction, specifies whether you want functional values (nderiv=0), first derivative values (nderiv=1), or second derivative values (nderiv=2). For example, if nderiv[0]=1 and nderiv[1]=1, then the second order mixed partial would be computed.
no
The number of X - Y coordinate values to be calculated for the output array.
xo
An array containing the X coordinate values for the output array.
yo
An array containing the Y coordinate values for the output array.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa3s (c_csa3d) - simple entry for three-dimensional input, gridded output

c_csa3s (c_csa3d) is called to find an approximating cubic spline for three-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use c_csa3xs (c_csa3xd).

Function prototype:

``` float *c_csa3s(int, float [], float [], float [], float [], int [], int, int,
int, float [], float [], float [], int *);

double *c_csa3d(int, double [], double [], double [], double [], int [], int, int,
int, double [], double [], double [], int *);
```
Return value:

c_csa3s (c_csa3d) returns a pointer to a linear array of data that is the approximation spline stored in row-major order. That is, if out is declared as

```  float *out;
```
and we set:
```  out = c_csa3s(n, x, y, z, u, knots, nx, ny, nz, xo, yo, zo, &ier);
```
then out[nz*ny*i + nz*j + k] is the approximation function value at coordinate point (xo[i], yo[j], zo[k]) for 0 <= i < nx, 0 <= j < ny, and 0 <= k < nz. The space for out is allocated internal to c_csa3s (c_csa3d) and is nx*ny*nz floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa3s (ni,      | int       |
xi,      | float []  | ni
yi,      | float []  | ni
zi,      | float []  | ni
ui,      | float []  | ni
knots,   | int []    | 3
nxo,     | int       |
nyo,     | int       |
nzo,     | int       |
xo,      | float []  | nxo
yo,      | float []  | nyo
zo,      | float []  | nzo
ier      | int *     |
);

double *c_csa3d (ni,      | int       |
xi,      | double [] | ni
yi,      | double [] | ni
zi,      | double [] | ni
ui,      | double [] | ni
knots,   | int []    | 3
nxo,     | int       |
nyo,     | int       |
nzo,     | int       |
xo,      | double [] | nxo
yo,      | double [] | nyo
zo,      | double [] | nzo
ier      | int *     |
);
-------------------------------------------------
```
ni
The number of input data points. It must be that ni > 3 and, depending on the size of knots below, ni may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the Z coordinate values for the input function.
ui
An array containing the functional values of the input function -- ui[k] is the functional value at (xi[k], yi[k], zi[k]) for k=0,ni-1.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction, knots[1] specifies the number of knots in the Y direction and knots[2] specifies the number of knots in the Z direction. knots[0], knots[1] and knots[2] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
nxo
The number of X coordinate values to be calculated for the output grid.
nyo
The number of Y coordinate values to be calculated for the output grid.
nzo
The number of Z coordinate values to be calculated for the output grid.
xo
An array containing the X coordinate values for the output grid.
yo
An array containing the Y coordinate values for the output grid.
zo
An array containing the Z coordinate values for the output grid.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa3xs (c_csa3xd) - expanded entry for three-dimensional input, gridded output

c_csa3xs (c_csa3xd) is called to find an approximating cubic spline surface for three-dimensional input data. c_csa3xs (c_csa3xd) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use c_csa3s (c_csa3d).

Function prototype:

``` float *c_csa3xs(int, float [], float [], float [], float [], float [],
int [], float, int [], int, int, int, float [],
float [], float [], int *);

double *c_csa3xd(int, double [], double [], double [], double [], double [],
int [], double, int [], int, int, int, double [],
double [], double [], int *);
```
Return value:

c_csa3xs (c_csa3xd) returns a pointer to a linear array of data that is the approximated function on a grid stored in row-major order. That is, if out is declared as

```  float *out;
```
and we set:
```out = c_csa3xs(ni, xi, yi, zi, ui, wts, knots, smth, nderiv,
nxo, nyo, nzo, xo, yo, zo, &ier)
```
then out[nz*ny*i + nz*j + k] is the approximation function value at coordinate point (xo[i], yo[j], zo[k]) for 0 <= i < nx, 0 <= j < ny, and 0 <= k < nz. The space for out is allocated internal to c_csa3xs (c_csa3xd) and is nx*ny*nz floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa3xs (ni,      | int       |
xi,      | float []  | ni
yi,      | float []  | ni
zi,      | float []  | ni
ui,      | float []  | ni
wts,     | float []  | ni
knots,   | int []    | 3
smth,    | float     |
nderiv   | int []    | 3
nxo,     | int       |
nyo,     | int       |
nzo,     | int       |
xo,      | float []  | nxo
yo,      | float []  | nyo
yo,      | float []  | nzo
ier      | int *     |
);

double *c_csa3xd (ni,     | int       |
xi,      | double [] | ni
yi,      | double [] | ni
zi,      | double [] | ni
ui,      | double [] | ni
wts,     | double [] | ni
knots,   | int []    | 3
smth,    | double    |
nderiv   | int []    | 3
nxo,     | int       |
nyo,     | int       |
nzo,     | int       |
xo,      | double [] | nxo
yo,      | double [] | nyo
yo,      | double [] | nzo
ier      | int *     |
);
-------------------------------------------------
```
ni
The number of input data points. It must be that ni > 3 and, depending on the size of knots below, ni may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the Z coordinate values for the input function.
ui
An array containing the functional values of the input function -- ui[k] is the functional value at (xi[k],yi[k],zi[k]) for k=0,n-1.
wts
An array containing weights for the ui values at the input values, that is, wts[l] is a weight for the value of ui[l] for l=0,ni-1. If you do not desire to weight the input ui values, then set wts[0] to -1. The weights in the wts array are relative and may be set to any non-negative value. When c_csa3xs (c_csa3xd) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction, knots[1] specifies the number of knots in the Y direction and knots[2] specifies the number of knots in the Z direction. knots[0], knots[1], and knots[2] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
smth
A parameter that controls extrapolation into data sparse regions. If smth is zero, then nothing special is done in data sparse regions. A good first choice for smth is 1.
nderiv
For each of the three coordinate direction, specifies whether you want functional values (nderiv=0), first derivative values (nderiv=1), or second derivative values (nderiv=2). For example, if nderiv[0]=1, nderiv[1]=1, and nderiv[2]=0, then the second order mixed partial with respect to X and Y would be computed.
nxo
The number of X coordinate values to be calculated for the output grid.
nyo
The number of Y coordinate values to be calculated for the output grid.
nzo
The number of Z coordinate values to be calculated for the output grid.
xo
An array containing the X coordinate values for the output grid.
yo
An array containing the Y coordinate values for the output grid.
zo
An array containing the Z coordinate values for the output grid.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa3ls (c_csa3ld) - simple entry for three-dimensional input, list output

c_csa3ls (c_csa3ld) is called to find values of an approximating cubic spline at specified three-dimensional coordinates. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use c_csa3lxs (c_csa3lxd).

Function prototype:

``` float *c_csa3ls(int, float [], float [], float [], float [],
int [], int, float [], float [], float[], int *);

double *c_csa3ld(int, double [], double [], double [], double [],
int [], int, double [], double [], double[], int *);
```
Return value:

c_csa3ls (c_csa3ld) returns a pointer to a linear array of data that contains the approximated values calculated at the input list of coordinate values. That is, if out is declared as

```  float *out;
```
and we set:
```  out = c_csa3ls(n, x, y, z, u, knots, no, xo, yo, zo, &ier);
```
then out[i] is the approximated function value at coordinate point (xo[i],yo[i],zo[i]) for 0 <= i < no. The space for out is allocated internal to c_csa3ls (c_csa3ld) and is no floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa3ls (n,       | int       |
xi,      | float []  | n
yi,      | float []  | n
zi,      | float []  | n
ui,      | float []  | n
knots,   | int []    | 3
no,      | int       |
xo,      | float []  | no
yo,      | float []  | no
zo,      | float []  | no
ier      | int *     |
);

double *c_csa3ld (n,      | int       |
xi,      | double [] | n
yi,      | double [] | n
zi,      | double [] | n
ui,      | double [] | n
knots,   | int []    | 3
no,      | int       |
xo,      | double [] | no
yo,      | double [] | no
zo,      | double [] | no
ier      | int *     |
);
-------------------------------------------------
```
n
The number of input data points. It must be that n > 3 and, depending on the size of knots below, n may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the Z coordinate values for the input function.
ui
An array containing the functional values of the input function -- ui[k] is the functional value at (xi[k], yi[k], zi[k]) for k=0,n-1.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction, knots[1] specifies the number of knots in the Y direction and knots[2] specifies the number of knots in the Z direction. knots[0] and knots[1] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
no
The number of X - Y - Z coordinate values to be calculated for the output array.
xo
An array containing the X coordinate values for the output array.
yo
An array containing the Y coordinate values for the output array.
zo
An array containing the Z coordinate values for the output array.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

## c_csa3lxs (c_csa3lxd) - expanded entry for three-dimensional input, list output

c_csa3lxs (c_csa3lxd) is called to find values of an approximating cubic spline at specified three-dimensional coordinates. c_csa3lxs (c_csa3lxd) is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use c_csa3ls (c_csa3ld).

Function prototype:

``` float *c_csa3lxs(int, float [], float [], float [], float [],
float [], int [], float, int [],
int, float [], float [], float [], int *);

double *c_csa3lxd(int, double [], double [], double [], double [],
double [], int [], double, int [],
int, double [], double [], double [], int *);
```
Return value:

c_csa3lxs (c_csa3lxd) returns a pointer to a linear array of data that contains the approximated values calculated at the input list of coordinate values. That is, if out is declared as

```  float *out;
```
and we set:
``` out = c_csa3lxs(n, x, y, z, u, wts, knots, smth, nderiv, no, xo, yo, zo, &ier);
```
then out[i] is the approximated function value at coordinate point (xo[i],yo[i],zo[i]) for 0 <= i < no. The space for out is allocated internal to c_csa2lxs (c_csa2lxd) and is no floats (doubles) in size.

Argument description:

```-------------------------------------------------
Argument | Type      |  Size
-------------------------------------------------
float *c_csa3lxs (ni,      | int       |
xi,      | float []  | ni
yi,      | float []  | ni
zi,      | float []  | ni
ui,      | float []  | ni
wts,     | float []  | ni
knots,   | int []    | 3
smth,    | float     |
nderiv,  | int []    | 3
no,      | int       |
xo,      | float []  | no
yo,      | float []  | no
zo,      | float []  | no
ier      | int *     |
);

double *c_csa3lxd (ni,     | int       |
xi,      | double [] | ni
yi,      | double [] | ni
zi,      | double [] | ni
ui,      | double [] | ni
wts,     | double [] | ni
knots,   | int []    | 3
smth,    | double    |
nderiv,  | int []    | 3
no,      | int       |
xo,      | double [] | no
yo,      | double [] | no
zo,      | double [] | no
ier      | int *     |
);
-------------------------------------------------
```
ni
The number of input data points. It must be that ni > 3 and, depending on the size of knots below, ni may have to be larger.
xi
An array containing the X coordinate values for the input function.
yi
An array containing the Y coordinate values for the input function.
zi
An array containing the Y coordinate values for the input function.
ui
An array containing the functional values of the input function -- ui[k] is the functional value at (xi[k], yi[k], zi[k]) for k=0,n-1.
wts
An array containing weights for the ui values at the input values, that is, wts[l] is a weight for the value of ui[l] for l=0,n-1. If you do not desire to weight the input yi values, then set wts[0] to -1. The weights in the wts array are relative and may be set to any non-negative value. When c_csa3lxs (c_csa3lxd) is called, the weights are summed and the individual weights are normalized so that the weight sum is unity.
knots
The number of knots to be used in constructing the approximation spline. knots[0] specifies the number of knots in the X direction, knots[1] specifies the number of knots in the Y direction and knots[2] specifies the number of knots in the Z direction. knots[0], knots[1], and knots[2] must each be at least 4. The larger the value for knots, the closer the approximated curve will come to passing through the input function values.
smth
A parameter that controls extrapolation into data sparse regions. If smth is zero, then nothing special is done in data sparse regions. A good first choice for smth is 1.
nderiv
For each of the three coordinate direction, specifies whether you want functional values (nderiv=0), first derivative values (nderiv=1), or second derivative values (nderiv=2). For example, if nderiv[0]=1, nderiv[1]=1, and nderiv[2]=0, then the second order mixed partial with respect to X and Y would be computed.
no
The number of X - Y - Z coordinate values to be calculated for the output array.
xo
An array containing the X coordinate values for the output array.
yo
An array containing the Y coordinate values for the output array.
zo
An array containing the Z coordinate values for the output array.
ier
An error return value. If *ier is returned as 0, then no errors were detected. If *ier is non-zero, then refer to the error list in the error table for details.

home | contents | defs | procedures | examples | errors