[MITgcm-devel] vectorization of layers
Martin Losch
Martin.Losch at awi.de
Fri Jan 4 10:58:01 EST 2013
Hi there,
I am not sure how much effort one still should invest into vectorizing the code, since our vector machine will only run for another year or so, but can you think of a good way of rewrite layers_fluxcalc.F so that it vectorizes? Currently these lines (and the corresponding for TatV):
ELSE IF (TatU .GE. layers_bounds(kgu(i,j),iLa)) THEN
C have to hunt for the right bin by getting hotter
DO WHILE (TatU .GE. layers_bounds(kgu(i,j)+1,iLa))
kgu(i,j) = kgu(i,j) + 1
ENDDO
C now layers_bounds(kgu(i,j)+1,iLa) < TatU <= layers_bounds(kgu(i,j)+1,iLa)
ELSE IF (TatU .LT. layers_bounds(kgu(i,j)+1,iLa)) THEN
C have to hunt for the right bin by getting colder
DO WHILE (TatU .LT. layers_bounds(kgu(i,j),iLa))
kgu(i,j) = kgu(i,j) - 1
ENDDO
C now layers_bounds(kgu(i,j)+1,iLa) <= TatU < layers_bounds(kgu(i,j)+1,iLa)
ELSE
inhibit vectorization (because the while-loops don't vectorize), and thus making it impossible to use the layers-pkg on a vector computer (This routines has a vector operation ratio of 5% and takes 86% of the computer time). Currently I have no clue what to do here, but I don't quite understand, what's going on in thie package/routine.
Martin
More information about the MITgcm-devel
mailing list