[497] | 1 | ;;;;;;;;;;;; positionDims ;;;;;;;;;;;;;;;; |
---|
| 2 | |
---|
| 3 | undef("positionDims") |
---|
| 4 | function positionDims(var,nbdim,names) |
---|
| 5 | ;============================ |
---|
| 6 | |
---|
| 7 | ; var : variable |
---|
| 8 | ; nbdim : number of dimensions for var |
---|
| 9 | ; names : names of the 4 dimensions: time,levs,lat,lon |
---|
| 10 | |
---|
| 11 | begin |
---|
| 12 | |
---|
| 13 | flag=(/10,10,10,10/) |
---|
| 14 | do i=0,nbdim-1 |
---|
| 15 | if (var!i.eq.names(0)) then |
---|
| 16 | flag(0)=i |
---|
| 17 | end if |
---|
| 18 | if (var!i.eq.names(1)) then |
---|
| 19 | flag(1)=i |
---|
| 20 | end if |
---|
| 21 | if (var!i.eq.names(2)) then |
---|
| 22 | flag(2)=i |
---|
| 23 | end if |
---|
| 24 | if (var!i.eq.names(3)) then |
---|
| 25 | flag(3)=i |
---|
| 26 | end if |
---|
| 27 | end do |
---|
| 28 | |
---|
| 29 | return(flag) |
---|
| 30 | |
---|
| 31 | end |
---|
| 32 | |
---|
| 33 | ;;;;;;;;;;;; trimVar ;;;;;;;;;;;;;;;; |
---|
| 34 | |
---|
| 35 | undef("trimVar") |
---|
| 36 | function trimVar(var,nbdim,dimname,mindimval,maxdimval) |
---|
| 37 | ;============================ |
---|
| 38 | |
---|
| 39 | ; var : variable |
---|
| 40 | ; nbdim : number of dimensions for var |
---|
| 41 | ; dimname : names of the dimensions for this var |
---|
| 42 | ; mindimval: min values for the dimensions |
---|
| 43 | ; maxdimval: max values for the dimensions |
---|
| 44 | |
---|
| 45 | begin |
---|
| 46 | |
---|
| 47 | if (nbdim.eq.1) then |
---|
| 48 | vartrim=var({$dimname(0)$|mindimval(0):maxdimval(0)}) |
---|
| 49 | end if |
---|
| 50 | if (nbdim.eq.2) then |
---|
| 51 | vartrim=var({$dimname(0)$|mindimval(0):maxdimval(0)},{$dimname(1)$|mindimval(1):maxdimval(1)}) |
---|
| 52 | end if |
---|
| 53 | if (nbdim.eq.3) then |
---|
| 54 | vartrim=var({$dimname(0)$|mindimval(0):maxdimval(0)},{$dimname(1)$|mindimval(1):maxdimval(1)},{$dimname(2)$|mindimval(2):maxdimval(2)}) |
---|
| 55 | end if |
---|
| 56 | if (nbdim.eq.4) then |
---|
| 57 | vartrim=var({$dimname(0)$|mindimval(0):maxdimval(0)},{$dimname(1)$|mindimval(1):maxdimval(1)},{$dimname(2)$|mindimval(2):maxdimval(2)},{$dimname(3)$|mindimval(3):maxdimval(3)}) |
---|
| 58 | end if |
---|
| 59 | |
---|
| 60 | return(vartrim) |
---|
| 61 | |
---|
| 62 | end |
---|
| 63 | |
---|
| 64 | ;;;;;;;;;;;; avgVar ;;;;;;;;;;;;;;;; |
---|
| 65 | |
---|
| 66 | undef("avgVar") |
---|
| 67 | function avgVar(vartrim,nbdim,dimavg) |
---|
| 68 | ;============================ |
---|
| 69 | |
---|
| 70 | ; vartrim : variable |
---|
| 71 | ; nbdim : number of dimensions for var |
---|
| 72 | ; dimavg : logicals for averaging the dimensions |
---|
| 73 | |
---|
| 74 | begin |
---|
| 75 | |
---|
| 76 | if ((nbdim.eq.4).and.(dimavg(3))) then |
---|
| 77 | vartrim_3=dim_avg_n_Wrap(vartrim,3) |
---|
| 78 | else |
---|
| 79 | vartrim_3=vartrim |
---|
| 80 | end if |
---|
| 81 | if ((nbdim.ge.3).and.(dimavg(2))) then |
---|
| 82 | vartrim_2=dim_avg_n_Wrap(vartrim_3,2) |
---|
| 83 | else |
---|
| 84 | vartrim_2=vartrim_3 |
---|
| 85 | end if |
---|
| 86 | if ((nbdim.ge.2).and.(dimavg(1))) then |
---|
| 87 | vartrim_1=dim_avg_n_Wrap(vartrim_2,1) |
---|
| 88 | else |
---|
| 89 | vartrim_1=vartrim_2 |
---|
| 90 | end if |
---|
| 91 | if ((nbdim.ge.1).and.(dimavg(0))) then |
---|
| 92 | varavg=dim_avg_n_Wrap(vartrim_1,0) |
---|
| 93 | else |
---|
| 94 | varavg=vartrim_1 |
---|
| 95 | end if |
---|
| 96 | |
---|
| 97 | return(varavg) |
---|
| 98 | |
---|
| 99 | end |
---|
| 100 | |
---|
| 101 | ;;;;;;;;;;;; deflimits_2d ;;;;;;;;;;;;;;;; |
---|
| 102 | |
---|
| 103 | undef("deflimits_2d") |
---|
| 104 | function deflimits_2d(var,res) |
---|
| 105 | ;============================ |
---|
| 106 | |
---|
| 107 | ; var : 2D variable |
---|
| 108 | ; res : ressource |
---|
| 109 | |
---|
| 110 | begin |
---|
| 111 | |
---|
| 112 | dims=dimsizes(var) |
---|
| 113 | dimname=getvardims(var) |
---|
| 114 | res@trXMinF = tofloat(var&$dimname(1)$(0)) |
---|
| 115 | res@trXMaxF = tofloat(var&$dimname(1)$(dims(1)-1)) |
---|
| 116 | res@trYMinF = tofloat(var&$dimname(0)$(0)) |
---|
| 117 | res@trYMaxF = tofloat(var&$dimname(0)$(dims(0)-1)) |
---|
| 118 | |
---|
| 119 | return(res) |
---|
| 120 | |
---|
| 121 | end |
---|
| 122 | |
---|
| 123 | ;;;;;;;;;;;; contours_2d ;;;;;;;;;;;;;;;; |
---|
| 124 | |
---|
| 125 | undef("contours_2d") |
---|
| 126 | function contours_2d(res,limits) |
---|
| 127 | ;============================ |
---|
| 128 | |
---|
| 129 | ; res : modified ressource for the plot |
---|
| 130 | ; limits : min, max and values for contours (-888 => automatic) |
---|
| 131 | |
---|
| 132 | begin |
---|
| 133 | |
---|
| 134 | if (limits(0).ne.-888) then |
---|
| 135 | res@cnLevelSelectionMode = "ManualLevels" |
---|
| 136 | res@cnMinLevelValF = limits(0) |
---|
| 137 | res@cnMaxLevelValF = limits(1) |
---|
| 138 | if (limits(2).ne.-888) then |
---|
| 139 | res@cnLevelSpacingF = limits(2) |
---|
| 140 | end if |
---|
| 141 | end if |
---|
| 142 | |
---|
| 143 | return(res) |
---|
| 144 | |
---|
| 145 | end |
---|
| 146 | |
---|
| 147 | ;;;;;;;;;;;; optionsOrtho ;;;;;;;;;;;;;;;; |
---|
| 148 | |
---|
| 149 | undef("optionsOrtho") |
---|
| 150 | function optionsOrtho(res,center,grid,spacing,gridcol) |
---|
| 151 | ;============================ |
---|
| 152 | |
---|
| 153 | ; res : modified ressource for the plot |
---|
| 154 | ; center : lon,lat coordinates for center of projection |
---|
| 155 | ; grid : logical for printing grid |
---|
| 156 | ; spacing: lon,lat spacing for grid |
---|
| 157 | ; gridcol: color for grid |
---|
| 158 | |
---|
| 159 | begin |
---|
| 160 | |
---|
| 161 | res@mpCenterLonF = center(0) ; choose center lon |
---|
| 162 | res@mpCenterLatF = center(1) ; choose center lat |
---|
| 163 | res@mpGridAndLimbOn = grid |
---|
| 164 | res@mpGridLonSpacingF = spacing(0) |
---|
| 165 | res@mpGridLatSpacingF = spacing(1) |
---|
| 166 | res@mpGridLineColor = gridcol |
---|
| 167 | |
---|
| 168 | return(res) |
---|
| 169 | |
---|
| 170 | end |
---|
| 171 | |
---|
| 172 | ;;;;;;;;;;;; optionsStereo ;;;;;;;;;;;;;;;; |
---|
| 173 | |
---|
| 174 | undef("optionsStereo") |
---|
| 175 | function optionsStereo(res,hm,grid,spacing,gridcol) |
---|
| 176 | ;============================ |
---|
| 177 | |
---|
| 178 | ; res : modified ressource for the plot |
---|
| 179 | ; hm : hemisphere to be plotted |
---|
| 180 | ; grid : logical for printing grid |
---|
| 181 | ; spacing: lon,lat spacing for grid |
---|
| 182 | ; gridcol: color for grid |
---|
| 183 | |
---|
| 184 | begin |
---|
| 185 | |
---|
| 186 | res@gsnPolar = hm |
---|
| 187 | |
---|
| 188 | res@mpGridAndLimbOn = grid |
---|
| 189 | res@mpGridLonSpacingF = spacing(0) |
---|
| 190 | res@mpGridLatSpacingF = spacing(1) |
---|
| 191 | res@mpGridLineColor = gridcol |
---|
| 192 | |
---|
| 193 | return(res) |
---|
| 194 | |
---|
| 195 | end |
---|
| 196 | |
---|
| 197 | ;;;;;;;;;;;; optionsOverPlot_2d ;;;;;;;;;;;;;;;; |
---|
| 198 | |
---|
| 199 | undef("optionsOverPlot_2d") |
---|
| 200 | function optionsOverPlot_2d(res) |
---|
| 201 | ;============================ |
---|
| 202 | |
---|
| 203 | ; res : modified ressource for the plot |
---|
| 204 | |
---|
| 205 | begin |
---|
| 206 | |
---|
| 207 | res@cnLineLabelFormat = "@5.1f" |
---|
| 208 | res@cnLineLabelsOn = True |
---|
| 209 | res@cnLabelMasking = True |
---|
| 210 | res@cnLineLabelBackgroundColor = -1 |
---|
| 211 | res@cnInfoLabelOn = False |
---|
| 212 | res@gsnContourNegLineDashPattern = 1 |
---|
| 213 | |
---|
| 214 | return(res) |
---|
| 215 | |
---|
| 216 | end |
---|
| 217 | |
---|
| 218 | ;;;;;;;;;;;; axePress_2d ;;;;;;;;;;;;;;;; |
---|
| 219 | |
---|
| 220 | undef("axePress_2d") |
---|
| 221 | function axePress_2d(res) |
---|
| 222 | ;============================ |
---|
| 223 | |
---|
| 224 | ; res : modified ressource for the plot |
---|
| 225 | |
---|
| 226 | begin |
---|
| 227 | |
---|
| 228 | res@tiYAxisString = "Pressure" |
---|
| 229 | res@trYReverse = True |
---|
| 230 | res@gsnYAxisIrregular2Log = True |
---|
| 231 | |
---|
| 232 | return(res) |
---|
| 233 | |
---|
| 234 | end |
---|
| 235 | |
---|
| 236 | ;;;;;;;;;;;; axePress_1d ;;;;;;;;;;;;;;;; |
---|
| 237 | |
---|
| 238 | undef("axePress_1d") |
---|
| 239 | function axePress_1d(res,axe,limits) |
---|
| 240 | ;============================ |
---|
| 241 | |
---|
| 242 | ; res : modified ressource for the plot |
---|
| 243 | ; axe : Y axis for plot (pressure) |
---|
| 244 | ; limits : min and max values for variable axis |
---|
| 245 | |
---|
| 246 | begin |
---|
| 247 | |
---|
| 248 | res@tiYAxisString = "Pressure" |
---|
| 249 | res@trYReverse = True |
---|
| 250 | res@xyYStyle = "Log" |
---|
| 251 | res@trYMinF = axe(0) |
---|
| 252 | res@trYMaxF = axe(dimsizes(axe)-1) |
---|
| 253 | if (limits(0).ne.-888) then |
---|
| 254 | res@trXMinF = limits(0) |
---|
| 255 | res@trXMaxF = limits(1) |
---|
| 256 | end if |
---|
| 257 | |
---|
| 258 | return(res) |
---|
| 259 | |
---|
| 260 | end |
---|
| 261 | |
---|
| 262 | |
---|
| 263 | undef("axeNoPress_1d") |
---|
| 264 | function axeNoPress_1d(res,axe,limits) |
---|
| 265 | ;============================ |
---|
| 266 | |
---|
| 267 | ; res : modified ressource for the plot |
---|
| 268 | ; axe : X axis for plot (not pressure) |
---|
| 269 | ; limits : min and max values for variable axis |
---|
| 270 | |
---|
| 271 | begin |
---|
| 272 | |
---|
| 273 | res@trXMinF = axe(0) |
---|
| 274 | res@trXMaxF = axe(dimsizes(axe)-1) |
---|
| 275 | if (limits(0).ne.-888) then |
---|
| 276 | res@trYMinF = limits(0) |
---|
| 277 | res@trYMaxF = limits(1) |
---|
| 278 | end if |
---|
| 279 | |
---|
| 280 | return(res) |
---|
| 281 | |
---|
| 282 | end |
---|
| 283 | |
---|
| 284 | ;;;;;;;;;;;; axeTimeX_2d ;;;;;;;;;;;;;;;; |
---|
| 285 | |
---|
| 286 | undef("axeTimeX_2d") |
---|
| 287 | function axeTimeX_2d(res,axe) |
---|
| 288 | ;============================ |
---|
| 289 | |
---|
| 290 | ; res : modified ressource for the plot |
---|
| 291 | ; axe : X axis is time |
---|
| 292 | |
---|
| 293 | begin |
---|
| 294 | |
---|
| 295 | res@tiXAxisString = "Time (local days)" |
---|
| 296 | res@sfXArray = axe |
---|
| 297 | res@tmXBLabelFontHeightF = 0.015 |
---|
| 298 | res@trXMinF = axe(0) |
---|
| 299 | res@trXMaxF = axe(dimsizes(axe)-1) |
---|
| 300 | |
---|
| 301 | return(res) |
---|
| 302 | |
---|
| 303 | end |
---|
| 304 | |
---|
| 305 | ;;;;;;;;;;;; axeTimeXls_2d ;;;;;;;;;;;;;;;; |
---|
| 306 | |
---|
| 307 | undef("axeTimeXls_2d") |
---|
| 308 | function axeTimeXls_2d(res,axe) |
---|
| 309 | ;============================ |
---|
| 310 | |
---|
| 311 | ; res : modified ressource for the plot |
---|
| 312 | ; axe : X axis is Ls |
---|
| 313 | |
---|
| 314 | begin |
---|
| 315 | |
---|
| 316 | res@tiXAxisString = "Solar longitude" |
---|
| 317 | res@sfXArray = axe |
---|
| 318 | res@gsnXAxisIrregular2Linear = True |
---|
| 319 | res@tmXBMode = "Manual" |
---|
| 320 | res@tmXBTickStartF = 0 |
---|
| 321 | res@tmXBTickEndF = 360 |
---|
| 322 | res@tmXBTickSpacingF = 30 |
---|
| 323 | res@tmXBMinorPerMajor = 2 |
---|
| 324 | res@tmXBLabelFontHeightF = 0.015 |
---|
| 325 | res@trXMinF = axe(0) |
---|
| 326 | res@trXMaxF = axe(dimsizes(axe)-1) |
---|
| 327 | |
---|
| 328 | return(res) |
---|
| 329 | |
---|
| 330 | end |
---|
| 331 | |
---|
| 332 | ;;;;;;;;;;;; axeTimeY_2d ;;;;;;;;;;;;;;;; |
---|
| 333 | |
---|
| 334 | undef("axeTimeY_2d") |
---|
| 335 | function axeTimeY_2d(res,axe) |
---|
| 336 | ;============================ |
---|
| 337 | |
---|
| 338 | ; res : modified ressource for the plot |
---|
| 339 | ; axe : Y axis is time |
---|
| 340 | |
---|
| 341 | begin |
---|
| 342 | |
---|
| 343 | res@tiYAxisString = "Time (local days)" |
---|
| 344 | res@sfYArray = axe |
---|
| 345 | res@tmYLLabelFontHeightF = 0.015 |
---|
| 346 | res@trYMinF = axe(0) |
---|
| 347 | res@trYMaxF = axe(dimsizes(axe)-1) |
---|
| 348 | |
---|
| 349 | return(res) |
---|
| 350 | |
---|
| 351 | end |
---|
| 352 | |
---|
| 353 | ;;;;;;;;;;;; axeTimeYls_2d ;;;;;;;;;;;;;;;; |
---|
| 354 | |
---|
| 355 | undef("axeTimeYls_2d") |
---|
| 356 | function axeTimeYls_2d(res,axe) |
---|
| 357 | ;============================ |
---|
| 358 | |
---|
| 359 | ; res : modified ressource for the plot |
---|
| 360 | ; axe : Y axis is Ls |
---|
| 361 | |
---|
| 362 | begin |
---|
| 363 | |
---|
| 364 | res@tiYAxisString = "Solar longitude" |
---|
| 365 | res@sfYArray = axe |
---|
| 366 | res@gsnYAxisIrregular2Linear = True |
---|
| 367 | res@tmYLMode = "Manual" |
---|
| 368 | res@tmYLTickStartF = 0 |
---|
| 369 | res@tmYLTickEndF = 360 |
---|
| 370 | res@tmYLTickSpacingF = 30 |
---|
| 371 | res@tmYLMinorPerMajor = 2 |
---|
| 372 | res@tmYLLabelFontHeightF = 0.015 |
---|
| 373 | res@trYMinF = axe(0) |
---|
| 374 | res@trYMaxF = axe(dimsizes(axe)-1) |
---|
| 375 | |
---|
| 376 | return(res) |
---|
| 377 | |
---|
| 378 | end |
---|
| 379 | |
---|
| 380 | ;;;;;;;;;;;; axeTime_1d ;;;;;;;;;;;;;;;; |
---|
| 381 | |
---|
| 382 | undef("axeTime_1d") |
---|
| 383 | function axeTime_1d(res,axe) |
---|
| 384 | ;============================ |
---|
| 385 | |
---|
| 386 | ; res : modified ressource for the plot |
---|
| 387 | ; axe : X axis is time |
---|
| 388 | |
---|
| 389 | begin |
---|
| 390 | |
---|
| 391 | res@tiXAxisString = "Time (local days)" |
---|
| 392 | res@tmXBLabelFontHeightF = 0.015 |
---|
| 393 | |
---|
| 394 | return(res) |
---|
| 395 | |
---|
| 396 | end |
---|
| 397 | |
---|
| 398 | ;;;;;;;;;;;; axeTimels_1d ;;;;;;;;;;;;;;;; |
---|
| 399 | |
---|
| 400 | undef("axeTimels_1d") |
---|
| 401 | function axeTimels_1d(res,axe) |
---|
| 402 | ;============================ |
---|
| 403 | |
---|
| 404 | ; res : modified ressource for the plot |
---|
| 405 | ; axe : X axis is Ls |
---|
| 406 | |
---|
| 407 | begin |
---|
| 408 | |
---|
| 409 | res@tiXAxisString = "Solar longitude" |
---|
| 410 | res@tmXBMode = "Manual" |
---|
| 411 | res@tmXBTickStartF = 0 |
---|
| 412 | res@tmXBTickEndF = 360 |
---|
| 413 | res@tmXBTickSpacingF = 30 |
---|
| 414 | res@tmXBMinorPerMajor = 2 |
---|
| 415 | res@tmXBLabelFontHeightF = 0.015 |
---|
| 416 | |
---|
| 417 | return(res) |
---|
| 418 | |
---|
| 419 | end |
---|
| 420 | |
---|
| 421 | ;;;;;;;;;;;; inversDim_2d ;;;;;;;;;;;;;;;; |
---|
| 422 | |
---|
| 423 | undef("inversDim_2d") |
---|
| 424 | function inversDim_2d(var) |
---|
| 425 | ;============================ |
---|
| 426 | |
---|
| 427 | ; var is a 2d variable |
---|
| 428 | |
---|
| 429 | begin |
---|
| 430 | |
---|
| 431 | dimname=getvardims(var) |
---|
| 432 | tmpvar = var($dimname(1)$|:,$dimname(0)$|:) |
---|
| 433 | |
---|
| 434 | return(tmpvar) |
---|
| 435 | |
---|
| 436 | end |
---|
| 437 | |
---|
| 438 | ;;;;;;;;;;;; revertLon_2dmap ;;;;;;;;;;;;;;;; |
---|
| 439 | |
---|
| 440 | undef("revertLon_2dmap") |
---|
| 441 | function revertLon_2dmap(var) |
---|
| 442 | ;============================ |
---|
| 443 | |
---|
| 444 | ; var is a 2d lat-lon variable |
---|
| 445 | |
---|
| 446 | begin |
---|
| 447 | |
---|
| 448 | tmpvar = var |
---|
| 449 | dimname = getvardims(var) |
---|
| 450 | Lname = dimname(1) |
---|
| 451 | nbL = dimsizes(var&$Lname$) |
---|
| 452 | tmpaxL = new(nbL,float) |
---|
| 453 | |
---|
| 454 | ;revert lon axis: |
---|
| 455 | do i=0,nbL-1 |
---|
| 456 | tmpaxL(i)=var&$Lname$(nbL-1-i) |
---|
| 457 | end do |
---|
| 458 | tmpvar&$Lname$ = tmpaxL |
---|
| 459 | |
---|
| 460 | ;revert values along lon axis: |
---|
| 461 | do i=0,nbL-1 |
---|
| 462 | tmpvar(:,i) = var(:,nbL-1-i) |
---|
| 463 | end do |
---|
| 464 | |
---|
| 465 | return(tmpvar) |
---|
| 466 | |
---|
| 467 | end |
---|
| 468 | |
---|
| 469 | ;;;;;;;;;;;; Map_2d ;;;;;;;;;;;;;;;; |
---|
| 470 | |
---|
| 471 | undef("Map_2d") |
---|
| 472 | function Map_2d(var,wks,res) |
---|
| 473 | ;============================ |
---|
| 474 | |
---|
| 475 | ; var : 2D variable |
---|
| 476 | ; wks : workstation |
---|
| 477 | ; res : ressource |
---|
| 478 | |
---|
| 479 | begin |
---|
| 480 | |
---|
| 481 | ; main plot characteristics |
---|
| 482 | |
---|
| 483 | res@gsnSpreadColors = True |
---|
| 484 | res@tmXTOn = False |
---|
| 485 | res@cnFillOn = True |
---|
| 486 | res@cnLineLabelsOn = True |
---|
| 487 | res@cnLabelMasking = True |
---|
| 488 | res@cnLineLabelBackgroundColor = "white" |
---|
| 489 | res@lbOrientation = "vertical" |
---|
| 490 | |
---|
| 491 | ; Create plot |
---|
| 492 | |
---|
| 493 | plotvar = gsn_csm_contour(wks, var, res ) |
---|
| 494 | |
---|
| 495 | return(plotvar) |
---|
| 496 | |
---|
| 497 | end |
---|
| 498 | |
---|
| 499 | ;;;;;;;;;;;; OPlot_2d ;;;;;;;;;;;;;;;; |
---|
| 500 | |
---|
| 501 | undef("OPlot_2d") |
---|
| 502 | function OPlot_2d(var,wks,res) |
---|
| 503 | ;============================ |
---|
| 504 | |
---|
| 505 | ; var : 2D variable |
---|
| 506 | ; wks : workstation |
---|
| 507 | ; res : ressource |
---|
| 508 | |
---|
| 509 | begin |
---|
| 510 | |
---|
| 511 | ; main plot characteristics |
---|
| 512 | |
---|
| 513 | res@tmXTOn = False |
---|
| 514 | res@tmYROn = False |
---|
| 515 | res@cnFillOn = False |
---|
| 516 | |
---|
| 517 | res@gsnLeftString = "" |
---|
| 518 | res@gsnRightString = "" |
---|
| 519 | |
---|
| 520 | ; Create plot |
---|
| 521 | |
---|
| 522 | plotvar = gsn_csm_contour(wks, var, res ) |
---|
| 523 | |
---|
| 524 | return(plotvar) |
---|
| 525 | |
---|
| 526 | end |
---|
| 527 | |
---|
| 528 | ;;;;;;;;;;;; Plot_1d ;;;;;;;;;;;;;;;; |
---|
| 529 | |
---|
| 530 | undef("Plot_1d") |
---|
| 531 | function Plot_1d(var,wks,res,axe,axep,limits) |
---|
| 532 | ;============================ |
---|
| 533 | |
---|
| 534 | ; var : 1D variable |
---|
| 535 | ; wks : workstation |
---|
| 536 | ; res : ressource |
---|
| 537 | ; axe : axis for plot |
---|
| 538 | ; axep : logical indication for pressure axis |
---|
| 539 | ; limits : min and max values for variable axis |
---|
| 540 | |
---|
| 541 | begin |
---|
| 542 | |
---|
| 543 | ; main plot characteristics |
---|
| 544 | |
---|
| 545 | ; Create plot |
---|
| 546 | ; pressure axis ? |
---|
| 547 | if (axep) then |
---|
| 548 | res=axePress_1d(res,axe,limits) |
---|
| 549 | plotvar = gsn_csm_xy(wks, var, axe, res ) |
---|
| 550 | else |
---|
| 551 | res1d=axeNoPress_1d(res,axe,limits) |
---|
| 552 | plotvar = gsn_csm_xy(wks, axe, var, res ) |
---|
| 553 | end if |
---|
| 554 | |
---|
| 555 | return(plotvar) |
---|
| 556 | |
---|
| 557 | end |
---|
| 558 | |
---|
| 559 | ;;;;;;;;;;;; Ortho_2d ;;;;;;;;;;;;;;;; |
---|
| 560 | |
---|
| 561 | undef("Ortho_2d") |
---|
| 562 | function Ortho_2d(var,wks,res) |
---|
| 563 | ;============================ |
---|
| 564 | |
---|
| 565 | ; var : 2D variable |
---|
| 566 | ; wks : workstation |
---|
| 567 | ; res : ressource |
---|
| 568 | |
---|
| 569 | begin |
---|
| 570 | |
---|
| 571 | ; main plot characteristics |
---|
| 572 | |
---|
| 573 | res@gsnSpreadColors = True |
---|
| 574 | res@tmXTOn = False |
---|
| 575 | res@cnFillOn = True |
---|
| 576 | res@cnLineLabelsOn = True |
---|
| 577 | res@cnLabelMasking = True |
---|
| 578 | res@cnLineLabelBackgroundColor = "white" |
---|
| 579 | res@lbOrientation = "vertical" |
---|
| 580 | |
---|
| 581 | res@mpProjection = "Orthographic" ; choose projection |
---|
| 582 | res@mpOutlineOn = False |
---|
| 583 | res@mpPerimOn = False ; turn off box around plot |
---|
| 584 | res@mpFillOn = False |
---|
| 585 | res@mpGridLineDashPattern = 2 |
---|
| 586 | |
---|
| 587 | ; Create plot |
---|
| 588 | |
---|
| 589 | plotvar = gsn_csm_contour_map(wks, var, res ) |
---|
| 590 | |
---|
| 591 | return(plotvar) |
---|
| 592 | |
---|
| 593 | end |
---|
| 594 | |
---|
| 595 | ;;;;;;;;;;;; Stereo_2d ;;;;;;;;;;;;;;;; |
---|
| 596 | |
---|
| 597 | undef("Stereo_2d") |
---|
| 598 | function Stereo_2d(var,wks,res) |
---|
| 599 | ;============================ |
---|
| 600 | |
---|
| 601 | ; var : 2D variable |
---|
| 602 | ; wks : workstation |
---|
| 603 | ; res : ressource |
---|
| 604 | |
---|
| 605 | begin |
---|
| 606 | |
---|
| 607 | ; main plot characteristics |
---|
| 608 | |
---|
| 609 | res@gsnSpreadColors = True |
---|
| 610 | res@tmXTOn = False |
---|
| 611 | res@cnFillOn = True |
---|
| 612 | res@cnLineLabelsOn = True |
---|
| 613 | res@cnLabelMasking = True |
---|
| 614 | res@cnLineLabelBackgroundColor = "white" |
---|
| 615 | res@lbOrientation = "vertical" |
---|
| 616 | |
---|
| 617 | res@mpProjection = "Stereographic" ; choose projection |
---|
| 618 | res@mpOutlineOn = False |
---|
| 619 | res@mpPerimOn = False ; turn off box around plot |
---|
| 620 | res@mpFillOn = False |
---|
| 621 | |
---|
| 622 | ; Create plot |
---|
| 623 | |
---|
| 624 | plotvar = gsn_csm_contour_map_polar(wks, var, res ) |
---|
| 625 | |
---|
| 626 | return(plotvar) |
---|
| 627 | |
---|
| 628 | end |
---|
| 629 | |
---|