Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mid-pressure calculation in gsw_distance.m #11

Open
chrisdane opened this issue Apr 12, 2019 · 1 comment
Open

mid-pressure calculation in gsw_distance.m #11

chrisdane opened this issue Apr 12, 2019 · 1 comment

Comments

@chrisdane
Copy link

chrisdane commented Apr 12, 2019

Hi

I was wondering if

p_mid = 0.5*(p(:,1:nla-1) + p(:,1:nla-1));
is correct since the same index 1:nla-1 is used to calculate the average pressure of different locations. So I think

>> p = [200 1000];
>> p_mid = 0.5*(p(:,1:nla-1) + p(:,1:nla-1))

p_mid =

   200

is wrong, as it should be rather

>> p_mid = 0.5*(p(:,1:nla-1) + p(:,2:nla))  

p_mid =

   600

as it is also used for latitude:

lat_mid = 0.5*(lat(:,1:nla-1) + lat(:,2:nla));

@PaulMBarker
Copy link
Member

I have corrected this and the change will appear in version 3.06.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants