DSO_Utilities.F90 Source File


This file depends on

sourcefile~~dso_utilities.f90~~EfferentGraph sourcefile~dso_utilities.f90 DSO_Utilities.F90 sourcefile~filesystemutilities.f90 FileSystemUtilities.F90 sourcefile~dso_utilities.f90->sourcefile~filesystemutilities.f90

Files dependent on this one

sourcefile~~dso_utilities.f90~~AfferentGraph sourcefile~dso_utilities.f90 DSO_Utilities.F90 sourcefile~maplshared.f90 MaplShared.F90 sourcefile~maplshared.f90->sourcefile~dso_utilities.f90 sourcefile~test_dso_utilities.pf test_DSO_Utilities.pf sourcefile~test_dso_utilities.pf->sourcefile~dso_utilities.f90 sourcefile~extdataroot_gridcomp.f90 ExtDataRoot_GridComp.F90 sourcefile~extdataroot_gridcomp.f90->sourcefile~maplshared.f90 sourcefile~mapl.f90 MAPL.F90 sourcefile~extdataroot_gridcomp.f90->sourcefile~mapl.f90 sourcefile~mapl_generic.f90 MAPL_Generic.F90 sourcefile~mapl_generic.f90->sourcefile~maplshared.f90 sourcefile~capdriver.f90 CapDriver.F90 sourcefile~capdriver.f90->sourcefile~extdataroot_gridcomp.f90 sourcefile~capdriver.f90->sourcefile~mapl.f90 sourcefile~comp_testing_driver.f90 Comp_Testing_Driver.F90 sourcefile~comp_testing_driver.f90->sourcefile~mapl_generic.f90 sourcefile~comp_testing_driver.f90->sourcefile~mapl.f90 sourcefile~mapl_capgridcomp.f90 MAPL_CapGridComp.F90 sourcefile~comp_testing_driver.f90->sourcefile~mapl_capgridcomp.f90 sourcefile~extdatadriver.f90 ExtDataDriver.F90 sourcefile~extdatadriver.f90->sourcefile~extdataroot_gridcomp.f90 sourcefile~extdatadrivermod.f90 ExtDataDriverMod.F90 sourcefile~extdatadriver.f90->sourcefile~extdatadrivermod.f90 sourcefile~extdatadriver.f90->sourcefile~mapl.f90 sourcefile~extdatadrivermod.f90->sourcefile~extdataroot_gridcomp.f90 sourcefile~extdatadrivermod.f90->sourcefile~mapl.f90 sourcefile~extdatagridcompmod.f90 ExtDataGridCompMod.F90 sourcefile~extdatagridcompmod.f90->sourcefile~mapl_generic.f90 sourcefile~extdatagridcompng.f90 ExtDataGridCompNG.F90 sourcefile~extdatagridcompng.f90->sourcefile~mapl_generic.f90 sourcefile~mapl.f90->sourcefile~mapl_generic.f90 sourcefile~mapl_capgridcomp.f90->sourcefile~mapl_generic.f90 sourcefile~mapl_capgridcomp.f90->sourcefile~extdatagridcompmod.f90 sourcefile~mapl_capgridcomp.f90->sourcefile~extdatagridcompng.f90 sourcefile~mapl_historygridcomp.f90 MAPL_HistoryGridComp.F90 sourcefile~mapl_capgridcomp.f90->sourcefile~mapl_historygridcomp.f90 sourcefile~mapl_geosatmaskmod.f90 MAPL_GeosatMaskMod.F90 sourcefile~mapl_geosatmaskmod.f90->sourcefile~mapl_generic.f90 sourcefile~mapl_historycollection.f90 MAPL_HistoryCollection.F90 sourcefile~mapl_historycollection.f90->sourcefile~mapl_generic.f90 sourcefile~mapl_historycollection.f90->sourcefile~mapl_geosatmaskmod.f90 sourcefile~mapl_stationsamplermod.f90 MAPL_StationSamplerMod.F90 sourcefile~mapl_historycollection.f90->sourcefile~mapl_stationsamplermod.f90 sourcefile~mapl_trajectorymod.f90 MAPL_TrajectoryMod.F90 sourcefile~mapl_historycollection.f90->sourcefile~mapl_trajectorymod.f90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_generic.f90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_geosatmaskmod.f90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_historycollection.f90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_stationsamplermod.f90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_trajectorymod.f90 sourcefile~mapl_orbgridcompmod.f90 MAPL_OrbGridCompMod.F90 sourcefile~mapl_orbgridcompmod.f90->sourcefile~mapl_generic.f90 sourcefile~mapl_stationsamplermod.f90->sourcefile~mapl_generic.f90 sourcefile~mapl_trajectorymod.f90->sourcefile~mapl_generic.f90 sourcefile~extdatadrivergridcomp.f90 ExtDataDriverGridComp.F90 sourcefile~extdatadrivergridcomp.f90->sourcefile~extdatagridcompmod.f90 sourcefile~extdatadrivergridcomp.f90->sourcefile~extdatagridcompng.f90 sourcefile~extdatadrivergridcomp.f90->sourcefile~mapl.f90 sourcefile~extdatadrivergridcomp.f90->sourcefile~mapl_historygridcomp.f90 sourcefile~mapl_cap.f90 MAPL_Cap.F90 sourcefile~mapl_cap.f90->sourcefile~mapl_capgridcomp.f90 sourcefile~mapl_demo_fargparse.f90 MAPL_demo_fargparse.F90 sourcefile~mapl_demo_fargparse.f90->sourcefile~mapl.f90 sourcefile~mapl_geosatmaskmod_smod.f90 MAPL_GeosatMaskMod_smod.F90 sourcefile~mapl_geosatmaskmod_smod.f90->sourcefile~mapl_geosatmaskmod.f90 sourcefile~mapl_trajectorymod_smod.f90 MAPL_TrajectoryMod_smod.F90 sourcefile~mapl_trajectorymod_smod.f90->sourcefile~mapl_trajectorymod.f90 sourcefile~pfio_mapl_demo.f90 pfio_MAPL_demo.F90 sourcefile~pfio_mapl_demo.f90->sourcefile~mapl.f90 sourcefile~regrid_util.f90 Regrid_Util.F90 sourcefile~regrid_util.f90->sourcefile~mapl.f90 sourcefile~time_ave_util.f90 time_ave_util.F90 sourcefile~time_ave_util.f90->sourcefile~mapl.f90 sourcefile~ut_extdata.f90 ut_ExtData.F90 sourcefile~ut_extdata.f90->sourcefile~extdatagridcompmod.f90 sourcefile~varspecdescription.f90 VarspecDescription.F90 sourcefile~varspecdescription.f90->sourcefile~mapl.f90

