nc_get_dim_len Subroutine

public subroutine nc_get_dim_len(ncid, name, length, ierr)

Get the length of a named dimension

Arguments

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

Non-zero (missing dimension) when present; absent behaves as today (error stop).


Calls

proc~~nc_get_dim_len~~CallsGraph proc~nc_get_dim_len nc_get_dim_len nf90_inq_dimid nf90_inq_dimid proc~nc_get_dim_len->nf90_inq_dimid nf90_inquire_dimension nf90_inquire_dimension proc~nc_get_dim_len->nf90_inquire_dimension proc~nc_check nc_check proc~nc_get_dim_len->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_get_dim_len~~CalledByGraph proc~nc_get_dim_len nc_get_dim_len proc~load_bathymetry_into_array load_bathymetry_into_array proc~load_bathymetry_into_array->proc~nc_get_dim_len proc~metrics_fill_from_supergrid metrics_fill_from_supergrid proc~metrics_fill_from_supergrid->proc~nc_get_dim_len proc~configure_ocean_metrics configure_ocean_metrics proc~configure_ocean_metrics->proc~metrics_fill_from_supergrid proc~ocean_state_seed_from_cfg ocean_state_seed_from_cfg proc~ocean_state_seed_from_cfg->proc~load_bathymetry_into_array proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_metrics proc~engine_setup->proc~ocean_state_seed_from_cfg proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean 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

Variables

Type Visibility Attributes Name Initial
integer, private :: dimid

Source Code

   subroutine nc_get_dim_len(ncid, name, length, ierr)
      !! Get the length of a named dimension
      integer, intent(in) :: ncid
      character(len=*), intent(in) :: name
      integer, intent(out) :: length
      integer, intent(out), optional :: ierr
         !! Non-zero (missing dimension) when present; absent behaves as
         !! today (`error stop`).

      integer :: dimid

      call nc_check(nf90_inq_dimid(ncid, name, dimid), &
                    "finding dimension "//trim(name), ierr)
      if (present(ierr)) then
         if (ierr /= nf90_noerr) return
      end if
      call nc_check(nf90_inquire_dimension(ncid, dimid, len=length), &
                    "querying dimension "//trim(name), ierr)

   end subroutine nc_get_dim_len