Changeset 2013 in lmdz_wrf


Ignore:
Timestamp:
Aug 2, 2018, 4:11:50 PM (7 years ago)
Author:
lfita
Message:

Adding surface observations and fixing errors

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/obs-sim_Comparison.bash

    r2012 r2013  
    823823        awk '{print $3"_"$4}'`
    824824
    825       simostptf=${odir}'/simout_vars_'${prn}'pt_'${stid}'_'${expl}'_'${fdate}'.nc'
    826       simostdiagsf=${odir}'/simout_'${prn}'diags_'${stid}'_'${expl}'_'${fdate}'.nc'
     825      simsndptf=${odir}'/simout_vars_'${prn}'pt_'${stid}'_'${expl}'_'${fdate}'.nc'
     826      simsnddiagsf=${odir}'/simout_'${prn}'diags_'${stid}'_'${expl}'_'${fdate}'.nc'
    827827
    828828      fvals=${ostlon}'#'${ostlat}'#'${simf}'#XLONG#XLAT#'${wrfdiags}'#'
     
    866866  iost=`expr ${iost} + 1`
    867867done
     868
     869# surface data
     870iost=1
     871obstype='surface'
     872prn='sfc'
     873listfiles=${sfcfiles}
     874wrfdiags=${wrfsfcdiags}
     875simdiagd=${simsfcdiagd}
     876for ostf in ${listfiles}; do
     877
     878  stid=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v id | grep NC \
     879    | awk '{printf("%d",$2)}'`
     880  ostlon=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v lon | grep NC \
     881    | awk '{print $2}'`
     882  ostlat=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v lat | grep NC \
     883    | awk '{print $2}'`
     884  ostheight=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v height |   \
     885    grep NC | awk '{print $2}'`
     886
     887  if test ${iost} -eq 1; then
     888    oststids=${stid}'@'${ostf}
     889    echo ${prn}","${stid}","${ostlon}","${ostlat}","${ostheight} > ${wdir}/stations.inf
     890  else
     891    oststids=${oststids}':'${stid}'@'${ostf}
     892    echo ${prn}","${stid}","${ostlon}","${ostlat}","${ostheight} >> ${wdir}/stations.inf
     893  fi
     894
     895  iexp=1
     896  for exp in ${exps}; do
     897    expf=`echo ${exp} | tr ',' ' ' | awk '{print $1}'`
     898    expl=`echo ${exp} | tr ',' ' ' | awk '{print $2}'`
     899    expn=`echo ${exp} | tr ',' ' ' | awk '{print $3}'`
     900    expc=`echo ${exp} | tr ',' ' ' | awk '{print $4}'`
     901
     902    simfiles=`ls -1 ${simdir}/${expf}/${simH}*${simM}*${simT}`
     903
     904    for simf in ${simfiles}; do
     905      simfn=`basename ${simf}`
     906      fdate=`echo ${simfn} | tr '.' ' ' | awk '{print $1}' | tr '_' ' ' |            \
     907        awk '{print $3"_"$4}'`
     908
     909      simsfcptf=${odir}'/simout_vars_'${prn}'pt_'${stid}'_'${expl}'_'${fdate}'.nc'
     910      simsfcdiagsf=${odir}'/simout_'${prn}'diags_'${stid}'_'${expl}'_'${fdate}'.nc'
     911
     912      fvals=${ostlon}'#'${ostlat}'#'${simf}'#XLONG#XLAT#'${wrfdiags}'#'
     913      fvals=${fvals}${wrfsfcnondiags}'#'${simdiagd}
     914      get_WRFsurface_data ${fvals}
     915
     916    # end of files
     917    done
     918
     919    # Concatenating files
     920    ofile=${odir}/simout_${prn}vars_${stid}_${expl}.nc
     921    if ${fscratch}; then rm ${ofile} >& /dev/null; fi
     922    if test ! -f ${ofile}; then
     923      Nconfc=`ls -1 ${odir}/simout_${prn}diags_*${stid}*${expl}*.nc | wc -l | awk '{print $1}'`
     924      if test ${Nconfc} -gt 1; then
     925        values=${odir}',Time,time'
     926        HMT='simout_'${prn}'diags_,'${stid}'_'${expn},'nc'
     927        python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}      \
     928         -f ${HMT} -v all
     929        if test $? -ne 0; then
     930          echo ${errmsg}
     931          echo "  python failed!!"
     932          echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}\
     933          -f ${HMT} -v all
     934          exit
     935        fi
     936        echo " * Concatenating "${obstype}" data at point: "${ostlon}", "${ostlat} >> ${ofileins}
     937        echo python  ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S \
     938          "'"${values}"'" -f ${HMT} -v all >> ${ofileins}
     939        echo " " >> ${ofileins}
     940        mv netcdf_fold_concatenated_HMT.nc ${ofile}
     941      else
     942        ffilen=`ls -1 ${odir}/simout_${prn}diags_*${stid}*${expl}*.nc`
     943        cp ${ffilen} ${ofile}
     944      fi
     945    fi
     946    iexp=`expr ${iexp} + 1`
     947  # end of experiments
     948  done
     949
     950  iost=`expr ${iost} + 1`
     951done
     952
    868953exit
    869954
  • trunk/tools/obs_simComparison.conf

    r2006 r2013  
    2323# Header of the name of the soundings file
    2424sndHf = UWyoming_snd_
    25 #snddimt=6
    26 #sndstn='Ezeiza'
    2725
    2826# Initial color value for the SkewT-logP evolution (rgb based, 'red' for ta; 'blue' for tda)
     
    8785# Name of the surface diagnostics to compute
    8886#wrfsfcdiags=wds:wss:WRFpsl_ecmwf:clt:WRFtdas
    89 wrfsfcdiags=T2:wds:wss:WRFtdas
     87wrfsfcdiags=wds:wss:WRFtdas
     88
     89# Name of the non-diagnostics surface variables to add
     90wrfsfcnondiags=T2
    9091
    9192# Figures output directory
Note: See TracChangeset for help on using the changeset viewer.