Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Vertical loop index in subroutine "advect_w" when the polar flag is on

TomoS

New member
Hi. I'd like to ask about the vertical loop index (for tile, kts, and ktf) in WRF(v3.8.1). In the subroutine advect_w located in dyn/module_advect_em.F, I found that the vertical loop index is kts:ktf as shown below.
```
IF ( config_flags%polar .AND. (j == jds+1) ) THEN
DO k=kts,ktf
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) - mrdy*fqy(i,k,jp1)
END DO
END DO
ELSE IF( config_flags%polar .AND. (j == jde) ) THEN
DO k=kts,ktf
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) + mrdy*fqy(i,k,jp0)
END DO
END DO
ELSE ! normal code
```
However, fqy (y-flux) is defined in a range of (kts+1: ktf+1) in the previous part of the subroutine. This means that fqy( : ,kts, : ) may always be NaN. Moreover, in other parts of the subroutine, the range of k is typically kts+1: ktf+1.

My question is: Why is the range of k kts:ktf in this loop? Shouldn't it be (kts+1: ktf+1)? I think updating tendency(i, kts, j-1) here is unnecessary since its value never changes.

Thank you in advance.
 
Last edited:
Hi,
Thank you for pointing this out to us. Are you using a global grid? If so, can you test the correction and let us know the result? Thanks!
 
Top