ncdf_read_topo_file() - read required variables

INTERFACE:

   subroutine ncdf_read_topo_file(filename)
USES:
    IMPLICIT NONE
DESCRIPTION:

This routine checks for and opens a NetCDF file with GETM bathymetry and grid information. The first variable read and checked is $grid\_type$. Subsequent operations depends on the value of $grid\_type$.

The following steps are done in $ncdf\_read\_topo\_file()$:

1: check and open NetCDF file specified by 'filename'
2: read $grid\_type$
3: inquire $bathymetry\_id$
4: some test related to $bathymetry\_id$
5: set local and global index ranges for reading
6: read bathymetry into $H$
7: depending on $grid\_type$ read axes and grid information - also check for optional variables
8: finally - check for and read spatially $z_0$
INPUT PARAMETERS:
     character(len=*), intent(in)        :: filename
REVISION HISTORY:
    Original author(s): Lars Umlauf
LOCAL VARIABLES:
    integer                             :: ncid
    integer                             :: status
    integer                             :: ndims
    integer                             :: dimlen
    integer                             :: id
    integer                             :: bathymetry_id
    integer                             :: xaxis_id=-1
    integer                             :: yaxis_id=-1
    integer, dimension(2)               :: dimidsT(2)
    character*(NF90_MAX_NAME)           :: xaxis_name,yaxis_name
    integer                             :: i,j,n
    integer                             :: iskipl,jskipl
    integer, dimension(1)               :: start
    integer, dimension(1)               :: count
    logical                             :: have_dx=.true.,have_dy=.true.
    logical                             :: have_dlon=.true.,have_dlat=.true.
    logical                             :: have_lon=.false.
    logical                             :: have_lat=.false.
    logical                             :: have_xc=.false.
    logical                             :: have_yc=.false.
    REALTYPE                            :: a(2)
    integer                             :: rc