dk.dmi.jog
Class FileHandlingLocal

java.lang.Object
  extended bydk.dmi.jog.FileHandlingLocal

public final class FileHandlingLocal
extends Object

An IO class reading in and writing out Grid and Station data from various sources at the authors workplace (provided as an example for other users).


Method Summary
static Grid readBSHBathy(String bathyfile, String infofile)
          Returns a Grid of a BSH bathymetry.
static Grid[] readBSHcmodRestart(Grid bf, Grid bc, String restartfile)
          Reads in a BSH restart file.
static void writeBSHcmodRestart(String file, Grid[] fine, Grid[] coarse, Grid fine_bathy, Grid coarse_bathy, int timestep)
          Writes out a BSHcmod restart file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readBSHBathy

public static Grid readBSHBathy(String bathyfile,
                                String infofile)
                         throws IOException
Returns a Grid of a BSH bathymetry.

Parameters:
bathyfile - name of BSH bathymetry file.
infofile - name of BSH configuration/data file.
Returns:
a Grid of a BSH bathymetry.
Throws:
IOException - if an error occurs while trying to read the input file.

readBSHcmodRestart

public static Grid[] readBSHcmodRestart(Grid bf,
                                        Grid bc,
                                        String restartfile)
                                 throws IOException
Reads in a BSH restart file.

Parameters:
bf - fine bathymetry Grid.
bc - coarse bathymetry Grid.
restartfile - name of restart file.
Returns:
a Grid array read from the restart file. The first grid is the fine grid while the second is the coarse grid. The variables contained in the Grids are: temperature coarse Grid, and salinity coarse Grid, temperature fine Grid, salinity fine Grid, u-velocity coarse Grid, v-velocity coarse Grid, u-velocity fine Grid, v-velocity fine Grid, elevation coarse Grid, elevation fine Grid.
Throws:
IOException - if an error occurs while trying to read the file.

writeBSHcmodRestart

public static void writeBSHcmodRestart(String file,
                                       Grid[] fine,
                                       Grid[] coarse,
                                       Grid fine_bathy,
                                       Grid coarse_bathy,
                                       int timestep)
                                throws IOException
Writes out a BSHcmod restart file.

Parameters:
file - name of restart file.
Throws:
IOException - if an error occurs while trying to write the restart file.