Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.6 kB
2
Indexable
Never
#! /bin/csh


cd ${5}
set tau = `ncks -H -v tau $1 | grep "tau = " | awk '{print $3}'`
set dtg = `ncdump -h $1 | grep "tau:time_origin" | awk '{print $3}' | tr '"' " " | tr "-" " " | awk '{print $1$2$3"00"}'`

echo Region: $2
echo Bathy file: $3

# To change a flag that has 0 and make it run you must replace the value with 'y'

# Below if statement will quietly return 0 if dbdbv# was found, otherwise it returns 1
set grep_result = `echo "$3" | grep -q "dbdbv[0-9]" ; echo $?`

if ( $grep_result == 1 ) then
 ${4} <<ENDofINPUT
   &inputs
      filetempin=$1
      filesaltin=$1
      filebathyin=$3
      ss_algorithm=3
      do_ss_wavelet=0
      do_nfss_netcdf=y
      do_ss_netcdf=0
      classification=CUI
      dist_letter=D
      dist_reason=OPS
      control_office='Commanding Officer, Naval Oceanographic Office'
      source_depth_m(1)=18.0
      source_depth_m(2)=50.0
      source_depth_m(3)=100.0
      source_depth_m(4)=125.0
      source_depth_m(5)=200.0
      source_depth_m(6)=300.0
      area=$2
      crdate=$dtg
      tau=$tau
      &end
 ENDofINPUT
else
 ${4} <<ENDofINPUT
   &inputs
      filetempin=$1
      filesaltin=$1
      filedbdbv=$3
      ss_algorithm=3
      do_ss_wavelet=0
      do_nfss_netcdf=y
      do_ss_netcdf=0
      classification=CUI
      dist_letter=D
      dist_reason=OPS
      control_office='Commanding Officer, Naval Oceanographic Office'
      source_depth_m(1)=18.0
      source_depth_m(2)=50.0
      source_depth_m(3)=100.0
      source_depth_m(4)=125.0
      source_depth_m(5)=200.0
      source_depth_m(6)=300.0
      area=$2
      crdate=$dtg
      tau=$tau
      &end
 ENDofINPUT
endif
Leave a Comment