[Swift-commit] r5971 - SwiftApps/ParVis/HiRAMTools

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Tue Oct 16 09:58:44 CDT 2012


Author: wilde
Date: 2012-10-16 09:58:43 -0500 (Tue, 16 Oct 2012)
New Revision: 5971

Added:
   SwiftApps/ParVis/HiRAMTools/makeyearly.sh
Removed:
   SwiftApps/ParVis/HiRAMTools/makeyearly-cdo.sh
Modified:
   SwiftApps/ParVis/HiRAMTools/makeyearly_realization.sh
Log:
Rename makeyearly-cdo.sh back to makeyearly.sh

Deleted: SwiftApps/ParVis/HiRAMTools/makeyearly-cdo.sh
===================================================================
--- SwiftApps/ParVis/HiRAMTools/makeyearly-cdo.sh	2012-10-16 14:55:15 UTC (rev 5970)
+++ SwiftApps/ParVis/HiRAMTools/makeyearly-cdo.sh	2012-10-16 14:58:43 UTC (rev 5971)
@@ -1,83 +0,0 @@
-#! /bin/bash
-
-# Create a fast (local-filesystem) working dir
-
-if mkdir -p /scratch/wilde; then
-  scratch=/scratch/wilde
-elif mkdir -p $HOME/scratch; then
-  scratch=$HOME/scratch
-else
-  echo $0: cant create scratch dir
-  exit 11
-fi
-
-tmp=$(mktemp -d $scratch/makeyearly_XXXXXX)
-startdir=$PWD
-cd $tmp
-
-echo running in $PWD
-
-qtrdec1=$1  # 1st quarter-decade dir
-qtrdec2=$2  # 2nd quarter-decade dir
-destbase=$3 # base dir for output years
-
-echo destbase=$destbase qtrdec1=$1 qtrdec2=$2
-
-# Add cdo and nco tools to PATH and Intel compiler v11 libs to LD_LIBRARY_PATH
-
-#export PATH=/soft/apps/cdo-1.4.7/bin:/soft/apps/nco-4.0.9/bin:$PATH
-export PATH=/soft/apps/nco-4.0.9/bin:$PATH
-export LD_LIBRARY_PATH=/soft/apps/intel-fc-11.0.074/lib/intel64:/soft/apps/intel-cc-11.0.074/lib/intel64:/soft/apps/netcdf-3.6.3/lib:/usr/lib:/usr/X11R6/lib:/usr/local/lib
-
-fname=$(basename $qtrdec1 .nc)
-firstyear=$(basename $(dirname $qtrdec1) | sed -e 's/....$//')
-
-# process only the time-based files
-
-if echo $fname | egrep -v 'grid_spec|scalar'; then
-
-  # Merge 2 quarter-decade files into one half-decade file
-
-  ncrcat $qtrdec1 $qtrdec2 5years.nc 
-
-  # Extract each year from the half-decade file
-
-  for (( y=$firstyear; y<$firstyear+5; y++ )); do
-    ncks -d time,"${y}-01-01 00:00:00","${y}-12-31 23:59:59" 5years.nc  $y.nc
-  done
-
-fi  
-
-# Copy the years from temporary to permanent filesystem
-
-for (( y=$firstyear; y<$firstyear+5; y++ ))
-do
-  destdir=$destbase/${y}0101
-  mkdir -p $destdir
-  if echo $fname | egrep -v 'grid_spec|scalar'; then
-    dd if=$y.nc of=$destdir/$fname.nc bs=8M
-  else
-    dd if=$qtrdec1 of=$destdir/$fname.nc bs=8M
-  fi
-done
-
-rm -rf $tmp
-
-# Delete when this works:
-
-  # Old method:
-  #
-  # cdo mergetime $qtrdec1 $qtrdec2 ${fname}.nc
-  # cdo splityear ${fname}.nc ${fname}.
-  # Yields, eg, from atmos_month.tile1:
-  # atmos_month.tile1.1950.nc
-  # atmos_month.tile1.1951.nc
-  # atmos_month.tile1.1952.nc
-  # atmos_month.tile1.1953.nc
-  # atmos_month.tile1.1954.nc
-
-  # New method:
-  #
-  # ncrcat input1.nc input2.nc 5years.nc 
-  # ncks -d time,"$yyyy-01-01 00:00:00","$yyyy-12-31 23:59:59" 5years.nc  year1.nc
-

