Explorar el Código

bash launch interpolation obs to eROCA1 grid and conversion to binary files

Alison Delhasse hace 2 meses
padre
commit
15f22ed15a

+ 30 - 21
conversion_uf_after_interpo/launch_conversion_uf.bash

@@ -37,13 +37,15 @@ set -e
 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
 
-yb=1990
-ye=1991
+yb=1988
+ye=1988
 
 for year in $yb $ye; do
  for mm in `seq 1 12`; do
 #year=1990
 #month="02"
+
+### upgrade with good date if not the 1sr of the month ??
 day='01'
 month=$(printf "%02d" $mm)
   
@@ -55,28 +57,35 @@ month=$(printf "%02d" $mm)
   cd /gpfs/scratch/acad/limhr/adelhass/conversion_uf_${tagdate}
   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
-  ./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 #year

+ 2 - 2
interpolate_observations/osisaf/remap/OSISAF_to_ORCA.bash

@@ -28,8 +28,8 @@ set -x
 set -o nounset
 set -o errexit
 
-yearb=1990    # Years to process
-yeare=1991           
+yearb=1992    # Years to process
+yeare=1992           
 
 grid=eORCA1    # Grid type: ORCA1 or ORCA25