Changeset 142 for trunk/SRC/ToBeReviewed/CALCULS/div.pro
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/CALCULS/div.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:div 6 ; 7 ; PURPOSE:calcule la divergence d'un champ 2D 8 ; 9 ; CATEGORY:calcule sur les matrices 10 ; 11 ; CALLING SEQUENCE:res=div(u,v) 12 ; 13 ; INPUTS: 14 ; u et v deux matrices representant les coordonnes d''un 15 ; champ de vecteur 16 ; 17 ; KEYWORD PARAMETERS: 18 ; 19 ; OUTPUTS:res: une matrice 2d 20 ; 21 ; COMMON BLOCKS: 22 ; common.pro 23 ; 24 ; SIDE EFFECTS: 25 ; 26 ; RESTRICTIONS: 27 ; les matrices u et v peuvent de 2 a 4 dimensions. 28 ; attention pour distinger les differents configurations de u et v 29 ; (xy, xyz, xyt, xyzt), on regarde la variable du common 30 ; -time qui contient le calendrier en jour julien d''IDL auquel 31 ; se rapportent u et v ansi que la variable 32 ; -jpt qui est le nombre de pas de temps a considerer ds time. 33 ; les tableaux u et v sont decoupes sur le meme domaine 34 ; geographique. A cause du decalage des grilles T, U, V et F il est 35 ; possiible que ces 2 tableaux n''aient pas la meme taille et se 36 ; repportent a des indices differents. Si tel est le cas les tableaux 37 ; sont redecoupes sur les indices qu'ils ont en commun et le dommaine 38 ; est redefinit pour qu'il colle a ces indices communs. 39 ; pour eviter ces redecoupes utiliser le mot cles /memeindice ds 40 ; domdef.pro 41 ; 42 ; les points sur le bord du dessin sont mis a !values.f_nan 43 ; 44 ; EXAMPLE: 45 ; 46 ; MODIFICATION HISTORY:Guillaume Roullet (grlod@ipsl.jussieu.fr) 5 ; 6 ; @file_comments 7 ; calculation of the divergence of a 2d field 8 ; 9 ; @categories 10 ; Calculation on matrixes 11 ; 12 ; @param UU 13 ; Matrix representing coordinates of a field of vectors 14 ; 15 ; @param VV 16 ; Matrix representing coordinates of a field of vectors 17 ; 18 ; @returns RES 19 ; A 2d matrix 20 ; 21 ; @uses 22 ; common.pro 23 ; 24 ; @restrictions 25 ; U and V matrixes can be 2 or 4d. 26 ; Beware, to discern differents configuration of U and V (xy, xyz, xyt, xyzt), 27 ; we look at the variable of the common 28 ; -time which contain the calendar in IDL julian days to which U and 29 ; V refered to, in the same way as the variable 30 ; -jpt which is the number of time's step to consider in time. 31 ; U and V arrays ae cut in the same geographic domain. Because of the gap of 32 ; T, U, V and F grids, it is possible that these two arrays hase not the same 33 ; size and refered to different indexes. In this case, arrays are recut on 34 ; common indexesand the domain is redifined to match with these common 35 ; indexes. To avoid these recuts, use the keyword /memeindice in domdef.pro 36 ; 37 ; 38 ; Points on the drawing edge are at !values.f_nan 39 ; 40 ; 41 ; @history 42 ; Guillaume Roullet (grlod@ipsl.jussieu.fr) 47 43 ; Creation : printemps 1998 48 44 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 49 45 ; adaptation pour marcher avec un domaine reduit 50 ; 12/1/2000 46 ; 12/1/2000; 47 ; 48 ; @version 49 ; $Id$ 50 ; 51 51 ;- 52 52 ;------------------------------------------------------------ … … 57 57 compile_opt idl2, strictarrsubs 58 58 ; 59 tempsun = systime(1) ; pour key_performance59 tempsun = systime(1) ; For key_performance 60 60 @common 61 61 ; … … 72 72 73 73 ;------------------------------------------------------------ 74 ; on trouve les points que u et v ont en communs74 ; We find common points between U and V 75 75 ;------------------------------------------------------------ 76 76 indicexu = (lindgen(jpi))[firstxu:firstxu+nxu-1] … … 91 91 (size(u))[0] EQ 3 AND date1 EQ date2 :BEGIN 92 92 ;------------------------------------------------------------ 93 ; extraction de u et v sur le domaine qui convient93 ; extraction of U and V on the appropriated domain 94 94 ;------------------------------------------------------------ 95 95 case 1 of … … 139 139 *tmask[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt:lastzt] 140 140 ;------------------------------------------------------------ 141 ; mise a !values.f_nan de la bordure141 ; Edging put at !values.f_nan 142 142 ;------------------------------------------------------------ 143 143 if NOT keyword_set(key_periodic) OR nx NE jpi then begin … … 154 154 if terre[0] NE -1 then zdiv[temporary(terre)] = valmask 155 155 ;------------------------------------------------------------ 156 ; pour le trace graphique156 ; For the graphic drawing 157 157 ;------------------------------------------------------------ 158 158 vargrid = 'T' … … 169 169 date1 NE date2 AND (size(u))[0] EQ 3 :BEGIN 170 170 ;------------------------------------------------------------ 171 ; extraction de u et v sur le domaine qui convient171 ; extraction of U and V on the appropriated domain 172 172 ;------------------------------------------------------------ 173 173 case 1 of … … 191 191 endcase 192 192 ;------------------------------------------------------------ 193 ; calcul de ladivergence193 ; Calculation of the divergence 194 194 ;------------------------------------------------------------ 195 195 zu = e2u[indice2d]*(umask())[indice2d+jpi*jpj*firstzt] … … 213 213 zdiv = temporary(zdiv)*(zu-shift(zu, 1, 0, 0)+zv-shift(zv, 0, 1, 0)) 214 214 ;------------------------------------------------------------ 215 ; mise a !values.f_nan de la bordure215 ; Edging put at !values.f_nan 216 216 ;------------------------------------------------------------ 217 217 if NOT keyword_set(key_periodic) OR nx NE jpi then begin … … 225 225 if terre[0] NE -1 then zdiv[temporary(terre)] = valmask 226 226 ;------------------------------------------------------------ 227 ; pour le trace graphique227 ; for the graphic drawing 228 228 ;------------------------------------------------------------ 229 229 vargrid = 'T' … … 250 250 indice3d = indice3d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt] 251 251 ;------------------------------------------------------------ 252 ; extraction de u et v sur le domaine qui convient252 ; extraction of U and V on the appropriated domain 253 253 ;------------------------------------------------------------ 254 254 case 1 of … … 275 275 endcase 276 276 ;------------------------------------------------------------ 277 ; calcul de ladivergence277 ; Calculation of the divergence 278 278 ;------------------------------------------------------------ 279 279 zu = temporary(u)*e2u[indice2d]*(umask())[indice3d] … … 286 286 zdiv = temporary(zdiv)*tmask[indice3d]/(e1t[indice2d]*e2t[indice2d]) 287 287 ;------------------------------------------------------------ 288 ; mise a !values.f_nan de la bordure288 ; Edging put at !values.f_nan 289 289 ;------------------------------------------------------------ 290 290 if NOT keyword_set(key_periodic) OR nx NE jpi then begin … … 301 301 if terre[0] NE -1 then zdiv[temporary(terre)] = valmask 302 302 ;------------------------------------------------------------ 303 ; pour le trace graphique303 ; for the graphic drawing 304 304 ;------------------------------------------------------------ 305 305 vargrid = 'T'
Note: See TracChangeset
for help on using the changeset viewer.