#!/bin/tcsh -f set echo set platform = ifc # A unique identifier for your platform set name = 512x1024x40 # Name of the experiment set base = bill_2.5/48th # Name of the experiment set npes = 10 # number of processors set days = 3 # number of days to run set months = 0 # number of months to run set root = $HOME/mom4 # The directory you created when you checkout set code_dir = $root/src # source code directory set expdir = $root/exp/${base}/${name} # directory of the experiment set workdir = $WORK/mom4p0d/exp/${base}/${name} # where model run and output produced set executable = $workdir/exec/mom4_dyn.x # executable set diagtable = $expdir/input/diag_table # path to diagnositics table set datatable = $expdir/input/data_table # path to the data override table. set fieldtable = $expdir/input/field_table # path to the field table set namelist = $expdir/input/namelist # path to namelist file set restart = $workdir/RESTART/20300101.tar set mppnccombine = $root/bin/mppnccombine_dyn.$platform # path to executable mppnccombine set time_stamp = $root/bin/time_stamp.csh # path to cshell to generate the date #------------------------------------------------------------------------------------------------ # setup directory structure if ( ! -d $workdir ) mkdir $workdir if ( ! -d $workdir/INPUT ) mkdir $workdir/INPUT if ( ! -d $workdir/RESTART ) mkdir $workdir/RESTART #------------------------------------------------------------------------------------------------ # get data sets, input data and executable cd $workdir cat > input.nml <> input.nml cp $datatable data_table cp $diagtable diag_table cp $fieldtable field_table cd INPUT cp $workdir/preprocessing/grid_spec.nc . cp $workdir/preprocessing/temp_sfc_restore_julian.nc ./temp_sfc_restore.nc cp $workdir/preprocessing/salt_sfc_restore_julian.nc ./salt_sfc_restore.nc cp $workdir/preprocessing/tau_julian.nc ./tau.nc # restart files: cp $workdir/preprocessing/*.res.nc . # cp $restart . # tar -xvf $restart:t # rm $restart:t cd $workdir cp $executable $executable:t #---------------------------------------------------------------------------------------------- # run the model if($npes > 1) then ibrun ./$executable:t > fms.out else $executable:t > fms.out endif cat fms.out #---------------------------------------------------------------------------------------------- # generate date for file names --- set begindate = `$time_stamp -bf digital` if ( $begindate == "" ) set begindate = tmp`date '+%j%H%M%S'` set enddate = `$time_stamp -ef digital` if ( $enddate == "" ) set enddate = tmp`date '+%j%H%M%S'` if ( -f time_stamp.out ) rm -f time_stamp.out #---------------------------------------------------------------------------------------------- # get a tar restart file cd RESTART # Rob Scott's guess work: # combine netcdf files foreach ncfile (`/bin/ls *.nc.0000`) $mppnccombine $ncfile:r rm $ncfile:r.???? end set resfiles = `ls *.res *.nc` if ( $#resfiles > 0 ) then cp $workdir/input.nml . cp $workdir/*_table . set files = ( $resfiles input.nml *_table ) tar -cf $enddate.tar $files rm -f $files endif cd $workdir #---------------------------------------------------------------------------------------------- # rename ascii files with the date foreach out (`ls *.out`) mv $out $begindate.$out end #---------------------------------------------------------------------------------------------- # combine netcdf files if ( $npes > 1 ) then foreach ncfile (`/bin/ls *.nc.0000`) $mppnccombine $ncfile:r rm $ncfile:r.???? end endif #---------------------------------------------------------------------------------------------- # rename nc files with the date foreach ncfile (`/bin/ls *.nc`) mv $ncfile $begindate.$ncfile end set files = `ls $begindate.*.nc` if ( $#files > 0 ) then tar -cf $begindate.nc.tar $files rm -f $files endif unset echo