|
@@ -37,13 +37,15 @@ set -e
|
|
indir=/gpfs/scratch/acad/limhr/adelhass/obs/OSI-450-430-a/interpo
|
|
indir=/gpfs/scratch/acad/limhr/adelhass/obs/OSI-450-430-a/interpo
|
|
outdir=/gpfs/scratch/acad/limhr/adelhass/obs/OSI-450-430-a/uf-siconc
|
|
outdir=/gpfs/scratch/acad/limhr/adelhass/obs/OSI-450-430-a/uf-siconc
|
|
|
|
|
|
-yb=1990
|
|
|
|
-ye=1991
|
|
|
|
|
|
+yb=1988
|
|
|
|
+ye=1988
|
|
|
|
|
|
for year in $yb $ye; do
|
|
for year in $yb $ye; do
|
|
for mm in `seq 1 12`; do
|
|
for mm in `seq 1 12`; do
|
|
#year=1990
|
|
#year=1990
|
|
#month="02"
|
|
#month="02"
|
|
|
|
+
|
|
|
|
+### upgrade with good date if not the 1sr of the month ??
|
|
day='01'
|
|
day='01'
|
|
month=$(printf "%02d" $mm)
|
|
month=$(printf "%02d" $mm)
|
|
|
|
|
|
@@ -55,28 +57,35 @@ month=$(printf "%02d" $mm)
|
|
cd /gpfs/scratch/acad/limhr/adelhass/conversion_uf_${tagdate}
|
|
cd /gpfs/scratch/acad/limhr/adelhass/conversion_uf_${tagdate}
|
|
cp -r ~/git/EnKF/src_conversion/* .
|
|
cp -r ~/git/EnKF/src_conversion/* .
|
|
|
|
|
|
|
|
+ ## test if file exist, else, skip the date
|
|
|
|
+ if [ -f ${indir}/ice_conc_OSISAF-eORCA1_${tagdate}.nc ] ; then
|
|
## launch conversion itself
|
|
## launch conversion itself
|
|
- ./prep_obs_ORCA1 ${indir}/ice_conc_OSISAF-eORCA1_${tagdate}.nc sic ${tagdate}
|
|
|
|
- cpt=0
|
|
|
|
- while [ ! -f observations.uf ] && [ ! -f observations.txt ] ; do
|
|
|
|
- cpt=$((cpt+1))
|
|
|
|
- sleep 20
|
|
|
|
- if [ ${cpt} -gt 10 ] ; then
|
|
|
|
- [ $? -ne 0 ] && exit 1
|
|
|
|
- fi
|
|
|
|
- done
|
|
|
|
|
|
+ ./prep_obs_ORCA1 ${indir}/ice_conc_OSISAF-eORCA1_${tagdate}.nc sic ${tagdate}
|
|
|
|
+ cpt=0
|
|
|
|
+ while [ ! -f observations.uf ] && [ ! -f observations.txt ] ; do
|
|
|
|
+ cpt=$((cpt+1))
|
|
|
|
+ sleep 20
|
|
|
|
+ if [ ${cpt} -gt 10 ] ; then
|
|
|
|
+ [ $? -ne 0 ] && exit 1
|
|
|
|
+ fi
|
|
|
|
+ done
|
|
|
|
|
|
- cp observations.txt ${outdir}/observations_${tagdate}.txt
|
|
|
|
- cp observations.uf ${outdir}/observations_${tagdate}.uf
|
|
|
|
|
|
+ cp observations.txt ${outdir}/observations_${tagdate}.txt
|
|
|
|
+ cp observations.uf ${outdir}/observations_${tagdate}.uf
|
|
|
|
|
|
- if [ ! -f ${outdir}/observations_${tagdate}.txt ] || [ ! -f ${outdir}/observations_${tagdate}.uf ] ; then
|
|
|
|
- echo "Something wrong ${outdir}/observations_${tagdate}.* don't exist! "
|
|
|
|
- exit 2
|
|
|
|
- else
|
|
|
|
- echo "conversion ${tagdate} DONE! and file in ${outdir}/observations_${tagdate}.*"
|
|
|
|
- echo "Remove tmp working dir /gpfs/scratch/acad/limhr/adelhass/conversion_uf_${tagdate} "
|
|
|
|
- rm -rf /gpfs/scratch/acad/limhr/adelhass/conversion_uf_${tagdate}
|
|
|
|
- fi
|
|
|
|
|
|
+ if [ ! -f ${outdir}/observations_${tagdate}.txt ] || [ ! -f ${outdir}/observations_${tagdate}.uf ] ; then
|
|
|
|
+ echo "Something wrong ${outdir}/observations_${tagdate}.* don't exist! "
|
|
|
|
+ exit 2
|
|
|
|
+ else
|
|
|
|
+ echo "conversion ${tagdate} DONE! and file in ${outdir}/observations_${tagdate}.*"
|
|
|
|
+ echo "Remove tmp working dir /gpfs/scratch/acad/limhr/adelhass/conversion_uf_${tagdate} "
|
|
|
|
+ rm -rf /gpfs/scratch/acad/limhr/adelhass/conversion_uf_${tagdate}
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ echo "File ${indir}/ice_conc_OSISAF-eORCA1_${tagdate}.nc doesn't exist, skip until next date."
|
|
|
|
+ ### create an empty file "observations_${tagdate}_missing" in the output rep
|
|
|
|
+ echo '' > ${outdir}/observations_${tagdate}_missing
|
|
|
|
+fi
|
|
|
|
|
|
done #month
|
|
done #month
|
|
done #year
|
|
done #year
|