Hello,
For a certain diagnostic, I have introduced to the registry a variable named "diag8". At every model time step, now I need to calculate the average of diag8 within the whole domain. For this reason I naively introduced the following piece of code at the beginning of "solve_em.F". Obviously this is not the correct way to do it since I am getting "meanval" equal to NaN :-|.
Could I please ask you for any tips on how to calculate the domain average of a certain variable?
Thank you in advance,
Manos
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!$OMP PiRALLEL DO &
!$OMP PRIVATE ( ij ) REDUCTION (+:meanval)
REDUCTION
DO ij = 1 , grid%num_tiles
DO i=ims,ime
DO k=kms,kme
DO j=jms,jme
meanval = meanval + abs(grid%diag8(i,k,j))/(ide*jde*kte)
END DO
END DO
END DO
END DO
!$OMP END PARALLEL DO
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
For a certain diagnostic, I have introduced to the registry a variable named "diag8". At every model time step, now I need to calculate the average of diag8 within the whole domain. For this reason I naively introduced the following piece of code at the beginning of "solve_em.F". Obviously this is not the correct way to do it since I am getting "meanval" equal to NaN :-|.
Could I please ask you for any tips on how to calculate the domain average of a certain variable?
Thank you in advance,
Manos
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!$OMP PiRALLEL DO &
!$OMP PRIVATE ( ij ) REDUCTION (+:meanval)
REDUCTION
DO ij = 1 , grid%num_tiles
DO i=ims,ime
DO k=kms,kme
DO j=jms,jme
meanval = meanval + abs(grid%diag8(i,k,j))/(ide*jde*kte)
END DO
END DO
END DO
END DO
!$OMP END PARALLEL DO
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!