Changeset 142 for trunk/SRC/ToBeReviewed/CALCULS/curl.pro
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/CALCULS/curl.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME:curl 6 ; 7 ; PURPOSE:calcule la composante verticale du rotationnel d''un champ 8 ; de vecteur horizontaux 9 ; 10 ; CATEGORY:calcule sur les matrices 11 ; 12 ; CALLING SEQUENCE:res=curl(u,v) 13 ; 14 ; INPUTS: 15 ; u et v deux matrices representant les coordonnes d''un 16 ; champ de vecteur 17 ; 18 ; KEYWORD PARAMETERS: 19 ; 20 ; OUTPUTS:res: une matrice 2d 21 ; 22 ; COMMON BLOCKS: 23 ; common.pro 24 ; 25 ; SIDE EFFECTS: 26 ; 27 ; RESTRICTIONS: 28 ; les matrices u et v peuvent de 2 a 4 dimensions. 29 ; attention pour distinger les differents configurations de u et v 30 ; (xy, xyz, xyt, xyzt), on regarde la variable du common 31 ; -time qui contient le calendrier en jour julien d''IDL auquel 32 ; se rapportent u et v ansi que la variable 33 ; -jpt qui est le nombre de pas de temps a considerer ds time. 34 ; les tableaux u et v sont decoupes sur le meme domaine 35 ; geographique. A cause du decalage des grilles T, U, V et F il est 36 ; possiible que ces 2 tableaux n''aient pas la meme taille et se 37 ; repportent a des indices differents. Si tel est le cas les tableaux 38 ; sont redecoupes sur les indices qu'ils ont en commun et le dommaine 39 ; est redefinit pour qu'il colle a ces indices communs. 40 ; pour eviter ces redecoupes utiliser le mot cles /memeindice ds 41 ; domdef.pro 42 ; 43 ; 44 ; les points sur le bord du dessin sont mis a !values.f_nan 45 ; 46 ; EXAMPLE: 47 ; 48 ; MODIFICATION HISTORY:Guillaume Roullet (grlod@ipsl.jussieu.fr) 5 ; 6 ; @file_comments 7 ; Calculate the vertical component of the curl of a field of horizontal vectors 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 ; @history 41 ; Guillaume Roullet (grlod@ipsl.jussieu.fr) 49 42 ; 50 43 ; Sebastien Masson (smasson@lodyc.jussieu.fr) … … 53 46 ; 21/5/1999: valeurs manquantes a !values.f_nan 54 47 ;periodicite 48 ; 49 ; @version 50 ; $Id$ 51 ; 55 52 ;- 56 53 ;------------------------------------------------------------ … … 62 59 ; 63 60 @common 64 tempsun = systime(1) ; pourkey_performance61 tempsun = systime(1) ; To key_performance 65 62 ; 66 63 IF finite(glamu[0])*finite(gphiu[0])*finite(glamv[0])*finite(gphiv[0]) EQ 0 THEN $ … … 76 73 77 74 ;------------------------------------------------------------ 78 ; on trouve les points que u et v ont en communs75 ; We find common points between U and V 79 76 ;------------------------------------------------------------ 80 77 indicexu = (lindgen(jpi))[firstxu:firstxu+nxu-1] … … 95 92 indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 96 93 ;------------------------------------------------------------ 97 ; extraction de u et v sur le domaine qui convient94 ; extraction of U and V on the appropriated domain 98 95 ;------------------------------------------------------------ 99 96 case 1 of … … 117 114 endcase 118 115 ;------------------------------------------------------------ 119 ; calcul du rotationnel116 ; calculation of the curl 120 117 ;------------------------------------------------------------ 121 118 coefu = (e1u[indice2d])[*]#replicate(1, nzt) … … 142 139 psi = tabf*psi 143 140 ;------------------------------------------------------------ 144 ; mise a !values.f_nan de la bordure141 ; Edging put at !values.f_nan 145 142 ;------------------------------------------------------------ 146 143 if NOT keyword_set(key_periodic) OR nx NE jpi then begin … … 155 152 if terref[0] NE -1 then psi[temporary(terref)] = valmask 156 153 ;------------------------------------------------------------ 157 ; pour le trace graphique154 ; For the graphic drawing 158 155 ;------------------------------------------------------------ 159 156 domdef, (glagmt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, gridtype = ['t', 'f'] … … 171 168 indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 172 169 ;------------------------------------------------------------ 173 ; extraction de u et v sur le domaine qui convient170 ; extraction of U and V on the appropriated domain 174 171 ;------------------------------------------------------------ 175 172 case 1 of … … 196 193 endcase 197 194 ;---------------------------------------------------------------------------- 198 ; calcul du rotationnel195 ; Calculation of the curl 199 196 ;---------------------------------------------------------------------------- 200 197 coefu = e1u[indice2d]*(umask())[indice2d+jpi*jpj*firstzt] … … 214 211 tabf = reform(tabf, nx, ny, jpt, /over) 215 212 ;------------------------------------------------------------ 216 ; calcul du rotationnel213 ; Calculation of the curl 217 214 ;------------------------------------------------------------ 218 215 zu = u*temporary(coefu) … … 222 219 psi = tabf*psi 223 220 ;------------------------------------------------------------ 224 ; mise a !values.f_nan de la bordure221 ; extraction of U and V on the appropriated domain 225 222 ;------------------------------------------------------------ 226 223 if NOT keyword_set(key_periodic) OR nx NE jpi then begin … … 255 252 indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 256 253 ;------------------------------------------------------------ 257 ; extraction de u et v sur le domaine qui convient258 254 ;------------------------------------------------------------ 259 255 case 1 of … … 278 274 endcase 279 275 ;------------------------------------------------------------ 280 ; calcul du rotationnel276 ; Calculation of the curl 281 277 ;------------------------------------------------------------ 282 278 coefu = e1u[indice2d]*(umask())[indice2d+jpi*jpj*firstzt] … … 295 291 296 292 ;------------------------------------------------------------ 297 ; mise a !values.f_nan de la bordure293 ; Edging put at !values.f_nan 298 294 ;------------------------------------------------------------ 299 295 if NOT keyword_set(key_periodic) OR nx NE jpi then begin … … 308 304 if terref[0] NE -1 then psi[temporary(terref)] = valmask 309 305 ;------------------------------------------------------------ 310 ; pour le trace graphique306 ; for the graphic drawing 311 307 ;------------------------------------------------------------ 312 308 domdef, (glamt[indice2d])[0, 0], (glamf[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphif[indice2d])[0, ny-1], vert1, vert2, gridtype = ['t', 'f']
Note: See TracChangeset
for help on using the changeset viewer.