[MITgcm-support] Grid setup at the Poles using compute_grid_perface

Benjamin Ocampo rurik at ualberta.ca
Thu Apr 14 18:48:10 EDT 2016


Hi All:

I decided to try using the SPgrid program to generate grid points at the
N-Pole.
This will be implemented into the Curvilinear grid set up in the program.

This was my attempt to make a regional grid at the pole using the following
MATLAB script:


clear all;
close all;
%
coef = 3.1415926535/180;
%
nx = 360;
ny = 50;
%
thetaN = (90-80)*coef;
theta0 = (90-90)*coef;
dtheta = (theta0-thetaN)/ny;
phi0 = 0;
dphi = (360/ny)*coef;
r = 6370e3;
%
for j = 1:nx;
        for k = 1:ny;
                theta = theta0+dtheta*(k-1);
                phi = phi0 + dphi*(j-1);
                x = r*sin(theta)*cos(phi); %For the conv. math desc.
                                                        % where theta = 0
at N-Pole
                y = r*sin(theta)*sin(phi);
                z = r*cos(theta);
                Cor(j,k,1) = x;
                Cor(j,k,2) = y;
                Cor(j,k,3) = z;
        end
end
compute_grid_perface(Cor,r)


However, I end up with this error:


Error using subsasgn
In an assignment  A(:) = B, the number of elements in A and B must be the
same.

Error in netcdf/subsasgn (line 83)
      result = subsasgn(v, s, other);

Error in compute_grid_perface (line 305)
  eval(comm);

Error in polar_grid (line 28)
compute_grid_perface(Cor,r)


Unfortunately, I am not too familiar with compute_grid_perface.m to
understand
what this error means or how to resolve it.

Is anyone familiar with compute_grid_perface.m? Any help would be
greatly appreciated.

Cheers,
Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20160414/275d9c1f/attachment.htm>


More information about the MITgcm-support mailing list