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

Adding SFS stresses to time series output (tslist)

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

elbigkonan

New member
Dear all,
I want to output the 6 SFS stresses in my time series (tslist) for WRF-LES runs I am attempting to do. The biggest issue (I guess) is to find out how each of these stresses are “stored” and so that I can operate with them in “WRF_timeseries.F” in order to output them, just as the time series of the u, v, w profiles are output. I guess they are somehow saved in the “grid” structure, just like the velocity components (grid%u, grid%v and grid%w) but I have not managed to find this out.

If you know/have ideas on how to output these in the timeseries option, I would love to hear those. Also if you know of some code that can do it or a modified “WRF_timeseries.F” that can, that will be very valuable to me.
Cheers
 
Hi,
It looks like these SFS tendencies are being computed in module_first_rk_step_part2.F under the subroutines vertical_diffusion_2 and horizontal_diffusion_2. The tendencies should be stored in the variables ru_tendf, rv_tendf, etc. Note that other tendencies do get added to these variables later on in the timestep, so you will want to save them to a separate variable right before and after the SFS diffusion subroutines are called.

Here’s a sample code of how one might do this for the x-component wind variable, for example (inside module_first_rk_step_part2.F):
Code:
  !$OMP PARALLEL DO   &
  !$OMP PRIVATE ( ij ii kk jj )
   DO ij = 1 , grid%num_tiles
      DO jj = grid%j_start(ij), min(grid%j_end(ij),jde-1)
      DO kk = k_start, min(k_end,kde-1)
      DO ii = grid%i_start(ij), grid%i_end(ij)
         grid%ru_tendf_diff2(ii,kk,jj)=ru_tendf(ii,kk,jj)
      END DO
      END DO
      END DO
   END DO
 !$OMP END PARALLEL DO

In the above example, grid%ru_tendf_diff2 is a new variable that will need to be added to the Registry. Note: You will want to put that loop BEFORE the SFS tendencies are computing, and then after calling the following code:
Code:
 !$OMP PARALLEL DO   &
 !$OMP PRIVATE ( ij ii kk jj)
  DO ij = 1 , grid%num_tiles

     DO jj = grid%j_start(ij), min(grid%j_end(ij),jde-1)
     DO kk = k_start, min(k_end,kde-1)
     DO ii = grid%i_start(ij), grid%i_end(ij)
         grid%ru_tendf_diff2(ii,kk,jj)=ru_tendf(ii,kk,jj)-grid%ru_tendf_diff2(ii,kk,jj)
     END DO
     END DO
     END DO
   ENDDO 
 !$OMP END PARALLEL DO

We aren't aware of anyone who has done this with timeseries (though some web searching may turn up some results), and unfortunately the above is about the extent of what we are able to offer. If that is not helpful, hopefully someone else will see this post and be able to help. Good luck!
 
Hi,
Thanks a lot for the quick answer1
I am not completely sure that these tendencies are in fact the SFS stresses (Mij) I am referring to. The 6 SFS stresses (Mij) are by default output in the wrfout files if one chooses the option sfs_opt=1 or 2, i.e., when one chooses one of the NBA SFS models. If sfs_opt is not used then one has to choose m_opt=1 to add the Mij output to the wrfout files. Since it seems pretty straightforward to add the six of them to the wrfout file, I thought there should be an easy way to output them in the timeseries.
So, just to confirm, are these tendencies the 6 Mij stress terms that one can also output in the wrfout file?
Thanks in advance!
 
Hi,
I guess those aren't the same ones you are interested in. I apologize that I'm not very familiar with the sfs options, as this part of the code is written by another group. From what I can tell, you are likely interested in m11, m22, m33, m12, m13, m23. These are calculated in dyn_em/module_sfs_nba.F in their corresponding subroutines (e.g., subroutine calc_mii calculates m11, calc_m12 calculates m12, etc.). At this point, they are just local variables with intent(out). These subroutines are then called in dyn_em/module_sfs_driver.F, inside subroutine sfs_driver, but at this point they are renamed from (e.g.) m11 to (e.g.) nba_mij(ims,kms,jms,P_m11). They don't seem to follow the same grid% structure as the other variables output in the time series, so I'm not sure this is a straight-forward task to do, unfortunately. It may be easier to plot the variables in your own scripted time-series after you run and output these variables.
 
Top