ncfile_var_exists Function

public function ncfile_var_exists(sf, varname_in) result(exists)

check if variable name exists (also including groups separated with "/")

Type Bound

t_ncfile

Arguments

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

self

character(len=*), intent(in) :: varname_in

name of the variable (can include "/" for groups)

Return Value logical


Calls

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

Called by

proc~~ncfile_var_exists~~CalledByGraph proc~ncfile_var_exists t_ncfile%ncfile_var_exists proc~readnetcdf ReadNETCDF proc~readnetcdf->proc~ncfile_var_exists proc~bff_init t_boundaryFromFile%bff_init proc~bff_init->proc~readnetcdf proc~boundaryfromfile_new boundaryFromFile_new proc~boundaryfromfile_new->proc~bff_init

Source Code

  FUNCTION ncfile_var_exists(sf,varname_in) RESULT(exists)
    ! MODULES
    IMPLICIT NONE
    !-------------------------------------------------------------------------------------------------------------------------------
    ! INPUT VARIABLES
    CHARACTER(LEN=*),INTENT(IN) :: varname_in  !! name of the variable (can include "/" for groups)
    !-------------------------------------------------------------------------------------------------------------------------------
    ! OUTPUT VARIABLES
    CLASS(t_ncfile),INTENT(INOUT)        :: sf !! self
    LOGICAL                              :: exists
    !-------------------------------------------------------------------------------------------------------------------------------
    ! LOCAL VARIABLES
    CHARACTER(LEN=255) :: varname
    INTEGER :: grpid,varid
    !===============================================================================================================================
    CALL mpi_check_single_access()
    CALL sf%enter_groups(varname_in,grpid,varname,exists)
#if NETCDF
    IF(exists)THEN
      sf%ioError = nf90_INQ_VARID(grpid, TRIM(varname), varid)
    END IF
    exists=(sf%ioError.EQ.nf90_NOERR)
#endif /*NETCDF*/
  END FUNCTION ncfile_var_exists