- Timestamp:
- Jun 19, 2016, 2:10:51 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.bash
r886 r898 120 120 done 121 121 122 # CF attributes 123 dimvars='lon:lat:time:Times' 124 125 allfilevars=`python ${pyHOME}/nc_var.py -o ivars -f ${wrff} | grep allvars | awk '{print $3}'` 126 allvs=`echo ${allfilevars} | tr ':' ' '` 127 for vn in ${allvs}; do 128 if ! $(isInlist ${dimvars} ${vn}); then 129 varattrs=`python ${pyHOME}/generic.py -o variables_values -S ${vn}` 130 stn=`echo ${varattrs} | tr ':' ' ' | awk '{print $2}'` 131 lon=`echo ${varattrs} | tr ':' ' ' | awk '{print $5}' | tr '|' '!'` 132 un=`echo ${varattrs} | tr ':' ' ' | awk '{print $6}' | tr '|' '!'` 133 134 pyout=`python ${pyHOME}/nc_var.py -o varaddattr -f ${wrff} -S 'standard_name|'${stn} -v ${vn}` 135 pyn=$? 136 Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'` 137 ferrmsgF ${pyn} ${fname} "python!'varaddattr'!'standard_name'!failed#"${Spyout} ${wrff} 138 pyout=`python ${pyHOME}/nc_var.py -o varaddattr -f ${wrff} -S 'long_name|'${lon} -v ${vn}` 139 pyn=$? 140 Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'` 141 ferrmsgF ${pyn} ${fname} "python!'varaddattr'!'long_name'!failed#"${Spyout} ${wrff} 142 pyout=`python ${pyHOME}/nc_var.py -o varaddattr -f ${wrff} -S 'units|'${un} -v ${vn}` 143 pyn=$? 144 Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'` 145 ferrmsgF ${pyn} ${fname} "python!'varaddattr'!'units'!failed#"${Spyout} ${wrff} 146 fi 147 done 122 148 } 123 149 … … 181 207 filen=${odir}/${CFvarn}_${headerf}_${ifile}-${Ntotfiles}.nc 182 208 if ${scratch}; then 183 rm ${filen} 184 rm ${odir}/${CFvarn}_${headerf}.nc 209 rm ${filen} >& /dev/null 210 rm ${odir}/${CFvarn}_${headerf}.nc >& /dev/null 185 211 fi 186 212 … … 229 255 WRF_toCF ${filen} ${vdnx} ${vdny} 230 256 fi 231 232 LLUIS TO ADD ALL CF attributes!!!!!!!233 234 257 fi 235 258 … … 240 263 # Joining variable files 241 264 filen=${odir}/${CFvarn}_${headerf}.nc 242 if ${scratch}; then rm ${filen} ; fi265 if ${scratch}; then rm ${filen} >& /dev/null; fi 243 266 244 267 if test ! -f ${filen}; then … … 350 373 # temporal mean values 351 374 'tmean') 352 vals='time :-1,time,mean,lon:lat:'${vdnz}':time'375 vals='time|-1,time,mean,lon:lat:'${vdnz}':time' 353 376 dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon' 354 377 … … 362 385 # x-axis mean values 363 386 'xmean') 364 vals='lon :-1,lon,mean,lon:lat:'${vdnz}':time'387 vals='lon|-1,lon,mean,lon:lat:'${vdnz}':time' 365 388 dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon' 366 389 echo "python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${cfiles} -v ${CFvarn}" … … 375 398 # y-axis mean values 376 399 'ymean') 377 vals='lat :-1,lat,mean,lon:lat:'${vdnz}':time'400 vals='lat|-1,lat,mean,lon:lat:'${vdnz}':time' 378 401 dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon' 379 402 echo "python ${pyHOME}/nc_var.py -o file_oper_alongdims -S ${vals} -f ${cfiles} -v ${CFvarn}" … … 410 433 uploadvars model_graphics.dat 411 434 412 if test scratch= 'true'; then435 if test ${scratch} = 'true'; then 413 436 scratch=true 414 437 echo ${warnmsg} 415 438 echo " "${main}": starting from the SCRATCH !!" 439 echo " 10 seconds left!!" 440 sleep 10 416 441 else 417 442 scratch=false … … 502 527 ih=1 503 528 for fh in ${fheaders}; do 529 if ${scratch}; then rm ${owdir}/*_${fh}*.nc >& /dev/null; fi 530 504 531 files1h=`ls -1 ${fh}* | tr '\n' '@'` 505 532 Lfiles1h=`expr length ${files1h}'0'` -
trunk/tools/model_graphics_template.dat
r886 r898 19 19 20 20 # Srcatch 21 s rcatch=false21 scratch=false 22 22 23 23 # Folder with the files
Note: See TracChangeset
for help on using the changeset viewer.