Changeset 2067 in lmdz_wrf
- Timestamp:
- Aug 10, 2018, 3:57:28 PM (7 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/get_WRFsounding-surface_data.bash
r2066 r2067 867 867 if test ! ${wrfcdxdiags} = 'None' || test ! ${wrfcdxnodiags} = 'None'; then 868 868 stid=${sndid} 869 simsfcptf=${odir}'/simcdx_vars_s fcpt_'${stid}'_'${expl}'_'${fdate}'.nc'870 simsfcdiagsf=${odir}'/simcdx_s fcdiags_'${stid}'_'${expl}'_'${fdate}'.nc'869 simsfcptf=${odir}'/simcdx_vars_sndpt_'${stid}'_'${expl}'_'${fdate}'.nc' 870 simsfcdiagsf=${odir}'/simcdx_snddiags_'${stid}'_'${expl}'_'${fdate}'.nc' 871 871 872 872 fvals=${sndlon}'#'${sndlat}'#'${infilen}'#LON#LAT#'${wrfcdxdiags}'#' -
trunk/tools/get_data_snd-sfc_validation.bash
r2057 r2067 61 61 sndlat=`echo ${sndvn} | tr ',' ' ' | awk '{print $3}'` 62 62 63 files=`ls -1 ${infolder}/${expn}/wrfout/wrfout_d${domn}*`64 63 kout='snd' 64 filek='_vars_'${kout}'pt _'${kout}'diags' 65 65 # Sounding values 66 66 if test ! ${snddiags} = 'None'; then 67 ofile=${ofold}/simout_sndvars_${sndid}_${expn}.nc 67 fHEADn='simout' 68 files=`ls -1 ${infolder}/${expn}/wrfout/wrfout_d${domn}*` 69 ofile=${ofold}/${fHEADn}_${kout}diags_${sndid}_${expn}.nc 68 70 if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi 69 71 if test ! -f ${ofile}; then … … 74 76 done 75 77 76 # Concatenating files 77 values=${ofold}',Time,time' 78 HMT='simout_snddiags_,'${sndid}'_'${expn},'nc' 79 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 80 -f ${HMT} -v all 81 if test $? -ne 0; then 82 echo ${errmsg} 83 echo " python failed!!" 84 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 85 -S ${values} -f ${HMT} -v all 86 exit 87 fi 88 echo " * Concatenating sounding data at point: "${sndlon}", "${sndlat} >> \ 89 ${insoutf} 90 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 91 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 92 echo " " >> ${insoutf} 93 mv netcdf_fold_concatenated_HMT.nc ${ofile} 78 # Concatenating files 79 values=${ofold}',Time,time' 80 for fk in ${filek}; do 81 ofile=${ofold}/${fHEADn}${fk}_${sndid}_${expn}.nc 82 HMT=${fHEADn}${fk}'_,'${sndid}'_'${expn},'nc' 83 Nfiles=`ls -1 ${ofold}/${fHEADn}${fk}_*${sndid}_${expn}*.nc | wc -l` 84 if test ${Nfiles} -gt 1; then 85 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 86 -f ${HMT} -v all 87 if test $? -ne 0; then 88 echo ${errmsg} 89 echo " python failed!!" 90 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 91 -S ${values} -f ${HMT} -v all 92 exit 93 fi 94 echo " * Concatenating sounding data '"${fk}"' at point: "${sndid} >> ${insoutf} 95 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 96 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 97 echo " " >> ${insoutf} 98 mv netcdf_fold_concatenated_HMT.nc ${ofile} 99 rm ${ofold}/${fHEADn}${fk}_${sndid}_${expn}_????-??-??_??:??:??.nc >& /dev/null 100 else 101 file1=`ls -1 ${ofold}/${fHEADn}${fk}_*${sndid}_${expn}*.nc` 102 mv ${file1} ${ofile} 103 fi 104 done 94 105 fi 95 106 fi 96 97 files=`ls -1 ${infolder}/${expn}/wrfout/wrfcdx_d${domn}*`98 107 99 108 # cordex values 100 109 if test ! ${cdxdiags} = 'None' || test ! ${cdxnondiags} = 'None'; then 101 ofile=${ofold}/simcdx_sndvars_${sndid}_${expn}.nc 110 fHEADn='simcdx' 111 files=`ls -1 ${infolder}/${expn}/wrfout/wrfcdx_d${domn}*` 112 ofile=${ofold}/${fHEADn}_${kout}diags_${sndid}_${expn}.nc 102 113 if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi 103 114 if test ! -f ${ofile}; then … … 108 119 done 109 120 110 # Concatenating files 111 values=${ofold}',Time,time' 112 HMT='simcdx_snddiags_,'${sndid}'_'${expn},'nc' 113 Nfiles=`ls -1 ${ofold}/simcdx_snddiags_*${sndid}_${expn}*.nc | wc -l` 114 if test ${Nfiles} -gt 0; then 115 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 116 -f ${HMT} -v all 117 if test $? -ne 0; then 118 echo ${errmsg} 119 echo " python failed!!" 120 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 121 -S ${values} -f ${HMT} -v all 122 exit 123 fi 124 echo " * Concatenating cdx sounding data at point: "${sndlon}", "${sndlat} >>\ 125 ${insoutf} 126 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 127 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 128 echo " " >> ${insoutf} 129 mv netcdf_fold_concatenated_HMT.nc ${ofile} 130 fi 121 # Concatenating files 122 values=${ofold}',Time,time' 123 for fk in ${filek}; do 124 ofile=${ofold}/${fHEADn}${fk}_${sndid}_${expn}.nc 125 HMT=${fHEADn}${fk}'_,'${sndid}'_'${expn},'nc' 126 Nfiles=`ls -1 ${ofold}/${fHEADn}${fk}_*${sndid}_${expn}*.nc | wc -l` 127 if test ${Nfiles} -gt 1; then 128 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 129 -f ${HMT} -v all 130 if test $? -ne 0; then 131 echo ${errmsg} 132 echo " python failed!!" 133 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 134 -S ${values} -f ${HMT} -v all 135 exit 136 fi 137 echo " * Concatenating cdx sounding data at point: "${sndlon}", "${sndlat} >>\ 138 ${insoutf} 139 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 140 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 141 echo " " >> ${insoutf} 142 mv netcdf_fold_concatenated_HMT.nc ${ofile} 143 rm ${ofold}/${fHEADn}${fk}_${sndid}_${expn}_????-??-??_??:??:??.nc >& /dev/null 144 else 145 file1=`ls -1 ${ofold}/${fHEADn}${fk}_*${sndid}_${expn}*.nc` 146 mv ${file1} ${ofile} 147 fi 148 done 131 149 fi 132 150 fi … … 134 152 done 135 153 fi 154 155 # Surface stations 136 156 if test ! ${sfcstations} = 'None'; then 137 157 for sfcvn in ${sfcsts}; do … … 140 160 sfclat=`echo ${sfcvn} | tr ',' ' ' | awk '{print $3}'` 141 161 142 files=`ls -1 ${infolder}/${expn}/wrfout/wrfout_d${domn}*`143 162 kout='sfc' 163 filek='_vars_'${kout}'pt _'${kout}'diags' 144 164 # out sfc pt 145 165 if test ! ${sfcdiags} = 'None' || test ! ${sfcnondiags} = 'None'; then 146 ofile=${ofold}/simout_sfcvars_${sfcid}_${expn}.nc 166 fHEADn='simout' 167 files=`ls -1 ${infolder}/${expn}/wrfout/wrfout_d${domn}*` 168 ofile=${ofold}/${fHEADn}_${kout}diags_${sfcid}_${expn}.nc 147 169 if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi 148 170 if test ! -f ${ofile}; then … … 155 177 # Concatenating files 156 178 values=${ofold}',Time,time' 157 HMT='simout_sfcdiags_,'${sfcid}'_'${expn},'nc' 158 Nfiles=`ls -1 ${ofold}/simout_sfcdiags_*${sndid}_${expn}*.nc | wc -l` 179 for fk in ${filek}; do 180 ofile=${ofold}/${fHEADn}${fk}_${sfcid}_${expn}.nc 181 HMT=${fHEADn}${fk}'_,'${sfcid}'_'${expn},'nc' 182 Nfiles=`ls -1 ${ofold}/${fHEADn}${fk}_*${sfcid}_${expn}*.nc | wc -l` 183 if test ${Nfiles} -gt 0; then 184 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 185 -f ${HMT} -v all 186 if test $? -ne 0; then 187 echo ${errmsg} 188 echo " python failed!!" 189 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 190 -S ${values} -f ${HMT} -v all 191 exit 192 fi 193 echo " * Concatenating surface data '"${fk}"' at point: "${sfcid} >> ${insoutf} 194 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 195 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 196 echo " " >> ${insoutf} 197 mv netcdf_fold_concatenated_HMT.nc ${ofile} 198 rm ${ofold}/${fHEADn}${fk}_${sfcid}_${expn}_????-??-??_??:??:??.nc >& /dev/null 199 else 200 file1=`ls -1 ${ofold}/${fHEADn}${fk}_*${sfcid}_${expn}*.nc` 201 mv ${file1} ${ofile} 202 fi 203 done 204 fi 205 fi 206 207 # cdx sfc pt 208 if test ! ${cdxdiags} = 'None' || test ! ${cdxnondiags} = 'None'; then 209 fHEADn='simcdx' 210 files=`ls -1 ${infolder}/${expn}/wrfout/wrfcdx_d${domn}*` 211 ofile=${ofold}/${fHEADn}_${kout}diags_${sfcid}_${expn}.nc 212 if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi 213 if test ! -f ${ofile}; then 214 for filen in ${files}; do 215 $pyHOME/get_WRFsounding-surface_data.bash ${scratch} ${ofold} ${expn} None \ 216 ${sfcvn} ${filen} None,None,None,${cdxdiags},${cdxnondiags} 217 # end of files 218 done 219 220 # Concatenating files 221 values=${ofold}',Time,time' 222 for fk in ${filek}; do 223 ofile=${ofold}/${fHEADn}${fk}_${sfcid}_${expn}.nc 224 HMT=${fHEADn}${fk}'_,'${sfcid}'_'${expn},'nc' 225 Nfiles=`ls -1 ${ofold}/${fHEADn}${fk}_*${sfcid}_${expn}*.nc | wc -l` 226 if test ${Nfiles} -gt 0; then 227 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 228 -f ${HMT} -v all 229 if test $? -ne 0; then 230 echo ${errmsg} 231 echo " python failed!!" 232 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 233 -S ${values} -f ${HMT} -v all 234 exit 235 fi 236 echo " * Concatenating cdx surface data at point: "${sfcid} >> ${insoutf} 237 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 238 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 239 echo " " >> ${insoutf} 240 mv netcdf_fold_concatenated_HMT.nc ${ofile} 241 rm ${ofold}/${fHEADn}${fk}_${sfcid}_${expn}_????-??-??_??:??:??.nc >& /dev/null 242 else 243 file1=`ls -1 ${ofold}/${fHEADn}${fk}_*${sfcid}_${expn}*.nc` 244 mv ${file1} ${ofile} 245 fi 246 done 247 fi 248 #exit 249 fi 250 251 # end of surfaces 252 done 253 fi 254 255 # 2D maps 256 kout='sfcmap' 257 filek='_vars_'${kout}' _'${kout}'diags' 258 okind='out cdx' 259 for ik in ${okind}; do 260 fHEADn='sim'${ik} 261 for fk in ${filek}; do 262 ofile=${ofold}/${fHEADn}${fk}_${expn}.nc 263 if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi 264 if test ! -f ${ofile}; then 265 # Concatenating files 266 values=${ofold}',Time,time' 267 HMT=${fHEADn}${fk}'_,'${expn},'nc' 268 Nfiles=`ls -1 ${ofold}/${fHEADn}${fk}_*${expn}*.nc | wc -l` 159 269 if test ${Nfiles} -gt 0; then 160 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \270 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 161 271 -f ${HMT} -v all 162 272 if test $? -ne 0; then 163 273 echo ${errmsg} 164 274 echo " python failed!!" 165 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \275 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 166 276 -S ${values} -f ${HMT} -v all 167 277 exit 168 278 fi 169 echo " * Concatenating surface data at point: "${sfclon}", "${sfclat}>> ${insoutf}170 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \279 echo " * Concatenating '${ik}' surface map data: " >> ${insoutf} 280 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 171 281 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 172 282 echo " " >> ${insoutf} 173 283 mv netcdf_fold_concatenated_HMT.nc ${ofile} 284 rm ${ofold}/${fHEADn}${fk}_${expn}_????-??-??_??:??:??.nc >& /dev/null 285 else 286 file1=`ls -1 ${ofold}/${fHEADn}${fk}_*${expn}*.nc` 287 mv ${file1} ${ofile} 174 288 fi 175 289 fi 176 fi 177 178 # cdx sfc pt 179 if test ! ${cdxdiags} = 'None' || test ! ${cdxnondiags} = 'None'; then 180 files=`ls -1 ${infolder}/${expn}/wrfout/wrfcdx_d${domn}*` 181 ofile=${ofold}/simcdx_sfcvars_${sfcid}_${expn}.nc 182 if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi 183 if test ! -f ${ofile}; then 184 for filen in ${files}; do 185 $pyHOME/get_WRFsounding-surface_data.bash ${scratch} ${ofold} ${expn} None \ 186 ${sfcvn} ${filen} None,None,None,${cdxdiags},${cdxnondiags} 187 # end of files 188 done 189 190 # Concatenating files 191 values=${ofold}',Time,time' 192 HMT='simcdx_sfcdiags_,'${sfcid}'_'${expn},'nc' 193 Nfiles=`ls -1 ${ofold}/simcdx_sfcdiags_*${sndid}_${expn}*.nc | wc -l` 194 if test ${Nfiles} -gt 0; then 195 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 196 -f ${HMT} -v all 197 if test $? -ne 0; then 198 echo ${errmsg} 199 echo " python failed!!" 200 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 201 -S ${values} -f ${HMT} -v all 202 exit 203 fi 204 echo " * Concatenating cdx surface data at point: "${sfclon}", "${sfclat} >> ${insoutf} 205 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 206 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 207 echo " " >> ${insoutf} 208 mv netcdf_fold_concatenated_HMT.nc ${ofile} 209 fi 210 fi 211 #exit 212 fi 213 214 # end of surfaces 215 done 216 fi 217 218 # 2D maps 219 okind='out cdx' 220 for ik in ${okind}; do 221 ofile=${ofold}/sim${ik}_sfcmapvars_${expn}.nc 222 if test ${scratch} = 'true'; then rm ${ofile} >& /dev/null; fi 223 if test ! -f ${ofile}; then 224 # Concatenating files 225 values=${ofold}',Time,time' 226 HMT='sim'${ik}'_sfcmapdiags_,'${expn},'nc' 227 Nfiles=`ls -1 ${ofold}/sim${ik}_sfcmapdiags_*${expn}*.nc | wc -l` 228 if test ${Nfiles} -gt 0; then 229 python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values} \ 230 -f ${HMT} -v all 231 if test $? -ne 0; then 232 echo ${errmsg} 233 echo " python failed!!" 234 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 235 -S ${values} -f ${HMT} -v all 236 exit 237 fi 238 echo " * Concatenating '${ik}' surface map data: " >> ${insoutf} 239 echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT \ 240 -S "'"${values}"'" -f ${HMT} -v all >> ${insoutf} 241 echo " " >> ${insoutf} 242 mv netcdf_fold_concatenated_HMT.nc ${ofile} 243 fi 244 fi 290 done 245 291 done 246 292
Note: See TracChangeset
for help on using the changeset viewer.