123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #!/bin/bash
- # ./chkexpout.sh model expid
- #set -xuve
- model=$1
- expid=$2
- src1=/esnas/exp/$model
- src2=/esnas/exp/$model/restartfiles
- src30=/esnas/exp/$model/gribfiles
- src3=/esnas/exp/$model/rawfiles
- src4=/esnas/exp/$model/cmorfiles
- sdates=$(ls -1 $src1/$expid | grep [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])
- for s in $sdates; do
- mems=$(ls -1 $src1/$expid/$s | grep fc)
- for m in $mems; do
- if [[ -d $src1/$expid/$s/$m ]]; then
- l=$(ls -1 $src1/$expid/$s/$m | grep logfiles | wc -l)
- mm=""
- if [[ -d $src1/$expid/$s/$m/outputs ]]; then
- a=$(ls -1 $src1/$expid/$s/$m/outputs | grep MMA | wc -l)
- o=$(ls -1 $src1/$expid/$s/$m/outputs | grep MMO | wc -l)
- sz=$(du -chs $src1/$expid/$s/$m/outputs | grep total | awk '{print $1}')
- mm="MMA=$a MMO=$o MM_SZ=$sz"
- fi
- rest=""
- # old option
- if [[ -d $src1/$expid/$s/$m/restarts ]]; then
- r=$(ls -1 $src1/$expid/$s/$m/restarts | grep REST | wc -l)
- sz=$(du -chs $src1/$expid/$s/$m/restarts | grep total | awk '{print $1}')
- rest="REST=$r REST_SZ=$sz"
- fi
- # old option
- if [[ -d $src2/$expid/$s/$m/restarts ]]; then
- r=$(ls -1 $src2/$expid/$s/$m/restarts | grep REST | wc -l)
- sz=$(du -chs $src2/$expid/$s/$m/restarts | grep total | awk '{print $1}')
- rest="REST=$r REST_SZ=$sz"
- fi
- grb=""
- if [[ -d $src3/$expid/$s/$m/outputs ]]; then
- gg=$(ls -1 $src3/$expid/$s/$m/outputs | grep ICMGG | wc -l)
- sh=$(ls -1 $src3/$expid/$s/$m/outputs | grep ICMSH | wc -l)
- sz=$(du -chs $src3/$expid/$s/$m/outputs | grep total | awk '{print $1}')
- grb="GG=$gg SH=$sh GRB_SZ=$sz"
- fi
- cmor=""
- if [[ -d $src4/$expid/$s/$m/outputs ]]; then
- ca=$(ls -1 $src4/$expid/$s/$m/outputs | grep CMORA | wc -l)
- co=$(ls -1 $src4/$expid/$s/$m/outputs | grep CMORO | wc -l)
- sz=$(du -chs $src4/$expid/$s/$m/outputs | grep total | awk '{print $1}')
- cmor="CMORA=$ca CMORO=$co CMOR_SZ=$sz"
- fi
- echo "$expid $s $m LOGS=$l ${mm} ${rest} $grb $cmor"
- fi
- done
- done
- du -chs $src1/$expid | grep $expid
- du -chs $src2/$expid | grep $expid
- du -chs $src30/$expid | grep $expid
- du -chs $src3/$expid | grep $expid
- du -chs $src4/$expid | grep $expid
|