#!/bin/ksh  

datai=20000602
dataf=20210225

while [ $datai -le $dataf ] ; do
 njobs=$(ps -auxwww |grep convert_MERGE_grib2_to_nc.ksh |grep /bin/ksh |wc -l) 
 if [ $njobs -le 15 ] ; then
   ./convert_MERGE_grib2_to_nc.ksh $datai &
   datai=`date -d "${datai:0:8} 00:00 24 hours" +"%Y%m%d"`
 else 
   sleep 10
 fi
done
