!c Description:
!c  NetCDF ファイルのオープン
!c
!c Current Code Owner: 
!c   sugiyama@gfd-dennou.org
!c
!c Histry: 
!c   Version    Date          Comment
!c   -------    ----------    --------
!c   1.0        2003-02-05    作成
!c
!c Copyright (C) SUGIYAMA Ko-ichiro, 2003, All rights reserved

module interface_netcdf_open
  interface 

     subroutine netcdf_open(file, ncid)
       integer, intent(out)           :: ncid
       character(*), intent(in)       :: file
     end subroutine netcdf_open
     
  end interface
end module interface_netcdf_open


subroutine netcdf_open(file, ncid)
  use netcdf
  use interface_netcdf_err
  
  implicit none  
  integer, intent(out)           :: ncid
  character(*), intent(in)       :: file
  
  integer                   :: status


  status = nf90_open(trim(file), NF90_WRITE, ncid)
  if(status /= nf90_noerr) call netcdf_err(status)
  
end subroutine netcdf_open
