program convert_fcorr ! Converts the flux corrections required by the CSIRO coupled GCM from CRAY ! native format to Alpha native format. ! ! The files that may be converted are cwice.dat12, hfcor.dat12, sfcor.dat12, ! txcor.dat12 and tycor.dat12. ! ! Usage: convert_fcorr ! ! Steve Phipps 15 November 2001 implicit none ! Define constants integer, parameter :: inunit=10, outunit=11, month=12, imt=66, jmt=58 ! Declare variables character(len=80) :: infile, outfile integer :: i, j, k real, dimension(imt, jmt) :: 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 k = 1, month read (inunit) ((data(i, j), i=1,imt), j=1,jmt) write (outunit) ((data(i, j), i=1,imt), j=1,jmt) end do ! Close input and output files close (unit=inunit) close (unit=outunit) end program convert_fcorr