Northeast Fisheries Center Reference Document 89-02 

TEMPEST 

A Computer Program for Estimating 

Temperature on the 

Northeast Continental Shelf 

by 

David G. Mountain 

National Marine Fisheries Service 

Northeast Fisheries Center 

Woods Hole, MA 02543 

January 1989 
Page iii 

Table of Contents 

Abstract ............................................... _ ........................... 1 

Introduction ................................................................... 1 

" 

Description ..................................................................... 1 

The data .. 000000................................................................. 3 

Determining the annual temperature cycle 

at a MARMAP station ............................................. 3 

Estimating temperature ............................................... 5 

Cautions in interpreting the 

temperature estimates ............................................. 5 

Operating instructions for TEMPEST ....................... 7 

Option 1 - Temperature for a given date ................... 7 

Option 2 - Annual cycle of temperature 

at a location .............................................................. 7 

References ..................................................................... 8 

List of Figures 

Figure 1. Locations of the MARMAP standard 

stations ..................................................................... 2 

Figure 2. Calculated annual curve for the 

bottom temperature at MARMAP station 56 .... 6 
Page 1 

ABSTRACT 

A method is presented for estimating the mean surface or bottom temperature 

at any location on the northeast continental shelf on any day of the year. The method is 

based on observations made by the Northeast Fisheries Center MARMAP program 

between 1977 and 1987. A disk with computer programs for making temperature 

estimates is included at the end of the report. 

Introduction 

This report describes a computer program for estimating the expected or mean 

surface and bottom temperatures at any location on the northeast continental shelf for any 

day of the year. The program and necessary 

data files are provided on a disk included 

wi th the report. 

Program Name: 

Computer: 

Executable 

file: 

Language: 

Current version: 

Written by: 

TEMPEST 

IBM PC or 

compatible 

TEMPEST.EXE 

or 

TEMPEST7.EXE 

Turbo Pascal 4.0 

with 

Graphix Toolbox 

2.1 January 1989 

David G. Mountain 

Northeast Fisheries 

Center 

Woods Hole, MA 02543 

The following sections present an 

overview of the program, the data set upon 

which the temperature estimates are based, 

the procedures used to make the estimates 

and operating instructions for the program. 

The program code is included on the disk in 

the file TEMPEST.P AS and may be viewed 

by listing the file on your computer. The data 

files CYCLETOP.DAT and CYCLEBOT.DAT 

may also be viewed by listing them. 

The program provides an easy method 

for obtaining the characteristic temperature 

patterns anywhere on the northeastern continental shelf. This information may be useful 

for planning experiments by identifying the 

range of temperatures likely to be encountered in an area, for the quality control of 

temperature observations from field work, 

or for biological modeling efforts by providing a spatially and temporally realistic temperature field. The temperature field generated by the program may also serve as a 

consistent reference against which other 

observations, scattered in space and in'time, 

may be compared. 

Description 

Estimates of surface or bottom temperature at any location on the northeast 

continental shelf are made using curves describing the annual temperature cycle at standard MARMAP station locations (see Figure 

1 and the D AT A section below). These curves 

represent the best fitting sum of three harmonics (frequencies of one, two and three 
Page 2 

: ~ : , o 60 

Figure 1. Locations of the MARMAP standard stations. 
Page 3 

cycles per year) to all surface or bottom observations at the MARMAP station. The temperature at an arbitrary location on the shelf 

is estimated by weighting the temperatures 

at nearby MARMAP stations inversely to the 

square of the distance from the station to the 

desired location. An estimate of the uncertainty of the temperature estimate is also 

made. 

A temperature estimate can be made 

for a particular day of the year or for an entire 

annual cycle. In the latter case, the annual 

cycle is plotted on the computer screen and, if 

desired, written to a disk file in the form of 

daily temperature values. 

The program requires six files to run -

a program file, two font files, two data files 

and a message file. The program is written in 

Turbo Pascal (version 4.0) with graphics 

routines included from the Turbo Pascal 

Graphix Toolbox. There are two versions of 

the compiled executable program file: 

TEMPEST.EXE - for any MS-DOS computer 

TEMPEST7.EXE - for use with a coprocessor 

(8087 or 80287) 

The font files are 4X4.FON and 

8X8.FON. The two data files are 

CYCLETOP.DA T and CYCLEBOT.DAT and 

contain the coefficients for the surface and 

bottom annual cycles. The message file is 

ERROR.MSG. 

The Data 

The data upon which the temperature 

estimates are based were obtained by the 

