ncfile_openfile Subroutine

public subroutine ncfile_openfile(sf)

open netcdf file

Type Bound

t_ncfile

Arguments

Type IntentOptional Attributes Name
class(t_ncfile), intent(inout) :: sf

self


Calls

proc~~ncfile_openfile~~CallsGraph proc~ncfile_openfile t_ncfile%ncfile_openfile proc~mpi_check_single_access mpi_check_single_access proc~ncfile_openfile->proc~mpi_check_single_access

Called by

proc~~ncfile_openfile~~CalledByGraph proc~ncfile_openfile t_ncfile%ncfile_openfile proc~ncfile_enter_groups t_ncfile%ncfile_enter_groups proc~ncfile_enter_groups->proc~ncfile_openfile proc~ncfile_init ncfile_init proc~ncfile_init->proc~ncfile_openfile proc~bff_init t_boundaryFromFile%bff_init proc~bff_init->proc~ncfile_init proc~readnetcdf ReadNETCDF proc~bff_init->proc~readnetcdf proc~hmap_axisnb_init_params hmap_axisNB_init_params proc~hmap_axisnb_init_params->proc~ncfile_init proc~readnetcdf~2 ReadNETCDF proc~hmap_axisnb_init_params->proc~readnetcdf~2 proc~ncfile_get_array t_ncfile%ncfile_get_array proc~ncfile_get_array->proc~ncfile_enter_groups proc~ncfile_get_scalar t_ncfile%ncfile_get_scalar proc~ncfile_get_scalar->proc~ncfile_enter_groups proc~ncfile_get_var_dims t_ncfile%ncfile_get_var_dims proc~ncfile_get_var_dims->proc~ncfile_enter_groups proc~ncfile_get_var_ndims t_ncfile%ncfile_get_var_ndims proc~ncfile_get_var_ndims->proc~ncfile_enter_groups proc~ncfile_var_exists t_ncfile%ncfile_var_exists proc~ncfile_var_exists->proc~ncfile_enter_groups proc~writedatatonetcdf WriteDataToNETCDF proc~writedatatonetcdf->proc~ncfile_init interface~t_hmap_axisnb t_hmap_axisNB interface~t_hmap_axisnb->proc~hmap_axisnb_init_params proc~hmap_axisnb_init hmap_axisNB_init interface~t_hmap_axisnb->proc~hmap_axisnb_init proc~boundaryfromfile_new boundaryFromFile_new proc~boundaryfromfile_new->proc~bff_init proc~hmap_axisnb_init->proc~hmap_axisnb_init_params proc~readnetcdf->proc~ncfile_get_array proc~readnetcdf->proc~ncfile_get_scalar proc~readnetcdf->proc~ncfile_var_exists proc~readnetcdf~2->proc~ncfile_get_array proc~readnetcdf~2->proc~ncfile_get_scalar

Source Code

  SUBROUTINE ncfile_openfile( sf)
    ! MODULES
    IMPLICIT NONE
    !-------------------------------------------------------------------------------------------------------------------------------
    ! INPUT VARIABLES
    !-------------------------------------------------------------------------------------------------------------------------------
    ! OUTPUT VARIABLES
    CLASS(t_ncfile),INTENT(INOUT)        :: sf !! self
    !-------------------------------------------------------------------------------------------------------------------------------
    ! LOCAL VARIABLES
    !===============================================================================================================================
    CALL mpi_check_single_access()
    IF(sf%isopen) RETURN
#if NETCDF
    SELECT CASE(sf%rwo_mode)
    CASE("r")
      sf%ioError = nf90_OPEN(TRIM(sf%fileName), nf90_NOWRITE, sf%nc_id)
      CALL sf%handle_error("opening file '"//TRIM(sf%filename)//"' in read  mode",&
                           TypeInfo="FileNotFoundError")
    CASE("w")
      sf%ioError = nf90_OPEN(TRIM(sf%fileName), nf90_WRITE, sf%nc_id)
      CALL sf%handle_error("opening file '"//TRIM(sf%filename)//"' in write mode",&
                           TypeInfo="FileNotFoundError")
    CASE("o")
      sf%ioError = nf90_CREATE(TRIM(sf%fileName), NF90_64BIT_OFFSET, sf%nc_id)
      CALL sf%handle_error("creating or overwriting file '"//TRIM(sf%filename))
    END SELECT
    sf%isopen=.TRUE.
#else
  CALL abort(__STAMP__,&
      "cannot open netcdf file, since code is compiled with BUILD_NETCDF=OFF")
#endif /*NETCDF*/
  END SUBROUTINE ncfile_openfile