Potential Vorticity

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
ocecept
Posts: 42
Joined: Tue Jan 08, 2008 3:57 pm
Location: Universidade Federal do Ceará
Contact:

Potential Vorticity

#1 Unread post by ocecept »

Hi guys;

Anyone have used the new logic to get the Potential Vorticity on the average files (see Herman post
https://www.myroms.org/projects/src/ticket/421).

I updated the ROMS code yesterday, my *.in and varinfo.dat files, but the my 3D potential vorticity results are all zeros. The 2D field looks ok and 2D and 3D relative vorticity also work fine. I spent some time trying to debug why I'm not getting any results for the 3D PVORT, but couldn't find the reason.

Does anyone have already successful used it?

Cheers;

Carlos Teixeira

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

Re: Potential Vorticity

#2 Unread post by arango »

Hmm, I ran my North Atlantic application for 10 years last night and I am getting nonzero potential vorticity. I can see the sub-tropical gyres and Gulf Stream.

ocecept
Posts: 42
Joined: Tue Jan 08, 2008 3:57 pm
Location: Universidade Federal do Ceará
Contact:

Re: Potential Vorticity

#3 Unread post by ocecept »

Thanks Herman;


I will do some tests with different applications, to see where is the problem.

Cheers;

Carlos

ocecept
Posts: 42
Joined: Tue Jan 08, 2008 3:57 pm
Location: Universidade Federal do Ceará
Contact:

Re: Potential Vorticity

#4 Unread post by ocecept »

Herman;

I think I have found the problem, but not the solution: :roll:

If I have DIAGNOSTICS_UV and DIAGNOSTICS_TS (and AVERAGES) defined it works and I get nonzero for the 3D field of the potential vorticity.

If these options are NOT defined (only AVERAGES is defined) I don't get the 3D potential vorticity.

Do you have DIAGNOSTICS_UV and DIAGNOSTICS_TS in your North Atlantic application?

I had a look into the code to find the problem, but no success.

Cheers;

Carlos

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

Re: Potential Vorticity

#5 Unread post by arango »

I ran with and without DIAGNOSTICS_UV and DIAGNOSTICS_TS and get the same results: a nonzero 2D/3D potential and relative vorticity.

Have you made changes to set_avg.F or set_diags.F? The vorticity fields are all computed at the same time in routine vorticity.F. Notice that the 3D relative and potential vorticity are computed in the same block and have couple of terms in common. I don't see how potential vorticity is all zero and relative vorticity is not.

ocecept
Posts: 42
Joined: Tue Jan 08, 2008 3:57 pm
Location: Universidade Federal do Ceará
Contact:

Re: Potential Vorticity

#6 Unread post by ocecept »

Herman;

I haven't changed set_avg.F or set_diags.F. I don't know what is happening :roll: . I got the results that I need using DIAGNOSTICS. Lets leave it and see if someone else have the same kind of problem in the future. Thanks a lot.

dcherian
Posts: 14
Joined: Mon Oct 17, 2011 1:41 am
Location: WHOI

Re: Potential Vorticity

#7 Unread post by dcherian »

I just ran into this problem. The issue is that potential density, pden=0 unless you have DIAGNOSTICS or LMD mixing defined.

vorticity.F uses pden to calculate grad(rho) for PV. However, pden is defined in Nonlinear/rho_eos.F as

Code: Select all

#   if defined LMD_SKPP || defined LMD_BKPP || defined DIAGNOSTICS
      real(r8), intent(out) :: pden(LBi:,LBj:,:)
#   endif
and then later on...

Code: Select all

#  if defined LMD_SKPP || defined LMD_BKPP || defined DIAGNOSTICS
            pden(i,j,k)=(den1(i,k)-1000.0_r8)
#   ifdef MASKING
            pden(i,j,k)=pden(i,j,k)*rmask(i,j)
#   endif
#  endif
So, pden=0 unless you have one of those 3 options (LMD_SKPP, LMD_BKPP, DIAGNOSTICS) defined. Adding " || defined AVERAGES" after every occurence of "|| defined DIAGNOSTICS" in rho_eos.F fixes it.

Deepak

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

Re: Potential Vorticity

#8 Unread post by arango »

Yes, good catch. Every time that I computed potential vorticity I have one of those CPP activated. I correct this and now the potential density, pden, is always computed. I removed CPP directive. We will use this field in the future for other algorithms.

Thank you for finding the cause of this problem. Please update...

dcherian
Posts: 14
Joined: Mon Oct 17, 2011 1:41 am
Location: WHOI

Re: Potential Vorticity

#9 Unread post by dcherian »

Also, the horizontal derivatives for the relative vorticity are calculated as

Code: Select all

dUde(i,j)=om_u(i,j  )*u(i,j  ,k,nout)-                    &                                                                                                                                                         
     &                  om_u(i,j-1)*u(i,j-1,k,nout)
dVdx(i,j)=on_v(i  ,j)*v(i  ,j,k,nout)-                    &                                                                                                                                                         
     &                  on_v(i-1,j)*v(i-1,j,k,nout)
cff=pm(i,j)*pn(i,j)
rvor(i,j,k)=cff*(dVdx(i,j)-dUde(i,j))
Isn't this only valid for a flat bottom? Shouldn't the chain rule (https://www.myroms.org/wiki/index.php/T ... sformation) be used when taking horizontal derivatives on a stretched grid?

Deepak

Post Reply