#!/bin/csh -x
#PBS -N pp_archm
#PBS -j oe
#PBS -o XXX.log
#PBS -W umask=027
#PBS -l application=home-grown
#PBS -l select=1:ncpus=24
#PBS -l walltime=0:05:00
#PBS -A NRLSS03755018
#PBS -q debug
#
set echo
set time = 1
C
#setenv OS `uname`
setenv OS 'HPE'
switch ($OS)
case 'SunOS':
case 'Linux':
    which aprun
    if (! $status) then
C --- XT4, XT5 or XC30
      setenv OS XT4
      setenv SRC ~/HYCOM-tools/mom6/src
      set APRUN='aprun -n 1'
    endif
    breaksw
default:
    setenv SRC ~/HYCOM-tools/mom6/src
    set APRUN=''
endsw
#
# --- convert a partial HYCOM blkdat.input to a mom6_vgrid.nc
# depthi : profile from climatology GDEM4 30W,15S
#
# --- R is region name.
# --- E is expt number.
#
setenv R GLBb0.08
setenv E 010
#
cd $HOME/HYCOM3-examples/${R}/topo
#
/bin/rm -f mom6_vgrid.nc
${APRUN} ${SRC}/hycom2vgrid <<E-o-D
  32      'kdm   ' = number of layers
  32      'nhybrd' = number of hybrid levels (0=all isopycnal)
   0      'nsigma' = number of sigma  levels (nhybrd-nsigma z-levels)
   3.0    'dp00  ' = deep    z-level spacing minimum thickness (m)
 450.0    'dp00x ' = deep    z-level spacing maximum thickness (m)
   1.18   'dp00f ' = deep    z-level spacing stretching factor (1.0=const.space)
   3.0    'ds00  ' = shallow z-level spacing minimum thickness (m)
 450.0    'ds00x ' = shallow z-level spacing maximum thickness (m)
   1.18   'ds00f ' = shallow z-level spacing stretching factor (1.0=const.space)
   2      'thflag' = reference pressure flag (0=Sigma-0, 2=Sigma-2)
   0      'vsigma' = spacially varying isopycnal target densities (0=F,1=T)
  01.00   'sigma ' = layer  1 isopycnal target density (sigma units)
  01.2000 'sigma ' = layer 02 isopycnal target density (sigma units)
  29.70   'sigma ' = layer  3 isopycnal target density (sigma units)
  30.50   'sigma ' = layer  4 isopycnal target density (sigma units)
  30.95   'sigma ' = layer  5 isopycnal target density (sigma units)
  31.50   'sigma ' = layer  6 isopycnal target density (sigma units)
  32.05   'sigma ' = layer  7 isopycnal target density (sigma units)
  32.60   'sigma ' = layer  8 isopycnal target density (sigma units)
  33.15   'sigma ' = layer  9 isopycnal target density (sigma units)
  33.70   'sigma ' = layer 10 isopycnal target density (sigma units)
  34.25   'sigma ' = layer 11 isopycnal target density (sigma units)
  34.75   'sigma ' = layer 12 isopycnal target density (sigma units)
  35.15   'sigma ' = layer 13 isopycnal target density (sigma units)
  35.50   'sigma ' = layer 14 isopycnal target density (sigma units)
  35.80   'sigma ' = layer 15 isopycnal target density (sigma units)
  36.04   'sigma ' = layer 16 isopycnal target density (sigma units)
  36.20   'sigma ' = layer 17 isopycnal target density (sigma units)
  36.38   'sigma ' = layer 18 isopycnal target density (sigma units)
  36.52   'sigma ' = layer 19 isopycnal target density (sigma units)
  36.62   'sigma ' = layer 20 isopycnal target density (sigma units)
  36.70   'sigma ' = layer 21 isopycnal target density (sigma units)
  36.77   'sigma ' = layer 22 isopycnal target density (sigma units)
  36.83   'sigma ' = layer 23 isopycnal target density (sigma units)
  36.89   'sigma ' = layer 24 isopycnal target density (sigma units)
  36.97   'sigma ' = layer 25 isopycnal target density (sigma units)
  37.02   'sigma ' = layer 26 isopycnal target density (sigma units)
  37.06   'sigma ' = layer 27 isopycnal target density (sigma units)
  37.09   'sigma ' = layer 28
  37.11   'sigma ' = layer 29
  37.13   'sigma ' = layer 30
  37.15   'sigma ' = layer 31
  37.20   'sigma ' = layer 32
   0.01   'frcomp' = fraction of compressibility to apply   (0.0 to 1.0)
  34.7    'salref' = reference salinity for compressibility (psu)
    0.000 'depthi' = interface  0  target depth for compressibility (m)
    3.000 'depthi' = interface  1  target depth for compressibility (m)
    6.540 'depthi' = interface  2  target depth for compressibility (m)
   10.717 'depthi' = interface  3  target depth for compressibility (m)
   15.646 'depthi' = interface  4  target depth for compressibility (m)
   21.463 'depthi' = interface  5  target depth for compressibility (m)
   28.326 'depthi' = interface  6  target depth for compressibility (m)
   36.425 'depthi' = interface  7  target depth for compressibility (m)
   45.981 'depthi' = interface  8  target depth for compressibility (m)
   97.788 'depthi' = interface  9  target depth for compressibility (m)
  163.215 'depthi' = interface  10  target depth for compressibility (m)
  198.500 'depthi' = interface  11  target depth for compressibility (m)
  243.306 'depthi' = interface  12  target depth for compressibility (m)
  302.063 'depthi' = interface  13  target depth for compressibility (m)
  375.432 'depthi' = interface  14  target depth for compressibility (m)
  462.924 'depthi' = interface  15  target depth for compressibility (m)
  551.643 'depthi' = interface  16  target depth for compressibility (m)
  672.580 'depthi' = interface  17  target depth for compressibility (m)
  854.396 'depthi' = interface  18  target depth for compressibility (m)
 1035.638 'depthi' = interface  19  target depth for compressibility (m)
 1182.651 'depthi' = interface  20  target depth for compressibility (m)
 1311.494 'depthi' = interface  21  target depth for compressibility (m)
 1441.785 'depthi' = interface  22  target depth for compressibility (m)
 1580.184 'depthi' = interface  23  target depth for compressibility (m)
 1816.349 'depthi' = interface  24  target depth for compressibility (m)
 2272.341 'depthi' = interface  25  target depth for compressibility (m)
 3063.086 'depthi' = interface  26  target depth for compressibility (m)
 3626.035 'depthi' = interface  27  target depth for compressibility (m)
 3922.305 'depthi' = interface  28  target depth for compressibility (m)
 4166.196 'depthi' = interface  29  target depth for compressibility (m)
 4467.996 'depthi' = interface  30  target depth for compressibility (m)
 5030.000 'depthi' = interface  31  target depth for compressibility (m)
 5130.000 'depthi' = interface  32  target depth for compressibility (m)
E-o-D
/bin/mv mom6_vgrid.nc mom6_vgrid_32l.nc

