DIAGNOSTICS_TS in step3d_t

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
jliang
Posts: 7
Joined: Fri Feb 21, 2020 5:01 pm
Location: Louisiana State University

DIAGNOSTICS_TS in step3d_t

#1 Unread post by jliang »

I must be missing something here. In the calculation of the rate of change term, the two lines (#1661-1662) that were commented (DiaTwrk(i,j,k,itrc,iTrate)=t(i,j,k,nnew,itrc)-t(i,j,k,nstp,itrc)) seem to me the straightforward calculation, while I don't understand the two lines (#1659-1660) that are used (DiaTwrk(i,j,k,itrc,iTrate)=t(i,j,k,nnew,itrc)-DiaTwrk(i,j,k,itrc,iTrate)).

Could someone help clarify when they have a chance? Thanks.

In step3d_t.F: (I leave the line numbers for reference)

1653 !
1654 ! Compute time-rate-of-change diagnostic term.
1655 !
1656 DO k=1,N(ng)
1657 DO j=JstrR,JendR
1658 DO i=IstrR,IendR
1659 DiaTwrk(i,j,k,itrc,iTrate)=t(i,j,k,nnew,itrc)- &
1660 & DiaTwrk(i,j,k,itrc,iTrate)
1661 !! DiaTwrk(i,j,k,itrc,iTrate)=t(i,j,k,nnew,itrc)- &
1662 !! & t(i,j,k,nstp,itrc)
1663 END DO
1664 END DO
1665 END DO

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: DIAGNOSTICS_TS in step3d_t

#2 Unread post by jcwarner »

i think it has to deal with the time stepping and the Hz grid cell thickness.

in prestep3d we have
cff1=Hz(i,j,k)*t(i,j,k,nstp,itrc)
...
# ifdef DIAGNOSTICS_TS
DiaTwrk(i,j,k,itrc,iTrate)=cff1

so the iTrate is t(nstp)*Hz ~= told*Hzold


in step3dt we do 2 things:

DO idiag=1,NDT
DiaTwrk(i,j,k,itrc,idiag)=DiaTwrk(i,j,k,itrc,idiag)* &
& oHz(i,j,k)
END DO
%those lines above convert the DiaTwrk to be just Tracer units

then we do
DiaTwrk(i,j,k,itrc,iTrate)=t(i,j,k,nnew,itrc)- &
& DiaTwrk(i,j,k,itrc,iTrate)
which is basically
iTrate_new = tnew -told*Hzold/Hznew

jliang
Posts: 7
Joined: Fri Feb 21, 2020 5:01 pm
Location: Louisiana State University

Re: DIAGNOSTICS_TS in step3d_t

#3 Unread post by jliang »

thanks a lot!!
jcwarner wrote: Tue Jun 13, 2023 4:13 pm i think it has to deal with the time stepping and the Hz grid cell thickness.

in prestep3d we have
cff1=Hz(i,j,k)*t(i,j,k,nstp,itrc)
...
# ifdef DIAGNOSTICS_TS
DiaTwrk(i,j,k,itrc,iTrate)=cff1

so the iTrate is t(nstp)*Hz ~= told*Hzold


in step3dt we do 2 things:

DO idiag=1,NDT
DiaTwrk(i,j,k,itrc,idiag)=DiaTwrk(i,j,k,itrc,idiag)* &
& oHz(i,j,k)
END DO
%those lines above convert the DiaTwrk to be just Tracer units

then we do
DiaTwrk(i,j,k,itrc,iTrate)=t(i,j,k,nnew,itrc)- &
& DiaTwrk(i,j,k,itrc,iTrate)
which is basically
iTrate_new = tnew -told*Hzold/Hznew

User avatar
dylanrs617
Posts: 3
Joined: Tue Oct 27, 2020 3:16 pm
Location: Los Alamos National Laboratory
Contact:

Re: DIAGNOSTICS_TS in step3d_t

#4 Unread post by dylanrs617 »

A little late, but I believe you're correct. Parker MacCready posted a thread about this about a decade ago, it gets at this issue as well. Took me too long to figure out myself until I discovered that thread, posting this to help aggregate.
pmaccc wrote: Thu May 02, 2013 6:22 pm I figured out the problem with my salt_rate test. salt_rate is NOT <ds/dt>, where <> denotes averaging over the time period for which diagnostics are collected. Instead (I think) salt_rate = <d(s*v)/dt>/<v> where v is the (changing) volume of a given grid cell. When I use this interpretation to check salt_rate using values from the avg and his fields it works perfectly.

Post Reply