Marine Resources Monitoring, Assessment 

and Prediction (MARMAP) program. MARMAP is an interdisciplinary program to 

measure the distribution of plankton, nutrients and water properties over the continental shelf from Cape Hatteras to the Gulf of 

Maine. Observations have been made on 

three to six survey cruises per year at over 180 

standard station locations (see Figure 1). The 

stations are separated by about 30 km, although not all stations were occupied on each 

cruise. From 1977 through 1987 the program 

made hydrographic measurements on 49 

cruises. 

On nearly all of the cruises water properties were measured using water bottles and 

reversing thermometers at up to 15 standard 

depths. In 1987 some of the data was obtained using a conductivity /temperature/ 

depth (CTD) profiling instrument. The accuracy of the temperature measurements is 

apprOximately -0.02 C. The method described in this report uses only the surface 

and near bottom temperature observations 

from the MARMAP data set. An observation 

had to be within Sm of the surface to be 

considered a surface value and within 10m of 

the bottom to be used as a bottom observation. 

Determining the Annual 

Temperature Cycle at a MARMAP 

Station 

To determine the annual cycle of surface or bottom temperature for a standard 

MARMAP station, all of the observations at 

the station were combined, regardless of year, 

with the dates expressed only as Julian Day. 

If there were at least 10 observations for the 

station and at least one in each quarter of the 

year, an annual curve was calculated. 

The annual curve fit to the data is the 

sum of three sinusoidal components - having 

frequencies of one, two and three cycles per 

year. To fit the different harmonic components, a multiple regression model was used 

wi th the form: 

T =l: [M. + A cos(23t * JD / P.) + B. sin(23t * JD / PI) '-13 J J J J J- , 
where: 

T = temperature 

M. = the mean temperature J for the jth component 

JO = Julian day 

A. = cosine amplitude for the 

J jth component 

B. = sine amplitude for the jth J 

component 

P. = the harmonic period for 

J the jth component 

The independent variables are the cosine and 

sine terms, evaluated for the Julian day of 

each observation and the harmonic period 

being considered. The model then has the 

form: 

where Xl is the cosine variable and X2 is the 

sine variable. The values of A and B were 

determined following the method described 

in the Statistical Package for the Social Sciences (5PsS Inc. 1975, p 323-329): 

A = SP[T1].S5[2] - SP[T2].SP[12] 

55[1].55[2] - SP[12].SP[12] 

B = SP[T2].S5[1] - 5P[Tl].5P[12] 

S5[1].S5[2] - 5P[12].SP[12] 

M = T - A.X1 - B.X2 

where T represents- the observed temperature values and 55 and 5P stand for the sum 

of squares and the sum of products: 

55[1] = I (Xli -Xl)2 = IXlI2 - (IXli )( IX1i )/N 

SP[12]=I(Xli -Xl )(X1J,-X2 )=I(Xli X1J )-(IXli)(IX1J )/N 

where N is the number of points and the 

summations are from i = 1 to N. 

The curve fitting procedure first fits 

an annual harmonic (p = 365 days) to the 

Page 4 

original data set. The mean, cosine and sine 

coefficients are determined by the above 

expressions. The Significance of the regression coefficients are tested as described by 

Fofonoff and Bryden (1975) and by Brownlee 

(1965). If the annual curve is Significant at the 

95% level, it is accepted and the residuals (the 

differences between the original data and the 

calculated annual curve) are the input data 

for fitting the second harmonic with period 

365/2 days. The Significance of this curve fit 

is tested. If accepted, the residuals are 'again 

determined and a third harmonic with P=365 / 

3 is fit to them. Since the original data are not 

uniformly spaced in time, the residuals from 

each harmonic will not necessarily have a 

zero mean. The second and third harmonics 

will have small mean values associated with 

them. The mean value for the year is the sum 

of the three means. 

The standard deviation of the original 

data from the combined annual curve is determined. Any points that are more than two 

standard deviations from the calculated curve 

are identified. The curve fitting process is repeated with these pOints omitted. The results 

of the second curve fitting are the values 

accepted and used. 

For each MARMAP station a record 

was written to a coefficient file containing: 

1. the station number 

2. the standard position for the station 

3. the standard bottom depth for the 

station 

4. the nine annual curve coefficients 

(mean,cosine and sine amplitude 

for each of the three harmonics) 

5. the standard deviation of the origi 

nal data from the annual curve. 

The file CYCLETOP.DAT contains data for 

the 180 stations for which surface temperature curves could be calculated. The file 

CYCLEBOT.DAT contains data for the 167 

bottom temperature curves which could be 

calculated. 
Page 5 

An example of the curve fitting results 

is shown in Figure 2 for the bottom temperature at MARMAP station 56. The solid line in 

the figure is the mean annual curve and the 

dashed lines represent plus and minus one 

standard deviation from the mean. The original data points are plotted and keyed by year. 

The calculated mean curve is able to follow 

the observations quite closely. The standard 

deviation results more from real interannual 

variability in the data than from an inability 

of the curve fitting method to represent the 

original data. 

Estimating Temperature 

At a Location 

To estimate the temperature at a given 

location on the shelf, the nearest MARMAP 

stations that have annual temperature curves 

are first identified. The list of MARMAP 

stations is searched to locate stations that are 

within a given range of latitude and longitude, as described below. If only one or no 

stations are found, the search distances or 

ranges are doubled. If no stations are again 

found, the distances are tripled and finally 

quadrupled. If no stations are found within 

four times the original search distances, no 

temperature estimate is attempted. 

The original search distances depend 

upon location. South of 39"N (near Delaware 

Bay) the isobaths are essentially north-south, 

