#!/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
  16      'kdm   ' = number of layers
  16      'nhybrd' = number of hybrid levels (0=all isopycnal)
   0      'nsigma' = number of sigma  levels (nhybrd-nsigma z-levels)
  6.540   'dp00  ' = deep    z-level spacing minimum thickness (m)
 900.0    'dp00x ' = deep    z-level spacing maximum thickness (m)
  1.3924  'dp00f ' = deep    z-level spacing stretching factor (1.0=const.space)
  6.540   'ds00  ' = shallow z-level spacing minimum thickness (m)
 900.0    'ds00x ' = shallow z-level spacing maximum thickness (m)
  1.3924  '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)
  29.7000 'sigma ' = layer 02 isopycnal target density (sigma units)
  30.9500 'sigma ' = layer 03 isopycnal target density (sigma units)
  32.0500 'sigma ' = layer 04 isopycnal target density (sigma units)
  33.1500 'sigma ' = layer 05 isopycnal target density (sigma units)
  34.2500 'sigma ' = layer 06 isopycnal target density (sigma units)
  35.1500 'sigma ' = layer 07 isopycnal target density (sigma units)
  35.8000 'sigma ' = layer 08 isopycnal target density (sigma units)
  36.2000 'sigma ' = layer 09 isopycnal target density (sigma units)
  36.5200 'sigma ' = layer 10 isopycnal target density (sigma units)
  36.7000 'sigma ' = layer 11 isopycnal target density (sigma units)
  36.8300 'sigma ' = layer 12 isopycnal target density (sigma units)
  36.9700 'sigma ' = layer 13 isopycnal target density (sigma units)
  37.0600 'sigma ' = layer 14 isopycnal target density (sigma units)
  37.1100 'sigma ' = layer 15 isopycnal target density (sigma units)
  37.1500 'sigma ' = layer 16 isopycnal target density (sigma units)
   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)
    6.540 'depthi' = interface  1  target depth for compressibility (m)
   15.646 'depthi' = interface  2  target depth for compressibility (m)
   28.326 'depthi' = interface  3  target depth for compressibility (m)
   45.981 'depthi' = interface  4  target depth for compressibility (m)
  142.153 'depthi' = interface  5  target depth for compressibility (m)
  215.856 'depthi' = interface  6  target depth for compressibility (m)
  332.700 'depthi' = interface  7  target depth for compressibility (m)
  490.468 'depthi' = interface  8  target depth for compressibility (m)
  742.989 'depthi' = interface  9  target depth for compressibility (m)
 1097.357 'depthi' = interface  10  target depth for compressibility (m)
 1369.476 'depthi' = interface  11  target depth for compressibility (m)
 1708.172 'depthi' = interface  12  target depth for compressibility (m)
 2567.667 'depthi' = interface  13  target depth for compressibility (m)
 3747.237 'depthi' = interface  14  target depth for compressibility (m)
 4311.727 'depthi' = interface  15  target depth for compressibility (m)
 5130.000 'depthi' = interface  16  target depth for compressibility (m)
E-o-D
/bin/mv mom6_vgrid.nc mom6_vgrid_16l.nc

