;+ ; ; @file_comments ; compute the 3D e3u from e3t and e3t_ps ; ; @categories ; diagnostics ; ; @keyword e1 {default=0}{type=scalar: 0 or 1} ; activate to compute e1u * e3u instead of e3u ; note that of both keywords e1 and e2 are acticated we compute e1u * e2u * e3u instead of e3u ; ; @keyword e2 {default=0}{type=scalar: 0 or 1} ; activate to compute e2u * e3u instead of e3u ; note that of both keywords e1 and e2 are acticated we compute e1u * e2u * e3u instead of e3u ; ; @returns ; e3u 3D array ; ; @uses ; cm_4mesh.pro ; ; @history ; Sebastien Masson, Jan 2011 ; ; @version ; $Id$ ; ;- function e3u_3d, e1 = e1, e2 = e2 ; compile_opt idl2, strictarrsubs ; @cm_4mesh ; IF keyword_set(key_partialstep) THEN lastx = ( lastxu + 1 ) < ( jpi - 1 ) ELSE lastx = lastxu nx = lastx - firstxu + 1 ; get e3t 3D e3t3d = e3t_3d(fstx = firstxu, lstx = lastx, fsty = firstyu, lsty = lastyu) ; IF keyword_set(key_partialstep) THEN BEGIN ; ; Rebuild the U-point 3D partial steps array from T-point 3D e3t_3D array ; tmp = shift(e3t3d, -1, 0, 0) IF nx EQ nxu THEN BEGIN IF keyword_set(key_periodic) THEN BEGIN IF nx NE jpi THEN BEGIN ; get the values from i = 0 tmp[nx-1, *, *] = e3t_3d(fstx = 0, lstx = 0, fsty = firstyu, lsty = lastyu) ENDIF ENDIF ELSE BEGIN tmp[nx-1, *, *] = e3t3d[nx-1, *, *] ENDELSE ENDIF e3u3d = [ [ (temporary(e3t3d))[*] ], [ (temporary(tmp))[*] ] ] e3u3d = min(temporary(e3u3d), dimension = 2) e3u3d = reform(e3u3d, nx, nyu, nzt, /overwrite) ; IF nx EQ nxu + 1 THEN e3u3d = (temporary(e3u3d))[0:nx-2, *, *] ; ENDIF ELSE e3u3d = temporary(e3t3d) ; CASE 1 OF keyword_set(e1) AND keyword_set(e2):arr2d = e1u[firstxu:lastxu, firstyu:lastyu] $ * e2u[firstxu:lastxu, firstyu:lastyu] keyword_set(e1) :arr2d = e1u[firstxu:lastxu, firstyu:lastyu] keyword_set(e2):arr2d = e2u[firstxu:lastxu, firstyu:lastyu] ELSE: ENDCASE ; IF n_elements(arr2d) NE 0 THEN e3u3d = temporary(e3u3d) * ( arr2d[*] # replicate(1., nzt) ) ; return, e3u3d END