How does it realize the continuity equation in ROMS?
How does it realize the continuity equation in ROMS?
Dear everyone:
I am calculating the integrated continuity equation and total transport flux with the ROMS output. When I calculate the integrated continuity equation, it is hardly closed. But when I calculate the net transport flux and the time variation of the volume in one grid, they are balanced well. Of course, I did them with the transformed equation in s-coordinate. Is this because that the grid is not exactly square to make the directly calculated continuity equation not closed?
Thank you for your time.
Yours sincerely,
Tao
I am calculating the integrated continuity equation and total transport flux with the ROMS output. When I calculate the integrated continuity equation, it is hardly closed. But when I calculate the net transport flux and the time variation of the volume in one grid, they are balanced well. Of course, I did them with the transformed equation in s-coordinate. Is this because that the grid is not exactly square to make the directly calculated continuity equation not closed?
Thank you for your time.
Yours sincerely,
Tao
Re: How does it realize the continuity equation in ROMS?
And where can I acquire the magnitude of "m and n" in the transformation of equations in s-coordinate?
-
- Posts: 6
- Joined: Thu Mar 01, 2012 2:28 pm
- Location: California Department of Water Resources
Re: How does it realize the continuity equation in ROMS?
I am also doing the same calculation. I believe you can output 'pm' and 'pn' from average or history nc files. Did you check mass conservation for one grid cell?
Re: How does it realize the continuity equation in ROMS?
I calculated it both in one grid and in one section. As we know, pm and pn are related to the density locations. But in C grid, u and v points locations are different from the locations of density. How can we know the pm and pn related to the u and v locations? That is to say, in the continuity equation in s-coordinate, "u*Hz/n", what should be the n is? pn(i,j) or pn(i+1,j) or (pn(i,j)+pn(i+1,j))/2, or other values? Thank you.
Re: How does it realize the continuity equation in ROMS?
Our grid numbering is such that u(i,j) is between rho(i,j) and rho(i-1,j). If you look through the code, you will see that pm at u points is always computed as an average of pm(i,j) and pm(i-1,j).
ETA: that said, that assumes you read the roms variables as ROMS does. If you read them as Python or Matlab does, you need to average with pm(i,j) and pm(i+1,j).
ETA: that said, that assumes you read the roms variables as ROMS does. If you read them as Python or Matlab does, you need to average with pm(i,j) and pm(i+1,j).
Re: How does it realize the continuity equation in ROMS?
Thank you very much. Which file is the code in? I am a beginner. I looked for them for a long time, but I did not find them.
Re: How does it realize the continuity equation in ROMS?
And I have seen that the calculation of total depth and vertically integrated mass flux in step2d_LF_AM3.h. The code is like this:
DO j=-1+J_RANGE+1
DO i=-2+I_RANGE+1
cff=0.5_r8*om_v(i,j)
cff1=cff*(Drhs(i,j)+Drhs(i,j-1))
DVom(i,j)=vbar(i,j,krhs)*cff1
# ifdef NEARSHORE_MELLOR
DVSom(i,j)=vbar_stokes(i,j)*cff1
DVom(i,j)=DVom(i,j)+DVSom(i,j)
# endif
END DO
END DO
But how does it calculate om_v, I did not find it. Thank you for your time.
DO j=-1+J_RANGE+1
DO i=-2+I_RANGE+1
cff=0.5_r8*om_v(i,j)
cff1=cff*(Drhs(i,j)+Drhs(i,j-1))
DVom(i,j)=vbar(i,j,krhs)*cff1
# ifdef NEARSHORE_MELLOR
DVSom(i,j)=vbar_stokes(i,j)*cff1
DVom(i,j)=DVom(i,j)+DVSom(i,j)
# endif
END DO
END DO
But how does it calculate om_v, I did not find it. Thank you for your time.
Re: How does it realize the continuity equation in ROMS?
I find things like this by using grep from the top of the ROMS source tree:
and many other lines...
Maybe it would be better to refine it:
Code: Select all
grep om_v */*/*
ROMS/Utility/metrics.F: real(r8), intent(out) :: om_v(LBi:,LBj:)
Maybe it would be better to refine it:
Code: Select all
kate@ThinkPad-W520:~/roms/feedme$ grep om_v */*/* | grep intent\(out\)
ROMS/Utility/metrics.F: real(r8), intent(out) :: om_v(LBi:,LBj:)
ROMS/Utility/metrics.F: real(r8), intent(out) :: pnom_v(LBi:,LBj:)
ROMS/Utility/metrics.F: real(r8), intent(out) :: om_v(LBi:UBi,LBj:UBj)
ROMS/Utility/metrics.F: real(r8), intent(out) :: pnom_v(LBi:UBi,LBj:UBj)