Changeset 908 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 19, 2016, 10:05:46 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.bash
r898 r908 162 162 # lsec: longitudinal section (longitudinal value must be given, [var]@[lat]) 163 163 # lmean: longitudinal mean values 164 # pinterp: pressure interpolation (to the given $plevels) 164 165 # tmean: temporal mean values 165 166 # zsum: vertical aggregated values … … 205 206 206 207 # Computing variable 207 filen=${odir}/${CFvarn}_${headerf}_${ifile}-${Ntotfiles}.nc 208 if test ${vark} == 'pinterp'; then 209 fhead=${headerf}p 210 else 211 fhead=${headerf} 212 fi 213 214 filen=${odir}/${CFvarn}_${fhead}_${ifile}-${Ntotfiles}.nc 208 215 if ${scratch}; then 209 216 rm ${filen} >& /dev/null 210 rm ${odir}/${CFvarn}_${ headerf}.nc >& /dev/null217 rm ${odir}/${CFvarn}_${fhead}.nc >& /dev/null 211 218 fi 212 219 213 if test ! -f ${filen} && test ! -f ${odir}/${CFvarn}_${ headerf}.nc; then220 if test ! -f ${filen} && test ! -f ${odir}/${CFvarn}_${fhead}.nc; then 214 221 if test ! ${modvar} = 'None'; then 215 222 # model variable … … 255 262 WRF_toCF ${filen} ${vdnx} ${vdny} 256 263 fi 264 # Attaching necessary variables for the pressure interpolation 265 if test ${vark} == 'pinterp'; then 266 requiredinterpvars='P:PB:PSFC:PH:PHB:HGT:T:QVAPOR:' 267 rqvs=`echo ${requiredinterpvars} | tr ':' ' '` 268 echo " "${fname}": adding variables: "${rqvs}" to allow pressure interpolation" 269 for rqv in ${rqvs}; do 270 pyout=`${pyHOME}/nc_var.py -o fvaradd -S ${cf},${rqv} -f ${filen}` 271 pyn=$? 272 Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'` 273 ferrmsgF ${pyn} ${fname} "python!'fvaradd'!failed#"${Spyout} ${filen} 274 done 275 fi 257 276 fi 277 258 278 259 279 ifile=`expr ${ifile} + 1` … … 262 282 263 283 # Joining variable files 264 filen=${odir}/${CFvarn}_${ headerf}.nc284 filen=${odir}/${CFvarn}_${fhead}.nc 265 285 if ${scratch}; then rm ${filen} >& /dev/null; fi 266 286 267 287 if test ! -f ${filen}; then 268 pyout=`python ${pyHOME}/nc_var.py -f ${CFvarn} _${headerf}_\269 -o netcdf_fold_concatenation -S ./,time -v all`288 pyout=`python ${pyHOME}/nc_var.py -f ${CFvarn}'_'${fhead}'_,-,.nc' \ 289 -o netcdf_fold_concatenation_HMT -S ./,time -v all` 270 290 pyn=$? 271 291 Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'` 272 ferrmsg ${pyn} ${fname} "python!'netcdf_fold_concatenation'!failed#"${Spyout} 273 274 mv netcdf_fold_concatenated.nc ${filen} 292 ferrmsg ${pyn} ${fname} "python!'netcdf_fold_concatenation_HMT'!failed#"${Spyout} 293 mv netcdf_fold_concatenated_HMT.nc ${filen} 275 294 if test -f ${filen}; then 276 rm ${CFvarn}_${ headerf}_*295 rm ${CFvarn}_${fhead}_*-*.nc 277 296 fi 278 297 fi … … 294 313 # lmean: longitudinal mean values 295 314 # lsec: longitudinal section (longitudinal value must be given, [var]@[lat]) 315 # pinterp: pressure interpolation (to the given $plevels) 296 316 # tmean: temporal mean values 297 317 # xmean: x-axis mean values … … 371 391 exit 372 392 ;; 393 # pinterp: pressure interpolation (to the given $plevels) 394 'pinterp') 395 vals=${plevels}',1,1' 396 python $pyHOME/nc_var.py -o pinterp -f ${cfiles} -S ${vals} -v ${CFvarn} 397 ;; 373 398 # temporal mean values 374 399 'tmean') … … 441 466 else 442 467 scratch=false 468 fi 469 470 if test ${debug} = 'true'; then 471 dbg=true 472 else 473 dbg=false 443 474 fi 444 475 … … 574 605 'lsec') 575 606 varvks=${varlsec} 607 ;; 608 'pinterp') 609 varvks=${varpinterp} 576 610 ;; 577 611 'tmean') … … 689 723 modv=`echo ${cvar} | tr '|' ' ' | awk '{print $4}'` 690 724 diagv=`echo ${cvar} | tr '|' ' ' | awk '{print $5}'` 691 echo " "${CFv}"; "${modv}" "${diagv}725 if ${dbg}; then echo " "${CFv}"; "${modv}" "${diagv}; fi 692 726 693 727 if test ! ${modv} = 'None' || test ! ${diagv} = 'None'; then … … 705 739 fi 706 740 else 707 echo " not computing '"${CFv}"' for model '"${mod}"' !!"741 if ${dbg}; then echo " not '"${CFv}"' for model '"${mod}"' !!"; fi 708 742 fi 709 743 -
trunk/tools/model_graphics_template.dat
r898 r908 20 20 # Srcatch 21 21 scratch=false 22 23 # Debug 24 debug=false 22 25 23 26 # Folder with the files … … 54 57 # lmean: longitudinal mean values 55 58 # lsec: longitudinal section (longitudinal value must be given, [var]@[lat]) 59 # pinterp: pressure interpolation (to the given $plevels, see below) 56 60 # tmean: temporal mean values 57 61 # xmean: x-axis mean values 58 62 # ymean: y-axis mean values 59 63 # zsum: vertical aggregated values 60 varkinds = direct:tmean:xmean:diff 64 varkinds = direct:tmean:xmean:diff:pinterp 61 65 62 66 # variables (providing CF-name, script must provide equivalent variable for each model) … … 67 71 varxmean = ta:ua:va:hur 68 72 vardiff = ualmean:valmean:talmean:huslmean:uas:vas:ps:pr 73 varpinterp = ta:ua:va:hur 69 74 75 # Pressure levels 76 # Common vertical pressure levels to compute vertical differences 77 plevels = 100000.:97500.:95000.:92500.:90000.:85000.:80000.:75000.:70000.:65000.:60000.:55000.:50000.:45000.:40000.:35000.:30000.:25000.:20000.:15000.:10000.:5000.:2500.:1000.:500.:250. 70 78 # Kind of plots 71 79 # diffmap2Dsfc: 2D map of surface differences values of 1 variable … … 79 87 diffmap2Dz = ualmean:valmean:talmean:huslmean 80 88 81 # Pressure levels82 # Common vertical pressure levels to compute vertical differences83 plevels = 100000.,97500.,95000.,92500.,90000.,85000.,80000.,75000.,70000.,65000.,60000.,55000.,50000.,45000.,40000.,35000.,30000.,25000.,20000.,15000.,10000.,5000.,2500.,1000.,500.,250.84 85 89 # Figures output 86 90 kindfig = pdf
Note: See TracChangeset
for help on using the changeset viewer.