% filename = % % Purpose: % % Variables: % % % Functions called: % % %-------------------------------- % %start with a clean slate... % load the ctd file data % Define the appropriate arrays for z, p, S and T % NOTE: you will have to convert depth into pressure!! % Establish the arrays size as nmax. nmax=size(depth,1); % Define acceleration due to gravity (m/s^2) % Initialize all arrays dens=zeros(nmax,1); E=zeros(nmax,1); N=zeros(nmax,1); % create density array % this calls the function rho.m for i=1:nmax dens(i)=rho(S(i),T(i),p(i)); end %establish boundary conditions for stability parameter (E) and %buoyancy frequency (N) E(1)=-(1/dens(1))*(dens(2)-dens(1))/z(2); E(nmax)=-(1/dens(nmax))*(dens(nmax)-dens(nmax-1))/(z(nmax)-z(nmax-1)); N(1)=sqrt(g*E(1)); N(nmax)=sqrt(g*E(nmax)); %Complete: for k=2: nmax -1 %Calculate finite difference for stability parameter (E) %Calculate the buoyancy frequency (N) end % Plot stability parameter % create new window for next figure % and plot buoyancy frequency