Also I am not sure if I got ssh, sssh, and nssh correctly because the values from *ssh.a, *sssh.a, *nssh.a are weird.
I set the values in you script as below.
foreach y ( $1 )
foreach month ( $2 )
setenv FOR022A ${OUT}/${E}_archMN.${y}_${month}_EastSea_ath.a
setenv FOR022 ${OUT}/${E}_archMN.${y}_${month}_EastSea_ath.b
setenv FOR023A ${OUT}/${E}_archMN.${y}_${month}_EastSea_athK.a
setenv FOR023 ${OUT}/${E}_archMN.${y}_${month}_EastSea_athK.b
setenv FOR024A ${OUT}/${E}_archMN.${y}_${month}_EastSea_ssh.a
setenv FOR024 ${OUT}/${E}_archMN.${y}_${month}_EastSea_ssh.b
/bin/rm $FOR022 $FOR022A $FOR023 $FOR023A $FOR024 $FOR024A
/data2/mhan/HYCOM/hycom/ALL/archive/src/archv2data2d <<E-o-D
${D}/${E}_archMN.${y}_${month}.a
HYCOM
000 'iexpt ' = experiment number x10 (000=from archive file)
3 'yrflag' = days in year flag (0=360J16,1=366J16,2=366J01,3-actual)
4500 'idm ' = longitudinal array size
3298 'jdm ' = latitudinal array size
32 'kdm ' = number of layers
34.0 'thbase' = reference density (sigma units)
0 'smooth' = smooth fields before plotting (0=F,1=T)
0 'mthin ' = mask thin layers from plots (0=F,1=T)
665 'iorign' = i-origin of plotted subregion
1972 'jorign' = j-origin of plotted subregion
191 'idmp ' = i-extent of plotted subregion (<=idm; 0 implies idm)
305 'jdmp ' = j-extent of plotted subregion (<=jdm; 0 implies jdm)
0 'areaio' = grid area I/O unit (0 no I/O) - optional
0 'botio ' = bathymetry I/O unit (0 no I/O)
0 'flxio ' = surf. heat flux I/O unit (0 no I/O)
0 'empio ' = surf. evap-pcip I/O unit (0 no I/O)
0 'tbfio ' = temp buoyancy flux I/O unit (0 no I/O)
0 'sbfio ' = saln buoyancy flux I/O unit (0 no I/O)
0 'abfio ' = tot. buoyancy flux I/O unit (0 no I/O)
0 'icvio ' = ice coverage I/O unit (0 no I/O)
0 'ithio ' = ice thickness I/O unit (0 no I/O)
0 'ictio ' = ice temperature I/O unit (0 no I/O)
22 'atthio' = average density I/O unit (0 no I/O), OPTIONAL
23 'adthio' = ave 0-depth den. I/O unit (0 no I/O), OPTIONAL, after atthio
1000 'adepth' = depth for adthio, OPTIONAL, always after adthio
24 'sshio ' = sea surf. height I/O unit (0 no I/O)
0 'bkeio ' = baro. k.e. I/O unit (0 no I/O)
0 'bsfio ' = baro. strmfn. I/O unit (0 no I/O)
0 'uvmio ' = mix. lay. u-vel. I/O unit (0 no I/O)
0 'vvmio ' = mix. lay. v-vel. I/O unit (0 no I/O)
0 'spmio ' = mix. lay. speed I/O unit (0 no I/O)
0 'bltio ' = bnd. lay. thick. I/O unit (0 no I/O)
0 'mltio ' = mix. lay. thick. I/O unit (0 no I/O)
0 'sstio ' = mix. lay. temp. I/O unit (0 no I/O)
0 'sssio ' = mix. lay. saln. I/O unit (0 no I/O)
0 'ssdio ' = mix. lay. dens. I/O unit (0 no I/O)
0 'mkeio ' = mix. lay. k.e. I/O unit (0 no I/O)
1 'kf ' = first output layer (=0 end output; <0 label with layer #)
32 'kl ' = last output layer
0 'uvlio ' = layer k u-vel. I/O unit (0 no I/O)
0 'vvlio ' = layer k v-vel. I/O unit (0 no I/O)
0 'splio ' = layer k speed. I/O unit (0 no I/O)
0 'infio ' = layer k i.dep. I/O unit (0 no I/O)
0 'thkio ' = layer k thick. I/O unit (0 no I/O)
0 'temio ' = layer k temp I/O unit (0 no I/O)
0 'salio ' = layer k saln. I/O unit (0 no I/O)
0 'tthio ' = layer k dens, I/O unit (0 no I/O)
0 'keio ' = kinetic energy I/O unit (0 no I/O)
0 'sfnio ' = layer k strmfn. I/O unit (0 no I/O)
0 'kf ' = first output layer (=0 end output; <0 label with layer #)
E-o-D
/bin/rm -f ${OUT}/${E}_archMN.${y}_${month}_EastSea_sssh.a
hycom_stericssh ${OUT}/${E}_archMN.${y}_${month}_EastSea_ath.a /data2/mhan/HYCOM/data/GLBb0.08/expt_19.1/topo/relax_ssh_091.a 4500 3298 ${OUT}/${E}_archMN.${y}_${month}_EastSea_sssh.a >! ${OUT}/${E}_archMN.${y}_${month}_EastSea_sssh.b
# /bin/rm -f ${OUT}/${E}_archMN.${y}_${month}_EastSea_sshK.a
# hycom_stericssh ${OUT}/${E}_archMN.${y}_${month}_EastSea_athK.a /data2/mhan/HYCOM/data/GLBb0.08/expt_19.1/topo/relax_ssh_091.a 4500 3298 ${OUT}/${E}_archMN.${y}_${month}_EastSea_sshK.a >! ${OUT}/${E}_archMN.${y}_${month}_EastSea_sshK.b
/bin/rm -f ${OUT}/${E}_archMN.${y}_${month}_EastSea_nssh.a
hycom_expr ${OUT}/${E}_archMN.${y}_${month}_EastSea_sssh.a ${OUT}/${E}_archMN.${y}_${month}_EastSea_ssh.a 4500 3298 1.0 -1.0 ${OUT}/${E}_archMN.${y}_${month}_EastSea_nssh.a >! ${OUT}/${E}_archMN.${y}_${month}_EastSea_nssh.b
end
end