nc_create_file Subroutine

public subroutine nc_create_file(filename, ncid, ierr)

Create a new NetCDF-4 file (overwrites if exists)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
integer, intent(out) :: ncid
integer, intent(out), optional :: ierr

Non-zero (e.g. a missing output directory) when present; absent behaves as today (error stop).


Calls

proc~~nc_create_file~~CallsGraph proc~nc_create_file nc_create_file nf90_create nf90_create proc~nc_create_file->nf90_create proc~nc_check nc_check proc~nc_create_file->proc~nc_check nf90_strerror nf90_strerror proc~nc_check->nf90_strerror proc~fail fail proc~nc_check->proc~fail error error proc~fail->error proc~error_ring_push error_ring_push proc~fail->proc~error_ring_push

Called by

proc~~nc_create_file~~CalledByGraph proc~nc_create_file nc_create_file proc~ocean_restart_write_local ocean_restart_write_local proc~ocean_restart_write_local->proc~nc_create_file proc~open_stream open_stream proc~open_stream->proc~nc_create_file proc~engine_configure_diag engine_configure_diag proc~engine_configure_diag->proc~open_stream proc~ocean_state_restart_write ocean_state_restart_write proc~ocean_state_restart_write->proc~ocean_restart_write_local proc~ocean_state_restart_write_drop_field ocean_state_restart_write_drop_field proc~ocean_state_restart_write_drop_field->proc~ocean_restart_write_local proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_state_restart_write proc~engine_setup engine_setup proc~driver_run_ocean->proc~engine_setup proc~engine_setup->proc~engine_configure_diag proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Source Code

   subroutine nc_create_file(filename, ncid, ierr)
      !! Create a new NetCDF-4 file (overwrites if exists)
      character(len=*), intent(in) :: filename
      integer, intent(out) :: ncid
      integer, intent(out), optional :: ierr
         !! Non-zero (e.g. a missing output directory) when present; absent
         !! behaves as today (`error stop`).

      call nc_check(nf90_create(trim(filename), &
                                ior(nf90_clobber, nf90_netcdf4), ncid), &
                    "creating "//trim(filename), ierr)

   end subroutine nc_create_file