Changeset 2033 in lmdz_wrf for trunk


Ignore:
Timestamp:
Aug 7, 2018, 1:34:32 AM (6 years ago)
Author:
lfita
Message:

Adding `uavaFROMobswswd', computing woind components from observations (wind origin)

Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diagnostics.inf

    r1980 r2033  
    4242va, WRFva, U@V@SINALPHA@COSALPHA
    4343uavaFwswd, uavaFROMwswd, ws@wd
     44uavaFOwswd, uavaFROMobswswd, ws@wd
    4445uavaz, WRFzwind, U@V@WRFz@U10@V10@SINALPHA@COSALPHA@z=100.
    4546uavaz, WRFzwind_log, U@V@WRFz@U10@V10@SINALPHA@COSALPHA@z=100.
  • trunk/tools/diagnostics.py

    r1999 r2033  
    911911        ncvar.insert_variable(ncobj, 'va', va, dnamesvar, dvnamesvar, newnc)
    912912
     913# ua va from obs ws wd (deg)
     914    elif diagn == 'uavaFROMobswswd':
     915           
     916        var0 = ncobj.variables[depvars[0]][:]
     917        var1 = ncobj.variables[depvars[1]][:]
     918
     919        ua = var0*np.cos((var1+180.)*np.pi/180.)
     920        va = var0*np.sin((var1+180.)*np.pi/180.)
     921
     922        dnamesvar = ncobj.variables[depvars[0]].dimensions
     923        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
     924
     925        ncvar.insert_variable(ncobj, 'ua', ua, dnamesvar, dvnamesvar, newnc)
     926        ncvar.insert_variable(ncobj, 'va', va, dnamesvar, dvnamesvar, newnc)
    913927
    914928# WRFbils fom WRF as HFX + LH
  • trunk/tools/obs-sim_Comparison.bash

    r2032 r2033  
    913913    figheader=`echo ${valuesfig} | tr '%' ' ' | awk '{print $9}'`
    914914
    915     Nfiles=`echo ${labs} | tr ':' ' ' | wc -w | awk '{print $1-1}'`
     915    Nfiles=`echo ${labs} | tr ',' ' ' | wc -w | awk '{print $1-1}'`
    916916    frqm='1'
    917917    iff=1
    918     while test ${iff} -le ${Nfiles}; do frqm=${frqm}'@10'; done
    919 
    920     values='linepoint;multicol;pres;-;'${lmark}':'${frqm}';spectral;auto:'${labs}':'
     918    while test ${iff} -le ${Nfiles}; do frqm=${frqm}'@10'; iff=`expr ${iff} + 1`; done
     919
     920    values='linepoint;multicol;pres;-;'${lmark}';'${frqm}';spectral;auto:'${labs}':'
    921921    values=${values}'WindRose!obs!,!sim!comparison!at!'${stid}'!on!'${timeS}'!UTC:'
    922922    values=${values}${kfig}':auto:''True'
     
    12681268  if ${fscratch}; then rm ${ouavasndf}; fi
    12691269  if test ! -f ${ouavasndf}; then
    1270     python ${pyHOME}/diagnostics.py -f ${sndf} -d 'time@time,pres@pres' -v 'uavaFROMwswd|ws@wd'
     1270    python ${pyHOME}/diagnostics.py -f ${sndf} -d 'time@time,pres@pres'              \
     1271      -v 'uavaFROMobswswd|ws@wd'
    12711272    if test $? -ne 0; then
    12721273      echo ${errmsg}
    12731274      echo "  python failed!!"
    1274       echo python ${pyHOME}/diagnostics.py -f ${sndf} -d 'time@time,pres@pres' -v 'uavaFROMwswd|ws@wd'
     1275      echo python ${pyHOME}/diagnostics.py -f ${sndf} -d 'time@time,pres@pres'       \
     1276        -v 'uavaFROMobswswd|ws@wd'
    12751277      exit
    12761278    fi
    12771279    echo " * Getting ua,va winds from station "${stid}": " >> ${ofileins}
    12781280    echo python ${pyHOME}/diagnostics.py -f ${sndf} -d "'"time@time,pres@pres"'"     \
    1279       -v "'"uavaFROMwswd|ws@wd"'" >> ${ofileins}
     1281      -v "'"uavaFROMobswswd|ws@wd"'" >> ${ofileins}
    12801282    echo " " >> ${ofileins}   
    12811283    mv diagnostics.nc ${ouavasndf}
     
    15491551
    15501552    multi_WindRose_plot ${fivals}
    1551     exit
    15521553
    15531554    it=`expr ${it} + 1`
Note: See TracChangeset for help on using the changeset viewer.