#!/bin/bash # this shell script calculates radiances for clouds at differnt heights. zmin is the bottom # of the cloud, zmax the top. rm radiance.dat for zmin in `seq 1 8`; do # zmax should be 1 km higher than zmin -> cloud layer thickness is 1 km let zmax=zmin+1 echo "zmin: "$zmin" zmax: "$zmax # Make template for wc_file where the altitudes are replaced using sed sed 's/ZMIN/'$zmin'/' wc.tmplt | sed 's/ZMAX/'$zmax'/' > wc.dat # execute uvspec uvspec < uvspec.inp > dummy # write result (zmin, zmax, radiance) into file gawk '{print '$zmin', '$zmax', $2}' dummy >> radiance.dat done