ETSF_IO library - documentation pages

### TABLE OF CONTENTS

- etsf_io_dims_get

## etsf_io_dims_get

[ Top ] [ etsf_dims ] [ Methods ]

NAME

etsf_io_dims_get

FUNCTION

Read the dimensions from an ETSF file. If one dimension is not found, its value is put to etsf_no_dimension (see ETSF_IO_CONSTANTS).

INPUTS

- ncid = integer returned by an 'open' NetCDF call. The file can be either in define or write mode. This status can be changed by the call.

OUTPUT

- dims <type(etsf_dims)> = an allocated structure to put the read values for all dimensions of the ETSF file pointed by @ncid.
- lstat = return .true. if all the actions succeed, if not the status of the file is undefined.
- error_data <type(etsf_io_low_error)> = contains the details of the error is @lstat is false.

NOTES

This file has been automatically generated by the autogen_subroutines.py script. Any change you would bring to it will systematically be overwritten.

SOURCE

    subroutine etsf_io_dims_get(ncid, dims, lstat, error_data)

      !Arguments ------------------------------------
      integer, intent(in) :: ncid
      type(etsf_dims), intent(out) :: dims
      logical, intent(out) :: lstat
      type(etsf_io_low_error), intent(out) :: error_data

      !Local variables-------------------------------
      character(len = *), parameter :: my_name = 'etsf_io_dims_get'

      ! *************************************************************************

    !DEBUG
    !write (*,*) 'etsf_io_dims_get : enter'
    !ENDDEBUG

      call etsf_io_low_read_dim(ncid, "character_string_length", &
                              & dims%character_string_length, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%character_string_length = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "complex", &
                              & dims%complex, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%complex = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "max_number_of_angular_momenta", &
                              & dims%max_number_of_angular_momenta, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%max_number_of_angular_momenta = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "max_number_of_basis_grid_points", &
                              & dims%max_number_of_basis_grid_points, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%max_number_of_basis_grid_points = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "max_number_of_coefficients", &
                              & dims%max_number_of_coefficients, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%max_number_of_coefficients = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "max_number_of_projectors", &
                              & dims%max_number_of_projectors, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%max_number_of_projectors = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "max_number_of_states", &
                              & dims%max_number_of_states, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%max_number_of_states = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_atoms", &
                              & dims%number_of_atoms, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_atoms = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_atom_species", &
                              & dims%number_of_atom_species, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_atom_species = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_cartesian_directions", &
                              & dims%number_of_cartesian_directions, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_cartesian_directions = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_coefficients_dielectric_function", &
                              & dims%number_of_coefficients_dielectric_function, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_coefficients_dielectric_function = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_components", &
                              & dims%number_of_components, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_components = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_frequencies_dielectric_function", &
                              & dims%number_of_frequencies_dielectric_function, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_frequencies_dielectric_function = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_grid_points_vector1", &
                              & dims%number_of_grid_points_vector1, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_grid_points_vector1 = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_grid_points_vector2", &
                              & dims%number_of_grid_points_vector2, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_grid_points_vector2 = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_grid_points_vector3", &
                              & dims%number_of_grid_points_vector3, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_grid_points_vector3 = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_kpoints", &
                              & dims%number_of_kpoints, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_kpoints = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_localization_regions", &
                              & dims%number_of_localization_regions, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_localization_regions = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_qpoints_dielectric_function", &
                              & dims%number_of_qpoints_dielectric_function, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_qpoints_dielectric_function = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_qpoints_gamma_limit", &
                              & dims%number_of_qpoints_gamma_limit, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_qpoints_gamma_limit = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_reduced_dimensions", &
                              & dims%number_of_reduced_dimensions, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_reduced_dimensions = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_spinor_components", &
                              & dims%number_of_spinor_components, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_spinor_components = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_spins", &
                              & dims%number_of_spins, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_spins = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_symmetry_operations", &
                              & dims%number_of_symmetry_operations, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_symmetry_operations = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "number_of_vectors", &
                              & dims%number_of_vectors, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%number_of_vectors = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "real_or_complex_coefficients", &
                              & dims%real_or_complex_coefficients, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%real_or_complex_coefficients = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "real_or_complex_density", &
                              & dims%real_or_complex_density, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%real_or_complex_density = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "real_or_complex_gw_corrections", &
                              & dims%real_or_complex_gw_corrections, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%real_or_complex_gw_corrections = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "real_or_complex_potential", &
                              & dims%real_or_complex_potential, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%real_or_complex_potential = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "real_or_complex_wavefunctions", &
                              & dims%real_or_complex_wavefunctions, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%real_or_complex_wavefunctions = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "symbol_length", &
                              & dims%symbol_length, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%symbol_length = etsf_no_dimension
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_max_number_of_coefficients", &
                              & dims%my_max_number_of_coefficients, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_max_number_of_coefficients = dims%max_number_of_coefficients
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_max_number_of_states", &
                              & dims%my_max_number_of_states, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_max_number_of_states = dims%max_number_of_states
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_number_of_components", &
                              & dims%my_number_of_components, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_number_of_components = dims%number_of_components
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_number_of_grid_points_vector1", &
                              & dims%my_number_of_grid_points_vect1, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_number_of_grid_points_vect1 = dims%number_of_grid_points_vector1
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_number_of_grid_points_vector2", &
                              & dims%my_number_of_grid_points_vect2, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_number_of_grid_points_vect2 = dims%number_of_grid_points_vector2
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_number_of_grid_points_vector3", &
                              & dims%my_number_of_grid_points_vect3, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_number_of_grid_points_vect3 = dims%number_of_grid_points_vector3
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_number_of_kpoints", &
                              & dims%my_number_of_kpoints, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_number_of_kpoints = dims%number_of_kpoints
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if

      call etsf_io_low_read_dim(ncid, "my_number_of_spins", &
                              & dims%my_number_of_spins, &
                              & lstat, error_data = error_data)
      if (.not. lstat) then
        if (error_data%access_mode_id == ERROR_MODE_INQ) then
          dims%my_number_of_spins = dims%number_of_spins
        else
          call etsf_io_low_error_update(error_data, my_name)
          return
        end if
      end if
      lstat = .true.

    !DEBUG
    !write (*,*) 'etsf_io_dims_get : exit'
    !ENDDEBUG

    end subroutine etsf_io_dims_get