Changeset 937 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 23, 2016, 8:10:57 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.bash
r927 r937 218 218 } 219 219 220 function join_lists() { 221 # Function to join lists without repeating values 222 # list1: first list to join 223 # list2: second list to join 224 # $ join_lists 1:2:3:4:5:6:7:8 a:b:3:c:5:6:7:9 225 # 1:2:3:4:5:6:7:8:a:b:c:9 226 227 fname='join_lists' 228 list1=$1 229 list2=$2 230 231 ls1s=`echo ${list1} | tr ':' ' '` 232 ls2s=`echo ${list2} | tr ':' ' '` 233 234 newlist=${list1} 235 for ls2 in ${ls2s}; do 236 if ! $(isInlist ${list1} ${ls2}); then 237 newlist=${newlist}':'${ls2} 238 fi 239 done 240 241 echo ${newlist} 242 } 220 243 221 244 # Specific … … 772 795 # diffmap2Dsfc: 2D map of surface differences values of 1 variable 773 796 # diffmap2Dz: 2D map of 3D differences values of 1 variable 774 # hovmsfc: Hovmoeller diagrams of 1 variable at the surface797 # shadconthovmsfc: Hovmoeller diagrams of 2 variable at the surface in shadow and the other in contourn 775 798 # map2Dsfc: 2D map of surface values of 1 variable 776 799 # map3D: 2D map of 3D values of 1 variable 777 # shadco unt2D: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]800 # shadcont2Dsfc: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2] 778 801 # 779 802 # ':' separated list of statitsics variable values are given as: [var]|[kind(including combo values)] … … 783 806 fname='draw_plot' 784 807 808 set -x 809 785 810 plot=$1 786 811 odir=$2 … … 795 820 # Assuming that multiple variables will be separated by '#' 796 821 nvars=`echo ${plotvals} | tr '#' ' ' | wc -w | awk '{print $1}'` 822 823 # Model and experiment 824 mod=`echo ${odir} | tr '/' '\n' | tail -n 2 | head -n 1` 825 exp=`echo ${odir} | tr '/' '\n' | tail -n 1` 797 826 798 827 figfiles='' … … 801 830 figvarparam='' 802 831 varkinds='' 832 vardims='' 803 833 if test ${nvars} -ge 1; then 804 834 figname=${kplot}_${headf} … … 821 851 fi 822 852 filen=`stats_filename ${varn} ${kind} ${headf}` 853 dims=`python ${pyHOME}/nc_var.py -o idims -f ${filen} | grep alldims | \ 854 awk '{print $3}'` 855 823 856 if test ${iv} -eq 1; then 824 857 varkinds=${varkind} … … 826 859 varinfilen=${vn} 827 860 figfiles=${filen} 861 vardims=${dims} 862 if $(isInlist ${dims} 'time'); then 863 tunits=`python ${pyHOME}/nc_var.py -o ivattrs -f ${filen} -v time | \ 864 grep units | grep -v '#' | awk '{print $3}'` 865 fi 828 866 else 829 867 varkinds=${varkinds}':'${varkind} … … 831 869 varinfilen=${varinfilen}':'${vn} 832 870 figfiles=${figfiles}':'${filen} 871 vardims=${vardims}':'${dims} 833 872 fi 834 873 … … 891 930 exit 892 931 ;; 893 'hovmsfc')894 echo " "${fname}": kind of plot '"${kplot}"' not ready !!"895 exit896 ;;897 932 'map2Dsfc') 898 933 echo " "${fname}": kind of plot '"${kplot}"' not ready !!" … … 903 938 exit 904 939 ;; 905 'shadco unt2Dsfc')906 figtit= `echo ${varkinds} | tr ':' '|'`940 'shadcont2Dsfc') 941 figtit=${mod}'|'${exp}'|'$(echo ${varkinds} | tr ':' '|') 907 942 shdstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $1}'` 908 943 cntstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $2}'` … … 924 959 graphvals=${graphvals}${figtit}':'${kindfig}':False:'${mapval} 925 960 926 plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont "927 plotins=${plotins}"-S '"${graphvals}"' -v "$(echo ${varinfileb} | tr ':' ',')928 echo " " >> ${odir}/all_figures.inf929 echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf930 echo ${plotins} >> ${odir}/all_figures.inf931 961 pyout=`python ${pyHOME}/drawing.py -f ${figfs} -o draw_2D_shad_cont \ 932 962 -S ${graphvals} -v $(echo ${varinfilen} | tr ':' ',')` … … 935 965 ferrmsg ${pyn} ${fname} "python!'draw_2D_shad_cont'!failed#"${Spyout} 936 966 mv 2Dfields_shadow-contour.${kindfig} ${figname} 967 968 # keeping all figures 969 plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont " 970 plotins=${plotins}"-S '"${graphvals}"' -v "$(echo ${varinfileb} | tr ':' ',') 971 echo " " >> ${odir}/all_figures.inf 972 echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf 973 echo ${plotins} >> ${odir}/all_figures.inf 974 975 # exit 976 ;; 977 'shadconthovmsfc') 978 shdstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $1}'` 979 cntstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $2}'` 980 981 # It is assumed that if the space variable is 'lon': is desired a (lon, time) plot 982 # it it is 'lat': then (time, lat) plot 983 dimspace='xxx' 984 if $( isInlist ${vardims} 'lon'); then 985 spacedim='lon' 986 figtit=${mod}'|'${exp}'|mean|longitudinal|evolution|of|'${shdstdn}'|&|' 987 figtit=${figtit}${cntstdn} 988 reverse='None' 989 dims=${spacedim}'|-1,time|-1;'${spacedim}'|-1,time|-1;'${spacedim}';time' 990 else 991 spacedim='lat' 992 figtit=${mod}'|'${exp}'|mean|meridional|evolution|of|'${shdstdn}'|&|' 993 figtit=${figtit}${cntstdn} 994 reverse='None' 995 dims=${spacedim}'|-1,time|-1;'${spacedim}'|-1,time|-1;time;'${spacedim} 996 fi 997 998 figfs=`echo ${figfiles} | tr ':' ','` 999 srange=`echo ${figvarparam} | tr ':' ' ' | awk '{print $1}' | tr '|' ' ' | \ 1000 awk '{print $1","$2}'` 1001 cbar=`echo ${figvarparam} | tr ':' ' ' | awk '{print $1}' | tr '|' ' ' | \ 1002 awk '{print $3}'` 1003 crange=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' | \ 1004 awk '{print $1","$2}'` 1005 cline=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' | \ 1006 awk '{print $5}'` 1007 cfmt=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' | \ 1008 awk '{print $4}'` 1009 1010 # if test ${spacedim} = 'lon'; then 1011 # dims='lon|-1,time|-1:lon|-1,time|-1:time:lon' 1012 # else 1013 # dims='lat|-1,time|-1:lat|-1,time|-1:time:lat' 1014 # fi 1015 1016 graphvals=$(echo ${CFvars} | tr ':' ',') 1017 graphvals=${shdstdn}','${cntstdn}';'${dims}';' 1018 graphvals=${graphvals}${cbar}';fixsigc,'${cline}';'${cfmt}';'${srange}';' 1019 graphvals=${graphvals}${crange}',9;'${figtit}';'${kindfig}';'${reverse}';' 1020 graphvals=${graphvals}'time|'${tunits}'|'${timekind}'|'${timefmt}'|' 1021 graphvals=${graphvals}${timelabel} 1022 1023 python ${pyHOME}/drawing.py -f ${figfs} -o draw_2D_shad_cont_time \ 1024 -S ${graphvals} -v $(echo ${varinfilen} | tr ':' ',') 1025 mv 2Dfields_shadow-contour.${kindfig} ${figname} 1026 1027 # keeping all figures 1028 plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont_time" 1029 plotins=${plotins}" -S ${graphvals} -v "$(echo ${varinfilen} | tr ':' ',') 1030 echo " " >> ${odir}/all_figures.inf 1031 echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf 1032 echo ${plotins} >> ${odir}/all_figures.inf 1033 937 1034 # exit 938 1035 ;; … … 987 1084 fi 988 1085 1086 if test ${addfiles} = 'true'; then 1087 addfiles=true 1088 else 1089 addfiles=false 1090 fi 1091 1092 if test ${addfigures} = 'true'; then 1093 addfigures=true 1094 else 1095 addfigures=false 1096 fi 1097 989 1098 if test ${debug} = 'true'; then 990 1099 dbg=true … … 1075 1184 echo "## Computation of variables " > ${owdir}/all_computevars.inf 1076 1185 echo "## Computation of statistics " > ${owdir}/all_statsvars.inf 1077 1078 1186 fi 1079 1187 … … 1320 1428 if $(isInlist ${directplots} ${drw}); then 1321 1429 case ${drw} in 1322 'hovmsfc')1323 plts=${plothovmsfc}1324 ;;1325 1430 'map2Dsfc') 1326 1431 plts=${pltmap2Dsfc} … … 1329 1434 plts=${pltmap3D} 1330 1435 ;; 1331 'shadcount2Dsfc') 1332 plts=${pltshadcount2Dsfc} 1436 'shadcont2Dsfc') 1437 plts=${pltshadcont2Dsfc} 1438 ;; 1439 'shadconthovmsfc') 1440 plts=${pltshadconthovmsfc} 1333 1441 ;; 1334 1442 *) … … 1353 1461 done 1354 1462 cat << EOF > directplotsdraw.inf 1463 Nkinds= ${ikp} 1355 1464 plots= ${plots} 1356 1465 EOF … … 1358 1467 echo ${warnmsg} 1359 1468 echo " "${main}": retrieving direct plots from existing file 'directplotsdraw.inf' !!" 1469 Nkinds=`cat directplotsdraw.inf | grep Nkinds | awk '{print $2}'` 1360 1470 plots=`cat directplotsdraw.inf | grep plots | awk '{print $2}'` 1361 1471 fi -
trunk/tools/model_graphics_template.dat
r927 r937 18 18 HOMEpy = ${HOME}/etudes/WRF_LMDZ/svn/LMDZ_WRF/tools 19 19 20 # Srcatch 21 scratch =false20 # Srcatch: should be any previous work removed and start from the scratch? 21 scratch = false 22 22 23 # Scratch files 24 filescratch =false23 # Scratch files: should be any files previous work removed and start from the scratch? 24 filescratch = false 25 25 26 # Scratch figures 27 figscratch=false 26 # Scratch figures: should be any figures previous work removed and start from the scratch? 27 figscratch = false 28 29 # Have new files been added and do they need to be processed? 30 addfiles = false 31 32 # Have new figures been added and do they need to be drawn? 33 addfiles = false 28 34 29 35 # Debug … … 77 83 varlast = tas:uas:vas:ps:pr:pracc:rsds:prw:evspsbl:hfss:hfls:hurs:huss:zmla:hufs:wakes:lwakeh:stherm:zmaxth:clt:cll:clm:clh:prc:prls:bils:wss 78 84 vartmean = tas:uas:vas:ps:pr:pracc:rsds:prw:evspsbl:hfss:hfls:hurs:huss:zmla:hufs:wakes:lwakeh:stherm:zmaxth:clt:cll:clm:clh:prc:prls:bils:wss 79 varxmean = ta:ua:va:hur 85 varxmean = ta:ua:va:hur:hurs:tas:wss:ps 80 86 vardiff = ualmean:valmean:talmean:huslmean:uas:vas:ps:pr 81 87 varpinterp = ta:ua:va:hur … … 83 89 84 90 # Operations which attach 'mean' at the end of the variable name 85 varmeanname='Lmean:lmean:tm aen:xmean:ymean'91 varmeanname='Lmean:lmean:tmean:xmean:ymean' 86 92 87 93 # Pressure levels … … 92 98 # diffmap2Dsfc: 2D map of surface differences values of 1 variable 93 99 # diffmap2Dz: 2D map of 3D differences values of 1 variable 94 # hovmsfc: Hovmoeller diagrams of 1 variable at the surface100 # shadconthovmsfc: Hovmoeller diagrams of 2 variables at the surface in shadow and the other in contourn 95 101 # map2Dsfc: 2D map of surface values of 1 variable 96 102 # map3D: 2D map of 3D values of 1 variable 97 # shadco unt2D: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]103 # shadcont2Dsfc: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2] 98 104 # 99 105 # ':' separated list of statitsics variable values are given as: [var]|[kind(including combo values)] 100 106 # in figures with more than 1 variable, use '#' to separate them 101 drawplots = shadco unt2Dsfc107 drawplots = shadcont2Dsfc:shadconthovmsfc 102 108 103 109 # Figures which can be made directly without another model/experiment output 104 directplots = hovmsfc:map2Dsfc:map3D:shadcount2Dsfc110 directplots = shadconthovmsfc:map2Dsfc:map3D:shadcont2Dsfc 105 111 106 pltshadcount2Dsfc = huss|tmean#tas|tmean:vas|tmean#uas|tmean:ps|tmean#wss|tmean:pr|tmean#rsds|tmean:prw|tmean#clt|tmean:hfls|tmean#hfss|tmean:evspsbl|tmean#bils|tmean:zmaxth|tmean#stherm|tmean:wakeh|tmean#wakes|tmean:zmaxth|tmean#stherm|tmean:prls|tmean#prc|tmean:clt|tmean#cll|tmean:clm|tmean#clh|tmean:hurs|tmean#zmla|tmean:huss|last#tas|last:vas|last#uas|last:ps|last#wss|tmean:pr|last#rsds|last:prw|last#clt|last:hfls|last#hfss|last:evspsbl|last#bils|last:zmaxth|last#stherm|last:wakeh|last#wakes|last:zmaxth|last#stherm|last:prls|last#prc|last:clt|last#cll|last:clm|last#clh|last:hurs|last#zmla|last 112 pltshadcont2Dsfc = huss|tmean#tas|tmean:vas|tmean#uas|tmean:ps|tmean#wss|tmean:pr|tmean#rsds|tmean:prw|tmean#clt|tmean:hfls|tmean#hfss|tmean:evspsbl|tmean#bils|tmean:zmaxth|tmean#stherm|tmean:wakeh|tmean#wakes|tmean:zmaxth|tmean#stherm|tmean:prls|tmean#prc|tmean:clt|tmean#cll|tmean:clm|tmean#clh|tmean:hurs|tmean#zmla|tmean:huss|last#tas|last:vas|last#uas|last:ps|last#wss|tmean:pr|last#rsds|last:prw|last#clt|last:hfls|last#hfss|last:evspsbl|last#bils|last:zmaxth|last#stherm|last:wakeh|last#wakes|last:zmaxth|last#stherm|last:prls|last#prc|last:clt|last#cll|last:clm|last#clh|last:hurs|last#zmla|last 113 pltshadconthovmsfc = hurs|xmean#tas|xmean:wss|xmean#ps|xmean 107 114 108 115 pltdiffmap2Dsfc = uas:vas:ps:pr … … 128 135 mapval = lcc,l 129 136 137 # Time parameters 138 # [timekind]; kind of output for the time ticks 139 # 'Nval': according to a given number of values as 'Nval',[Nval] 140 # 'exct': according to an exact number [Nunits] of time unit as 'exct',[tunit]; 141 # tunit= [Nunits],[tu] 142 # [tu]= 'c': centuries, 'y': year, 'm': month, 'w': week, 'd': day, 'h': hour, 'i': minute, 's': second, 'l': milisecond 143 # [timefmt]; desired format for the time ticks (combination of LaTeX and 'linux date formats') 144 # [timelabel]; label at the graph ('!' for spaces) 145 146 timekind = exct,6,h 147 timefmt = $%d^{%H}$ 148 timelabel = date!($[DD]^{[HH]}$) 149 130 150 # Generic 131 151 errmsg = ERROR--error--ERROR--error
Note: See TracChangeset
for help on using the changeset viewer.