Skip to content

mid-pressure calculation in gsw_distance.m #11

@chrisdane

Description

@chrisdane

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions