Save grid related variables

INTERFACE:

    subroutine save_grid_ncdf(ncid,save3d)
DESCRIPTION:

This routine saves netCDF variables in an already existing netCDF file in save mode with netCDF file-id "ncid". The variables saved correspond to those GETM variables not changing in time, i.e. grid related variables and bathymetry. If the logical flag "save3d" evaluates false, no information about the vertical grid is saved (e.g. if results from a horizontally integrated run are stored). USES:

    use exceptions
    use netcdf
    use grid_ncdf
    use domain, only: imin,imax,jmin,jmax
    use domain, only: grid_type,vert_cord
    use domain, only: have_lonlat,have_xy
    use domain, only: ioff,joff
    use domain, only: dx,dy
    use domain, only: dlon,dlat
    use domain, only: xcord,ycord
    use domain, only: xxcord,yxcord
    use domain, only: xc,yc
    use domain, only: xx,yx
    use domain, only: latc,lonc,convc
    use domain, only: latx,lonx,convx
    use domain, only: latu,latv
    use domain, only: dxc,dyc,dxu,dyu,dxv,dyv,dxx,dyx
  KB   use domain, only: rearth
    use domain, only: H,ga
    use domain, only: az,au,av
    use output, only: save_metrics,save_masks
 
    IMPLICIT NONE
INPUT PARAMETERS:
    integer, intent(in)        :: ncid
    logical, intent(in)        :: save3d
REVISION HISTORY:
    Original author(s): Lars Umlauf
LOCAL VARIABLES:
    integer                   :: i,j
    integer                   :: status
    integer                   :: start(2),edges(2)
    integer                   :: id
    character(32)             :: zname
    REALTYPE                  :: ws(E2DFIELD)