Changeset 973 in lmdz_wrf
- Timestamp:
- Jun 29, 2016, 6:09:47 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.bash
r972 r973 727 727 } 728 728 729 function compute_vars() { 730 # Function to compute variables 731 # Iwdir= input folder 732 # Owdir= output folder 733 # Files= files to use 734 # Moddims= list of names of dimensions of the file 735 # Modvdims= list of names of the dimensions variables of the file 736 # VarCompute= list of variables to compute as ';' list of 737 # [CFvarn]|[varkind]|[headerf]|[varmod]|[vardiag] 738 # Filescratch= wether files have to be compute from the scratch or not 739 fname='compute_vars' 740 741 Iwdir=$1 742 Owdir=$2 743 Files=$3 744 Moddims=$4 745 Modvdims=$5 746 VarCompute=$6 747 Filescratch=$7 748 749 cd $Owdir 750 ic=1 751 isc=1 752 cvars=`echo ${VarCompute} | tr ';' ' '` 753 for cvar in ${cvars}; do 754 CFv=`echo ${cvar} | tr '|' ' ' | awk '{print $1}'` 755 vark=`echo ${cvar} | tr '|' ' ' | awk '{print $2}'` 756 fileh=`echo ${cvar} | tr '|' ' ' | awk '{print $3}'` 757 modv=`echo ${cvar} | tr '|' ' ' | awk '{print $4}'` 758 diagv=`echo ${cvar} | tr '|' ' ' | awk '{print $5}'` 759 if ${dbg}; then echo " "${CFv}"; "${modv}" "${diagv}; fi 760 761 if test ! ${modv} = 'None' || test ! ${diagv} = 'None'; then 762 compute_variable ${Iwdir} ${Files} ${Owdir} ${cvar} ${Moddims} ${Modvdims} \ 763 ${Filescratch} 764 ic=`expr ${ic} + 1` 765 766 if test ! ${vark} = 'diff' && test ! ${vark} = 'combo'; then 767 if test ${vark} = 'pinterp'; then 768 fhead=${fileh}'p' 769 else 770 fhead=${fileh} 771 fi 772 compute_statistics ${iwdir} ${CFv}_${fhead}.nc ${owdir} ${cvar} \ 773 ${moddims} ${modvdims} ${filescratch} 774 isc=`expr ${isc} + 1` 775 else 776 if test ${vark} = 'diff'; then 777 echo " "${main}": differences will be calculated when all the " \ 778 "model/experiments will be done !" 779 elif test ${vark} = 'combo'; then 780 echo " "${main}": combos will be calculated later when all the " \ 781 "variables will be done !" 782 fi 783 fi 784 else 785 if ${dbg}; then echo " not '"${CFv}"' for model '"${mod}"' !!"; fi 786 fi 787 788 # exit 789 # end of computing vars 790 done 791 } 792 729 793 function compute_statistics(){ 730 794 # Function to compute different statistics … … 1485 1549 testfs: ${testfiles} 1486 1550 EOF 1487 1488 exit1489 1551 else 1490 1552 echo $warnmsg … … 1501 1563 ## 1502 1564 echo " Computing all variables ..." 1503 cd $owdir 1504 ic=1 1505 isc=1 1506 cvars=`echo ${varcompute} | tr ';' ' '` 1507 for cvar in ${cvars}; do 1508 CFv=`echo ${cvar} | tr '|' ' ' | awk '{print $1}'` 1509 vark=`echo ${cvar} | tr '|' ' ' | awk '{print $2}'` 1510 fileh=`echo ${cvar} | tr '|' ' ' | awk '{print $3}'` 1511 modv=`echo ${cvar} | tr '|' ' ' | awk '{print $4}'` 1512 diagv=`echo ${cvar} | tr '|' ' ' | awk '{print $5}'` 1513 if ${dbg}; then echo " "${CFv}"; "${modv}" "${diagv}; fi 1514 1515 if test ! ${modv} = 'None' || test ! ${diagv} = 'None'; then 1516 compute_variable ${iwdir} ${files} ${owdir} ${cvar} ${moddims} ${modvdims} \ 1517 ${filescratch} 1518 ic=`expr ${ic} + 1` 1519 1520 if test ! ${vark} = 'diff' && test ! ${vark} = 'combo'; then 1521 if test ${vark} = 'pinterp'; then 1522 fhead=${fileh}'p' 1523 else 1524 fhead=${fileh} 1525 fi 1526 compute_statistics ${iwdir} ${CFv}_${fhead}.nc ${owdir} ${cvar} \ 1527 ${moddims} ${modvdims} ${filescratch} 1528 isc=`expr ${isc} + 1` 1529 else 1530 if test ${vark} = 'diff'; then 1531 echo " "${main}": differences will be calculated when all the " \ 1532 "model/experiments will be done !" 1533 elif test ${vark} = 'combo'; then 1534 echo " "${main}": combos will be calculated later when all the " \ 1535 "variables will be done !" 1536 fi 1537 fi 1538 else 1539 if ${dbg}; then echo " not '"${CFv}"' for model '"${mod}"' !!"; fi 1540 fi 1541 1542 # exit 1543 # end of computing vars 1544 done 1545 1565 1566 compute_vars ${iwdir} ${owdir} ${files} ${moddims} ${modvdims} ${varcompute} ${filescratch} 1567 1568 exit 1546 1569 # Computing combos 1547 1570 if ${combo}; then
Note: See TracChangeset
for help on using the changeset viewer.