From 1049e1da6e52a70dbc29f5008f5eeaf48addeb20 Mon Sep 17 00:00:00 2001 From: rem1776 Date: Fri, 2 Aug 2024 11:40:11 -0400 Subject: [PATCH] update to use file length instead of path length where appropriate --- amip_interp/amip_interp.F90 | 4 ++-- amip_interp/include/amip_interp.inc | 4 ++-- column_diagnostics/column_diagnostics.F90 | 2 +- column_diagnostics/include/column_diagnostics.inc | 2 +- coupler/atmos_ocean_fluxes.F90 | 4 ++-- data_override/get_grid_version.F90 | 2 +- data_override/include/data_override.inc | 2 +- diag_integral/diag_integral.F90 | 10 +++++----- diag_manager/diag_data.F90 | 2 +- diag_manager/diag_manager.F90 | 2 +- diag_manager/diag_output.F90 | 2 +- diag_manager/diag_table.F90 | 4 ++-- diag_manager/diag_util.F90 | 4 ++-- diag_manager/fms_diag_field_object.F90 | 2 +- diag_manager/fms_diag_file_object.F90 | 8 ++++---- diag_manager/fms_diag_yaml.F90 | 6 +++--- drifters/drifters.F90 | 1 + exchange/xgrid.F90 | 11 ++++++----- field_manager/field_manager.F90 | 6 +++--- field_manager/fm_util.F90 | 6 +++--- fms2_io/blackboxio.F90 | 2 +- fms2_io/fms_io_utils.F90 | 4 ++-- mosaic2/mosaic2.F90 | 1 - mpp/include/mpp_util.inc | 10 +++++----- 24 files changed, 51 insertions(+), 50 deletions(-) diff --git a/amip_interp/amip_interp.F90 b/amip_interp/amip_interp.F90 index 27623bab4b..87ff746fc0 100644 --- a/amip_interp/amip_interp.F90 +++ b/amip_interp/amip_interp.F90 @@ -135,7 +135,7 @@ module amip_interp_mod NOTE, mpp_error, fms_error_handler use constants_mod, only: TFREEZE, pi -use platform_mod, only: r4_kind, r8_kind, i2_kind, FMS_PATH_LEN +use platform_mod, only: r4_kind, r8_kind, i2_kind, FMS_FILE_LEN use mpp_mod, only: input_nml_file use fms2_io_mod, only: FmsNetcdfFile_t, fms2_io_file_exists=>file_exists, open_file, close_file, & get_dimension_size, fms2_io_read_data=>read_data @@ -304,7 +304,7 @@ module amip_interp_mod ! ---- global unit & date ---- integer :: iunit - character(len=FMS_PATH_LEN) :: file_name_sst, file_name_ice + character(len=FMS_FILE_LEN) :: file_name_sst, file_name_ice type(FmsNetcdfFile_t), target :: fileobj_sst, fileobj_ice type (date_type) :: Curr_date = date_type( -99, -99, -99 ) diff --git a/amip_interp/include/amip_interp.inc b/amip_interp/include/amip_interp.inc index 7bb308381f..b675d047f8 100644 --- a/amip_interp/include/amip_interp.inc +++ b/amip_interp/include/amip_interp.inc @@ -46,7 +46,7 @@ subroutine GET_AMIP_SST_ (Time, Interp, sst, err_msg, lon_model, lat_model) integer, dimension(:), allocatable :: ryr, rmo, rdy character(len=30) :: time_unit real(FMS_AMIP_INTERP_KIND_), dimension(:), allocatable :: timeval - character(len=FMS_PATH_LEN) :: ncfilename + character(len=FMS_FILE_LEN) :: ncfilename type(FmsNetcdfFile_t) :: fileobj logical :: the_file_exists ! end add by JHC @@ -652,7 +652,7 @@ endif integer(I2_KIND) :: idat(mobs,nobs) integer :: nrecords, yr, mo, dy, ierr, k integer, dimension(:), allocatable :: ryr, rmo, rdy - character(len=FMS_PATH_LEN) :: ncfilename + character(len=FMS_FILE_LEN) :: ncfilename character(len=NF90_MAX_NAME) :: ncfieldname type(FmsNetcdfFile_t), pointer :: fileobj integer, parameter :: lkind = FMS_AMIP_INTERP_KIND_ diff --git a/column_diagnostics/column_diagnostics.F90 b/column_diagnostics/column_diagnostics.F90 index b7a3eb6874..39bcc8bc69 100644 --- a/column_diagnostics/column_diagnostics.F90 +++ b/column_diagnostics/column_diagnostics.F90 @@ -32,7 +32,7 @@ module column_diagnostics_mod get_date, time_type use constants_mod, only: constants_init, PI, RADIAN use mpp_mod, only: input_nml_file -use platform_mod, only: r4_kind, r8_kind +use platform_mod, only: r4_kind, r8_kind, FMS_FILE_LEN !------------------------------------------------------------------- implicit none diff --git a/column_diagnostics/include/column_diagnostics.inc b/column_diagnostics/include/column_diagnostics.inc index 225457a509..8b79c72a6d 100644 --- a/column_diagnostics/include/column_diagnostics.inc +++ b/column_diagnostics/include/column_diagnostics.inc @@ -99,7 +99,7 @@ integer, dimension(:), intent(out) :: diag_units !< unit number for real(FMS_CD_KIND_) :: ref_lat real(FMS_CD_KIND_) :: current_distance character(len=8) :: char !< character string for diaganostic column index - character(len=FMS_PATH_LEN) :: filename !< filename for output file for diagnostic column + character(len=FMS_FILE_LEN) :: filename !< filename for output file for diagnostic column logical :: allow_ij_input logical :: open_file integer :: io diff --git a/coupler/atmos_ocean_fluxes.F90 b/coupler/atmos_ocean_fluxes.F90 index 42b96bf062..840b82f28b 100644 --- a/coupler/atmos_ocean_fluxes.F90 +++ b/coupler/atmos_ocean_fluxes.F90 @@ -135,8 +135,8 @@ function aof_set_coupler_flux(name, flux_type, implementation, atm_tr_index, par integer :: length integer :: num_parameters integer :: outunit - character(len=FMS_PATH_LEN) :: coupler_list - character(len=FMS_PATH_LEN) :: current_list + character(len=FMS_PATH_LEN) :: coupler_list + character(len=FMS_PATH_LEN) :: current_list character(len=fm_string_len) :: flux_type_test character(len=fm_string_len) :: implementation_test character(len=256) :: error_header diff --git a/data_override/get_grid_version.F90 b/data_override/get_grid_version.F90 index 02107c7834..5b838651d1 100644 --- a/data_override/get_grid_version.F90 +++ b/data_override/get_grid_version.F90 @@ -24,7 +24,7 @@ !> @{ module get_grid_version_mod use constants_mod, only: DEG_TO_RAD -use platform_mod, only: r4_kind, r8_kind +use platform_mod, only: r4_kind, r8_kind, FMS_PATH_LEN use mpp_mod, only : mpp_error,FATAL,NOTE, mpp_min, mpp_max use mpp_domains_mod, only : domain2d, operator(.NE.),operator(.EQ.) use mpp_domains_mod, only : mpp_get_global_domain, mpp_get_data_domain diff --git a/data_override/include/data_override.inc b/data_override/include/data_override.inc index 671820fc69..dfb14a028c 100644 --- a/data_override/include/data_override.inc +++ b/data_override/include/data_override.inc @@ -21,7 +21,7 @@ ! modules. These modules are not intended to be used directly - they should be ! used through the data_override_mod API. See data_override.F90 for details. -use platform_mod, only: r4_kind, r8_kind +use platform_mod, only: r4_kind, r8_kind, FMS_PATH_LEN use yaml_parser_mod use constants_mod, only: DEG_TO_RAD use mpp_mod, only : mpp_error, FATAL, WARNING, NOTE, stdout, stdlog, mpp_max diff --git a/diag_integral/diag_integral.F90 b/diag_integral/diag_integral.F90 index 501768be89..f4c2e75ab1 100644 --- a/diag_integral/diag_integral.F90 +++ b/diag_integral/diag_integral.F90 @@ -28,7 +28,7 @@ module diag_integral_mod !############################################################################### -use platform_mod, only: i8_kind, FMS_PATH_LEN +use platform_mod, only: i8_kind, FMS_FILE_LEN use time_manager_mod, only: time_type, get_time, set_time, & time_manager_init, & operator(+), operator(-), & @@ -141,7 +141,7 @@ module diag_integral_mod character(len=8) :: & time_units = 'hours' !< time units associated with !! output_interval -character(len=FMS_PATH_LEN) :: & +character(len=FMS_FILE_LEN) :: & file_name = ' ' !< optional integrals output file name logical :: & print_header = .true. !< print a header for the integrals @@ -1079,13 +1079,13 @@ end function vert_diag_integral !! @return character array updated_file_name function ensemble_file_name(fname) result(updated_file_name) character (len=*), intent(inout) :: fname - character (len=FMS_PATH_LEN) :: updated_file_name + character (len=FMS_FILE_LEN) :: updated_file_name integer :: ensemble_id_int character(len=7) :: ensemble_suffix character(len=2) :: ensemble_id_char integer :: i !> Make sure the file name short enough to handle adding the ensemble number - if (len(trim(fname)) > FMS_PATH_LEN-7) call error_mesg ('diag_integral_mod :: ensemble_file_name', & + if (len(trim(fname)) > FMS_FILE_LEN-7) call error_mesg ('diag_integral_mod :: ensemble_file_name', & trim(fname)//" is too long and can not support adding ens_XX. Please shorten the "//& "file_name in the diag_integral_nml", FATAL) !> Get the ensemble ID and convert it to a string @@ -1104,7 +1104,7 @@ function ensemble_file_name(fname) result(updated_file_name) !> Loop through to find the last period do i=len(trim(fname)),2,-1 if (fname(i:i) == ".") then - updated_file_name = fname(1:i-1)//trim(ensemble_suffix)//fname(i:FMS_PATH_LEN) + updated_file_name = fname(1:i-1)//trim(ensemble_suffix)//fname(i:len(fname)) return endif enddo diff --git a/diag_manager/diag_data.F90 b/diag_manager/diag_data.F90 index 0e2f0cb272..3019e2b8ae 100644 --- a/diag_manager/diag_data.F90 +++ b/diag_manager/diag_data.F90 @@ -180,7 +180,7 @@ MODULE diag_data_mod !> @brief Type to define the diagnostic files that will be written as defined by the diagnostic table. !> @ingroup diag_data_mod TYPE file_type - CHARACTER(len=FMS_PATH_LEN) :: name !< Name of the output file. + CHARACTER(len=FMS_FILE_LEN) :: name !< Name of the output file. CHARACTER(len=128) :: long_name INTEGER, DIMENSION(max_fields_per_file) :: fields INTEGER :: num_fields diff --git a/diag_manager/diag_manager.F90 b/diag_manager/diag_manager.F90 index c6269394bc..0714cfe59f 100644 --- a/diag_manager/diag_manager.F90 +++ b/diag_manager/diag_manager.F90 @@ -1415,7 +1415,7 @@ SUBROUTINE add_associated_files(file_num, cm_file_num, cm_ind) INTEGER :: year, month, day, hour, minute, second INTEGER :: n CHARACTER(len=25) :: date_prefix - CHARACTER(len=FMS_PATH_LEN) :: asso_file_name + CHARACTER(len=FMS_FILE_LEN) :: asso_file_name ! Create the date_string IF ( prepend_date ) THEN diff --git a/diag_manager/diag_output.F90 b/diag_manager/diag_output.F90 index d564b5a22e..20b263566e 100644 --- a/diag_manager/diag_output.F90 +++ b/diag_manager/diag_output.F90 @@ -109,7 +109,7 @@ SUBROUTINE diag_output_init (file_name, file_title, file_unit,& integer, allocatable, dimension(:) :: current_pelist integer :: mype !< The pe you are on character(len=9) :: mype_string !< a string to store the pe - character(len=FMS_PATH_LEN) :: filename_tile !< Filename with the tile number included + character(len=FMS_FILE_LEN) :: filename_tile !< Filename with the tile number included !! It is needed for subregional diagnostics !---- initialize mpp_io ---- diff --git a/diag_manager/diag_table.F90 b/diag_manager/diag_table.F90 index ddcd512de1..f0e749d465 100644 --- a/diag_manager/diag_table.F90 +++ b/diag_manager/diag_table.F90 @@ -255,7 +255,7 @@ MODULE diag_table_mod USE diag_data_mod, ONLY: global_descriptor, get_base_time, set_base_time, & & DIAG_OTHER, DIAG_OCEAN, DIAG_ALL, coord_type, append_pelist_name, pelist_name USE diag_util_mod, ONLY: init_file, check_duplicate_output_fields, init_input_field, init_output_field - USE platform_mod, ONLY: FMS_PATH_LEN + USE platform_mod, ONLY: FMS_FILE_LEN IMPLICIT NONE @@ -284,7 +284,7 @@ MODULE diag_table_mod INTEGER :: iOutput_freq_units INTEGER :: iNew_file_freq_units INTEGER :: iFile_duration_units - CHARACTER(len=FMS_PATH_LEN) :: file_name + CHARACTER(len=FMS_FILE_LEN) :: file_name CHARACTER(len=10) :: output_freq_units CHARACTER(len=10) :: time_units CHARACTER(len=128) :: long_name diff --git a/diag_manager/diag_util.F90 b/diag_manager/diag_util.F90 index 05bdb5e958..379e6aaae3 100644 --- a/diag_manager/diag_util.F90 +++ b/diag_manager/diag_util.F90 @@ -1655,10 +1655,10 @@ SUBROUTINE opening_file(file, time, filename_time) LOGICAL :: time_ops, aux_present, match_aux_name, req_present, match_req_fields CHARACTER(len=7) :: avg_name = 'average' CHARACTER(len=128) :: time_units, timeb_units, avg, error_string, aux_name, req_fields, fieldname - CHARACTER(len=FMS_PATH_LEN) :: filename + CHARACTER(len=FMS_FILE_LEN) :: filename CHARACTER(len=128) :: suffix, base_name CHARACTER(len=32) :: time_name, timeb_name,time_longname, timeb_longname, cart_name - CHARACTER(len=FMS_PATH_LEN) :: fname + CHARACTER(len=FMS_FILE_LEN) :: fname CHARACTER(len=24) :: start_date TYPE(domain1d) :: domain TYPE(domain2d) :: domain2 diff --git a/diag_manager/fms_diag_field_object.F90 b/diag_manager/fms_diag_field_object.F90 index b47b0d9f88..6b4b61f704 100644 --- a/diag_manager/fms_diag_field_object.F90 +++ b/diag_manager/fms_diag_field_object.F90 @@ -1899,7 +1899,7 @@ subroutine generate_associated_files_att(this, att, start_time) type(time_type), intent(in) :: start_time !< The start_time for the field's file character(len=:), allocatable :: field_name !< Name of the area/volume field - character(len=FMS_PATH_LEN) :: file_name !< Name of the file the area/volume field is in! + character(len=FMS_FILE_LEN) :: file_name !< Name of the file the area/volume field is in! character(len=128) :: start_date !< Start date to append to the begining of the filename integer :: year, month, day, hour, minute, second diff --git a/diag_manager/fms_diag_file_object.F90 b/diag_manager/fms_diag_file_object.F90 index 1668b2c2bb..95e8cd8b3c 100644 --- a/diag_manager/fms_diag_file_object.F90 +++ b/diag_manager/fms_diag_file_object.F90 @@ -1115,10 +1115,10 @@ subroutine open_diag_file(this, time_step, file_is_opened) class(fmsDiagFile_type), pointer :: diag_file !< Diag_file object to open class(diagDomain_t), pointer :: domain !< The domain used in the file character(len=:), allocatable :: diag_file_name !< The file name as defined in the yaml - character(len=FMS_PATH_LEN) :: base_name !< The file name as defined in the yaml + character(len=FMS_FILE_LEN) :: base_name !< The file name as defined in the yaml !! without the wildcard definition - character(len=FMS_PATH_LEN) :: file_name !< The file name as it will be written to disk - character(len=FMS_PATH_LEN) :: temp_name !< Temp variable to store the file_name + character(len=FMS_FILE_LEN) :: file_name !< The file name as it will be written to disk + character(len=FMS_FILE_LEN) :: temp_name !< Temp variable to store the file_name character(len=128) :: start_date !< The start_time as a string that will be added to !! the begining of the filename (start_date.filename) character(len=128) :: suffix !< The current time as a string that will be added to @@ -1694,7 +1694,7 @@ subroutine write_field_metadata(this, diag_field, diag_axis) logical :: is_regional !< Flag indicating if the field is in a regional file character(len=255) :: cell_measures !< cell_measures attributes for the field logical :: need_associated_files !< .True. if the 'associated_files' global attribute is needed - character(len=FMS_PATH_LEN) :: associated_files !< Associated files attribute to add + character(len=FMS_FILE_LEN) :: associated_files !< Associated files attribute to add is_regional = this%is_regional() diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index 476894d062..a1c9b0b805 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -43,7 +43,7 @@ module fms_diag_yaml_mod use, intrinsic :: iso_c_binding, only : c_ptr, c_null_char use fms_string_utils_mod, only: fms_array_to_pointer, fms_find_my_string, fms_sort_this, fms_find_unique, string, & fms_f2c_string -use platform_mod, only: r4_kind, i4_kind, r8_kind, i8_kind, FMS_PATH_LEN +use platform_mod, only: r4_kind, i4_kind, r8_kind, i8_kind, FMS_FILE_LEN use fms_mod, only: lowercase implicit none @@ -77,7 +77,7 @@ module fms_diag_yaml_mod !> @brief type to hold an array of sorted diag_files type fileList_type - character(len=FMS_PATH_LEN), allocatable :: file_name(:) !< Array of diag_field + character(len=FMS_FILE_LEN), allocatable :: file_name(:) !< Array of diag_field type(c_ptr), allocatable :: file_pointer(:) !< Array of pointers integer, allocatable :: diag_file_indices(:) !< Index of the file in the diag_file array end type @@ -1525,7 +1525,7 @@ function get_diag_files_id(indices) & integer :: field_id !< Indices of the field in the diag_yaml field array integer :: i !< For do loops - character(len=FMS_PATH_LEN) :: filename !< Filename of the field + character(len=FMS_FILE_LEN) :: filename !< Filename of the field integer, allocatable :: file_indices(:) !< Indices of the file in the sorted variable_list allocate(file_id(size(indices))) diff --git a/drifters/drifters.F90 b/drifters/drifters.F90 index 91962512dc..4f5110cbdd 100644 --- a/drifters/drifters.F90 +++ b/drifters/drifters.F90 @@ -95,6 +95,7 @@ module drifters_mod drifters_comm_gather, drifters_comm_update use cloud_interpolator_mod, only: cld_ntrp_linear_cell_interp, cld_ntrp_locate_cell, cld_ntrp_get_cell_values + use platform_mod, only: FMS_PATH_LEN implicit none private diff --git a/exchange/xgrid.F90 b/exchange/xgrid.F90 index bbfe6b310f..1ec0159891 100644 --- a/exchange/xgrid.F90 +++ b/exchange/xgrid.F90 @@ -129,7 +129,7 @@ module xgrid_mod use fms2_io_mod, only: FmsNetcdfFile_t, open_file, variable_exists, close_file use fms2_io_mod, only: FmsNetcdfDomainFile_t, read_data, get_dimension_size use fms2_io_mod, only: get_variable_units, dimension_exists -use platform_mod, only: r8_kind, i8_kind, FMS_PATH_LEN +use platform_mod, only: r8_kind, i8_kind, FMS_FILE_LEN implicit none private @@ -1530,11 +1530,12 @@ subroutine setup_xmap(xmap, grid_ids, grid_domains, grid_file, atm_grid, lnd_ug_ real(r8_kind), dimension(:,:), allocatable :: check_data real(r8_kind), dimension(:,:,:), allocatable :: check_data_3D real(r8_kind), allocatable :: tmp_2d(:,:), tmp_3d(:,:,:) - character(len=FMS_PATH_LEN) :: xgrid_file, xgrid_name - character(len=256) :: tile_file, mosaic_file, xgrid_dimname - character(len=256) :: mosaic1, mosaic2, contact + character(len=FMS_FILE_LEN) :: xgrid_file, xgrid_name + character(len=FMS_FILE_LEN) :: tile_file, mosaic_file + character(len=256) :: mosaic1, mosaic2, contact, xgrid_dimname character(len=256) :: tile1_name, tile2_name - character(len=256), allocatable :: tile1_list(:), tile2_list(:), xgrid_filelist(:) + character(len=256), allocatable :: tile1_list(:), tile2_list(:) + character(len=FMS_FILE_LEN), allocatable :: xgrid_filelist(:) integer :: npes, npes2 integer, allocatable :: pelist(:) type(domain2d), save :: domain2 diff --git a/field_manager/field_manager.F90 b/field_manager/field_manager.F90 index d74c035cc1..5c4b44294b 100644 --- a/field_manager/field_manager.F90 +++ b/field_manager/field_manager.F90 @@ -191,7 +191,7 @@ module field_manager_mod write_version_number, & check_nml_error use fms2_io_mod, only: file_exists -use platform_mod, only: r4_kind, r8_kind, FMS_PATH_LEN +use platform_mod, only: r4_kind, r8_kind, FMS_PATH_LEN, FMS_FILE_LEN #ifdef use_yaml use fm_yaml_mod #endif @@ -590,9 +590,9 @@ end subroutine field_manager_init !> @brief Routine to read and parse the field table yaml subroutine read_field_table_yaml(nfields, table_name) integer, intent(out), optional :: nfields !< number of fields -character(len=FMS_PATH_LEN), intent(in), optional :: table_name !< Name of the field table file, default is 'field_table.yaml' +character(len=*), intent(in), optional :: table_name !< Name of the field table file, default is 'field_table.yaml' -character(len=FMS_PATH_LEN) :: tbl_name !< field_table yaml file +character(len=FMS_FILE_LEN) :: tbl_name !< field_table yaml file character(len=fm_string_len) :: method_control !< field_table yaml file integer :: h, i, j, k, l, m !< dummy integer buffer type (fmTable_t) :: my_table !< the field table diff --git a/field_manager/fm_util.F90 b/field_manager/fm_util.F90 index 1042a0cab6..c507d09095 100644 --- a/field_manager/fm_util.F90 +++ b/field_manager/fm_util.F90 @@ -1602,7 +1602,7 @@ subroutine fm_util_set_value_integer_array(name, ival, length, caller, no_overwr integer, intent(in) :: ival(length) character(len=*), intent(in), optional :: caller logical, intent(in), optional :: no_overwrite -character(len=FMS_PATH_LEN), intent(in), optional :: good_name_list +character(len=*), intent(in), optional :: good_name_list ! ! Local parameters @@ -1759,7 +1759,7 @@ subroutine fm_util_set_value_logical_array(name, lval, length, caller, no_overwr logical, intent(in) :: lval(length) character(len=*), intent(in), optional :: caller logical, intent(in), optional :: no_overwrite -character(len=FMS_PATH_LEN), intent(in), optional :: good_name_list +character(len=*), intent(in), optional :: good_name_list ! ! Local parameters @@ -1916,7 +1916,7 @@ subroutine fm_util_set_value_string_array(name, sval, length, caller, no_overwri character(len=*), intent(in) :: sval(length) character(len=*), intent(in), optional :: caller logical, intent(in), optional :: no_overwrite -character(len=FMS_PATH_LEN), intent(in), optional :: good_name_list +character(len=*), intent(in), optional :: good_name_list ! ! Local parameters diff --git a/fms2_io/blackboxio.F90 b/fms2_io/blackboxio.F90 index a64fdc32d8..f7d26eb3d2 100644 --- a/fms2_io/blackboxio.F90 +++ b/fms2_io/blackboxio.F90 @@ -68,7 +68,7 @@ subroutine get_new_filename(path, new_path, directory, timestamp, new_name) character(len=FMS_PATH_LEN) :: dir character(len=FMS_FILE_LEN) :: tstamp - character(len=FMS_FILE_LEN) :: nname + character(len=FMS_PATH_LEN) :: nname dir = "" if (present(directory)) then diff --git a/fms2_io/fms_io_utils.F90 b/fms2_io/fms_io_utils.F90 index ce1cbba0ec..85b34aa840 100644 --- a/fms2_io/fms_io_utils.F90 +++ b/fms2_io/fms_io_utils.F90 @@ -678,7 +678,7 @@ 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=FMS_PATH_LEN) :: basefile + character(len=FMS_FILE_LEN) :: basefile character(len=6) :: tilename character(len=2) :: my_tile_str integer :: lens, ntiles, ntileMe, tile, my_tile_id @@ -736,7 +736,7 @@ 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=FMS_PATH_LEN) :: basefile + character(len=FMS_FILE_LEN) :: basefile character(len=6) :: tilename character(len=2) :: my_tile_str integer :: lens, ntiles, my_tile_id diff --git a/mosaic2/mosaic2.F90 b/mosaic2/mosaic2.F90 index a8d53576b9..da259e5d8d 100644 --- a/mosaic2/mosaic2.F90 +++ b/mosaic2/mosaic2.F90 @@ -48,7 +48,6 @@ module mosaic2_mod integer, parameter :: & MAX_NAME = 256, & !> max length of the variable names - FMS_PATH_LEN = 1024, & !> max length of the file names X_REFINE = 2, & !> supergrid size/model grid size in x-direction Y_REFINE = 2 !> supergrid size/model grid size in y-direction diff --git a/mpp/include/mpp_util.inc b/mpp/include/mpp_util.inc index ca3fa3d980..ad09bf5861 100644 --- a/mpp/include/mpp_util.inc +++ b/mpp/include/mpp_util.inc @@ -870,7 +870,7 @@ end function rarray_to_char integer :: SD_UNIT, total_calls integer :: j,k,ct, msg_cnt character(len=2) :: u - character(len=20) :: filename + character(len=FMS_FILE_LEN) :: filename character(len=20),dimension(MAX_BINS),save :: bin data bin( 1) /' 0 - 8 B: '/ @@ -1348,8 +1348,8 @@ end function rarray_to_char integer, dimension(2) :: get_ascii_file_num_lines_and_length !< number of lines (1) and !! max line length (2) integer :: num_lines, max_length - integer, parameter :: LENGTH=1024 - character(len=LENGTH) :: str_tmp + integer, parameter :: LENGTH=FMS_FILE_LEN + character(len=FMS_FILE_LEN) :: str_tmp character(len=5) :: text integer :: status, f_unit, from_pe logical :: file_exist @@ -1389,10 +1389,10 @@ end function rarray_to_char call mpp_error(FATAL, 'get_ascii_file_num_lines: Error reading line '//trim(text)// & ' in file '//trim(FILENAME)//'.') end if - if ( len_trim(str_tmp) == LENGTH ) then + if ( len_trim(str_tmp) == FMS_FILE_LEN ) then write(UNIT=text, FMT='(I5)') length call mpp_error(FATAL, 'get_ascii_file_num_lines: Length of output string ('//trim(text)//& - & ' is too small. Increase the LENGTH value.') + & ' is too small. Increase the FMS_MAX_FILE_LEN cpp value.') end if if (len_trim(str_tmp) > max_length) max_length = len_trim(str_tmp) num_lines = num_lines + 1