Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Tue Oct 16, 2018 12:12 pm




Post new topic Reply to topic  [ 3 posts ] 

All times are UTC

Author Message
PostPosted: Thu May 03, 2018 11:36 am 
Offline

Joined: Fri Jul 07, 2017 7:34 pm
Posts: 7
Location: cicese
Hello
I want to compute the derivative of U and V in curvilinear coordinates but in sigma (no Z) with the aim of compute the conversion of barotropic energy (similar to Marchesiello et al 2003). I did the code in matlab but I'm sure it's good. Can you help me please? I used part of the ROMS-Agrif Visualizations_tool code

Thank you very much.


Attachments:
File comment: here the code
curv_derivatives.m [1.85 KiB]
Downloaded 23 times
Top
 Profile  
Reply with quote  
PostPosted: Sun May 06, 2018 10:43 pm 
Offline

Joined: Wed Feb 03, 2010 6:59 pm
Posts: 95
Location: Universidad Autonoma de Baja California Sur
Hello fcampos

You have this
uom(i,:,:) = 2*squeeze(Hu(i,:,:))./(pm(:,1:L)+pm(:,2:Lp));
uon(i,:,:) = 2*squeeze(Hu(i,:,:))./(pn(:,1:L)+pn(:,2:Lp));
von(i,:,:) = 2*squeeze(Hv(i,:,:))./(pn(1:M,:)+pn(2:Mp,:));
vom(i,:,:) = 2*squeeze(Hv(i,:,:))./(pm(1:M,:)+pm(2:Mp,:));

how about
uom(i,:,:) = squeeze(2*((Hu(i,:,:))./(pm(:,1:L)+pm(:,2:Lp))));
uon(i,:,:) = squeeze(2*((Hu(i,:,:))./(pn(:,1:L)+pn(:,2:Lp))));
von(i,:,:) = squeeze(2*((Hv(i,:,:))./(pn(1:M,:)+pn(2:Mp,:))));
vom(i,:,:) = squeeze(2*((Hv(i,:,:))./(pm(1:M,:)+pm(2:Mp,:))));

perhaps it works


Top
 Profile  
Reply with quote  
PostPosted: Mon May 07, 2018 12:59 am 
Offline

Joined: Fri Jul 07, 2017 7:34 pm
Posts: 7
Location: cicese
Hello.
The 2 affects all the matrix. So if you put it before or after "squeeze" affect the multiplication in a similar way. The purpose of my question is if the structure of the transformation into sigma coordinates (in matlab) is indeed good. in my opinion it is well written XD.

Thank you for your reply


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group