#! /bin/csh # # Changes OzPOM files from single to double precision # cat ozpom.f \ | sed -e "s/^ program ozpom/ program ozpomd/" \ | sed -e "s/^C \* SOURCE : ozpom\.f /C \* SOURCE : ozpomd\.f/" \ | sed -e "s&^C \* g77 -o ozpom ozpom\.f /usr/lib/libnetcdf\.a &C \* g77 -o ozpomd ozpomd.f /usr/lib/libnetcdf.a&" \ | sed -e "s/^C \* netCDF subroutines (ozpom\.n)\. /C \* netCDF subroutines (ozpomd\.n)\./" \ | sed -e "s/^C \* source files (ozpom\.f, ozpom\.c and ozpom\.n) must /C \* source files (ozpomd\.f, ozpomd\.c and ozpomd\.n) must/" \ | sed -e "s/^C NOTE that the array sizes im, jm and kb should be set in ozpom\.c/C NOTE that the array sizes im, jm and kb should be set in ozpomd\.c/" \ | sed -e "s/^ $ 'edit file ozpom\.c as appropriate ',/ $ 'edit file ozpomd\.c as appropriate ',/" \ | sed -e "s/\([0-9.]\)e\([-+0-9]\)/\1d\2/g" \ | sed -e "s/^ real/ double precision/" \ | sed -e "s/real(/dble(/g" \ | sed -e "s/^ include 'ozpom\.c'/ include 'ozpomd\.c'/" \ | sed -e "s/^ include 'ozpom\.n' / include 'ozpomd\.n'/" >! ozpomd.f # cat ozpom.c \ | sed -e "s/^C Common blocks for ozpom\.f/C Common blocks for ozpomd\.f/" \ | sed -e "s/\([0-9.]\)e\([-+0-9]\)/\1d\2/g" \ | sed -e "s/^ real/ double precision/" \ | sed -e "s/real(/dble(/g" >! ozpomd.c # cat ozpom.n \ | sed -e "s/^C NetCDF subroutines for ozpom\.f/C NetCDF subroutines for ozpomd\.f/" \ | sed -e "s/\([0-9.]\)e\([-+0-9]\)/\1d\2/g" \ | sed -e "s/^ real/ double precision/" \ | sed -e "s/_real(/_double(/g" \ | sed -e "s/_real /_double/g" \ | sed -e "s/^ include 'ozpom\.c'/ include 'ozpomd\.c'/" \ | sed -e "s/real(/dble(/g" >! ozpomd.n