Copied: SwiftApps/ParVis/HiRAMTools/makeyearly.sh (from rev 5969, SwiftApps/ParVis/HiRAMTools/makeyearly-cdo.sh)
===================================================================
--- SwiftApps/ParVis/HiRAMTools/makeyearly.sh	                        (rev 0)
+++ SwiftApps/ParVis/HiRAMTools/makeyearly.sh	2012-10-16 14:58:43 UTC (rev 5971)
@@ -0,0 +1,83 @@
+#! /bin/bash
+
+# Create a fast (local-filesystem) working dir
+
+if mkdir -p /scratch/wilde; then
+  scratch=/scratch/wilde
+elif mkdir -p $HOME/scratch; then
+  scratch=$HOME/scratch
+else
+  echo $0: cant create scratch dir
+  exit 11
+fi
+
+tmp=$(mktemp -d $scratch/makeyearly_XXXXXX)
+startdir=$PWD
+cd $tmp
+
+echo running in $PWD
+
+qtrdec1=$1  # 1st quarter-decade dir
+qtrdec2=$2  # 2nd quarter-decade dir
+destbase=$3 # base dir for output years
+
+echo destbase=$destbase qtrdec1=$1 qtrdec2=$2
+
+# Add cdo and nco tools to PATH and Intel compiler v11 libs to LD_LIBRARY_PATH
+
+#export PATH=/soft/apps/cdo-1.4.7/bin:/soft/apps/nco-4.0.9/bin:$PATH
+export PATH=/soft/apps/nco-4.0.9/bin:$PATH
+export LD_LIBRARY_PATH=/soft/apps/intel-fc-11.0.074/lib/intel64:/soft/apps/intel-cc-11.0.074/lib/intel64:/soft/apps/netcdf-3.6.3/lib:/usr/lib:/usr/X11R6/lib:/usr/local/lib
+
+fname=$(basename $qtrdec1 .nc)
+firstyear=$(basename $(dirname $qtrdec1) | sed -e 's/....$//')
+
+# process only the time-based files
+
+if echo $fname | egrep -v 'grid_spec|scalar'; then
+
+  # Merge 2 quarter-decade files into one half-decade file
+
+  ncrcat $qtrdec1 $qtrdec2 5years.nc 
+
+  # Extract each year from the half-decade file
+
+  for (( y=$firstyear; y<$firstyear+5; y++ )); do
+    ncks -d time,"${y}-01-01 00:00:00","${y}-12-31 23:59:59" 5years.nc  $y.nc
+  done
+
+fi  
+
+# Copy the years from temporary to permanent filesystem
+
+for (( y=$firstyear; y<$firstyear+5; y++ ))
+do
+  destdir=$destbase/${y}0101
+  mkdir -p $destdir
+  if echo $fname | egrep -v 'grid_spec|scalar'; then
+    dd if=$y.nc of=$destdir/$fname.nc bs=8M
+  else
+    dd if=$qtrdec1 of=$destdir/$fname.nc bs=8M
+  fi
+done
+
+rm -rf $tmp
+
+# Delete when this works:
+
+  # Old method:
+  #
+  # cdo mergetime $qtrdec1 $qtrdec2 ${fname}.nc
+  # cdo splityear ${fname}.nc ${fname}.
+  # Yields, eg, from atmos_month.tile1:
+  # atmos_month.tile1.1950.nc
+  # atmos_month.tile1.1951.nc
+  # atmos_month.tile1.1952.nc
+  # atmos_month.tile1.1953.nc
+  # atmos_month.tile1.1954.nc
+
+  # New method:
+  #
+  # ncrcat input1.nc input2.nc 5years.nc 
+  # ncks -d time,"$yyyy-01-01 00:00:00","$yyyy-12-31 23:59:59" 5years.nc  year1.nc
+

Modified: SwiftApps/ParVis/HiRAMTools/makeyearly_realization.sh
===================================================================
--- SwiftApps/ParVis/HiRAMTools/makeyearly_realization.sh	2012-10-16 14:55:15 UTC (rev 5970)
+++ SwiftApps/ParVis/HiRAMTools/makeyearly_realization.sh	2012-10-16 14:58:43 UTC (rev 5971)
@@ -82,7 +82,7 @@
 
 cat >$rundir/tc <<END
 
-cobalt makeyearly $bindir/makeyearly-cdo.sh
+cobalt makeyearly $bindir/makeyearly.sh
 
 END
 




More information about the Swift-commit mailing list