I am currently trying to output diagnostics of kinetic energy, potential energy, work done by the wind ... within an mpi run and using ana_diag.h.
Looking at /Nonlinear/diag.F (where energetical diagnostics are computed) and /Functionals/ana_diag.h, I got confused about how I should sum the diagnostics variables over the domain.
In /Nonlinear/diag.F for example, diagnostics seemed to be summed over each tiles first:
and then in between tile:DO j=Jstr,Jend
DO k=N(ng),1,-1
DO i=Istr,Iend
u2v2=u(i ,j,k,nstp)*u(i ,j,k,nstp)+ &
...
IF (tile_count.eq.0) THEN
...
CALL mp_reduce (ng, iNLM, Nreduce, buffer, op_handle)
...
In /Functionals/ana_diag.h, there is however:
which seems to indicate that a sum over the whole domain is possible (?)DO k=1,N(ng)
DO j=0,Mm(ng)+1
DO i=1,Lm(ng)+1
umax=MAX(umax,u(i,j,k,nnew(ng)))
...
What the difference between both approaches ?
Is it that one is parallel and the other one not ?
Thanks
Aurelien