Source Code

module mapl_DSO_Utilities
   use mapl_FileSystemUtilities
   implicit none

   public :: is_valid_dso_name
   public :: is_valid_dso_extension
   public :: is_supported_dso_name
   public :: is_supported_dso_extension
   public :: adjust_dso_name

   public :: SYSTEM_DSO_EXTENSION

   ! NOTE: SYSTEM_DSO_SUFFIX is a preprocessor macro set by CMake
   character(*), parameter :: SYSTEM_DSO_EXTENSION = SYSTEM_DSO_SUFFIX

contains

   pure logical function is_valid_dso_name(name)
      character(*), intent(in) :: name
      is_valid_dso_name = is_valid_dso_extension(get_file_extension(name))
   end function is_valid_dso_name

   ! An empty extension is valid, as we can supply the system-specific one.
   pure logical function is_valid_dso_extension(extension)
      character(len=*), intent(in) :: extension
      is_valid_dso_extension = (extension == '' .or. extension == SYSTEM_DSO_EXTENSION)
   end function is_valid_dso_extension

   ! We allow users to specify a DSO extensions that is only valid on
   ! some other OS.  This allows things to work on say OSX if the user
   ! puts a Linux DSO in a resource file.
   pure logical function is_supported_dso_name(name)
      character(len=*), intent(in) :: name
      is_supported_dso_name = is_supported_dso_extension(get_file_extension(name))
   end function is_supported_dso_name

   ! We allow users to specify a DSO extensions that is only valid on
   ! some other OS.  This allows things to work on say OSX if the user
   ! puts a Linux DSO in a resource file.
   pure logical function is_supported_dso_extension(extension)
      character(len=*), intent(in) :: extension
      character(len=6), dimension(*), parameter :: SUPPORTED_DSO_EXTENSIONS = [character(len=6) :: '.so','.dylib','.dll', '']
      is_supported_dso_extension = any(extension == SUPPORTED_DSO_EXTENSIONS)
   end function is_supported_dso_extension

   ! We allow users to specify DSO file names with or without the
   ! suffix.  This function creates the full name appropriate to a
   ! given system.
   pure function adjust_dso_name(guess)
      character(:), allocatable :: adjust_dso_name
      character(*), intent(in) :: guess

      adjust_dso_name = get_file_basename(guess) // SYSTEM_DSO_EXTENSION

  end function adjust_dso_name

end module mapl_DSO_Utilities