Changeset 2012 in lmdz_wrf


Ignore:
Timestamp:
Aug 2, 2018, 3:42:26 PM (7 years ago)
Author:
lfita
Message:

Working version with the generic definition of output file (preventing generalization...)

File:
1 edited

Legend:

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

    r2009 r2012  
    789789
    790790# sounding data
    791 isnd=1
    792 for sndf in ${sndfiles}; do
    793   stid=`python $pyHOME/nc_var.py -o grattr -f ${sndf} -S Station_number`
    794   sndlon=`ncdump -h ${sndf} | grep Station_longitude | awk '{print $3}'`
    795   sndlat=`ncdump -h ${sndf} | grep Station_latitude | awk '{print $3}'`
    796   sndheight=`ncdump -h ${sndf} | grep Station_elevation | awk '{print $3}'`
    797 
    798   if test ${isnd} -eq 1; then
    799     sndstids=${stid}'@'${sndf}
    800     echo "snd,"${stid}","${sndlon}","${sndlat}","${sndheight} > ${wdir}/stations.inf
     791iost=1
     792obstype='sounding'
     793prn='snd'
     794listfiles=${sndfiles}
     795wrfdiags=${wrfsnddiags}
     796simdiagd=${simsnddiagd}
     797for ostf in ${listfiles}; do
     798  stid=`python $pyHOME/nc_var.py -o grattr -f ${ostf} -S Station_number`
     799  ostlon=`ncdump -h ${ostf} | grep Station_longitude | awk '{print $3}'`
     800  ostlat=`ncdump -h ${ostf} | grep Station_latitude | awk '{print $3}'`
     801  ostheight=`ncdump -h ${ostf} | grep Station_elevation | awk '{print $3}'`
     802
     803  if test ${iost} -eq 1; then
     804    oststids=${stid}'@'${ostf}
     805    echo ${prn}","${stid}","${ostlon}","${ostlat}","${ostheight} > ${wdir}/stations.inf
    801806  else
    802     sndstids=${sndstids}':'${stid}'@'${sndf}
    803     echo "snd,"${stid}","${sndlon}","${sndlat}","${sndheight} >> ${wdir}/stations.inf
     807    oststids=${oststids}':'${stid}'@'${ostf}
     808    echo ${prn}","${stid}","${ostlon}","${ostlat}","${ostheight} >> ${wdir}/stations.inf
    804809  fi
    805810
     
    818823        awk '{print $3"_"$4}'`
    819824
    820       simsndptf=${odir}'/simout_vars_sndpt_'${stid}'_'${expl}'_'${fdate}'.nc'
    821       simsnddiagsf=${odir}'/simout_snddiags_'${stid}'_'${expl}'_'${fdate}'.nc'
    822 
    823       fvals=${sndlon}'#'${sndlat}'#'${simf}'#XLONG#XLAT#'${wrfsnddiags}'#'
    824       fvals=${fvals}${simsnddiagd}
     825      simostptf=${odir}'/simout_vars_'${prn}'pt_'${stid}'_'${expl}'_'${fdate}'.nc'
     826      simostdiagsf=${odir}'/simout_'${prn}'diags_'${stid}'_'${expl}'_'${fdate}'.nc'
     827
     828      fvals=${ostlon}'#'${ostlat}'#'${simf}'#XLONG#XLAT#'${wrfdiags}'#'
     829      fvals=${fvals}${simdiagd}
    825830      get_WRFsounding_data ${fvals}
    826831
     
    829834
    830835    # Concatenating files
    831     ofile=${odir}/simout_sndvars_${stid}_${expn}.nc
     836    ofile=${odir}/simout_${prn}vars_${stid}_${expl}.nc
    832837    if ${fscratch}; then rm ${ofile} >& /dev/null; fi
    833838    if test ! -f ${ofile}; then
    834       Nconfc=`ls -1 ${odir}/simout_snddiags_*${stid}*nc | wc -l | awk '{print $1}'`
     839      Nconfc=`ls -1 ${odir}/simout_${prn}diags_*${stid}*${expl}*.nc | wc -l | awk '{print $1}'`
    835840      if test ${Nconfc} -gt 1; then
    836841        values=${odir}',Time,time'
    837         HMT='simout_snddiags_,'${stid}'_'${expn},'nc'
     842        HMT='simout_'${prn}'diags_,'${stid}'_'${expn},'nc'
    838843        python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}      \
    839844         -f ${HMT} -v all
     
    845850          exit
    846851        fi
    847         echo " * Concatenating sounding data at point: "${sndlon}", "${sndlat} >> ${ofileins}
     852        echo " * Concatenating "${obstype}" data at point: "${ostlon}", "${ostlat} >> ${ofileins}
    848853        echo python  ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S \
    849854          "'"${values}"'" -f ${HMT} -v all >> ${ofileins}
     
    851856        mv netcdf_fold_concatenated_HMT.nc ${ofile}
    852857      else
    853         ffilen=`ls -1 ${odir}/simout_snddiags_*${stid}*nc`
     858        ffilen=`ls -1 ${odir}/simout_${prn}diags_*${stid}*${expl}*.nc`
    854859        cp ${ffilen} ${ofile}
    855860      fi
     
    859864  done
    860865
    861   isnd=`expr ${isnd} + 1`
     866  iost=`expr ${iost} + 1`
    862867done
    863868exit
Note: See TracChangeset for help on using the changeset viewer.