program convert_tscorr ! Converts the temperature and salinity correction terms required by the ! CSIRO coupled GCM from CRAY native format to Alpha native format. ! ! The files that may be converted are t1coravth, s1coravth and dtm1av. ! ! Usage: convert_tscorr ! ! Steve Phipps 15 November 2001 implicit none ! Define constants integer, parameter :: inunit=10, outunit=11, month=12, lon=64, lat=28 ! Declare variables character(len=80) :: infile, outfile, header integer :: i, j, k, l, kmonth real, dimension(lon, lat, 2) :: data ! Get names of input and output files call getarg(1, infile) call getarg(2, outfile) ! Open input and output files open(unit=inunit, file=infile, status='old', form='unformatted', & action='read', convert='cray') open(unit=outunit, file=outfile, status='new', form='unformatted', & action='write') ! Read data from input file and write immediately to output file do l = 1, month read (inunit) header write (*, *) "Header = ", header write (outunit) header read (inunit) kmonth write (*, *) "kmonth = ", kmonth write (outunit) kmonth read (inunit) (((data(i, j, k), i=1,lon), j=1,lat), k=1,2) write (outunit) (((data(i, j, k), i=1,lon), j=1,lat), k=1,2) end do ! Close input and output files close (unit=inunit) close (unit=outunit) end program convert_tscorr