Changeset 2087 in lmdz_wrf for trunk/tools
- Timestamp:
- Aug 22, 2018, 9:06:22 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/get_WRFsounding-surface_data.bash
r2085 r2087 279 279 echo " " >> ${ofileins} 280 280 # CF varname 281 CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} | 282 grep -v variables_values | tr ':' ' ' |awk '{print $1}'`281 CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} | tr ':' ' ' |\ 282 awk '{print $1}'` 283 283 if test $? -ne 0; then 284 284 echo ${errmsg} … … 375 375 376 376 if ${fscratch}; then rm ${simsfcmapdiagsf}; fi 377 if test ! -f ${simsfcmapdiagsf}; then 377 378 if test ! ${sfcdiagnames} = 'None'; then 378 if test ! -f ${simsfcmapdiagsf}; then 379 python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d ${sfcmapdiagd} \ 379 python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d ${sfcmapdiagd} \ 380 380 -v ${sfcdiagvals} 381 381 if test $? -ne 0; then … … 451 451 -f ${simsfcmapdiagsf} >> ${ofileins} 452 452 echo " " >> ${ofileins} 453 # CF varname , no need?453 # CF varname 454 454 CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} | \ 455 grep -v variables_values |tr ':' ' ' | awk '{print $1}'`455 tr ':' ' ' | awk '{print $1}'` 456 456 if test $? -ne 0; then 457 457 echo ${errmsg} … … 527 527 exit 528 528 fi 529 echo "* get values at sfc point: "${stlon}", "${stlat} >> ${ofileins}530 echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}\529 echo "* get values at sfc point: "${stlon}", "${stlat} >> ${ofileins} 530 echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen} \ 531 531 -S "'"${values}"'" -v all >> ${ofileins} 532 echo " " >> ${ofileins}532 echo " " >> ${ofileins} 533 533 534 534 ofilen='newfile_multidims.nc' … … 537 537 538 538 # Computing sfc diagnostics 539 if test ! ${sfcdiagnames} = 'None'; then540 sfcdiagd='Time@WRFtime'541 diagns=`echo ${sfcdiagnames} | tr ':' ' '`542 543 idiag=1544 for diagn in ${diagns}; do 545 diagv=`cat $pyHOME/diagnostics.inf | grep WRF | grep ${diagn}',' | tr ',' ' ' |\546 awk '{print $2"|"$3}'`547 if test ${idiag} -eq 1; then548 sfcdiagvals=${diagv}549 else550 sfcdiagvals=${sfcdiagvals}','${diagv}551 fi552 idiag=`expr ${idiag} + 1`553 done554 555 if ${fscratch}; then rm ${simsfcdiagsf}; fi556 if test ! -f ${simsfcdiagsf}; then 539 if ${fscratch}; then rm ${simsfcdiagsf}; fi 540 if test ! -f ${simsfcdiagsf}; then 541 if test ! ${sfcdiagnames} = 'None'; then 542 sfcdiagd='Time@WRFtime' 543 diagns=`echo ${sfcdiagnames} | tr ':' ' '` 544 545 idiag=1 546 for diagn in ${diagns}; do 547 diagv=`cat $pyHOME/diagnostics.inf | grep WRF | grep ${diagn}',' | tr ',' ' ' |\ 548 awk '{print $2"|"$3}'` 549 if test ${idiag} -eq 1; then 550 sfcdiagvals=${diagv} 551 else 552 sfcdiagvals=${sfcdiagvals}','${diagv} 553 fi 554 idiag=`expr ${idiag} + 1` 555 done 556 557 557 python ${pyHOME}/diagnostics.py -f ${simsfcptf} -d ${sfcdiagd} -v ${sfcdiagvals} 558 558 if test $? -ne 0; then … … 569 569 mv diagnostics.nc ${simsfcdiagsf} 570 570 fi 571 fi 572 573 #Adding non-diagnostic variables 574 if test ! ${nondiagvs} = 'None'; then 575 # If there was not diagnostics 576 if test ! -f ${simsfcdiagsf}; then 577 dddv='Time@Times' 578 selvars='Times' 579 python ${pyHOME}/nc_var.py -o selvar -S ${dddv} -f ${simsfcptf} -v ${selvars} 580 if test $? -ne 0; then 581 echo ${errmsg} 582 echo " python failed!!" 583 echo python ${pyHOME}/nc_var.py -o selvar -S "'"${dddv}"'" -f ${simsfcptf} \ 584 -v ${vars} 585 exit 586 rm ${simsfcptf} 587 fi 588 echo "* creation of diagnostics file at sfc point: "${stlon}", "${stlat} >> \ 589 ${ofileins} 590 echo python ${pyHOME}/nc_var.py -o selvar -S "'"${dddv}"'" -f ${simsfcptf} \ 591 -v ${selvars} >> ${ofileins} 592 echo " " >> ${ofileins} 593 mv selvar_new.nc ${simsfcdiagsf} 594 python ${pyHOME}/nc_var.py -o WRF_CFtime_creation -S 19491201000000,minutes \ 595 -f ${simsfcdiagsf} -v time 596 if test $? -ne 0; then 597 echo ${errmsg} 598 echo " python failed!!" 571 572 #Adding non-diagnostic variables 573 if test ! ${nondiagvs} = 'None'; then 574 # If there was not diagnostics 575 if test ! -f ${simsfcdiagsf}; then 576 dddv='Time@Times' 577 selvars='Times' 578 python ${pyHOME}/nc_var.py -o selvar -S ${dddv} -f ${simsfcptf} -v ${selvars} 579 if test $? -ne 0; then 580 echo ${errmsg} 581 echo " python failed!!" 582 echo python ${pyHOME}/nc_var.py -o selvar -S "'"${dddv}"'" -f ${simsfcptf} \ 583 -v ${vars} 584 exit 585 rm ${simsfcptf} 586 fi 587 echo "* creation of diagnostics file at sfc point: "${stlon}", "${stlat} >> \ 588 ${ofileins} 589 echo python ${pyHOME}/nc_var.py -o selvar -S "'"${dddv}"'" -f ${simsfcptf} \ 590 -v ${selvars} >> ${ofileins} 591 echo " " >> ${ofileins} 592 mv selvar_new.nc ${simsfcdiagsf} 593 python ${pyHOME}/nc_var.py -o WRF_CFtime_creation -S 19491201000000,minutes \ 594 -f ${simsfcdiagsf} -v time 595 if test $? -ne 0; then 596 echo ${errmsg} 597 echo " python failed!!" 598 echo python ${pyHOME}/nc_var.py -o WRF_CFtime_creation -S 19491201000000,minutes \ 599 -f ${simsfcdiagsf} -v time 600 exit 601 rm ${simsfcdiagsf} 602 fi 603 echo "* creation of CF-time variable for file at sfc point: "${stlon}", " \ 604 ${stlat} >> ${ofileins} 599 605 echo python ${pyHOME}/nc_var.py -o WRF_CFtime_creation -S 19491201000000,minutes \ 600 -f ${simsfcdiagsf} -v time 601 exit 602 rm ${simsfcdiagsf} 603 fi 604 echo "* creation of CF-time variable for file at sfc point: "${stlon}", " \ 605 ${stlat} >> ${ofileins} 606 echo python ${pyHOME}/nc_var.py -o WRF_CFtime_creation -S 19491201000000,minutes \ 607 -f ${simsfcdiagsf} -v time >> ${ofileins} 608 echo " " >> ${ofileins} 609 fi 610 varsadd=`echo ${nondiagvs} | tr ':' ' '` 611 for vadd in ${varsadd}; do 612 python ${pyHOME}/nc_var.py -o fvaradd -S ${simsfcptf},${vadd} -f ${simsfcdiagsf} 613 if test $? -ne 0; then 614 echo ${errmsg} 615 echo " python failed!!" 616 echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcptf},${vadd}"'" \ 617 -f ${simsfcdiagsf} 618 exit 619 rm ${simsfcdiagsf} 620 fi 621 echo "* adding variable '"${vadd}"' at sfc point: "${stlon}", "${stlat} >> ${ofileins} 622 echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcptf},${vadd}"'" \ 623 -f ${simsfcdiagsf} >> ${ofileins} 624 echo " " >> ${ofileins} 625 # CF varname 626 CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} | \ 627 grep -v variables_values | tr ':' ' ' | awk '{print $1}'` 628 if test $? -ne 0; then 629 echo ${errmsg} 630 echo " python failed!!" 631 echo python $pyHOME/generic.py -o variables_values -S ${vadd} 632 exit 633 rm ${simsfcdiagsf} 634 fi 635 python $pyHOME/nc_var.py -o chvarname -S ${CFvarn} -f ${simsfcdiagsf} -v ${vadd} 636 if test $? -ne 0; then 637 echo ${errmsg} 638 echo " python failed!!" 639 echo python ${pyHOME}/nc_var.py -o chvarname -S ${CFvarn} -f ${simsfcdiagsf} \ 640 -v ${vadd} 641 exit 642 rm ${simsfcdiagsf} 643 fi 644 done 606 -f ${simsfcdiagsf} -v time >> ${ofileins} 607 echo " " >> ${ofileins} 608 fi 609 varsadd=`echo ${nondiagvs} | tr ':' ' '` 610 for vadd in ${varsadd}; do 611 python ${pyHOME}/nc_var.py -o fvaradd -S ${simsfcptf},${vadd} -f ${simsfcdiagsf} 612 if test $? -ne 0; then 613 echo ${errmsg} 614 echo " python failed!!" 615 echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcptf},${vadd}"'" \ 616 -f ${simsfcdiagsf} 617 exit 618 rm ${simsfcdiagsf} 619 fi 620 echo "* adding variable '"${vadd}"' at sfc point: "${stlon}", "${stlat} >> ${ofileins} 621 echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcptf},${vadd}"'" \ 622 -f ${simsfcdiagsf} >> ${ofileins} 623 echo " " >> ${ofileins} 624 # CF varname 625 CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} | tr ':' ' ' |\ 626 awk '{print $1}'` 627 if test $? -ne 0; then 628 echo ${errmsg} 629 echo " python failed!!" 630 echo python $pyHOME/generic.py -o variables_values -S ${vadd} 631 exit 632 rm ${simsfcdiagsf} 633 fi 634 python $pyHOME/nc_var.py -o chvarname -S ${CFvarn} -f ${simsfcdiagsf} -v ${vadd} 635 if test $? -ne 0; then 636 echo ${errmsg} 637 echo " python failed!!" 638 echo python ${pyHOME}/nc_var.py -o chvarname -S ${CFvarn} -f ${simsfcdiagsf} \ 639 -v ${vadd} 640 exit 641 rm ${simsfcdiagsf} 642 fi 643 done 644 fi 645 645 fi 646 646 } … … 792 792 # CF varname 793 793 CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} | \ 794 grep -v variables_values |tr ':' ' ' | awk '{print $1}'`794 tr ':' ' ' | awk '{print $1}'` 795 795 if test $? -ne 0; then 796 796 echo ${errmsg}
Note: See TracChangeset
for help on using the changeset viewer.