Changeset 495 for trunk/SRC/Computation
- Timestamp:
- 04/17/14 10:49:43 (10 years ago)
- Location:
- trunk/SRC/Computation
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Computation/bsf.pro
r493 r495 30 30 ; @returns {type=2D xy array} 31 31 ; barotropic stream function in Sv 32 ; 32 ; 33 33 ; @uses 34 34 ; <pro>cm_4mesh</pro> … … 42 42 ; - to be valid, mask must be equal to 0 at the bottom and on each 43 43 ; side of the domain along x direction 44 ; - define the common variables (of cm_4data) 44 ; - define the common variables (of cm_4data) 45 45 ; varname = 'BSF' 46 46 ; varunit = 'Sv' 47 ; vargrid = 'F' 47 ; vargrid = 'F' 48 48 ; 49 49 ; @examples … … 93 93 IF keyword_set(refpoint) THEN BEGIN 94 94 refind = neighbor(refpoint[0], refpoint[1], glamf[firstx:lastx, firsty:lasty], gphif[firstx:lastx, firsty:lasty], SPHERE = key_onearth) 95 IF n_elements(refvalue) EQ 0 THEN refval = - bsf[refind[0]] ELSE refval = refvalue - bsf[refind[0]] 95 IF n_elements(refvalue) EQ 0 THEN refval = - bsf[refind[0]] ELSE refval = refvalue - bsf[refind[0]] 96 96 bsf = temporary(bsf) + refval 97 97 ENDIF -
trunk/SRC/Computation/curl.pro
r371 r495 27 27 ; @keyword MILLION {default=0}{type=scalar: 0 or 1} 28 28 ; Activate to multiply returned array by 1.e6 29 ; 29 ; 30 30 ; @keyword _EXTRA 31 31 ; Used to declare that this routine accepts inherited keywords … … 88 88 ; 89 89 gr = litchamp(uu, /grid) 90 IF gr NE '' THEN BEGIN 90 IF gr NE '' THEN BEGIN 91 91 IF gr NE 'U' THEN return, report('the first parameter is not located on U grid, but on '+ strtrim(gr, 2) +'grid') 92 ENDIF 92 ENDIF 93 93 gr = litchamp(vv, /grid) 94 IF gr NE '' THEN BEGIN 94 IF gr NE '' THEN BEGIN 95 95 IF gr NE 'V' THEN return, report('the second parameter is not located on V grid, but on '+ strtrim(gr, 2) +'grid') 96 ENDIF 96 ENDIF 97 97 u = litchamp(uu) 98 98 v = litchamp(vv) -
trunk/SRC/Computation/div.pro
r378 r495 26 26 ; @keyword MILLION {default=0}{type=scalar: 0 or 1} 27 27 ; Activate to multiply returned array by 1.e6 28 ; 28 ; 29 29 ; @keyword _EXTRA 30 30 ; Used to declare that this routine accepts inherited keywords … … 86 86 ; 87 87 gr = litchamp(uu, /grid) 88 IF gr NE '' THEN BEGIN 88 IF gr NE '' THEN BEGIN 89 89 IF gr NE 'U' THEN return, report('the first parameter is not located on U grid, but on '+ strtrim(gr, 2) +'grid') 90 ENDIF 90 ENDIF 91 91 gr = litchamp(vv, /grid) 92 IF gr NE '' THEN BEGIN 92 IF gr NE '' THEN BEGIN 93 93 IF gr NE 'V' THEN return, report('the second parameter is not located on V grid, but on '+ strtrim(gr, 2) +'grid') 94 ENDIF 94 ENDIF 95 95 u = litchamp(uu) 96 96 v = litchamp(vv) -
trunk/SRC/Computation/e3t_3d.pro
r493 r495 28 28 ; 29 29 ;- 30 function e3t_3d, e1 = e1, e2 = e2, fstx = fstx, lstx = lstx, fsty = fsty, lsty = lsty 30 function e3t_3d, e1 = e1, e2 = e2, fstx = fstx, lstx = lstx, fsty = fsty, lsty = lsty 31 31 ; 32 32 compile_opt idl2, strictarrsubs … … 48 48 ENDCASE 49 49 e3t3d = arr2d[*] # e3t[firstzt:lastzt] 50 e3t3d = reform(e3t3d, nx, ny, nzt, /overwrite) 50 e3t3d = reform(e3t3d, nx, ny, nzt, /overwrite) 51 51 ; 52 52 IF keyword_set(key_partialstep) THEN BEGIN … … 60 60 ok2 = inter(sea, where(bottom2 GE 0 AND bottom2 LT nzt)) 61 61 ; apply e3t_ps to e3t_3D at the bottom of the ocean 62 IF ok[0] NE -1 THEN BEGIN 62 IF ok[0] NE -1 THEN BEGIN 63 63 ; the bottom of the ocean in 3D index is: 64 64 bottom = (lindgen(nx*ny))[ok ] + nx*ny*(temporary(bottom ))[ok ] 65 65 e3t3d[temporary(bottom )] = arr2d[ok ] * (e3t_ps[fstx:lstx, fsty:lsty])[ok ] 66 66 ENDIF 67 IF ok2[0] NE -1 THEN BEGIN 67 IF ok2[0] NE -1 THEN BEGIN 68 68 bottom2 = (lindgen(nx*ny))[ok2] + nx*ny*(temporary(bottom2))[ok2] 69 69 e3t3d[temporary(bottom2)] = arr2d[ok2] * (e3t_ps[fstx:lstx, fsty:lsty])[ok2] 70 70 ENDIF 71 ; 71 ; 72 72 ENDIF 73 73 ; -
trunk/SRC/Computation/e3u_3d.pro
r493 r495 34 34 @cm_4mesh 35 35 ; 36 IF keyword_set(key_partialstep) THEN lastx = ( lastxu + 1 ) < ( jpi - 1 ) ELSE lastx = lastxu 36 IF keyword_set(key_partialstep) THEN lastx = ( lastxu + 1 ) < ( jpi - 1 ) ELSE lastx = lastxu 37 37 nx = lastx - firstxu + 1 38 38 ; get e3t 3D … … 41 41 IF keyword_set(key_partialstep) THEN BEGIN 42 42 ; 43 ; Rebuild the U-point 3D partial steps array from T-point 3D e3t_3D array 43 ; Rebuild the U-point 3D partial steps array from T-point 3D e3t_3D array 44 44 ; 45 45 tmp = shift(e3t3d, -1, 0, 0) … … 59 59 ; 60 60 IF nx EQ nxu + 1 THEN e3u3d = (temporary(e3u3d))[0:nx-2, *, *] 61 ; 61 ; 62 62 ENDIF ELSE e3u3d = temporary(e3t3d) 63 63 ; -
trunk/SRC/Computation/e3v_3d.pro
r493 r495 40 40 ; 41 41 IF keyword_set(key_partialstep) THEN BEGIN 42 ; Rebuild the V-point 3D partial steps array from T-point 3D e3t_3D array 42 ; Rebuild the V-point 3D partial steps array from T-point 3D e3t_3D array 43 43 tmp = shift(e3t3d, 0, -1, 0) 44 44 IF ny EQ nyv THEN tmp[*, ny-1, *] = e3t3d[*, ny-1, *] … … 48 48 ; 49 49 IF ny EQ nyv + 1 THEN e3v3d = (temporary(e3v3d))[*, 0:ny-2, *] 50 ; 50 ; 51 51 ENDIF ELSE e3v3d = temporary(e3t3d) 52 52 ; … … 63 63 return, e3v3d 64 64 END 65 -
trunk/SRC/Computation/e3w_3d.pro
r493 r495 42 42 ENDCASE 43 43 e3w_3d = arr2d[*] # e3w[firstzw:lastzw] 44 e3w_3d = reform(e3w_3d, nxt, nyt, nzw, /overwrite) 44 e3w_3d = reform(e3w_3d, nxt, nyt, nzw, /overwrite) 45 45 ; 46 46 IF keyword_set(key_partialstep) THEN BEGIN … … 64 64 ENDIF 65 65 ENDIF 66 ; 66 ; 67 67 return, e3w_3d 68 68 END 69 -
trunk/SRC/Computation/grad.pro
r371 r495 9 9 ; @param FIELD 10 10 ; The field for which we want to compute the gradient. A 2D (xy), 11 ; 3D (xyz or yt) or 4D (xyzt) array or a structure readable by 11 ; 3D (xyz or yt) or 4D (xyzt) array or a structure readable by 12 12 ; <pro>litchamp</pro> and containing a 2D (xy), 3D (xyz or yt) or 4D (xyzt) array. 13 13 ; Note that the dimension of the array must suit the domain dimension. … … 18 18 ; @keyword MILLION {default=0}{type=scalar: 0 or 1} 19 19 ; Activate to multiply returned array by 1.e6 20 ; 20 ; 21 21 ; @keyword _EXTRA 22 22 ; Used to declare that this routine accepts inherited keywords -
trunk/SRC/Computation/msf.pro
r493 r495 35 35 ; @returns {type=2D yz array} 36 36 ; meridional stream function in Sv 37 ; 37 ; 38 38 ; @uses 39 39 ; <pro>cm_4mesh</pro> … … 47 47 ; - to be valid, mask must be equal to 0 at the bottom and on each 48 48 ; side of the domain along x direction 49 ; - define the common variables (of cm_4data) 49 ; - define the common variables (of cm_4data) 50 50 ; varname = 'MSF' 51 51 ; varunit = 'Sv' … … 100 100 ; 101 101 ; current -> transport 102 IF NOT keyword_set(transport) THEN vn = temporary(vn) * e3v_3d(/e1) 102 IF NOT keyword_set(transport) THEN vn = temporary(vn) * e3v_3d(/e1) 103 103 vtr = temporary(vn) * msk 104 104 ; … … 110 110 maskout = reverse(temporary(maskout), 2) 111 111 ENDIF 112 ; 113 ; defau t computation:112 ; 113 ; default computation: 114 114 ; msf = 1.e-6 * total(total(temporary(vtr), 1), 2, /cumulative) 115 115 ; but we force the computation from bottom to up. … … 132 132 133 133 IF (jpiglo EQ 182 AND jpjglo EQ 149) OR (jpiglo EQ 722 AND jpjglo EQ 511) $ 134 OR (jpiglo EQ 1442 AND jpjglo EQ 1021) OR (jpiglo EQ 4322 AND jpjglo EQ 3059) THEN BEGIN 134 OR (jpiglo EQ 1442 AND jpjglo EQ 1021) OR (jpiglo EQ 4322 AND jpjglo EQ 3059) THEN BEGIN 135 135 ; find the i index with the northest latitude 136 136 ind = (where(gphit[firstx:lastx, firsty:lasty] EQ max(gphit[firstx:lastx, firsty:lasty])))[0] mod nx
Note: See TracChangeset
for help on using the changeset viewer.