and the program will search further in the 

,along-shelf direction than in the cross-shelf 

direction. The original search distances are 

0.2 latitude (22 km) and 0.15 longitude (12 

km). On the shelf east of Long Island to 

Georges Bank the isobaths are east-wes~ and 

the original search distances are 0.1 latitude 

(11 km) and 0.25 longitude (21 km). I~ the 

New York Bight (between the two prevIous 

areas) and in the Gulf of Maine the original 

search area is about square, 0.15 latitude (16 

km) and 0.20 longitude (16 km). 

When the nearby stations have been 

identified, a weighting factor is assigned to 

each station. The factor is inversely proportional to the square of the distance from it to 

the given location. The sum of the weighting 

factors is 1. The weight assigned to a station 

represents the proportion it contributes to the 

, final temperature estimate. The coefficients 

for the annual curve at the desired location 

are calculated by a weighted average of the 

coefficients from the contributing MARMAP 

stations. 

The annual curve for each standard 

MARMAP station has an associated standard 

deviation. This is the standard deviation of 

the original observations from the calculated 

annual curve. When combining the contributions from the different stations to estimate 

the temperature at an arbitrary point, an estimate of the uncertainty is also made by weighting the variance (square of the standard 

deviation) for the different stations. The 

uncertainty estimate has two parts - one related to estimating the mean value at the 

point and the other to estimating the uncertainty about the mean. With N standard 

stations contributing, each having a variance 

v and an assigned weight a, the total variance 

estimate is: 

where the first summation represents the 

uncertainty of the mean and the second represents the weighted average uncertainty 

about the mean. The uncertainty listed for a 

temperature estimate is the square root of this 

variance. 

Cautions in Interpreting the 

Temperature Estimates 

1. Near the seaward edge of the contnental shelf actual temperatures could be significantly different than estimated by this 
c:c 

N 

:::l 

N 

W 

