Changeset 48 for trunk/grad.pro
- Timestamp:
- 03/16/14 20:38:39 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grad.pro
r41 r48 11 11 res = litchamp(field) 12 12 taille=size(res) 13 grille, mask, glam, gphi, gdep, nx, ny,nz,premierx,premiery,premierz,dernierx, derniery, dernierz 13 grille, mask, glam, gphi, gdep, nx, ny,nz,premierx,premiery,premierz,dernierx, derniery, dernierz 14 14 if n_elements(valmask) EQ 0 then valmask = 1e20 15 15 case strupcase(vargrid) of 16 16 'T':BEGIN 17 17 case direc of 18 'x':BEGIN 18 'x':BEGIN 19 19 divi = e1u[premierx:dernierx, premiery:derniery] 20 20 newmask = (umask())[premierx:dernierx, premiery:derniery, premierz:dernierz] … … 35 35 vargrid = 'W' 36 36 END 37 ELSE :return, report('Bad definition of direction argument')37 ELSE : return, report('Bad definition of direction argument') 38 38 ENDCASE 39 39 END … … 47 47 vargrid = 'T' 48 48 END 49 ELSE :return, report('Bad definition of direction argument')49 ELSE : return, report('Bad definition of direction argument') 50 50 endcase 51 51 END … … 71 71 vargrid = 'W' 72 72 END 73 ELSE :return, report('Bad definition of direction argument')73 ELSE : return, report('Bad definition of direction argument') 74 74 endcase 75 75 END … … 95 95 vargrid = 'W' 96 96 END 97 ELSE :return, report('Bad definition of direction argument')97 ELSE : return, report('Bad definition of direction argument') 98 98 endcase 99 99 END … … 103 103 ; 'y':divi = (shift(e2u, 0, -1))[premierx:dernierx, premiery:derniery] 104 104 ; 'z':divi = e3w[premierz:dernierz] 105 ; ELSE :return, report('Bad definition of direction argument')105 ; ELSE : return, report('Bad definition of direction argument') 106 106 ; endcase 107 107 ; END 108 ELSE :return, report('Bad definition of vargrid')108 ELSE : return, report('Bad definition of vargrid') 109 109 ENDCASE 110 110 res = fitintobox(res) … … 117 117 if earth[0] NE -1 then res[earth] = !values.f_nan 118 118 case direc of 119 'x':BEGIN 119 'x':BEGIN 120 120 res = (shift(res, -1, 0)-res)/divi 121 121 if key_periodique EQ 0 OR nx NE jpi THEN res[nx-1, *] = !values.f_nan 122 122 if vargrid EQ 'T' OR vargrid EQ 'V' then res = shift(res, 1, 0) 123 123 END 124 'y':BEGIN 124 'y':BEGIN 125 125 res = (shift(res, 0, -1)-res)/divi 126 126 res[*, ny-1] = !values.f_nan 127 if vargrid EQ 'T' OR vargrid EQ 'U' then res = shift(res, 0, 1) 128 END 129 ELSE :return, report('Bad definition of direction argument for the type of array')127 if vargrid EQ 'T' OR vargrid EQ 'U' then res = shift(res, 0, 1) 128 END 129 ELSE : return, report('Bad definition of direction argument for the type of array') 130 130 ENDCASE 131 131 earth = where(newmask[*, *, premierz] EQ 0) … … 143 143 divi = divi[*]#replicate(1, jpt) 144 144 case direc of 145 'x':BEGIN 145 'x':BEGIN 146 146 res = (shift(res, -1, 0, 0)-res)/divi 147 147 if key_periodique EQ 0 OR nx NE jpi THEN res[nx-1, *, *] = !values.f_nan 148 148 if vargrid EQ 'T' OR vargrid EQ 'V' then res = shift(res, 1, 0, 0) 149 149 END 150 'y':BEGIN 150 'y':BEGIN 151 151 res = (shift(res, 0, -1, 0)-res)/divi 152 152 res[*, ny-1, *] = !values.f_nan 153 if vargrid EQ 'T' OR vargrid EQ 'U' then res = shift(res, 0, 1, 0) 154 END 155 ELSE :return, report('Bad definition of direction argument for the type of array')153 if vargrid EQ 'T' OR vargrid EQ 'U' then res = shift(res, 0, 1, 0) 154 END 155 ELSE : return, report('Bad definition of direction argument for the type of array') 156 156 ENDCASE 157 157 earth = where(newmask[*, *, premierz] EQ 0) 158 if earth[0] NE -1 then BEGIN 158 if earth[0] NE -1 then BEGIN 159 159 earth = earth#replicate(1, jpt)+replicate(1, n_elements(earth))#(nx*ny*lindgen(jpt)) 160 160 res[earth] = valmask … … 168 168 if earth[0] NE -1 then res[earth] = !values.f_nan 169 169 case direc OF 170 'x':BEGIN 170 'x':BEGIN 171 171 divi = divi[*]#replicate(1, nz) 172 172 res = (shift(res, -1, 0, 0)-res)/divi … … 174 174 if vargrid EQ 'T' OR vargrid EQ 'V' then res = shift(res, 1, 0, 0) 175 175 END 176 'y':BEGIN 176 'y':BEGIN 177 177 divi = divi[*]#replicate(1, nz) 178 178 res = (shift(res, 0, -1, 0)-res)/divi 179 179 res[*, ny-1, *] = !values.f_nan 180 if vargrid EQ 'T' OR vargrid EQ 'U' then res = shift(res, 0, 1, 0) 180 if vargrid EQ 'T' OR vargrid EQ 'U' then res = shift(res, 0, 1, 0) 181 181 END 182 182 'z':BEGIN 183 183 divi = reform(replicate(1, nx*ny)#divi, nx, ny, nz) 184 184 if nx EQ 1 OR ny EQ 1 then res = reform(res, nx, ny, nz) 185 if vargrid EQ 'W' THEN BEGIN 185 if vargrid EQ 'W' THEN BEGIN 186 186 res = (shift(res, 0, 0, 1)-res)/divi 187 187 res[*, *, 0] = !values.f_nan … … 206 206 divi = reform(divi[*]#replicate(1, jpt), nx, ny, nz, jpt, /over) 207 207 if nx EQ 1 OR ny EQ 1 then res = reform(res, nx, ny, nz, jpt) 208 if vargrid EQ 'W' THEN BEGIN 208 if vargrid EQ 'W' THEN BEGIN 209 209 res = (shift(res, 0, 0, 1, 0)-res)/divi 210 210 res[*, *, 0, *] = !values.f_nan … … 227 227 return, res 228 228 end 229 230 231 232 233 234
Note: See TracChangeset
for help on using the changeset viewer.