calculating ubar and vbar

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

calculating ubar and vbar

#1 Unread post by turuncu »

Hi,

I want to calculate ubar and vbar using u and v. Is it calculated using following formula,

ubar = ubar + u*dz
vbar = vbar + v*dz

but in this case the units of the 2d vertical integrated momentum component will be m2/s (m/s * m) because we multiply with the thickness of the layer. In climatology package the unit of ubar and vbar is in m/s. Which one is correct? May be the formula is wrong and you can provide me the correct one.

Thanks,

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: calculating ubar and vbar

#2 Unread post by kate »

In step3d_uv:

CF = CF + Hz
DC = DC + u*Hz

ubar = DC/CF (more or less)

venuscheung

Re: calculating ubar and vbar

#3 Unread post by venuscheung »

hi,
is there any update of calculatung ubar and vbar by u and v?
or is there any recommendation for me to refer to?
thank you

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: calculating ubar and vbar

#4 Unread post by arango »

Look at Nonlinear/ini_fields.F instead. It is very clear how it is computed there. It is how the inital ubar anf vbar is computed in ROMS.

venuscheung

Re: calculating ubar and vbar

#5 Unread post by venuscheung »

Sorry, I think I am going to ask some silly questions since I am not that understand the flow.

Currently, I have download data like zeta, u v current, temp and salinity from MERCATER, yet some error occur when I used the mercator2roms.m.
Since I am not a MATLAB expert, I decided to rewrite the script using python.
However, I meet some problem in understanding the calcutation in ubar and vbar.

When look into the script INI_FIELD.F, I wonder will ROMS calculate ubar and vbar itself if the initial file contains u and v data.
How should I modified my header file if so.

Thank you very much.

venuscheung

Re: calculating ubar and vbar

#6 Unread post by venuscheung »

To make it clear, here is the error when I tried to convert MERCATOR to ROMS initial file.
However, I cannot upload my nc file even after zipping it.

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

Error in mercator2roms (line 188)
Fwork(indnan(m))=Fwork(indwet(near));

Error in d_mercator2roms_update (line 225)
temp=mercator2roms('temp',S,Temp,Tlon,Tlat,Rmask3d,Tdepth);

Error in run (line 96)
evalin('caller', [script ';']);

Thank you.
Attachments
grid13_gebco_smooth4.nc
(64 KiB) Downloaded 217 times
d_mercator2roms_update.m
(11.14 KiB) Downloaded 222 times
mercator2roms.m
(6.4 KiB) Downloaded 226 times

venuscheung

Re: calculating ubar and vbar

#7 Unread post by venuscheung »

To update, the error has been solved.

Yet , when I used the new initial file, a new error popped up.
Please have a look if you have any idea to solve it. Thank you.
Attachments
temp.txt
(56.85 KiB) Downloaded 232 times

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: calculating ubar and vbar

#8 Unread post by kate »

Code: Select all

   STEP   Day HH:MM:SS  KINETIC_ENRG   POTEN_ENRG    TOTAL_ENRG    NET_VOLUME
          C => (i,j,k)       Cu            Cv            Cw         Max Speed

    144     1 00:00:00           NaN           NaN           NaN  5.758336E+16
          (163,187,19)  2.195484E-02  1.405542E-02  0.000000E+00  1.002493E+00
Have you tried a shorter timestep? Have you tried smoothing your bathymetry? You need to get ROMS to dump a restart record on the trouble before everything goes to NaN so that you can see what is going on.

venuscheung

Re: calculating ubar and vbar

#9 Unread post by venuscheung »

Thank you for your reply.

I have solved it by using ANA_INITIAL in my header file.

lcbernardo
Posts: 88
Joined: Wed Oct 01, 2014 8:57 pm
Location: International Coastal Research Center

Re: calculating ubar and vbar

#10 Unread post by lcbernardo »

venuscheung wrote: Wed Dec 25, 2019 6:08 am Thank you for your reply.

I have solved it by using ANA_INITIAL in my header file.
I'd like to clarify what you meant as you seemed to be using an initial condition file earlier. So instead of using an initial condition file, you edited ana_initial.h to input your desired initial conditions?

venuscheung

Re: calculating ubar and vbar

#11 Unread post by venuscheung »

lcbernardo wrote: Thu Dec 26, 2019 7:18 am
venuscheung wrote: Wed Dec 25, 2019 6:08 am Thank you for your reply.

I have solved it by using ANA_INITIAL in my header file.
I'd like to clarify what you meant as you seemed to be using an initial condition file earlier. So instead of using an initial condition file, you edited ana_initial.h to input your desired initial conditions?
yes, I put ana_initial in my header file, yet the result show that the model seems starting from a new initial condition that salinity = 35 and sst = 17.
should use other initial condition instead of ana_initial

Post Reply