0:::::(.0 

:JEa: 

0::::: 

w 

Cl1::N 

wEc:c , 

, 

, ,EB 

, , 

" .'-', ..,. , , ... , w.' ~ ~ ~ ____ ~ •• 

' ... 11 -------- ............... __ 4.1: -<J • 

, 

''''0 ' ... )4 , , ... , , , , , , , , , , , Gr, ' , ' , '0 , , , , + , '... ... 

, ' , 

, 

, 

, 

Page 6 

o - 1977 

o - 1978 

~ - 1979 

+ - 1980 

x - 1981 

o - 1982 ~ .. 1983 

a ... 1984 

w. "" 1985 

• - 1986 

EB "" 1987 

o+-----~------~----~------,_----_,------,_----~----~ 

a so 100 150 200 250 300 

JULIAN DAY 

Figure 2. Calculated annual curve (solid line) for the bottom tempetature at MARMAP station 56. The dashed lines represent plus and minus one standard deviation from the mean curve. The original data points are plotted with symbols 

indicating the year of observation. 

program, particularly on the bottom, due to 

movement of the shelf/slope front. 

2. The peak surface temperature generally occurs in July or August. This period 

was not well sampled at all MARMAP stations and the temperature peak may not be 

well defined in all of the calculated annual 

curves. 

3. When estimating bottom temperature, 

the depth range of stations contributing to the 

estimate should be considered. When the 

program provides the opportunity, the user 

should drop from the calculations stations 

having a significantly different depth than at 

the location of interest. 

4. Estuarine and nearshore regions are 

not sampled in the MARMAP surveys (see 

Figure 1). Local effects are likely important 

in determining temperature in these areas. 

Therefore the method presented here would 

not be reliable in those regions. 
Page 7 

Operating Instructions for 

TEMPEST 

User entries are indicated in bold type. 

1. With the computer on, set the default 

drive to the drive containing the program, 

font and data files. At the> prompt type the 

name of the appropriate program (for example: 

TEMPEST7). 

2. The program begins execution and 

asks the user to choose either surface or bottom temperature estimates. The proper response is to enter either S or B. The program 

then reads the file containing the coefficients 

for the surface or bottom annual temperature 

curves, which takes a few seconds to complete. 

3. The program then presents two options: 

1) to estimate temperature at a given location 

on a given date, 2) to estimate the annual 

temperature cycle at a given location. This 

option requires a computer with a graphics 

adapter: eGA, EGA, VGA or Hercules 

monochrome. The user should choose an option by entering either 1 or 2. 

Option 1 - Temperature For a Given 

Date 

4. The program asks for the desired latitude, longitude and date. The latitude and 

longitude are in integer degrees and decimal 

minutes with a space between (for example: 

4045.7). The date is entered as integer month 

and day with a space between (for example: 

7 25 for July 25). 

5. The program searches for the MARMAP stations closest to the given position. 

The stations are listed with station number 

(see Figure 1), temperature (estimated from 

the annual curve for the station), weighting 

factor, distance to the given position and 

bottom depth. The program then asks if the 

user wants to drop any of the identified 

stations from the estimating procedure. 

The user enters Y for yes and N for no. If 

yes, the user is asked to enter the station 

number to be dropped. The program then 

inquires if another station is to be dropped. 

The user may enter Y and continue dropping stations from the list. 

6. The program then prints: 

a. the given latitude, longitude and date 

b. the estimated temperature and its 

uncertainty 

c. the calculated temperature, weighting 

factor, distance and depth for each con 

tributing MARMAP station. 

7. The program asks if the user wants to 

run the program again. If Y, the program returns to step 3. If N, the program stops. 

Option 2 - Annual Cycle of Temperature at a Location 

[This option requires a graphics adapter on 

your computer] 

8. Steps 4 and 5 above are followed, with 

no date being requested in step 4. 

9. The information for the MARMAP 

stations being used is listed. The temperatures listed are for July 1, to provide an indication of the inter-station variability. When 

ready the user presses Enter. The estimated 

temperature for each day of the year is calculated and the annual cycle is plotted on the 

computer screen. The maximum and 

minimum temperatures and the dates on 

which they occur are listed under the plotted 

annual cycle. 

10. When done viewing the plot, the user 

presses Enter and is provided with five options: 
1. exit the program 

2. enter a new position 

(return to step 3). 

3. list the estimated temperatures for 45 

day period. 

4. review the annual cycle plot 

(for example: return to step 9). 

5. write the temperatures for the year to 

a disk file. 

11. If a list of temperatures (option 3) is 

selected, the program asks for a starting date, 

which is entered as integer month and day 

(for example: 4 10 for April 10th). The program offers to write the temperatures to a 

disk file. A file is created with the name 

TSXXYY.LST or TBXXYY.LST where the S or 

B indicate surface or bottom values, XX is the 

degrees of latitude and YY the degrees of 

longitude. 

Since direct output to a printer from 

Turbo Pascal is compatible with only Epson 

printers, this disk file provides a way for any 

user to get a hard copy output of the list by a 

DOS Print command. The program then lists 

the date and temperature for 45 days beginPage 8 

ning with the given date. The option list in 

step 10 is then repeated. 

12. H a disk file of the daily values is chosen (option 5) a text file is created with the 

name TSXXYY.DAT orTBXXYY.DAT. TheS 

or B indicates surface or bottom values, XX is 

the degrees in latiutude and YY the degrees 

of longitude. The date and estimated temperature are then written to the file for each 

day of the year. The option list in step 10 is 

then repeated. 

References 

Brownlee, KA. 1965. Statistical theory and 

methodology in science and engineering. New 

York: J. Wiley & Sons. 59Opp. 

Fofonoff, N.P. and H. Bryden. 1975. Specific 

gravity and density of seawater at atmospheric pressure. J. Mar. Res. 33(Suppl.), 69-

82. 

SPSS, Inc. 1983. SP S5 X users guide. New 

York: McGraw-Hill. 806p.