Changeset 2037 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Aug 7, 2018, 3:54:33 PM (7 years ago)
Author:
lfita
Message:

Including cordex and 2D maps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/get_data_snd-sfc_validation.bash

    r2010 r2037  
    77infolder='/ccc/scratch/cont003/lmd/fitaborl/estudios/FPS_ALPS/additional/IOP'
    88
     9# Domain
     10domn='02'
     11
    912# Output folder
    1013ofolder='/ccc/scratch/cont003/lmd/fitaborl/estudios/FPS_ALPS/additional/IOP/validation'
     
    2326
    2427# Surface diagnostics
    25 sfcdiags='wds:wss:WRFtdas'
     28sfcdiags='wds:wss:WRFtdas:pr'
    2629
    2730# Surface NON-diag variables
    2831sfcnondiags='T2'
     32
     33# cdx Surface diagnostics
     34cdxdiags='None'
     35
     36# cdx Surface NON-diag variables
     37cdxnondiags='PR:PRW:PSL:UAS:VAS:CAPEMAX:CAPEMEAN:CINMAX:CINMEAN:LFCPMAX:LFCPMEAN:LFCZMAX:LFCZMEAN:LIMAX:LIMEAN'
    2938
    3039#######    #######
     
    4251  ofold=${ofolder}/${expn}
    4352
    44   files=`ls -1 ${infolder}/${expn}/wrfout/wrfout_d02*`
    45 
    4653  mkdir -p ${ofold}
    4754
     
    5259    sndlat=`echo ${sndvn} | tr ',' ' ' | awk '{print $3}'`
    5360
     61    files=`ls -1 ${infolder}/${expn}/wrfout/wrfout_d${domn}*`
     62
     63    # Sounding values
    5464    ofile=${ofold}/simout_sndvars_${sndid}_${expn}.nc
    5565    if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi
     
    5767      for filen in ${files}; do
    5868        $pyHOME/get_WRFsounding-surface_data.bash ${scratch} ${ofold} ${expn}        \
    59           ${sndvn} None ${filen} ${snddiags} ${sfcdiags} ${sfcnondiags}
     69          ${sndvn} None ${filen} ${snddiags},None,None,None,None
    6070      # end of files
    6171      done
     
    8090      mv netcdf_fold_concatenated_HMT.nc ${ofile}
    8191    fi
    82     #exit
    83 
    84   # end of soundings
     92
     93    files=`ls -1 ${infolder}/${expn}/wrfout/wrfcdx_d${domn}*`
     94
     95    # cordex values
     96    ofile=${ofold}/simcdx_sndvars_${sndid}_${expn}.nc
     97    if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi
     98    if test ! -f ${ofile}; then
     99      for filen in ${files}; do
     100        $pyHOME/get_WRFsounding-surface_data.bash ${scratch} ${ofold} ${expn}        \
     101          ${sndvn} None ${filen} None,None,None,${cdxdiags},${cdxnondiags}
     102      # end of files
     103      done
     104
     105    # Concatenating files
     106      values=${ofold}',Time,time'
     107      HMT='simcdx_snddiags_,'${sndid},'nc'
     108      python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}       \
     109       -f ${HMT} -v all
     110      if test $? -ne 0; then
     111        echo ${errmsg}
     112        echo "  python failed!!"
     113        echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}\
     114        -f ${HMT} -v all
     115        exit
     116      fi
     117      echo " * Concatenating cdx sounding data at point: "${sndlon}", "${sndlat} >>  \
     118        ${insoutf}
     119      echo python  ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S "'"${values}"'" \
     120       -f ${HMT} -v all >> ${insoutf}
     121      echo " " >> ${insoutf}
     122      mv netcdf_fold_concatenated_HMT.nc ${ofile}
     123    fi
     124
     125  # end of sounding stations
    85126  done
    86   fi
    87127
    88128  if test ! ${sfcstations} = 'None'; then
     
    92132    sfclat=`echo ${sfcvn} | tr ',' ' ' | awk '{print $3}'`
    93133
     134    files=`ls -1 ${infolder}/${expn}/wrfout/wrfout_d${domn}*`
     135
    94136    ofile=${ofold}/simout_sfcvars_${sfcid}_${expn}.nc
    95137    if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi
     
    97139      for filen in ${files}; do
    98140        $pyHOME/get_WRFsounding-surface_data.bash ${scratch} ${ofold} ${expn} None   \
    99           ${sfcvn} ${filen} ${snddiags} ${sfcdiags} ${sfcnondiags}
     141          ${sfcvn} ${filen} None,${sfcdiags},${sfcnondiags},None,None
    100142      # end of files
    101143      done
     
    114156      fi
    115157      echo " * Concatenating surface data at point: "${sfclon}", "${sfclat} >> ${insoutf}
     158      echo python  ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S "'"${values}"'" \
     159       -f ${HMT} -v all >> ${insoutf}
     160      echo " " >> ${insoutf}
     161      mv netcdf_fold_concatenated_HMT.nc ${ofile}
     162    fi
     163
     164    files=`ls -1 ${infolder}/${expn}/wrfout/wrfcdx_d${domn}*`
     165
     166    ofile=${ofold}/simcdx_sfcvars_${sfcid}_${expn}.nc
     167    if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi
     168    if test ! -f ${ofile}; then
     169      for filen in ${files}; do
     170        $pyHOME/get_WRFsounding-surface_data.bash ${scratch} ${ofold} ${expn} None   \
     171          ${sfcvn} ${filen} None,None,None,${cdxdiags},${cdxnondiags}
     172      # end of files
     173      done
     174
     175    # Concatenating files
     176      values=${ofold}',Time,time'
     177      HMT='simcdx_sfcdiags_,'${sfcid},'nc'
     178      python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}         \
     179       -f ${HMT} -v all
     180      if test $? -ne 0; then
     181        echo ${errmsg}
     182        echo "  python failed!!"
     183        echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}  \
     184        -f ${HMT} -v all
     185        exit
     186      fi
     187      echo " * Concatenating cdx surface data at point: "${sfclon}", "${sfclat} >> ${insoutf}
    116188      echo python  ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S "'"${values}"'" \
    117189       -f ${HMT} -v all >> ${insoutf}
     
    125197  fi
    126198
     199  # 2D maps
     200  okind='out cdx'
     201  for ik in ${okind}; do
     202    ofile=${ofold}/sim${ik}_sfcmapvars_${expn}.nc
     203    if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi
     204    if test ! -f ${ofile}; then
     205
     206    # Concatenating files
     207      values=${ofold}',Time,time'
     208      HMT='sim'${ik}'_sfcmapdiags_,'${expn},'nc'
     209      python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}         \
     210       -f ${HMT} -v all
     211      if test $? -ne 0; then
     212        echo ${errmsg}
     213        echo "  python failed!!"
     214        echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}  \
     215        -f ${HMT} -v all
     216        exit
     217      fi
     218      echo " * Concatenating '${ik}' surface map data: " >> ${insoutf}
     219      echo python  ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S "'"${values}"'" \
     220       -f ${HMT} -v all >> ${insoutf}
     221      echo " " >> ${insoutf}
     222      mv netcdf_fold_concatenated_HMT.nc ${ofile}
     223    fi
     224  done
     225
    127226# End of experiments
    128227done
Note: See TracChangeset for help on using the changeset viewer.