pro construct_currents ; Purpose ; ------- ; Constructs a text file containing surface ocean currents in the format read ; by the CSIRO AGCM ; ; History ; ------- ; 2004 Sep 24 Steve Phipps Original version ; Define constants nx = 64 ny = 56 ; Initialise variables filename = '' ; Get climatological ocean currents read, filename, prompt="Name of file containing ocean currents : " ncid = ncdf_open(filename) datid = ncdf_varid(ncid, "longitude") ncdf_varget, ncid, datid, lon datid = ncdf_varid(ncid, "latitude") ncdf_varget, ncid, datid, lat datid = ncdf_varid(ncid, "ocu") ncdf_varget, ncid, datid, ocu datid = ncdf_varid(ncid, "ocv") ncdf_varget, ncid, datid, ocv ncdf_close, ncid ; Write data to output file openw, 1, "ocuv.3st" for month = 0, 11 do begin header1 = " " header2 = " " strput, header1, "Surface u-velocity, month "+strtrim(string(month+1), 2), 0 strput, header2, "Surface v-velocity, month "+strtrim(string(month+1), 2), 0 printf, 1, "" printf, 1, header1 printf, 1, format='(6x, 8f8.2)', lon for j = 0, ny-1 do begin printf, 1, lat(j), ocu(*, j, month) endfor printf, 1, "" printf, 1, header2 printf, 1, format='(6x, 8f8.2)', lon for j = 0, ny-1 do begin printf, 1, lat(j), ocv(*, j, month) endfor endfor close, 1 end