Changeset 226 for trunk/SRC/ToBeReviewed/CALCULS
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/CALCULS
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/CALCULS/depth2floatlevel.pro
r163 r226 4 4 ;+ 5 5 ; @file_comments 6 ; Rather comparable to depth2level but here, the calculated level is in float. 7 ; For example, the level 5.4 correspond to a depth equal 6 ; Rather comparable to depth2level but here, the calculated level is in float. 7 ; For example, the level 5.4 correspond to a depth equal 8 8 ; to gdep[5]+.4*(gdep[6]-gdep[5]) 9 9 ; 10 ; @categories 10 ; @categories 11 11 ; Without loop 12 12 ; … … 32 32 ; ->champ nul a 1e-6 pres 33 33 ; 34 ; @history 34 ; @history 35 35 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 36 36 ; 15/06/2000 37 ; 37 ; 38 38 ; @version 39 39 ; $Id$ … … 57 57 levellow = depth2level(depthin, /lower, /nomask) 58 58 depthlow = level2depth(levellow, /nomask) 59 ; calculate the distance depthlow-depthup and management of the case 60 ; of this distance is null or eq al to !values.f_nan59 ; calculate the distance depthlow-depthup and management of the case 60 ; of this distance is null or equal to !values.f_nan 61 61 divi = depthlow-depthup 62 62 nan = where(finite(divi) EQ 0) … … 74 74 endif 75 75 ;------------------------------------------------------------ 76 if keyword_set(key_performance) THEN print, 'temps depth2floatlevel', systime(1)-tempsun 76 if keyword_set(key_performance) THEN print, 'temps depth2floatlevel', systime(1)-tempsun 77 77 ; 78 78 return, res -
trunk/SRC/ToBeReviewed/CALCULS/depth2level.pro
r163 r226 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; Allows to pass from a 2d depth array to a corresponding 2d level array. 8 8 ; … … 11 11 ; 12 12 ; @param TAB {type=2d array} 13 ; 2d depth array (or a structure respecting litchamp crit rions)13 ; 2d depth array (or a structure respecting litchamp criterions) 14 14 ; 15 15 ; @keyword UPPER … … 17 17 ; 18 18 ; @keyword LOWER 19 ; We select the level just below the depth 19 ; We select the level just below the depth 20 20 ; 21 ; @keyword CLOSER 22 ; We select the depth's closer level 21 ; @keyword CLOSER 22 ; We select the depth's closer level 23 23 ; 24 ; @keyword NOMASK 24 ; @keyword NOMASK 25 25 ; To do not mask land points 26 26 ; 27 ; @returns 27 ; @returns 28 28 ; It is a 2d array containing level's values. 29 29 ; … … 31 31 ; common.pro 32 32 ; 33 ; @restrictions 33 ; @restrictions 34 34 ; For depths out of gdep's values, the value !values.f_nan is sent back. 35 ; if the depth is superior to this one of the bottom, we send back jpk-1 in 35 ; if the depth is superior to this one of the bottom, we send back jpk-1 in 36 36 ; the upper case, and !values.f_nan in the lower case. 37 37 ; … … 80 80 if notanumber[0] NE -1 then in[notanumber] = 0 81 81 ;------------------------------------------------------------ 82 ; We transform the 2d de th value in a 2d array of levels corresponding to depthes82 ; We transform the 2d depth value in a 2d array of levels corresponding to depths 83 83 ;------------------------------------------------------------ 84 84 ; We go on array who have the size of 3d arrays 85 prof=replicate(1,nx*ny)#gdep[firstz:lastz] 85 prof=replicate(1,nx*ny)#gdep[firstz:lastz] 86 86 in = in[*]#replicate(1, nz) 87 87 ; … … 116 116 ;------------------------------------------------------------ 117 117 ;------------------------------------------------------------ 118 if keyword_set(key_performance) THEN print, 'temps depth2level', systime(1)-tempsun 118 if keyword_set(key_performance) THEN print, 'temps depth2level', systime(1)-tempsun 119 119 return, levels 120 120 end -
trunk/SRC/ToBeReviewed/CALCULS/depth2mask.pro
r163 r226 4 4 ;+ 5 5 ; 6 ; @file_comments 7 ; Allows to pass from a 2d depth sill array to a 3d array of mask 6 ; @file_comments 7 ; Allows to pass from a 2d depth sill array to a 3d array of mask 8 8 ; with one of levels above the sill depth and 0s below. 9 9 ; … … 12 12 ; 13 13 ; @param TAB {type=3d array} 14 ; 2d sill depth array (or a structure respecting litchamp crit rions)14 ; 2d sill depth array (or a structure respecting litchamp criterions) 15 15 ; 16 16 ; @keyword _EXTRA 17 17 ; used to pass your keywords 18 ; 18 ; 19 19 ; @returns 20 20 ; It is a 3d array containing the mas associated to the 2d sill depth array … … 42 42 @common 43 43 ;------------------------------------------------------------ 44 ; We transform the 2d de th value in a 2d array of levels corresponding to depthes44 ; We transform the 2d depth value in a 2d array of levels corresponding to depths 45 45 ;------------------------------------------------------------ 46 46 niveaux = depth2level(tab, _extra = ex) … … 51 51 mask = level2mask(niveaux) 52 52 ;------------------------------------------------------------ 53 if keyword_set(key_performance) NE 0 THEN print, 'temps depth2mask', systime(1)-tempsun 53 if keyword_set(key_performance) NE 0 THEN print, 'temps depth2mask', systime(1)-tempsun 54 54 return, mask 55 55 end -
trunk/SRC/ToBeReviewed/CALCULS/floatlevel2depth.pro
r163 r226 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; Rather comparable to level2depth. It is the invert function of depth2floatlevel 8 8 ; … … 17 17 ; 18 18 ; @returns 19 ; 2d array containing depth es19 ; 2d array containing depths 20 20 ; 21 21 ; @uses … … 52 52 ; We sill (delete land points at valmask for example) 53 53 flevelin = 0 > flevelin < (jpk-1) 54 ; We ca culate the depth54 ; We calculate the depth 55 55 depthup = level2depth(floor(flevelin), /nomask) 56 56 depthlow= level2depth(ceil(flevelin), /nomask) … … 67 67 endif 68 68 ;------------------------------------------------------------ 69 if keyword_set(key_performance) THEN print, 'temps floatlevel2depth', systime(1)-tempsun 69 if keyword_set(key_performance) THEN print, 'temps floatlevel2depth', systime(1)-tempsun 70 70 ; 71 71 return, res -
trunk/SRC/ToBeReviewed/CALCULS/hdyn.pro
r224 r226 19 19 ; array representing the temperature. Has the same size than SN. 20 20 ; 21 ; @keyword GILL 21 ; @keyword GILL 22 22 ; We activate this key if we want to calculate the dynamic height 23 23 ; like in the GILL page 215, which means by rapport to a reference state which … … 32 32 ; Give a value to this keyword to change the reference salinity used in the 33 33 ; calculation when GILL is activated. 34 ; 34 ; 35 35 ; @keyword TREF 36 36 ; Give a value to this keyword to change the reference temperature used in the … … 58 58 ; 59 59 ; @restrictions 60 ; approximation: The pressure in decibars is equal to the depth in meters 60 ; approximation: The pressure in decibars is equal to the depth in meters 61 61 ; (the pressure increase of 1 bar every 10 m) 62 62 ; … … 99 99 if total(tailles[0:tailles[0]] NE taillet[0:taillet[0]]) NE 0 then $ 100 100 return, report('arrays sn and tn must have the same size') 101 if tailles[3] NE jpk then return, report('vertical dimension of sn and tn arra rrays must be equal to jpk')101 if tailles[3] NE jpk then return, report('vertical dimension of sn and tn arrays must be equal to jpk') 102 102 nx = nxt 103 103 ny = nyt -
trunk/SRC/ToBeReviewed/CALCULS/level2depth.pro
r224 r226 47 47 grille,mask, -1, -1,gdep,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 48 48 ;--------------------------------------------------------------- 49 ; verification of the coherence between array's size and the domain defin ied by domdef49 ; verification of the coherence between array's size and the domain defined by domdef 50 50 ;--------------------------------------------------------------- 51 51 taille = size(niveaux) -
trunk/SRC/ToBeReviewed/CALCULS/norme.pro
r163 r226 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; calculate the norm of a field of vectors, then make a possible average. 8 8 ; Comment 1: The field of vector can be, 2d:xy, 3d: xyz or xyt, 9 9 ; 4d: xyzt 10 10 ; Comment 2: 11 ; The calculation of the norm is made before the possible spatial or 12 ; temporal average because the average of the norm is not equal to the 11 ; The calculation of the norm is made before the possible spatial or 12 ; temporal average because the average of the norm is not equal to the 13 13 ; norm of averages 14 14 … … 24 24 ; 25 25 ; @keyword BOXZOOM 26 ; boxzoom on which do the average (by default the domain selected 26 ; boxzoom on which do the average (by default the domain selected 27 27 ; by the last domdef done) 28 28 ; 29 29 ; @keyword DIREC 30 30 ; 't' 'x' 'y' 'z' 'xys' 'xz' 'yz' 'xyz' 'xt' 'yt' 'zt' 'xyt' 31 ; 'xzt' 'yzt' 'xyzt' Direction on which do averages 31 ; 'xzt' 'yzt' 'xyzt' Direction on which do averages 32 32 ; 33 33 ; @returns … … 37 37 ; common.pro 38 38 ; 39 ; @restrictions 40 ; The norm is calculated on points TTo do this calculation, we average 41 ; field U and Von points T before calculate the norme. At the edge of 42 ; coast and of domain, we can not calculate fields U and V at points T, 43 ; that is why these points are at value !values.f_nan. 44 ; 45 ; When we calculate on a reduce geographic domain, field U and V have not 46 ; necessarily the same number of point. In this case, we recut U and V to 47 ; keep only common points. We profit of this to redo a domdef which redefine 39 ; @restrictions 40 ; The norm is calculated on points TTo do this calculation, we average 41 ; field U and Von points T before calculate the norme. At the edge of 42 ; coast and of domain, we can not calculate fields U and V at points T, 43 ; that is why these points are at value !values.f_nan. 44 ; 45 ; When we calculate on a reduce geographic domain, field U and V have not 46 ; necessarily the same number of point. In this case, we recut U and V to 47 ; keep only common points. We profit of this to redo a domdef which redefine 48 48 ; a geographic domain on which fields U and V are extracted on same points 49 49 ; 50 50 ; @restrictions 51 ; To know what type of array we work with, we test its size and dates 52 ; gave by time[0] and time[jpt-1] to know if thee is a temporal dimension. 53 ; Before to start norme, make sure that time and jpt are defined how 54 ; they have to! 51 ; To know what type of array we work with, we test its size and dates 52 ; gave by time[0] and time[jpt-1] to know if thee is a temporal dimension. 53 ; Before to start norme, make sure that time and jpt are defined how 54 ; they have to! 55 55 ; 56 56 ; @examples 57 ; To calculate the average of the norme of streams on all the domain 57 ; To calculate the average of the norme of streams on all the domain 58 58 ; between 0 et 50: 59 59 ; IDL> res=norme(un,vn,boxzoom=[0,50],dir='xyz') … … 90 90 ; 91 91 ;------------------------------------------------------------ 92 if keyword_set(boxzoom) then BEGIN 92 if keyword_set(boxzoom) then BEGIN 93 93 Case 1 Of 94 94 N_Elements(Boxzoom) Eq 1:bte = [lon1, lon2, lat1, lat2, 0., boxzoom[0]] … … 100 100 ENDCASE 101 101 domdef, boxzoom 102 ENDIF 102 ENDIF 103 103 ;------------------------------------------------------------ 104 104 if NOT keyword_set(direc) then direc = 0 … … 120 120 if grillev EQ '' then grillev = 'V' 121 121 IF grilleu EQ 'V' AND grillev EQ 'U' THEN inverse = 1 122 IF grilleu EQ 'T' AND grillev EQ 'T' THEN BEGIN 123 interpolle = 0 122 IF grilleu EQ 'T' AND grillev EQ 'T' THEN BEGIN 123 interpolle = 0 124 124 return, report('cas non code mais facile a faire!') 125 125 ENDIF ELSE interpolle = 1 … … 140 140 indiceyv = (lindgen(jpj))[firstyv:firstyv+nyv-1] 141 141 indicey = inter(indiceyu, indiceyv) 142 nx = n_elements(indicex) 142 nx = n_elements(indicex) 143 143 ny = n_elements(indicey) 144 144 ;---------------------------------------------------------------------------- … … 149 149 ;---------------------------------------------------------------------------- 150 150 ;---------------------------------------------------------------------------- 151 (size(u))[0] EQ 3 AND date1 EQ date2 :BEGIN 151 (size(u))[0] EQ 3 AND date1 EQ date2 :BEGIN 152 152 ;---------------------------------------------------------------------------- 153 153 indice2d = lindgen(jpi, jpj) … … 160 160 case 1 of 161 161 (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 162 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 162 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 163 163 case (size(u))[3] OF 164 nzt:BEGIN 164 nzt:BEGIN 165 165 if nxu NE nx then $ 166 if indicex[0] EQ firstxu then u = u[0:nx-1,*,*] ELSE u = u[1: nx, *,*] 166 if indicex[0] EQ firstxu then u = u[0:nx-1,*,*] ELSE u = u[1: nx, *,*] 167 167 IF nxv NE nx THEN $ 168 168 if indicex[0] EQ firstxv then v = v[0:nx-1,*,*] ELSE v = v[1: nx, *,*] 169 169 IF nyu NE ny THEN $ 170 if indicey[0] EQ firstyu then u = u[*,0:ny-1,*] ELSE u = u[*, 1: ny,*] 170 if indicey[0] EQ firstyu then u = u[*,0:ny-1,*] ELSE u = u[*, 1: ny,*] 171 171 IF nyv NE ny THEN $ 172 172 if indicey[0] EQ firstyv then v = v[*,0:ny-1,*] ELSE v = v[*, 1: ny,*] 173 173 end 174 jpk:BEGIN 174 jpk:BEGIN 175 175 if nxu NE nx then $ 176 if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt] ELSE u = u[1: nx, *,firstzt:lastzt] 176 if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt] ELSE u = u[1: nx, *,firstzt:lastzt] 177 177 IF nxv NE nx THEN $ 178 178 if indicex[0] EQ firstxv then v = v[0:nx-1, *,firstzt:lastzt] ELSE v = v[1: nx, *,firstzt:lastzt] 179 179 IF nyu NE ny THEN $ 180 if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt] ELSE u = u[*, 1: ny,firstzt:lastzt] 180 if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt] ELSE u = u[*, 1: ny,firstzt:lastzt] 181 181 IF nyv NE ny THEN $ 182 182 if indicey[0] EQ firstyv then v = v[*, 0:ny-1,firstzt:lastzt] ELSE v = v[*, 1: ny,firstzt:lastzt] … … 186 186 END 187 187 (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND (size(u))[3] EQ jpk AND $ 188 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN 188 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN 189 189 u = u[indice3d] 190 190 v = v[indice3d] … … 209 209 if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0,*]=a 210 210 ;---------------------------------------------------------------------------- 211 ; attribution of the mask and of lo gitude and latitude arrays211 ; attribution of the mask and of longitude and latitude arrays 212 212 ;---------------------------------------------------------------------------- 213 213 mask = tmask[indice3d] … … 234 234 ;---------------------------------------------------------------------------- 235 235 ;---------------------------------------------------------------------------- 236 date1 NE date2 AND (size(u))[0] EQ 3 :BEGIN 236 date1 NE date2 AND (size(u))[0] EQ 3 :BEGIN 237 237 indice2d = lindgen(jpi, jpj) 238 238 indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] … … 242 242 case 1 of 243 243 (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 244 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 244 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 245 245 if nxu NE nx then $ 246 if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *] 246 if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *] 247 247 IF nxv NE nx THEN $ 248 248 if indicex[0] EQ firstxv then v = v[0:nx-1, *, *] ELSE v = v[1: nx, *, *] 249 249 IF nyu NE ny THEN $ 250 if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *] 250 if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *] 251 251 IF nyv NE ny THEN $ 252 252 if indicey[0] EQ firstyv then v = v[*, 0:ny-1, *] ELSE v = v[*, 1: ny, *] 253 253 END 254 254 (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $ 255 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 255 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 256 256 u = u[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *] 257 257 v = v[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *] … … 270 270 ;---------------------------------------------------------------------------- 271 271 ; attribution of the mask and of longitude and latitude arrays. 272 ; We recover the complete grid to establish a big mask extent in the four 273 ; direction to cover pointsfor which a land point has been 272 ; We recover the complete grid to establish a big mask extent in the four 273 ; direction to cover pointsfor which a land point has been 274 274 ; considerated (make a small drawing) 275 275 ;---------------------------------------------------------------------------- … … 288 288 res[*,0, *]=!values.f_nan 289 289 mask = where(mask eq 0) 290 IF mask[0] NE -1 THEN BEGIN 290 IF mask[0] NE -1 THEN BEGIN 291 291 coeftps = lindgen(jpt)*nx*ny 292 292 coeftps = replicate(1, n_elements(mask))#coeftps … … 304 304 ;---------------------------------------------------------------------------- 305 305 ;---------------------------------------------------------------------------- 306 date1 NE date2 AND (size(u))[0] EQ 4:BEGIN 306 date1 NE date2 AND (size(u))[0] EQ 4:BEGIN 307 307 indice2d = lindgen(jpi, jpj) 308 308 indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] … … 314 314 case 1 of 315 315 (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 316 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 316 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 317 317 case (size(u))[3] OF 318 nzt:BEGIN 318 nzt:BEGIN 319 319 if nxu NE nx then $ 320 if indicex[0] EQ firstxu then u = u[0:nx-1,*,*,*] ELSE u = u[1: nx, *,*,*] 320 if indicex[0] EQ firstxu then u = u[0:nx-1,*,*,*] ELSE u = u[1: nx, *,*,*] 321 321 IF nxv NE nx THEN $ 322 322 if indicex[0] EQ firstxv then v = v[0:nx-1,*,*,*] ELSE v = v[1: nx, *,*,*] 323 323 IF nyu NE ny THEN $ 324 if indicey[0] EQ firstyu then u = u[*,0:ny-1,*,*] ELSE u = u[*, 1: ny,*,*] 324 if indicey[0] EQ firstyu then u = u[*,0:ny-1,*,*] ELSE u = u[*, 1: ny,*,*] 325 325 IF nyv NE ny THEN $ 326 326 if indicey[0] EQ firstyv then v = v[*,0:ny-1,*,*] ELSE v = v[*, 1: ny,*,*] 327 327 end 328 jpk:BEGIN 328 jpk:BEGIN 329 329 if nxu NE nx then $ 330 if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt,*] ELSE u = u[1: nx, *,firstzt:lastzt,*] 330 if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt,*] ELSE u = u[1: nx, *,firstzt:lastzt,*] 331 331 IF nxv NE nx THEN $ 332 332 if indicex[0] EQ firstxv then v = v[0:nx-1, *,firstzt:lastzt,*] ELSE v = v[1: nx, *,firstzt:lastzt,*] 333 333 IF nyu NE ny THEN $ 334 if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt,*] ELSE u = u[*, 1: ny,firstzt:lastzt,*] 334 if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt,*] ELSE u = u[*, 1: ny,firstzt:lastzt,*] 335 335 IF nyv NE ny THEN $ 336 336 if indicey[0] EQ firstyv then v = v[*, 0:ny-1,firstzt:lastzt,*] ELSE v = v[*, 1: ny,firstzt:lastzt,*] … … 340 340 END 341 341 (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND (size(u))[3] EQ jpk AND $ 342 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN 342 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN 343 343 u = u[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1,firstzt:lastzt, *] 344 344 v = v[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1,firstzt:lastzt, *] … … 356 356 if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0,*,*]=a 357 357 ;---------------------------------------------------------------------------- 358 ; attribution of the mask and of lo gitude and latitude arrays358 ; attribution of the mask and of longitude and latitude arrays 359 359 ;---------------------------------------------------------------------------- 360 360 mask = tmask[indice3d] … … 370 370 res[*,0, *, *]=!values.f_nan 371 371 mask = where(mask eq 0) 372 IF mask[0] NE -1 THEN BEGIN 372 IF mask[0] NE -1 THEN BEGIN 373 373 coeftps = lindgen(jpt)*nx*ny*nzt 374 374 coeftps = replicate(1, n_elements(mask))#coeftps … … 394 394 case 1 of 395 395 (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 396 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 396 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 397 397 if nxu NE nx then $ 398 if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 398 if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 399 399 IF nxv NE nx THEN $ 400 400 if indicex[0] EQ firstxv then v = v[0:nx-1, *] ELSE v = v[1: nx, *] 401 401 IF nyu NE ny THEN $ 402 if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny] 402 if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny] 403 403 IF nyv NE ny THEN $ 404 404 if indicey[0] EQ firstyv then v = v[*, 0:ny-1] ELSE v = v[*, 1: ny] 405 405 END 406 406 (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $ 407 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 407 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 408 408 u = u[indice2d] 409 409 v = v[indice2d] … … 429 429 ;---------------------------------------------------------------------------- 430 430 ; attribution of the mask and of longitude and latitude arrays. 431 ; We recover the complete grid to establish a big mask extent in the four 432 ; direction to cover pointsfor which a land point has been 431 ; We recover the complete grid to establish a big mask extent in the four 432 ; direction to cover pointsfor which a land point has been 433 433 ; considerated (make a small drawing) 434 434 ;---------------------------------------------------------------------------- … … 455 455 endcase 456 456 ;------------------------------------------------------------ 457 if keyword_set(key_performance) THEN print, 'temps norme', systime(1)-tempsun 457 if keyword_set(key_performance) THEN print, 'temps norme', systime(1)-tempsun 458 458 return, res 459 459 end -
trunk/SRC/ToBeReviewed/CALCULS/projectondepth.pro
r224 r226 12 12 ; @param ARRAYIN {type=3d array} 13 13 ; It is a 3d array whose 3rd dimension must be equal to jpk 14 ; 14 ; 15 15 ; @param DEPTHIN {type=2d array} 16 16 ; It is a 2d array indicating for each point n, at which depth to project 17 ; 17 ; 18 18 ; @returns 19 19 ; A 2d array which is the projection of the 3d array following depths indicated by depthin … … 22 22 ; common.pro 23 23 ; 24 ; @restrictions 24 ; @restrictions 25 25 ; points at !values.f_nan impossible calculation. Land points masked at valmask. 26 26 ; … … 29 29 ; IDL> a=gdept[jpk-1]/(1.*jpi*jpj)*findgen(jpi,jpj) 30 30 ; We build an array to project on these depths. For the test, 31 ; we build a 3d array whose each vector following z is the depth. 31 ; we build a 3d array whose each vector following z is the depth. 32 32 ; IDL> arraytest=replicate(1,jpi*jpj)#gdept 33 33 ; IDL> arraytest=reform(arraytest,jpi,jpj,jpk, /over) … … 35 35 ; IDL> plt, 1e6*(a-projectondepth(arraytest,a)),/nocontour 36 36 ; ->null field at 1e-6 pres 37 ; 38 ; verif cation projecting the temperature of 20°C for example...37 ; 38 ; verification projecting the temperature of 20°C for example... 39 39 ; 40 40 ; @history … … 63 63 if tailledepth[0] NE 2 THEN return, report('Depth array must have 2 dimensions') 64 64 if taillearray[0] NE 3 THEN return, report('Array in must have 3 dimensions') 65 ; verification of the coherence between array's size and the domain 65 ; verification of the coherence between array's size and the domain 66 66 grille, mask, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 67 67 case 1 of … … 103 103 if terre[0] NE -1 then res[terre] = valmask 104 104 ;------------------------------------------------------------ 105 if keyword_set(key_performance) THEN print, 'temps projectondepth', systime(1)-tempsun 105 if keyword_set(key_performance) THEN print, 'temps projectondepth', systime(1)-tempsun 106 106 return, res 107 107 end -
trunk/SRC/ToBeReviewed/CALCULS/remplit.pro
r209 r226 22 22 ; 23 23 ; @keyword FILLXDIR 24 ; 24 ; 25 25 ; 26 26 ; @keyword FILLYDIR … … 51 51 ; $Id$ 52 52 ; 53 ;; 54 ;; Extrapole zinout[jpi,jpj] sur les continents en utilisant les 4 55 ;; plus proches voisins masques oceaniquement et construit un nouveau 56 ; masque 57 ;; contenant l'ancien masque oceanique PLUSles points extrapoles. 58 ;; Reitere le processus niter fois. 59 ;; C'est pas clair, essayez ! 60 ;; 61 ;; 53 ;; 54 ;; Extrapole zinout[jpi,jpj] sur les continents en utilisant les 4 55 ;; plus proches voisins masques oceaniquement et construit un nouveau masque 56 ;; contenant l'ancien masque oceanique PLUS les points extrapoles. 57 ;; Reitere le processus niter fois. 58 ;; C'est pas clair, essayez ! 59 ;; 60 ;; 62 61 ; 63 62 ; /Nan: to fill the point which have the value 64 ; !values.f_nan. W hitout this keyword, these point are not filling63 ; !values.f_nan. Without this keyword, these point are not filling 65 64 ; and stays at !values.f_nan. 66 65 ; … … 139 138 ;--------------------------------------------------------------- 140 139 ;--------------------------------------------------------------- 141 ; iteration 142 ;--------------------------------------------------------------- 143 ;--------------------------------------------------------------- 144 FOR n = 1, niter DO BEGIN 140 ; iteration 141 ;--------------------------------------------------------------- 142 ;--------------------------------------------------------------- 143 FOR n = 1, niter DO BEGIN 145 144 ; on trouve les points coast 146 145 tempdeux = systime(1) ; pour key_performance =2 … … 244 243 END 245 244 endcase 246 ; 245 ; 247 246 z[coast] = temporary(zcoast)/ temporary(weight) 248 247 ; we update the the boundary conditions of z … … 258 257 IF testvar(var = key_performance) EQ 2 THEN $ 259 258 print, 'temps remplit: une iteration ', systime(1)-tempdeux 260 ENDFOR 259 ENDFOR 261 260 fini: 262 261 ; … … 280 279 key_gridtype = oldkey_gridtype 281 280 ;--------------------------------------------------------------- 282 if keyword_set(key_performance) THEN print, 'temps remplit', systime(1)-tempsun 281 if keyword_set(key_performance) THEN print, 'temps remplit', systime(1)-tempsun 283 282 return, z 284 END 283 END 285 284
Note: See TracChangeset
for help on using the changeset viewer.