[445] | 1 | ;+ |
---|
| 2 | ; |
---|
| 3 | ; @file_comments |
---|
| 4 | ; compute the 3D e3v from e3t and e3t_ps |
---|
| 5 | ; |
---|
| 6 | ; @categories |
---|
| 7 | ; diagnostics |
---|
| 8 | ; |
---|
| 9 | ; @keyword e1 {default=0}{type=scalar: 0 or 1} |
---|
| 10 | ; activate to compute e1v * e3v instead of e3v |
---|
[493] | 11 | ; note that of both keywords e1 and e2 are activated we compute e1v * e2v * e3v instead of e3v |
---|
[445] | 12 | ; |
---|
| 13 | ; @keyword e2 {default=0}{type=scalar: 0 or 1} |
---|
| 14 | ; activate to compute e2v * e3v instead of e3v |
---|
[493] | 15 | ; note that of both keywords e1 and e2 are activated we compute e1v * e2v * e3v instead of e3v |
---|
[445] | 16 | ; |
---|
| 17 | ; @returns |
---|
| 18 | ; e3v 3D array |
---|
| 19 | ; |
---|
| 20 | ; @uses |
---|
| 21 | ; cm_4mesh.pro |
---|
| 22 | ; |
---|
| 23 | ; @history |
---|
| 24 | ; Sebastien Masson, Jan 2011 |
---|
| 25 | ; |
---|
| 26 | ; @version |
---|
| 27 | ; $Id$ |
---|
| 28 | ; |
---|
| 29 | ;- |
---|
| 30 | function e3v_3d, e1 = e1, e2 = e2 |
---|
| 31 | ; |
---|
| 32 | compile_opt idl2, strictarrsubs |
---|
| 33 | ; |
---|
| 34 | @cm_4mesh |
---|
| 35 | ; |
---|
| 36 | IF keyword_set(key_partialstep) THEN lasty = ( lastyv + 1 ) < ( jpj - 1 ) ELSE lasty = lastyv |
---|
| 37 | ny = lasty - firstyv + 1 |
---|
| 38 | ; get e3t 3D |
---|
| 39 | e3t3d = e3t_3d(fstx = firstxv, lstx = lastxv, fsty = firstyv, lsty = lasty) |
---|
| 40 | ; |
---|
| 41 | IF keyword_set(key_partialstep) THEN BEGIN |
---|
[495] | 42 | ; Rebuild the V-point 3D partial steps array from T-point 3D e3t_3D array |
---|
[445] | 43 | tmp = shift(e3t3d, 0, -1, 0) |
---|
| 44 | IF ny EQ nyv THEN tmp[*, ny-1, *] = e3t3d[*, ny-1, *] |
---|
| 45 | e3v3d = [ [ (temporary(e3t3d))[*] ], [ (temporary(tmp))[*] ] ] |
---|
| 46 | e3v3d = min(temporary(e3v3d), dimension = 2) |
---|
| 47 | e3v3d = reform(e3v3d, nxv, ny, nzt, /overwrite) |
---|
| 48 | ; |
---|
| 49 | IF ny EQ nyv + 1 THEN e3v3d = (temporary(e3v3d))[*, 0:ny-2, *] |
---|
[495] | 50 | ; |
---|
[445] | 51 | ENDIF ELSE e3v3d = temporary(e3t3d) |
---|
| 52 | ; |
---|
| 53 | CASE 1 OF |
---|
| 54 | keyword_set(e1) AND keyword_set(e2):arr2d = e1v[firstxv:lastxv, firstyv:lastyv] $ |
---|
| 55 | * e2v[firstxv:lastxv, firstyv:lastyv] |
---|
| 56 | keyword_set(e1) :arr2d = e1v[firstxv:lastxv, firstyv:lastyv] |
---|
| 57 | keyword_set(e2):arr2d = e2v[firstxv:lastxv, firstyv:lastyv] |
---|
| 58 | ELSE: |
---|
| 59 | ENDCASE |
---|
| 60 | ; |
---|
[454] | 61 | IF n_elements(arr2d) NE 0 THEN e3v3d = temporary(e3v3d) * ( arr2d[*] # replicate(1.d, nzt) ) |
---|
[445] | 62 | ; |
---|
| 63 | return, e3v3d |
---|
| 64 | END |
---|