problems to make inital connditions

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
javadi
Posts: 118
Joined: Mon Jan 27, 2020 5:55 pm
Location: UoT

problems to make inital connditions

#1 Unread post by javadi »

Dear users
I try to make initial conditions using c_initial and d_inital which are based on MATLAB. Although I understand some parts of the codes, I have faced some problems. Firstly, I cannot interpolate correctly after using this script. Secondly, although my temperature and salinity are not zero in my input file, all values for outputs are zero(?).

Error is:
Interpolating from OA fields, please wait ...
Error using interp1>reshapeAndSortXandV (line 424)
X and V must be of the same length.

Error in interp1 (line 93)
[X,V,orig_size_v] = reshapeAndSortXandV(varargin{1},varargin{2});

My error is in this part of codes:

% Interpolate OA of temperature and salinity from standard levels to
% model depths.
%--------------------------------------------------------------------------

if (OA_INTERPOLATE),

disp(' ')
disp('Interpolating from OA fields, please wait ...');

InpRec = 1;

Zoa=nc_read(OAname, 'zout');

oa_temp=nc_read(OAname, 'temp', InpRec);
oa_salt=nc_read(OAname, 'salt', InpRec);

for j=1:Mr,
for i=1:Lr,
Zroms = squeeze(z_r(i,j,:));
Toa = squeeze(oa_temp(i,j,:));
Soa = squeeze(oa_salt(i,j,:));

S.temp(i,j,:) = interp1(Zoa, Toa, Zroms, method);
S.salt(i,j,:) = interp1(Zoa, Soa, Zroms, method);
end,
end,

end,

please help me with your interesting comments

javadi
Posts: 118
Joined: Mon Jan 27, 2020 5:55 pm
Location: UoT

Re: problems to make inital connditions

#2 Unread post by javadi »

Dear users

I think that this problem originates from a bad understanding of OA and Zout. I could not correctly define zout; hence, I have face this error. I need some information about Zout.

Post Reply