Changeset 231 for trunk/SRC/ToBeReviewed/GRILLE/f2v.pro
- Timestamp:
- 03/19/07 18:15:51 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/GRILLE/f2v.pro
r163 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; 6 3 ; @file_comments 7 ; Allows to pass a field referring to the grid F on the grid V, 8 ; thanks to the average: 9 ; res = 0.5*(res + shift(res, 1, 0)) 4 ; Allows to pass a field referring to the grid F on the grid V, 5 ; thanks to the average: 6 ; res = 0.5*(res + shift(res, 1, 0)) 10 7 ; 11 ; @categories 8 ; @categories 12 9 ; Grid 13 10 ; … … 21 18 ; common.pro 22 19 ; 23 ; @restrictions 24 ; Force parameters of the zoom on the grid V to be the same as 20 ; @restrictions 21 ; Force parameters of the zoom on the grid V to be the same as 25 22 ; those on the grid T. 26 23 ; 27 ; @restrictions 28 ; Points which can not be calculated are put at the value NaN 24 ; @restrictions 25 ; Points which can not be calculated are put at the value NaN 29 26 ; consecrated by IDL: !values.f_nan 30 27 ; … … 38 35 ; 39 36 ;- 40 ;------------------------------------------------------------ 41 ;------------------------------------------------------------ 42 ;------------------------------------------------------------ 37 ; 43 38 FUNCTION f2v, temp 44 ;---------------------------------------------------------45 39 ; 46 40 compile_opt idl2, strictarrsubs … … 68 62 ; case on tha array's size and application 69 63 taille = size(temp) 70 CASE taille[0] OF 64 CASE taille[0] OF 71 65 1: res = -1 72 2: BEGIN 66 2: BEGIN 73 67 case 1 of 74 68 taille[1] eq nxf and taille[2] eq nyf: … … 79 73 endcase 80 74 mask = (fmask())[firstxf:lastxf, firstyf:lastyf, 0] 81 terre = where(mask EQ 0) 75 terre = where(mask EQ 0) 82 76 IF terre[0] NE -1 THEN res[terre] = !values.f_nan 83 77 res = 0.5*(res + shift(res, 1, 0)) 84 78 if NOT (keyword_set(key_periodic) AND nxf EQ jpi) then res[0, *] = !values.f_nan 85 79 mask = (vmask())[firstxf:lastxf, firstyf:lastyf, 0] 86 terre = where(mask EQ 0) 80 terre = where(mask EQ 0) 87 81 IF terre[0] NE -1 THEN res[terre] = valmask 88 82 END 89 3: BEGIN 83 3: BEGIN 90 84 case 1 of 91 85 taille[1] eq nxf and taille[2] eq nyf AND taille[3] EQ nzt: … … 105 99 mask = reform(mask, nxf, nyf, jpt, /over) 106 100 ENDIF ELSE mask = (fmask())[firstxf:lastxf, firstyf:lastyf, firstzt:lastzt] 107 terre = where(temporary(mask) EQ 0) 101 terre = where(temporary(mask) EQ 0) 108 102 IF terre[0] NE -1 THEN res[temporary(terre)] = !values.f_nan 109 103 res = 0.5*(res + shift(res, 1, 0, 0)) … … 114 108 mask = reform(mask, nxf, nyf, jpt, /over) 115 109 ENDIF ELSE mask = (vmask())[firstxf:lastxf, firstyf:lastyf, firstzt:lastzt] 116 terre = where(temporary(mask) EQ 0) 110 terre = where(temporary(mask) EQ 0) 117 111 IF terre[0] NE -1 THEN res[temporary(terre)] = valmask 118 112 END 119 4: BEGIN 113 4: BEGIN 120 114 case 1 of 121 115 taille[1] eq nxf and taille[2] eq nyf AND taille[3] EQ nzt AND taille[4] EQ jpt: … … 130 124 mask = temporary(mask[*])#replicate(1, jpt) 131 125 mask = reform(mask, nxf, nyf, nzt, jpt, /over) 132 terre = where(temporary(mask) EQ 0) 126 terre = where(temporary(mask) EQ 0) 133 127 IF terre[0] NE -1 THEN res[temporary(terre)] = !values.f_nan 134 128 res = 0.5*(res + shift(res, 1, 0, 0, 0)) … … 137 131 mask = temporary(mask[*])#replicate(1, jpt) 138 132 mask = reform(mask, nxf, nyf, nzt, jpt, /over) 139 terre = where(temporary(mask) EQ 0) 133 terre = where(temporary(mask) EQ 0) 140 134 IF terre[0] NE -1 THEN res[temporary(terre)] = valmask 141 135 END … … 144 138 IF NOT keyword_set(key_forgetold) THEN BEGIN 145 139 @updateold 146 ENDIF 147 140 ENDIF 141 148 142 return, res 149 143 END 150
Note: See TracChangeset
for help on using the changeset viewer.