Exercise 5: Using EXCEL to process CTD data

In this exercise we will download data using FTP, convert the data to usable scientific units, and plot the data.

The data are from the Pacific ocean near Guatamala. The raw data consist of measurements of pressure, temperature and electrical conductivity ( proxy for salinity).

The data are located at;

ftp.u.washington.edu/pub/user-supported/blewis

Keep a copy of the raw data on your diskette.

Once you have imported the data into EXCEL, you will need to convert the raw data to depth, temperature and salinity and also to calculate the speed of sound in the seawater.

The equations to do these conversions are given in the following section.

The latitude of the site is 15 deg N

Pressure is in decibars, temperature in deg C, and conductivity is in the form of a ratio.

See also

http://www.phys.ocean.dal.ca/~kelley/seawater/WaterProperties.html

for more equations on water properties.

-----------------------------------------------------------------------------------------------------------------------

NOTE: The VB procedures below allow you to perform the calculations on the CTD data

---------------------------------------------------------------

function SAL78(CND,T,P)

' ***********************************************

' SAL78 converts conductivity to salinity

' the conductivity ratio (CND)=1.0000000 for salinity=35

' PSS-78. temperature=15.0 deg. celcius, and atmospheric

' pressure.

' ***********************************************

' references: also located in UNESCO Report NO. 37 1981

' Practical Salinity Scale 1978: E.L. Lewis IEEE Ocean Eng.

' Jan. 1980

' ***********************************************

' units:

' pressure P decibars

' temperature T deg. celcius (IPTS-68)

' conductivity CND ratio (M=0)

' salinity SAL78 (PSS-78) (M=0)

' checkvalues:

' SAL78=1.888091:CND=40.0000,T=40degC,P=10000dcbrs:M=1

' SAL78=40.00000:CND=1.888091,T=40degC,P=10000dcbrs:M=0

' ***********************************************

' SAL78 ratio: returns zero for conductivity ratio: <0.0005

' SAL78: returns zero for salinity: <0.02

' ***********************************************

' Practical Salinity Scale 1978 definition with temperature

' correction

' ***********************************************

' convert conductivity to salinity

R=CND

DT=T-15.0

RT=R/(RT35(T)*(1.0+C(P)/(B(T)+A(T)*R)))

RT=sqrt(ABS(RT))

SAL78=SAL(RT,DT)

End function

Function SAL(XR,XT)

SAL=((((2.7081*XR-7.0261)*XR+14.0941)*XR+25.3851)*XR -0.1692)*XR+0.0080 +(XT/(1.0+0.0162*XT))*(((((-0.0144*XR+ 0.0636)*XR-0.0375)*XR-0.0066)*XR-0.0056)*XR+0.0005)

End function

Function RT(XT)

RT35=(((1.0031E-9*XT-6.9698E-7)*XT+1.104259E-4)*XT +2.00564E-2)*XT+0.6766097

End function

Function C(XP)

C=((3.989E-15*XP-6.370E-10)*XP+2.070E-5)*XP

End function

Function B(XT)

B=(4.464E-4*XT+3.426E-2)*XT+1.0

End function

Function A(XT)

A=-3.107E-3*XT+0.4215

End function

 

function depth(P,LAT)

' ****************************

' depth in meters from pressure in decibars using

' Saunder's and Fofonoff's method.

' deep-sea res., 1976,23,109-111.

' formula refitted for 1980 equation of state

' units:

' pressure p decibars

' latitude lat degrees

' depth depth meters

' checkvalue: depth=9712.653 M for P=10000 decibars,

' latitude=30 deg

' above for standard ocean: T=0 deg. celcius;

' S=35 (PSS-78)

' ****************************

x=sin(lat/57.29578)

x=x*x

' gr=gravity variation with latitude: Anon (1970)

' Bulletin Geodesique

gr=9.780318*(1.0+(5.2788E-3+2.36E-5*x)*x)+1.092E-6*p

depth=(((-1.82E-15*P+2.279E-10)*P-2.2512E-5)*P+9.72659)*P

depth=depth/gr

end function

function SVEL(S,T,PO)

' ***********************************************

' Sound Speed Seawater Chen and Millero 1977,JASA,62,1129-35

' units:

' pressure PO decibars

' temperature T deg celcius (IPTS-68)

' salinity S (PSS-78)

' sound speed SVEL meters/second

' checkvalue:SVEL=1731,995m/s,S=40(PSS-78),T=40degC,P=10000db

' ***********************************************

' scale pressure to bars

P=PO/10.

SR=sqrt(ABS(S))

' S**2 term

D=1.727E-3-7.9836E-6*P

' S**3/2 term

B1=7.3637E-5+1.7945E-7*T

B0=-1.922E-2-4.42E-5*T

B4=B0+B1*P

' S**1 term

A3=(-3.389E-13*T+6.649E-12)*T+1.100E-10

A2=((7.988E-12*T-1.6002E-10)*T+9.1041E-9)*T-3.9064E-7

A1=(((-2.0122E-10*T+1.0507E-8)*T-6.4885E-8)*T-1.2580E -5)*T+9.4742E-5

A0=(((-3.21E-8*T+2.006E-6)*T+7.164E-5)*T-1.262E-2) *T+1.389

A4=((A3*P+A2)*P+A1)*P+A0

' s**0 term

C3=(-2.3643E-12*T+3.8504E-10)*T-9.7729E-9

C2=(((1.0405E-12*T-2.5335E-10)*T+2.5974E-8)*T-1.7107E-6) *T+3.1260E-5

C1=(((-6.1185E-10*T+1.3621E-7)*T-8.1788E-6)*T+6.8982E-4) *T+0.153563

C0=((((3.1464E-9*T-1.47800E-6)*T+3.3420E-4)*T-5.80852E-2)*T+5.03711)*T+1402.388

C4=((C3*P+C2)*P+C1)*P+C0

' sound speed return

SVEL=C4+(A4+B4*SR+D*S)*S

End function

-----------------------------------------------------------------------------------------------------------