pro construct_flux_adjustments ; Purpose ; ------- ; Reads flux adjustments from a netCDF file, and generates a binary auxiliary ; file to be read by the CSIRO coupled model. ; ; History ; ------- ; 2004 Nov 19 Steve Phipps Original version ; Define constants nx = 66 ny = 58 ; Initialise variables df = dblarr(nx, ny, 12) ; Get flux adjustments filename = '' var = '' read, filename, prompt="Enter name of file containing flux adjustments : " read, var, prompt="Enter name of variable containing flux adjustment data : " ncid = ncdf_open(filename) datid = ncdf_varid(ncid, var) ncdf_varget, ncid, datid, df_in ncdf_close, ncid ; Convert the flux adjustments to 64-bit, and pad them out df(1:nx-2, 1:ny-2, *) = double(df_in) df(*, 0, *) = 0.0d df(*, ny-1, *) = 0.0d df(0, *, *) = df(nx-2, *, *) df(nx-1, *, *) = df(1, *, *) ; Save the flux adjustments to file filename = '' read, filename, prompt="Enter name of auxiliary file : " openw, 1, filename, /f77_unformatted for month = 0, 11 do begin writeu, 1, df(*, *, month) endfor close, 1 end