Changeset 963
 Timestamp:
 Jul 25, 2012 12:40:24 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SCRIPTS/NCL/profiles.ncl
r961 r963 1322 1322 end if 1323 1323 1324 ; **************************************************** 1325 ; set up legend and colors 1326 ; **************************************************** 1327 1328 legend_label=new(np,string) 1329 do p=0, np1 1330 legend_label(p)=sprintf("%6.2f", t_all(ti_in(p))/3600) 1331 end do 1332 1333 ; *************************************************** 1334 ; set up recourses 1335 ; *************************************************** 1336 1337 res = True 1338 res@gsnDraw = False 1339 res@gsnFrame = False 1340 res@txFont = "helvetica" 1341 res@tiMainFont = "helvetica" 1342 res@tiXAxisFont = "helvetica" 1343 res@tiYAxisFont = "helvetica" 1344 res@tmXBLabelFont = "helvetica" 1345 res@tmYLLabelFont = "helvetica" 1346 res@lgLabelFont = "helvetica" 1347 res@tmLabelAutoStride = True 1348 1349 1350 if (legend .EQ. 1)then 1351 res@pmLegendDisplayMode = "Always" 1352 end if 1353 1354 res@pmLegendSide = "Right" 1355 res@xyExplicitLegendLabels = legend_label 1356 res@pmLegendWidthF = 0.12 1357 res@pmLegendHeightF = 0.05*np 1358 res@pmLegendParallelPosF = 1.0 1359 res@pmLegendOrthogonalPosF = 0.2625;1.0 1360 res@lgLabelFontHeightF = font_size_legend 1361 res@lgTitleString = "Time (h)" 1362 res@lgTitleFontHeightF = font_size 1363 res@txFontHeightF = font_size 1364 res@tiXAxisFontHeightF = font_size 1365 res@tiYAxisFontHeightF = font_size 1366 res@tmXBLabelFontHeightF = font_size 1367 res@tmYLLabelFontHeightF = font_size 1368 res@tiXAxisString = " " 1369 res@lgJustification = "TopLeft" 1370 1371 if ( black .eq. 0 ) then 1372 res@xyLineColors = (ispan(237,2,235/np)) 1373 end if 1374 if (norm_z .EQ. 1)then 1375 res@tiYAxisString = "Height (m)" 1376 else 1377 res@tiYAxisString = "Height / "+norm_z+" (m)" 1378 end if 1379 1380 if (log_z .EQ. 1) then 1381 res@trYLog = True 1382 end if 1383 1384 if (dash .EQ. 0 ) then 1385 res@xyMonoDashPattern = True 1386 else 1387 res@xyMonoDashPattern = False 1388 if (no_files .GT. 1) 1389 res@xyMonoDashPattern = True 1390 print(" ") 1391 print("If you use more than one file, patterns for different "+\ 1392 "timesteps cannot be used") 1393 print(" ") 1394 end if 1395 end if 1396 1397 res@tmXBMinorPerMajor = 4 1398 res@tmYLMinorPerMajor = 4 1399 1400 resP = True 1401 resP@gsnMaximize = True 1402 resP@gsnPanelXWhiteSpacePercent = 3.0 1403 resP@gsnPanelYWhiteSpacePercent = 2.0 1404 resP@txFont = "helvetica" 1405 resP@txString = f_att@title 1406 resP@txFuncCode = "~" 1407 resP@txFontHeightF = 0.015 1408 1409 ; *************************************************** 1410 ; set up graphics for plot 1411 ; *************************************************** 1412 1413 if (combine .EQ. 1) then 1414 plot_o = new(number_comb,graphic) 1415 label=new(number_comb,string) 1416 color_o=new(number_comb,integer) 1417 1418 if (check_vType) then 1419 mini=new(number_comb,double) 1420 maxi=new(number_comb,double) 1421 else 1422 mini=new(number_comb,float) 1423 maxi=new(number_comb,float) 1424 end if 1425 end if 1426 1427 if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then 1428 format_out@wkPaperSize = "A4" 1429 end if 1430 if ( format_out .EQ. "png" ) then 1431 format_out@wkWidth = 1000 1432 format_out@wkHeight = 1000 1433 end if 1434 1435 if (wks_gsn_log) then 1436 wks=gsn_open_wks(format_out,file_out) 1437 gsn_define_colormap(wks,"rainbow+white") 1438 wks_gsn_log = False 1439 end if 1324 if (com_i .EQ. 0) then 1440 1325 1441 1326 ; *************************************************** … … 1541 1426 min_z=min_z/norm_z 1542 1427 max_z=max_z/norm_z 1428 1429 end if 1430 1431 ; **************************************************** 1432 ; set up legend and colors 1433 ; **************************************************** 1434 1435 legend_label=new(np,string) 1436 do p=0, np1 1437 legend_label(p)=sprintf("%6.2f", t_all(ti_in(p))/3600) 1438 end do 1439 1440 ; *************************************************** 1441 ; set up recourses 1442 ; *************************************************** 1443 1444 res = True 1445 res@gsnDraw = False 1446 res@gsnFrame = False 1447 res@txFont = "helvetica" 1448 res@tiMainFont = "helvetica" 1449 res@tiXAxisFont = "helvetica" 1450 res@tiYAxisFont = "helvetica" 1451 res@tmXBLabelFont = "helvetica" 1452 res@tmYLLabelFont = "helvetica" 1453 res@lgLabelFont = "helvetica" 1454 res@tmLabelAutoStride = True 1455 1456 1457 if (legend .EQ. 1)then 1458 res@pmLegendDisplayMode = "Always" 1459 end if 1460 1461 res@pmLegendSide = "Left";"Right" 1462 res@xyExplicitLegendLabels = legend_label 1463 res@pmLegendWidthF = 0.12 1464 res@pmLegendHeightF = 0.05*np 1465 res@pmLegendParallelPosF = 1.0 1466 1467 if (max_z .GE. 1000.) then 1468 res@pmLegendOrthogonalPosF = 1.227 1469 else if ((max_z .LT. 1000.) .AND. (max_z .GE. 100.)) then 1470 res@pmLegendOrthogonalPosF = 1.202 1471 else if ((max_z .LT. 100.) .AND. (max_z .GE. 10.)) then 1472 res@pmLegendOrthogonalPosF = 1.177 1473 else if ((max_z .LT. 10.) .AND. (max_z .GE. 1.)) then 1474 res@pmLegendOrthogonalPosF = 1.190 1475 else if ((max_z .LT. 1.)) then 1476 res@pmLegendOrthogonalPosF = 1.215 1477 end if 1478 end if 1479 end if 1480 end if 1481 end if 1482 res@lgLabelFontHeightF = font_size_legend 1483 res@lgTitleString = "Time (h)" 1484 res@lgTitleFontHeightF = font_size 1485 res@txFontHeightF = font_size 1486 res@tiXAxisFontHeightF = font_size 1487 res@tiYAxisFontHeightF = font_size 1488 res@tmXBLabelFontHeightF = font_size 1489 res@tmYLLabelFontHeightF = font_size 1490 res@tiXAxisString = " " 1491 res@lgJustification = "TopLeft" 1492 1493 if ( black .eq. 0 ) then 1494 res@xyLineColors = (ispan(237,2,235/np)) 1495 end if 1496 if (norm_z .EQ. 1)then 1497 res@tiYAxisString = "Height (m)" 1498 else 1499 res@tiYAxisString = "Height / "+norm_z+" (m)" 1500 end if 1501 1502 if (log_z .EQ. 1) then 1503 res@trYLog = True 1504 end if 1505 1506 if (dash .EQ. 0 ) then 1507 res@xyMonoDashPattern = True 1508 else 1509 res@xyMonoDashPattern = False 1510 if (no_files .GT. 1) 1511 res@xyMonoDashPattern = True 1512 print(" ") 1513 print("If you use more than one file, patterns for different "+\ 1514 "timesteps cannot be used") 1515 print(" ") 1516 end if 1517 end if 1518 1519 res@tmXBMinorPerMajor = 4 1520 res@tmYLMinorPerMajor = 4 1521 1522 resP = True 1523 resP@gsnMaximize = True 1524 resP@gsnPanelXWhiteSpacePercent = 6.0 1525 resP@gsnPanelYWhiteSpacePercent = 6.0 1526 resP@txFont = "helvetica" 1527 resP@txString = f_att@title 1528 resP@txFuncCode = "~" 1529 resP@txFontHeightF = 0.0105 1530 1531 ; *************************************************** 1532 ; set up graphics for plot 1533 ; *************************************************** 1534 1535 if (combine .EQ. 1) then 1536 plot_o = new(number_comb,graphic) 1537 label=new(number_comb,string) 1538 color_o=new(number_comb,integer) 1539 1540 if (check_vType) then 1541 mini=new(number_comb,double) 1542 maxi=new(number_comb,double) 1543 else 1544 mini=new(number_comb,float) 1545 maxi=new(number_comb,float) 1546 end if 1547 end if 1548 1549 if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then 1550 format_out@wkPaperSize = "A4" 1551 end if 1552 if ( format_out .EQ. "png" ) then 1553 format_out@wkWidth = 1000 1554 format_out@wkHeight = 1000 1555 end if 1556 1557 if (wks_gsn_log) then 1558 wks=gsn_open_wks(format_out,file_out) 1559 gsn_define_colormap(wks,"rainbow+white") 1560 wks_gsn_log = False 1561 end if 1543 1562 1544 1563 ; *************************************************** … … 3337 3356 if (over .EQ. 0) then 3338 3357 3339 label = vNam(varn)3358 label = " " + vNam(varn) 3340 3359 3341 3360 lgres1 = True … … 3344 3363 lgres1@lgLabelFont = "helvetica" 3345 3364 lgres1@lgLabelFontHeightF = font_size_legend * 10.0 * 0.7 3346 lgres1@vpWidthF = 0.1 23365 lgres1@vpWidthF = 0.14 3347 3366 lgres1@vpHeightF = 0.1 / 3.0 + 0.01 3348 3367 … … 4552 4571 end if 4553 4572 end if 4554 label(n_o)= vNam(varn)4573 label(n_o)=" " + vNam(varn) 4555 4574 color_o(n_o)=237 4556 4575 plot_o(n_o)=gsn_csm_xy(wks,data(varn,:,:),z,res) … … 4599 4618 lgres = True 4600 4619 lgMonoDashIndex = False 4620 lgres@lgLineDashSegLenF = 0.075 4601 4621 lgres@lgDashIndexes = (/0,1,2/) 4602 4622 lgres@lgLabelFont = "helvetica" 4603 lgres@vpWidthF = 0.1 24604 lgres@vpHeightF = 0.1 * number_comb / 3.0 + 0.014623 lgres@vpWidthF = 0.14 4624 lgres@vpHeightF = 0.1 * number_comb / 3.0 + (number_comb + 1) * 0.01 4605 4625 lgres@lgLabelFontHeightF = 10.0 * font_size_legend * ((number_comb \ 4606 4626  2.0) * 0.35 + 0.65)
Note: See TracChangeset
for help on using the changeset viewer.