diff --git a/fms2_io/blackboxio.F90 b/fms2_io/blackboxio.F90 index 4c5c6c3fb..a64fdc32d 100644 --- a/fms2_io/blackboxio.F90 +++ b/fms2_io/blackboxio.F90 @@ -66,9 +66,9 @@ subroutine get_new_filename(path, new_path, directory, timestamp, new_name) character(len=*), intent(in), optional :: timestamp !< Time. character(len=*), intent(in), optional :: new_name !< New file basename. - character(len=256) :: dir - character(len=256) :: tstamp - character(len=256) :: nname + character(len=FMS_PATH_LEN) :: dir + character(len=FMS_FILE_LEN) :: tstamp + character(len=FMS_FILE_LEN) :: nname dir = "" if (present(directory)) then @@ -392,7 +392,7 @@ subroutine netcdf_save_restart_wrap2(fileobj, unlim_dim_level, directory, timest !! or "netcdf4". Defaults to !! "64bit". - character(len=256) :: new_name + character(len=FMS_PATH_LEN) :: new_name type(FmsNetcdfFile_t), target :: new_fileobj type(FmsNetcdfFile_t), pointer :: p logical :: close_new_file @@ -425,7 +425,7 @@ subroutine netcdf_restore_state_wrap(fileobj, unlim_dim_level, directory, timest character(len=*), intent(in), optional :: timestamp !< Model time. character(len=*), intent(in), optional :: filename !< New name for the file. - character(len=256) :: new_name + character(len=FMS_PATH_LEN) :: new_name type(FmsNetcdfFile_t), target :: new_fileobj type(FmsNetcdfFile_t), pointer :: p logical :: close_new_file @@ -534,7 +534,7 @@ subroutine save_domain_restart_wrap(fileobj, unlim_dim_level, directory, timesta !! or "netcdf4". Defaults to !! "64bit". - character(len=256) :: new_name + character(len=FMS_PATH_LEN) :: new_name type(FmsNetcdfDomainFile_t), target :: new_fileobj type(FmsNetcdfDomainFile_t), pointer :: p logical :: close_new_file @@ -567,7 +567,7 @@ subroutine restore_domain_state_wrap(fileobj, unlim_dim_level, directory, timest character(len=*), intent(in), optional :: filename !< New name for the file. logical, intent(in), optional :: ignore_checksum !< Checksum data integrity flag. - character(len=256) :: new_name + character(len=FMS_PATH_LEN) :: new_name type(FmsNetcdfDomainFile_t), target :: new_fileobj type(FmsNetcdfDomainFile_t), pointer :: p logical :: close_new_file diff --git a/fms2_io/fms_io_utils.F90 b/fms2_io/fms_io_utils.F90 index cd72c0c8d..ce1cbba0e 100644 --- a/fms2_io/fms_io_utils.F90 +++ b/fms2_io/fms_io_utils.F90 @@ -678,7 +678,8 @@ subroutine get_mosaic_tile_file_sg(file_in, file_out, is_no_domain, domain, tile type(domain2D), intent(in), optional, target :: domain !< domain provided integer, intent(in), optional :: tile_count !< tile count - character(len=256) :: basefile, tilename + character(len=FMS_PATH_LEN) :: basefile + character(len=6) :: tilename character(len=2) :: my_tile_str integer :: lens, ntiles, ntileMe, tile, my_tile_id integer, dimension(:), allocatable :: tile_id @@ -735,7 +736,8 @@ subroutine get_mosaic_tile_file_ug(file_in, file_out, domain) character(len=*), intent(out) :: file_out !< name of tile file type(domainUG), intent(in), optional :: domain !< domain provided - character(len=256) :: basefile, tilename + character(len=FMS_PATH_LEN) :: basefile + character(len=6) :: tilename character(len=2) :: my_tile_str integer :: lens, ntiles, my_tile_id diff --git a/fms2_io/fms_netcdf_domain_io.F90 b/fms2_io/fms_netcdf_domain_io.F90 index f592bd24c..ab58224d0 100644 --- a/fms2_io/fms_netcdf_domain_io.F90 +++ b/fms2_io/fms_netcdf_domain_io.F90 @@ -65,7 +65,7 @@ module fms_netcdf_domain_io_mod !! with the "y" axis !! of a 2d domain. integer :: ny !< Number of "y" dimensions. - character(len=256) :: non_mangled_path !< Non-domain-mangled file path. + character(len=FMS_PATH_LEN) :: non_mangled_path !< Non-domain-mangled file path. logical :: adjust_indices !< Flag telling if indices need to be adjusted !! for domain-decomposed read. endtype FmsNetcdfDomainFile_t @@ -346,9 +346,9 @@ function open_domain_file(fileobj, path, mode, domain, nc_format, is_restart, do integer, dimension(2) :: io_layout integer, dimension(1) :: tile_id - character(len=256) :: combined_filepath + character(len=FMS_PATH_LEN) :: combined_filepath type(domain2d), pointer :: io_domain - character(len=256) :: distributed_filepath + character(len=FMS_PATH_LEN) :: distributed_filepath integer :: pelist_size integer, dimension(:), allocatable :: pelist logical :: success2 diff --git a/fms2_io/fms_netcdf_unstructured_domain_io.F90 b/fms2_io/fms_netcdf_unstructured_domain_io.F90 index ad6ef199b..408edb9f7 100644 --- a/fms2_io/fms_netcdf_unstructured_domain_io.F90 +++ b/fms2_io/fms_netcdf_unstructured_domain_io.F90 @@ -27,6 +27,7 @@ module fms_netcdf_unstructured_domain_io_mod use mpp_domains_mod use fms_io_utils_mod use netcdf_io_mod +use platform_mod implicit none private @@ -34,7 +35,7 @@ module fms_netcdf_unstructured_domain_io_mod !> @ingroup fms_netcdf_unstructured_domain_io_mod type, public, extends(FmsNetcdfFile_t) :: FmsNetcdfUnstructuredDomainFile_t type(domainug) :: domain !< Unstructured domain. - character(len=256) :: non_mangled_path !< Non-domain-mangled path. + character(len=FMS_PATH_LEN) :: non_mangled_path !< Non-domain-mangled path. endtype FmsNetcdfUnstructuredDomainFile_t !> @addtogroup fms_netcdf_unstructured_domain_io_mod @@ -94,8 +95,8 @@ function open_unstructured_domain_file(fileobj, path, mode, domain, nc_format, & type(domainug), pointer :: io_domain integer :: pelist_size integer, dimension(:), allocatable :: pelist - character(len=256) :: buf - character(len=256) :: buf2 + character(len=FMS_PATH_LEN) :: buf + character(len=FMS_PATH_LEN) :: buf2 integer :: tile_id !Get the input domain's I/O domain pelist. diff --git a/fms2_io/netcdf_io.F90 b/fms2_io/netcdf_io.F90 index 65f9eccf9..e9396211f 100644 --- a/fms2_io/netcdf_io.F90 +++ b/fms2_io/netcdf_io.F90 @@ -126,7 +126,7 @@ module netcdf_io_mod !> @brief Netcdf file type. !> @ingroup netcdf_io_mod type, public :: FmsNetcdfFile_t - character(len=256) :: path !< File path. + character(len=FMS_PATH_LEN) :: path !< File path. logical :: is_readonly !< Flag telling if the file is readonly. integer :: ncid !< Netcdf file id. character(len=256) :: nc_format !< Netcdf file format. @@ -569,8 +569,8 @@ function netcdf_file_open(fileobj, path, mode, nc_format, pelist, is_restart, do integer :: err integer :: netcdf4 !< Query the file for the _IsNetcdf4 global attribute in the event !! that the open for collective reads fails - character(len=256) :: buf !< Filename with .res in the filename if it is a restart - character(len=256) :: buf2 !< Filename with the filename appendix if there is one + character(len=FMS_PATH_LEN) :: buf !< File path with .res in the filename if it is a restart + character(len=FMS_PATH_LEN) :: buf2 !< File path with the filename appendix if there is one logical :: is_res logical :: dont_add_res !< flag indicated to not add ".res" to the filename