Changeset 808 for trunk/UTIL/NCL/visu-utils.ncl
- Timestamp:
- Oct 16, 2012, 12:57:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/NCL/visu-utils.ncl
r497 r808 56 56 if (nbdim.eq.4) then 57 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 ; vartrim=var($dimname(0)$|0:0,{$dimname(1)$|mindimval(1):maxdimval(1)},{$dimname(2)$|mindimval(2):maxdimval(2)},{$dimname(3)$|mindimval(3):maxdimval(3)}) 58 59 end if 59 60 … … 628 629 end 629 630 631 ;;;;;;;;;;;; customVar ;;;;;;;;;;;;;;;; 632 633 undef("customVar") 634 function customVar(infile,labelvar) 635 ;============================ 636 637 ; infile : input file 638 ; labelvar : input label for variable 639 640 ; THIS IS TO BE CUSTOMIZED EACH TIME ACCORDING TO YOUR NEEDS 641 ; because it is impossible to make it automatic... 642 643 begin 644 645 prepared = "dummy" ; DEFAULT 646 647 if (labelvar.eq."dTdyn") then 648 if (isfilevar(infile,"vitu")) then 649 dtdyn = infile->dtdyn 650 else 651 dtdyn = infile->DTCORE 652 end if 653 myvar = dtdyn*1e7 654 copy_VarMeta(dtdyn,myvar) 655 myvar@units ="K/Vd" 656 myvar@long_name="Dynamics heating rate" 657 prepared = labelvar 658 end if 659 660 if (labelvar.eq."dTadj") then 661 if (isfilevar(infile,"vitu")) then 662 dtadj = infile->dtajs 663 else 664 dtadj = infile->DADJ 665 end if 666 myvar = dtadj*1e7 667 copy_VarMeta(dtadj,myvar) 668 myvar@units ="K/Vd" 669 myvar@long_name="Dry convection heating rate" 670 prepared = labelvar 671 end if 672 673 if (labelvar.eq."dTvdf") then 674 if (isfilevar(infile,"vitu")) then 675 dtvdf = infile->dtvdf 676 else 677 dtvdf = infile->DTV 678 end if 679 myvar = dtvdf*1e7 680 copy_VarMeta(dtvdf,myvar) 681 myvar@units ="K/Vd" 682 myvar@long_name="PBL heating rate" 683 prepared = labelvar 684 end if 685 686 if (labelvar.eq."dTrad") then 687 if (isfilevar(infile,"vitu")) then 688 dtlwr = infile->dtlwr 689 dtswr = infile->dtswr 690 else 691 dtlwr = infile->QRL 692 dtswr = infile->QRS 693 end if 694 myvar = (dtlwr+dtswr)*1e7 695 copy_VarMeta(dtlwr,myvar) 696 myvar@units ="K/Vd" 697 myvar@long_name="Radiative balance" 698 prepared = labelvar 699 end if 700 701 if (labelvar.eq."Tbal") then 702 if (isfilevar(infile,"vitu")) then 703 dtlwr = infile->dtlwr 704 dtswr = infile->dtswr 705 dtajs = infile->dtajs 706 dtdyn = infile->dtdyn 707 dtvdf = infile->dtvdf 708 else 709 dtlwr = infile->QRL 710 dtswr = infile->QRS 711 dtajs = infile->DADJ 712 dtdyn = infile->DTCORE 713 dtvdf = infile->DTV 714 end if 715 myvar = (dtlwr+dtswr+dtajs+dtdyn+dtvdf)*1e7 716 copy_VarMeta(dtlwr,myvar) 717 myvar@units ="K/Vd" 718 myvar@long_name="Thermal balance" 719 prepared = labelvar 720 end if 721 722 if (labelvar.eq."Tforc") then 723 if (isfilevar(infile,"vitu")) then 724 dtlwr = infile->dtlwr 725 dtswr = infile->dtswr 726 dtajs = infile->dtajs 727 if (isfilevar(infile,"dtvdf")) then 728 dtvdf = infile->dtvdf 729 else 730 dtvdf = dtajs*0. 731 end if 732 else 733 dtlwr = infile->QRL 734 dtswr = infile->QRS 735 dtajs = infile->DADJ 736 if (isfilevar(infile,"DTV")) then 737 dtvdf = infile->DTV 738 else 739 dtvdf = dtajs*0. 740 end if 741 end if 742 myvar = (dtlwr+dtswr+dtajs+dtvdf)*1e7 743 copy_VarMeta(dtlwr,myvar) 744 myvar@units ="K/Vd" 745 myvar@long_name="Thermal physical forcing" 746 prepared = labelvar 747 end if 748 749 if (labelvar.eq."ske") then 750 if (isfilevar(infile,"vitu")) then 751 u = infile->vitu 752 v = infile->vitv 753 else 754 u = infile->U 755 v = infile->V 756 end if 757 myvar = u*u+v*v 758 copy_VarMeta(u,myvar) 759 myvar@units ="m2/s2" 760 myvar@long_name="Specific kinetic energy" 761 prepared = labelvar 762 end if 763 764 if (prepared.eq."dummy") then ; DEFAULT: LEAVE AS IS 765 print("You chose a customized variable !") 766 print("Modify the function customVar in visu-utils.ncl to prepare this variable") 767 exit 768 end if 769 770 return(myvar) 771 772 end 773
Note: See TracChangeset
for help on using the changeset viewer.