Opened 16 years ago

Last modified 14 years ago

#31 new defect

plot roms outputs with SAXO

Reported by: christophe.menkes@… Owned by: smasson
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:

Description (last modified by pinsard)

Sorry in french...

Hello Seb,

une nouveau defi pour toi. Je suis entrain de me mettre a ROMS. C'est
assez amusant. C'est surtout hyper simple de faire des config.
Voila, j'ai fait une config Pacifique pour commencer. Roms cree une grille
C de type OPA. Un exemple est dans /usr/temp/menkes/roms_grd.nc
Ma question, simple, est: comment adapter tes outils pour lire ca
plutot que le meshmask ?
un des problemes c'est que u,t,v n'ont pas le meme nombre de points.
Un deuxieme probleme que tu ne vois pas la, c'est que les coordonnees
sont en sigma et donc s'ajustent a la bathymetry et donc il faut arriver a
les retransformer en z. POur cela, lorsque le run calcule la surface
libre, zeta (voir dans /usr/temp/menkes/roms_avg_seb.nc, on a une
transformation analytique:

etant donnes:

% Number of vertical Levels
%
N = 30;
%
%  Vertical grid parameters
%
theta_s = 6.;
theta_b = 0.;
hc      = 5.;
%

on a en matlab :

function z = zlevs(h,zeta,theta_s,theta_b,hc,N,type);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%  pierrick 2002
%
%
%
% function z = zlevs(h,zeta,theta_s,theta_b,hc,N,type);
%
%
%
% this function compute the depth of rho or w points for ROMS
%
%
%
% On Input:
%
%
%
%    type    'r': rho point 'w': w point
%
%
%
% On Output:
%
% Number of vertical Levels
%
N = 30;
%
%  Vertical grid parameters
%
theta_s = 6.;
theta_b = 0.;
hc      = 5.;
%
%
%
%    z       Depths (m) of RHO- or W-points (3D matrix).
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[M,L]=size(h);
%
% Set S-Curves in domain [-1 < sc < 0] at vertical W- and RHO-points.
%
cff1=1./sinh(theta_s);
cff2=0.5/tanh(0.5*theta_s);
if type=='w'
  sc=((0:N)-N)/N;
  N=N+1;
else
  sc=((1:N)-N-0.5)/N;
end
Cs=(1.-theta_b)*cff1*sinh(theta_s*sc)...
    +theta_b*(cff2*tanh(theta_s*(sc+0.5))-0.5);
%
% Create S-coordinate system: based on model topography h(i,j),
% fast-time-averaged free-surface field and vertical coordinate
% transformation metrics compute evolving depths of of the three-
% dimensional model grid.
%    
hinv=1./h;
cff=hc*(sc-Cs);
cff1=Cs;
cff2=sc+1;
z=zeros(N,M,L);
for k=1:N
  z0=cff(k)+cff1(k)*h;
  z(k,:,:)=z0+zeta.*(1.+z0.*hinv);
end

%if type=='w'
%  hmin=min(min(h));
%  hmax=max(max(h));
%  for k=N:-1:1
%    cff1=sc(k)*hc+(hmin-hc)*Cs(k);
%    cff2=sc(k)*hc+(0.5*(hmin+hmax)-hc)*Cs(k);
%    cff3=sc(k)*hc+(hmax-hc)*Cs(k);
%    disp([num2str(k,6),' | ',num2str(sc(k),6),' | ',num2str(Cs(k)),' |
',...
%         num2str(cff1),' | ',num2str(cff2),' | ',num2str(cff3)])
%  end
%end

return

Je ne te demande pas de me faire les programmes, sauf si vraiment ca
t'interesse.....mais par contre, je voudrais bien un conseil sur comment,
a ton avis, proceder dans ta suite de programmes.
En gros, on a ici des prorammes matlab mais je voudrais faire qcq chose de
propre en IDL pour ROMS.

Thanks.
Bob
$

Change History (4)

comment:1 Changed 16 years ago by smasson

I have to find some time to look at your examples files...

one solution for problem 1) would be to use ncks to cut the extra lines/columns of U and V points to get back to the same configuration as for OPA C grid (starting on T point with the same number of TUVF points). Another solutions can be imagined based on the idea toautomatically cut the extra lines/columns when reading U and V points (for example having different values for i[xy][min|max]mesh for T, U, V points).
for pb 2) I need to think about it more... Stephane already ask me the same thing as you...

seb

comment:2 Changed 15 years ago by test

  • Type changed from enhancement to defect

test

comment:3 Changed 15 years ago by test

  • Type defect deleted

test

comment:5 Changed 14 years ago by pinsard

  • Description modified (diff)
  • Type set to defect

just improve description by adding some accolades.

Note: See TracTickets for help on using tickets.