[2] | 1 | ;------------------------------------------------------------ |
---|
| 2 | ;------------------------------------------------------------ |
---|
| 3 | ;------------------------------------------------------------ |
---|
| 4 | ;+ |
---|
| 5 | ; |
---|
[142] | 6 | ; @file_comments |
---|
| 7 | ; Provide caption |
---|
[2] | 8 | ; |
---|
[142] | 9 | ; @categories |
---|
| 10 | ; graphic, annex |
---|
[2] | 11 | ; |
---|
[142] | 12 | ; @param MI {in}{required} |
---|
| 13 | ; The min of the drawing |
---|
| 14 | ; |
---|
| 15 | ; @param MA {in}{required} |
---|
| 16 | ; The max of the plot |
---|
[2] | 17 | ; |
---|
[142] | 18 | ; @param COUPE |
---|
| 19 | ; Charactere containing two letters giving the type of the cut (for example: 'xz'). |
---|
[2] | 20 | ; |
---|
[142] | 21 | ; @keyword CONTOUR |
---|
| 22 | ; If we want to trace contours of a different field than the one |
---|
| 23 | ; whose we have the colored drawing (by examlpe E-P in color and QSR in contours). |
---|
| 24 | ; It must be a field respecting same caracteristics than the argument number one of plt. |
---|
[2] | 25 | ; |
---|
[142] | 26 | ; @keyword ENDPOINTS |
---|
| 27 | ; Used when we do vertical cuts in diagonal. |
---|
[2] | 28 | ; |
---|
[142] | 29 | ; @keyword _EXTRA |
---|
| 30 | ; used to pass your keywords |
---|
| 31 | ; |
---|
| 32 | ; @uses |
---|
| 33 | ; common.pro |
---|
[2] | 34 | ; |
---|
[142] | 35 | ; @restrictions |
---|
| 36 | ; The use of the global variable langage allows to change the language and the caption easily. |
---|
[2] | 37 | ; |
---|
[142] | 38 | ; @history |
---|
| 39 | ; Sebastien Masson (smasson@lodyc.jussieu.fr) |
---|
[2] | 40 | ; 14/8/98 |
---|
| 41 | ; Eric Guilyardi (ericg@lodyc.jussieu.fr) GB version |
---|
| 42 | ; 11/6/99 |
---|
[142] | 43 | ; |
---|
| 44 | ; @version |
---|
| 45 | ; $Id$ |
---|
| 46 | ; |
---|
[2] | 47 | ;- |
---|
| 48 | ;------------------------------------------------------------ |
---|
| 49 | ;------------------------------------------------------------ |
---|
| 50 | ;------------------------------------------------------------ |
---|
| 51 | pro legende,mi,ma,coupe,CONTOUR = contour,ENDPOINTS = endpoints, DIREC = direc $ |
---|
| 52 | , VECTLEGENDE = vectlegende $ |
---|
[42] | 53 | , INTERVALLE = intervalle, TYPE_YZ = type_yz, VARNAME2 = varname2 $ |
---|
[2] | 54 | , NPTS = npts, _EXTRA = ex |
---|
[114] | 55 | ; |
---|
| 56 | compile_opt idl2, strictarrsubs |
---|
| 57 | ; |
---|
[2] | 58 | @common |
---|
| 59 | tempsun = systime(1) ; pour key_performance |
---|
| 60 | ;------------------------------------------------------------ |
---|
[42] | 61 | grille, -1, -1, -1, gdep, nx, ny, nz |
---|
[2] | 62 | ; |
---|
| 63 | ; English legends |
---|
| 64 | ; |
---|
[42] | 65 | fmt_mm = '(f12.2)' |
---|
| 66 | fmt_bt = '(f7.1)' |
---|
| 67 | colorf = '' |
---|
| 68 | contourf = 'Contour plot,' |
---|
| 69 | vecteurf = 'Vector norm ' |
---|
| 70 | expf = '' |
---|
| 71 | datef = ' ' |
---|
| 72 | fieldf = ' ' |
---|
| 73 | depthf = ' ' |
---|
| 74 | endpointsf = 'Diag. Section' |
---|
| 75 | zonalf = '' |
---|
| 76 | IF key_onearth THEN latintf = 'latitudes in ' ELSE latintf = 'j index in ' |
---|
| 77 | timintf = 'time in ' |
---|
| 78 | onf = ' - ' |
---|
| 79 | depthf2 = 'Depth (m)' |
---|
| 80 | Meridf = 'Zonal Mean ' |
---|
| 81 | IF key_onearth THEN lonintf = 'longitudes in ' ELSE lonintf = 'i in ' |
---|
| 82 | hovxt = 'XT-plot ' |
---|
| 83 | diaghovxt = 'Diag. XT-plot ' |
---|
| 84 | depintf = 'depths in ' |
---|
| 85 | timef = 'Time' |
---|
| 86 | hovyt = 'YT-plot ' |
---|
| 87 | diaghovyt = 'Diag. YT-plot ' |
---|
| 88 | hovzt = 'ZT-plot ' |
---|
| 89 | hovt = '' |
---|
| 90 | IF key_onearth THEN lontitle = 'Longitude' ELSE lontitle = 'i index' |
---|
| 91 | IF key_onearth THEN lattitle = 'Latitude' ELSE lattitle = 'j index' |
---|
| 92 | |
---|
[2] | 93 | vertz = depthf2 |
---|
| 94 | legniv = ' m' |
---|
[42] | 95 | IF keyword_set(TYPE_YZ) THEN BEGIN |
---|
| 96 | IF type_yz EQ 'hPa' THEN vertz = 'hPa' |
---|
| 97 | IF type_yz EQ 'hPa' THEN legniv = ' hPa' |
---|
[2] | 98 | ENDIF |
---|
| 99 | ; |
---|
| 100 | ; Start legende |
---|
| 101 | ; |
---|
| 102 | ;------------------------------------------------------------ |
---|
[142] | 103 | ; definition and possible complement of !p.subtitle |
---|
[2] | 104 | ;------------------------------------------------------------ |
---|
| 105 | if n_elements(varunit) ne 0 then unite='('+varunit+')' else unite='' |
---|
| 106 | !p.subtitle=colorf+unite+': Min= '+strtrim(string(format=fmt_mm,mi), 2)$ |
---|
| 107 | +', Max= '+strtrim(string(format=fmt_mm,ma), 2) |
---|
| 108 | if keyword_set(intervalle) then BEGIN |
---|
| 109 | if intervalle NE -1 then $ |
---|
| 110 | !p.subtitle=!p.subtitle+', Int= '+strtrim(string(format=fmt_mm,intervalle), 2) |
---|
| 111 | endif |
---|
[142] | 112 | if size(contour, /type) EQ 8 then BEGIN ; it is a structure |
---|
[2] | 113 | unite='('+contour.(1)+')' |
---|
| 114 | !p.subtitle=!p.subtitle+'!C '+contourf+unite $ |
---|
| 115 | +': Min= '+strtrim(string(format=fmt_mm,contour.(0)[0]), 2)$ |
---|
| 116 | +', Max= '+strtrim(string(format=fmt_mm,contour.(0)[1]), 2) |
---|
| 117 | if contour.inter NE -1 then $ |
---|
| 118 | !p.subtitle=!p.subtitle+', Int= '+strtrim(string(format=fmt_mm,contour.inter), 2) |
---|
| 119 | ENDIF |
---|
| 120 | if size(vectlegende, /type) EQ 8 then begin |
---|
| 121 | unite='('+vectlegende.(1)+')' |
---|
| 122 | !p.subtitle=!p.subtitle+'!C '+vecteurf+unite $ |
---|
| 123 | +': Min= '+strtrim(string(format=fmt_mm,vectlegende.(0)[0]), 2)$ |
---|
| 124 | +', Max= '+strtrim(string(format=fmt_mm,vectlegende.(0)[1]), 2) |
---|
| 125 | endif |
---|
| 126 | ;------------------------------------------------------------ |
---|
[142] | 127 | ; Shapping of subdomain 's dimensions |
---|
| 128 | ;------------------------------------------------------------ |
---|
| 129 | la1=strtrim(string(format=fmt_bt, lat1), 2) |
---|
[2] | 130 | la2=strtrim(string(format=fmt_bt, lat2), 2) |
---|
| 131 | lo1=strtrim(string(format=fmt_bt, lon1), 2) |
---|
| 132 | lo2=strtrim(string(format=fmt_bt, lon2), 2) |
---|
[42] | 133 | pr1=strtrim(string(format=fmt_bt, vert1), 2) |
---|
| 134 | pr2=strtrim(string(format=fmt_bt, vert2), 2) |
---|
[2] | 135 | ;------------------------------------------------------------ |
---|
[142] | 136 | ; Management of the date |
---|
| 137 | ;------------------------------------------------------------ |
---|
| 138 | if n_elements(vardate) EQ 0 then vardate = '' |
---|
[2] | 139 | if NOT keyword_set(direc) then direc = '' |
---|
| 140 | if strpos(direc, 't') NE -1 then begin |
---|
| 141 | svardate = strtrim(vairdate(time[0]), 1)+' - '+strtrim(vairdate(time[jpt-1]), 1) |
---|
| 142 | ENDIF ELSE svardate = vardate |
---|
| 143 | ;------------------------------------------------------------ |
---|
[142] | 144 | ; case on the caes where the caption is applied |
---|
| 145 | ;------------------------------------------------------------ |
---|
[2] | 146 | case coupe of |
---|
| 147 | 'xy':begin |
---|
[42] | 148 | if strupcase(vargrid) EQ 'W' then firstz = firstzw $ |
---|
| 149 | ELSE firstz = firstzt |
---|
| 150 | if(strpos(direc, 'z') EQ -1 AND firstz NE 0) then BEGIN |
---|
| 151 | prof = strtrim(round(gdep[0]), 1) |
---|
| 152 | !p.title = expf+varexp+datef+svardate+fieldf+varname+depthf+prof+legniv |
---|
| 153 | ENDIF ELSE !p.title = expf+varexp+datef+svardate+fieldf+varname |
---|
| 154 | !x.title = lontitle |
---|
| 155 | !y.title = lattitle |
---|
[2] | 156 | end |
---|
| 157 | |
---|
| 158 | 'xz':begin |
---|
| 159 | IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(ny, 1) |
---|
| 160 | IF long(n) LE 3 THEN zonalf = 'Section ' |
---|
| 161 | if keyword_set(endpoints) AND lat1 NE lat2 then $ |
---|
| 162 | !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ |
---|
| 163 | !p.title = zonalf+varexp+datef+svardate+fieldf+varname |
---|
[42] | 164 | !x.title = lontitle |
---|
| 165 | if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN |
---|
| 166 | IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) |
---|
| 167 | ENDIF |
---|
[2] | 168 | !y.title = depthf2 |
---|
| 169 | end |
---|
| 170 | |
---|
| 171 | 'yz':begin |
---|
| 172 | IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx, 1) |
---|
| 173 | IF long(n) LE 3 THEN meridf = '' |
---|
| 174 | if keyword_set(endpoints) AND lon1 NE lon2 then $ |
---|
| 175 | !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ |
---|
| 176 | !p.title = meridf+varexp+datef+svardate+fieldf+varname |
---|
| 177 | !y.title = vertz |
---|
[42] | 178 | !x.title = lattitle |
---|
| 179 | if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN |
---|
| 180 | IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) |
---|
| 181 | ENDIF |
---|
[2] | 182 | end |
---|
| 183 | |
---|
| 184 | 'xt':begin |
---|
| 185 | ; IF keyword_set(npts) THEN n = strtrim(npts, 1) |
---|
| 186 | if keyword_set(endpoints) AND lat1 NE lat2 then $ |
---|
| 187 | !p.title = diaghovxt+varexp+fieldf+varname ELSE $ |
---|
| 188 | !p.title = hovxt+varexp+fieldf+varname |
---|
| 189 | IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !y.title = timef |
---|
[42] | 190 | !x.title = lontitle |
---|
| 191 | if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN |
---|
| 192 | IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) |
---|
| 193 | ENDIF |
---|
[2] | 194 | end |
---|
| 195 | |
---|
| 196 | 'yt':begin |
---|
| 197 | ; IF keyword_set(npts) THEN n = strtrim(npts, 1) |
---|
| 198 | if keyword_set(endpoints) AND lon1 NE lon2 then $ |
---|
| 199 | !p.title = diaghovyt+varexp+fieldf+varname ELSE $ |
---|
| 200 | !p.title = hovyt+varexp+fieldf+varname |
---|
| 201 | IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef |
---|
[42] | 202 | !y.title = lattitle |
---|
| 203 | if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN |
---|
| 204 | IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) |
---|
| 205 | ENDIF |
---|
[2] | 206 | end |
---|
| 207 | |
---|
| 208 | 'zt':begin |
---|
| 209 | ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny, 1) |
---|
| 210 | !p.title = hovzt+varexp+fieldf+varname |
---|
| 211 | !y.title = depthf2 |
---|
| 212 | IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef |
---|
| 213 | end |
---|
| 214 | 't':begin |
---|
| 215 | ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE BEGIN |
---|
| 216 | ; if keyword_set(integration3d) then n=strtrim(nx*ny*nz, 1) ELSE n=strtrim(nx*ny, 1) |
---|
| 217 | ; ENDELSE |
---|
| 218 | !p.title = hovt+varexp+fieldf+varname |
---|
| 219 | !y.title = varname |
---|
| 220 | IF (time[(size(time))[0]-1] - time[0]) GE 10 THEN !x.title = timef |
---|
| 221 | end |
---|
| 222 | 'x':begin |
---|
| 223 | ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(ny*nz, 1) |
---|
| 224 | if keyword_set(endpoints) AND lat1 NE lat2 then $ |
---|
| 225 | !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ |
---|
| 226 | !p.title = varexp+datef+svardate+fieldf+varname |
---|
[42] | 227 | !x.title = lontitle |
---|
| 228 | if keyword_set(endpoints) AND lat1 EQ lat2 then BEGIN |
---|
| 229 | IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lataxe(0, 0, lat1), 1) ELSE !x.title = !x.title+' at j index '+strtrim(lat1, 1) |
---|
| 230 | ENDIF |
---|
[2] | 231 | !y.title = varname |
---|
| 232 | end |
---|
| 233 | 'y':begin |
---|
| 234 | ; IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*nz, 1) |
---|
| 235 | if keyword_set(endpoints) AND lon1 NE lon2 then $ |
---|
| 236 | !p.title = endpointsf+varexp+datef+svardate+fieldf+varname ELSE $ |
---|
| 237 | !p.title = varexp+datef+svardate+fieldf+varname |
---|
[42] | 238 | !x.title = lattitle |
---|
| 239 | if keyword_set(endpoints) AND lon1 EQ lon2 then BEGIN |
---|
| 240 | IF key_onearth THEN !x.title = !x.title+' at '+strtrim(lonaxe(0, 0, lon1), 1) ELSE !x.title = !x.title+' at i index '+strtrim(lon1, 1) |
---|
| 241 | ENDIF |
---|
[2] | 242 | !y.title = varname |
---|
| 243 | end |
---|
| 244 | 'z':begin |
---|
| 245 | IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny, 1) |
---|
| 246 | !p.title = varexp+datef+svardate+fieldf+varname |
---|
| 247 | !y.title = depthf2 |
---|
| 248 | !x.title = varname |
---|
| 249 | end |
---|
| 250 | 'yfx': BEGIN |
---|
| 251 | IF keyword_set(npts) THEN n = strtrim(npts, 1) ELSE n=strtrim(nx*ny*nz, 1) |
---|
| 252 | !p.title = varexp+datef+svardate+varunit |
---|
| 253 | !x.title = varname2 |
---|
| 254 | !y.title = varname |
---|
| 255 | END |
---|
| 256 | else: |
---|
| 257 | ENDCASE |
---|
| 258 | if keyword_set(direc) then BEGIN |
---|
| 259 | if strpos(direc, 'x') NE -1 then $ |
---|
| 260 | !p.subtitle = lonintf+'['+lo1+', '+lo2+']'+onf+'('+strtrim(nx, 1)+' points) !C' +!p.subtitle |
---|
| 261 | if strpos(direc, 'y') NE -1 then BEGIN |
---|
| 262 | if strpos(!p.subtitle, '[') EQ -1 then $ |
---|
| 263 | !p.subtitle = latintf+'['+la1+', '+la2+']'+onf+'('+strtrim(ny, 1)+' points) !C'+!p.subtitle $ |
---|
| 264 | ELSE !p.subtitle = latintf+'['+la1+', '+la2+']'+onf+'('+strtrim(ny, 1)+' points) '+!p.subtitle |
---|
| 265 | ENDIF |
---|
| 266 | if strpos(direc, 'z') NE -1 AND (nz NE 1 OR coupe NE 'xy') then BEGIN |
---|
| 267 | if strpos(!p.subtitle, '[') EQ -1 then $ |
---|
| 268 | !p.subtitle = depintf+'['+pr1+', '+pr2+']'+onf+'('+strtrim(nz, 1)+' points) !C'+!p.subtitle $ |
---|
| 269 | ELSE !p.subtitle = depintf+'['+pr1+', '+pr2+']'+onf+'('+strtrim(nz, 1)+' points) '+!p.subtitle |
---|
| 270 | ENDIF |
---|
| 271 | ENDIF |
---|
| 272 | if keyword_set(endpoints) AND coupe NE 'yt' AND lat1 NE lat2 then !p.title = !p.title+'!C!C' |
---|
| 273 | |
---|
| 274 | if keyword_set(key_performance) THEN print, 'temps legende', systime(1)-tempsun |
---|
| 275 | return |
---|
| 276 | end |
---|