#!/bin/sh # shell to run ocean heat content time series and geographic # distribution from in situ ocean profile data (World Ocean Database, WOD) #MAINDIR is the directory in whose subdirectories all of the files for # OHC calculations are found and to which the output files will be written. # In this example shell this is simply the present directory above # the 'shells' directory in which 'run_ohc.shell' resides. # Change as necessary. But take care, full pathnames + file names # must be <= 80 characters. MAINDIR="." #SHELLDIR is location for shells for OHC (including this one) SHELLDIR="$MAINDIR"/shells #EXECDIR is the directory in which executables are stored EXECDIR="$MAINDIR"/executables #WORKDIR is the directory in which shells/programs are run. # This present shell should be run from the work directory # In this example shell, from necessity, the WORKDIR=MAINDIR. # Since this shell does not clean up after itself, there will # be numerous files copied to the work area and lefft there. #WORKDIR="$MAINDIR"/work WORKDIR="$MAINDIR" #INFOFILEDIR: directory for information files for program runs INFOFILEDIR="$MAINDIR"/info_files #CLIMATOLOGYDIR: directory for climatological mean fields and statistics # including anomaly fields CLIMATOLOGYDIR="$MAINDIR"/climatology #CLIMATOLOGYSTATSDIR: directory for anomaly error statistics CLIMATOLOGYSTATSDIR="$CLIMATOLOGYDIR"/stats #NETCDFDIR is the directory for the OHC netcdf files NETCDFDIR="$MAINDIR"/netcdf #YEARSTART: starting year to run anomaly fields (YEAR - 1900) YEARSTART="116" YEARSTARTFULL="2016" #YEAREND: ending year to run anomaly fields (YEAR - 1900) YEAREND="116" YEARENDFULL="2016" #SEAS_START: starting season (1-4) of first year for anomaly run SEAS_START="1" #SEAS_END: ending season (1-4) of last year for anomaly run SEAS_END="4" #DEP1: starting depth level for analysis (1=surface) DEP1="1" #DEP2: ending depth level for analysis (16=700m depth) DEP2="16" #subset.sheet: subsetting instructions for WOD system #empty for OHC. cp "$INFOFILEDIR"/subset.sheet_empty "$WORKDIR"/subset.sheet #maskchoice.t : WOD quality flags for ocean profile data cp "$INFOFILEDIR"/maskchoice.t "$WORKDIR"/maskchoice.d #probefile.allt_ohc: data set information/selections for WOD system cp "$INFOFILEDIR"/probefile.allt_ohc "$WORKDIR"/probefile.d #devfile_anom.3month: instructions for run of finalsd.exe cp "$INFOFILEDIR"/devfile_anom.3month "$WORKDIR"/devfile.d #loop through each requested year for (( YEAR = "$YEARSTART"; YEAR <= "$YEAREND"; YEAR++)) do #if any but first year start in first season (1) #for first year, use user input start season SEAS1="1" if [ "$YEAR" -eq "$YEARSTART" ] then SEAS1="$SEAS_START" fi #if any but last year end in last season (4) #for last year, use user input end season SEAS2="4" if [ "$YEAR" -eq "$YEAREND" ] then SEAS2="$SEAS_END" fi # run loop for each designated season for each year for (( SEAS = "$SEAS1"; SEAS <= "$SEAS2"; SEAS++)) do #enter year, season into short information file for analysis.exe cat>"$WORKDIR"/dum2<"$WORKDIR"/statpath.d<"$WORKDIR"/dum<"$WORKDIR"/statpath.d<"$WORKDIR"/statpath.d<