;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; NAME:tracegrille ; ; PURPOSE:dessine la grille ; ; CATEGORY: ; ; CALLING SEQUENCE:tracegrille ; ; INPUTS:none ; ; KEYWORD PARAMETERS: ; ; XSTRIDE un entier pour specifier qu''on ne veut tracer ; qu''une ligne de i constant tout les xstride points ; ; YSTRIDE un entier pour specifier qu''on ne veut tracer ; qu''une ligne de j constant tout les ystride points ; ; OCEAN: pour ne tracer la grille que sur les points oceans ; ; EARTH: pour ne tracer la grille que sur les points terre ; ; + tous les mots clefs de la procedure PLOTS ; ; OUTPUTS:none ; ; COMMON BLOCKS:common.pro ; ; SIDE EFFECTS:trace la grille specifiee par vargrid, sur le domaine ; definit par le dernier domdef. ; ; RESTRICTIONS: ; ; EXAMPLE: ; ; IDL> plt,indgen(jpi,jpj),/nocontour,/nocouleur ; IDL> tracegrille,/ocean,color=20 ; IDL> tracegrille,/earth,color=80 ; ; ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) ; ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ PRO tracegrille, OCEAN = ocean, EARTH = earth, XSTRIDE = xstride, YSTRIDE = ystride, _extra = extra @common tempsun = systime(1) ; pour key_performance if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c' grille, mask, glam, gphi, gdep, nx, ny if (size(mask))[0] EQ 3 then mask = mask[*, *, 0] case 1 of keyword_set(ocean):BEGIN earth = where(mask EQ 0) if earth[0] NE -1 then begin glam[earth] = !values.f_nan gphi[earth] = !values.f_nan endif END keyword_set(earth):BEGIN ocean = where(mask EQ 1) if ocean[0] NE -1 then begin glam[ocean] = !values.f_nan gphi[ocean] = !values.f_nan endif END ELSE: endcase if NOT keyword_set(xstride) then xstride = 1 if NOT keyword_set(ystride) then ystride = 1 case key_gridtype of 'c':BEGIN for i = 0, ny-1, ystride do begin plots, glam[*, i], gphi[*, i], color = c_cote, _extra = extra endfor for i = 0, nx-1, xstride do begin plots, glam[i, *], gphi[i, *], color = c_cote, _extra = extra endfor END 'e':BEGIN shifted = glam[0, 0] LT glam[0, 1] glam2 = glam+(glam[1]-glam[0])/2. if shifted then begin for i = 0, ny-2 do BEGIN xx = (transpose([[glam[*, i]], [glam2[*, i]]]))[*] yy = (transpose([[gphi[*, i]], [gphi[*, i+1]]]))[*] plots, xx[0:2*nx-2], yy[0:2*nx-2], color = c_cote, _extra = extra ENDFOR ENDIF ELSE BEGIN for i = 1, ny-1 do BEGIN xx = (transpose([[glam[*, i]], [glam2[*, i]]]))[*] yy = (transpose([[gphi[*, i]], [gphi[*, i-1]]]))[*] plots, xx[0:2*nx-2], yy[0:2*nx-2], color = c_cote, _extra = extra ENDFOR ENDELSE for i = 1, (ny-1)/2 do $ plots, [glam[0, 2*i-1], glam[0, 2*i]] $ , [gphi[0, 2*i-1], gphi[0, 2*i]], color = c_cote, _extra = extra for i = 0, (ny-2)/2 do $ plots, [glam[nx-1, 2*i], glam[nx-1, 2*i+1]] $ , [gphi[nx-1, 2*i], gphi[nx-1, 2*i+1]], color = c_cote, _extra = extra END endcase if keyword_set(key_performance) THEN print, 'temps trace grille', systime(1)-tempsun return end