wilkin wrote: ↑Tue Jun 09, 2020 4:20 pm
Where ROMS expresses anything in
kinematic units (per unit mass), such as converting stress to friction velocity (tau/rho0), or heat flux (W/m2) to degrees meters/s (Hf/(Cp*rho0) in the surface temperature boundary condition, it always uses the constant parameter rho0. Likewise, to calculate Brunt-Väisälä frequency the factor g/rho0 is used.
If you are trying to add a "horizontal acceleration", are you aware of the existing BODYFORCE option?
Thanks for your reply, I checked BODYFORCE by your guidence, I found the code in rhs3d.F about BODYFORCE:
Code: Select all
# ifdef BODYFORCE
DO j=JstrV-1,Jend
DO i=IstrU-1,Iend
wrk(i,j)=0.0_r8
END DO
END DO
DO k=N(ng),levsfrc(ng),-1
DO j=JstrV-1,Jend
DO i=IstrU-1,Iend
wrk(i,j)=wrk(i,j)+Hz(i,j,k)
END DO
END DO
END DO
DO j=Jstr,Jend
DO i=IstrU,Iend
cff=0.25_r8*(pm(i-1,j)+pm(i,j))*(pn(i-1,j)+pn(i,j))
cff1=1.0_r8/(cff*(wrk(i-1,j)+wrk(i,j)))
Uwrk(i,j)=sustr(i,j)*cff1
END DO
END DO
DO k=levsfrc(ng),N(ng)
DO j=Jstr,Jend
DO i=IstrU,Iend
cff=Uwrk(i,j)*(Hz(i ,j,k)+Hz(i-1,j,k))
ru(i,j,k,nrhs)=ru(i,j,k,nrhs)+cff
It seems that the forcing term
ru on the right hand side of the equation euqals
τ*A*Hz/Wrk,
which has a force (N) dimension (Pa*m2*m/m).
As for me, BODYFORCE requirs surface stress and transforms it to body force,
BUT I input acceleration a(m/s2) (because I just have horizontal acceleration data,
I let sustr=au and svstr=ay mandatorily ), not stress in smflux.F, and I modify the code in order to satisfy the dimensional homogeneity:
NOTICE the second line from the bottom, ru= rho0*acceleration*A*Wrk*Hz/Wrk
Code: Select all
# ifdef BODYFORCE
DO j=JstrV-1,Jend
DO i=IstrU-1,Iend
wrk(i,j)=0.0_r8
END DO
END DO
DO k=N(ng),levsfrc(ng),-1
DO j=JstrV-1,Jend
DO i=IstrU-1,Iend
wrk(i,j)=wrk(i,j)+Hz(i,j,k)
END DO
END DO
END DO
DO j=Jstr,Jend
DO i=IstrU,Iend
cff=0.25_r8*(pm(i-1,j)+pm(i,j))*(pn(i-1,j)+pn(i,j))
cff1=1.0_r8/(cff*(wrk(i-1,j)+wrk(i,j)))
Uwrk(i,j)=sustr(i,j)*cff1[/b]
END DO
END DO
DO k=levsfrc(ng),N(ng)
DO j=Jstr,Jend
DO i=IstrU,Iend
cff=Uwrk(i,j)*(Hz(i ,j,k)+Hz(i-1,j,k))*rho0*(wrk(i-1,j)+wrk(i,j))*0.5_r8 !!!!!!!!!!!!NOTICE THIS MODIFICATION
ru(i,j,k,nrhs)=ru(i,j,k,nrhs)+cff
But,
ROMS showed rho speed trouble. I wonder that if there is anything I misunderstood.
Thanks
Hoty