Hi WRF support team and community,
I am using WRF V4.7.1 .
Currently, my history output is set to 1-hour intervals (history_interval = 60). However, the default output for 3D wind components provides only instantaneous values at the time of output.
My Goal: I want to output the 1-hour time-averaged values for both U and V (separately) for each output time. For example, the values in the 01:00 history output should represent the average of all time steps during the hour leading up to 01:00.
Current Progress & Questions: I have already started modifying the code, but I am not sure if I am on the right track or if there is a much simpler way.
1. Registry.EM_COMMON: I defined variables for accumulation:
state real u_acc ikj misc 1 - rhdu "u_acc" "ACCUMULATED U" "m s-1"
state real v_acc ikj misc 1 - rhdu "v_acc" "ACCUMULATED V" "m s-1"
2. dyn_em/start_em.F: I added initialization logic to reset these 3D variables to zero at the start.
DO j = jts,min(jte,jde-1)
! Added 3D initialization
DO k = kms, kme
DO i = its, min(ite,ide-1)
grid%u_acc(i,k,j) = 0.
grid%v_acc(i,k,j) = 0.
ENDDO
ENDDO
! (Existing 2D initializations follow...)
3. My Questions:
I am using WRF V4.7.1 .
Currently, my history output is set to 1-hour intervals (history_interval = 60). However, the default output for 3D wind components provides only instantaneous values at the time of output.
My Goal: I want to output the 1-hour time-averaged values for both U and V (separately) for each output time. For example, the values in the 01:00 history output should represent the average of all time steps during the hour leading up to 01:00.
Current Progress & Questions: I have already started modifying the code, but I am not sure if I am on the right track or if there is a much simpler way.
1. Registry.EM_COMMON: I defined variables for accumulation:
state real u_acc ikj misc 1 - rhdu "u_acc" "ACCUMULATED U" "m s-1"
state real v_acc ikj misc 1 - rhdu "v_acc" "ACCUMULATED V" "m s-1"
2. dyn_em/start_em.F: I added initialization logic to reset these 3D variables to zero at the start.
DO j = jts,min(jte,jde-1)
! Added 3D initialization
DO k = kms, kme
DO i = its, min(ite,ide-1)
grid%u_acc(i,k,j) = 0.
grid%v_acc(i,k,j) = 0.
ENDDO
ENDDO
! (Existing 2D initializations follow...)
3. My Questions:
- Is there a simpler way? Can I achieve this 1-hour averaging for 3D U and V simply by changing namelist.inputsettings or using an existing diagnostic framework in V4.7.1?
- If manual modification is required, where is the best place to:
- Accumulate u and v at each time step?
- Perform the averaging calculation and reset the accumulation variables right after each history output?