From 5f85d40d33a774ec5935872a45a30d5a73544285 Mon Sep 17 00:00:00 2001 From: Eric Stofferahn <7784797+GFDL-Eric@users.noreply.github.com> Date: Thu, 3 Mar 2022 11:37:16 -0500 Subject: [PATCH 1/4] lite purge updated to 6deed0a --- coupler/coupler_types.F90 | 331 +------------------------------- coupler/ensemble_manager.F90 | 6 +- data_override/data_override.F90 | 3 +- diag_integral/diag_integral.F90 | 5 +- diag_manager/diag_manager.F90 | 1 - diag_manager/diag_util.F90 | 26 +-- 6 files changed, 15 insertions(+), 357 deletions(-) diff --git a/coupler/coupler_types.F90 b/coupler/coupler_types.F90 index d88bdf03ef..ed39c786ef 100644 --- a/coupler/coupler_types.F90 +++ b/coupler/coupler_types.F90 @@ -34,8 +34,6 @@ module coupler_types_mod use fms2_io_mod, only: get_variable_attribute, get_dimension_size, get_dimension_names use fms2_io_mod, only: register_variable_attribute, get_variable_dimension_names use fms2_io_mod, only: get_variable_num_dimensions - use fms_io_mod, only: restart_file_type, fms_io_register_restart_field=>register_restart_field - use fms_io_mod, only: query_initialized, restore_state use time_manager_mod, only: time_type use diag_manager_mod, only: register_diag_field, send_data use data_override_mod, only: data_override @@ -97,8 +95,6 @@ module coupler_types_mod integer :: atm_tr_index = 0 !< atm_tr_index character(len=128) :: ice_restart_file = ' ' !< ice_restart_file character(len=128) :: ocean_restart_file = ' ' !< ocean_restart_file - type(restart_file_type), pointer :: rest_type => NULL() !< A pointer to the restart_file_type - !! that is used for this field. type(FmsNetcdfDomainFile_t), pointer :: fms2_io_rest_type => NULL() !< A pointer to the restart_file_type !! That is used for this field logical :: use_atm_pressure !< use_atm_pressure @@ -151,8 +147,6 @@ module coupler_types_mod integer :: atm_tr_index = 0 !< atm_tr_index character(len=128) :: ice_restart_file = ' ' !< ice_restart_file character(len=128) :: ocean_restart_file = ' ' !< ocean_restart_file - type(restart_file_type), pointer :: rest_type => NULL() !< A pointer to the restart_file_type - !! that is used for this field. type(FmsNetcdfDomainFile_t), pointer :: fms2_io_rest_type => NULL() !< A pointer to the restart_file_type !! That is used for this field logical :: use_atm_pressure !< use_atm_pressure @@ -321,9 +315,6 @@ module coupler_types_mod !! in restart files. !> @ingroup coupler_types_mod interface coupler_type_register_restarts - module procedure mpp_io_CT_register_restarts_2d, mpp_io_CT_register_restarts_3d - module procedure mpp_io_CT_register_restarts_to_file_2d, mpp_io_CT_register_restarts_to_file_3d - module procedure CT_register_restarts_2d, CT_register_restarts_3d end interface coupler_type_register_restarts @@ -331,7 +322,6 @@ module coupler_types_mod !! been saved in restart files. !> @ingroup coupler_types_mod interface coupler_type_restore_state - module procedure mpp_io_CT_restore_state_2d, mpp_io_CT_restore_state_3d module procedure CT_restore_state_2d, CT_restore_state_3d end interface coupler_type_restore_state @@ -3340,97 +3330,7 @@ subroutine register_axis_wrapper(fileobj, to_read, nz) call register_axis_wrapper_write(fileobj, nz) endif - end subroutine - - !! @brief Register the fields in a coupler_2d_bc_type to be saved in restart files - !! - !! This subroutine registers the fields in a coupler_2d_bc_type to be saved in restart files - !! specified in the field table. - subroutine mpp_io_CT_register_restarts_2d(var, bc_rest_files, num_rest_files, mpp_domain, ocean_restart) - type(coupler_2d_bc_type), intent(inout) :: var !< BC_type structure to be registered for restarts - type(restart_file_type), dimension(:), pointer :: bc_rest_files !< Structures describing the restart files - integer, intent(out) :: num_rest_files !< The number of restart files to use - type(domain2D), intent(in) :: mpp_domain !< The FMS domain to use for this registration call - logical, optional, intent(in) :: ocean_restart !< If true, use the ocean restart file name. - - character(len=80), dimension(max(1,var%num_bcs)) :: rest_file_names - character(len=80) :: file_nm - logical :: ocn_rest - integer :: f, n, m - - ocn_rest = .true. - if (present(ocean_restart)) ocn_rest = ocean_restart - - ! Determine the number and names of the restart files - num_rest_files = 0 - do n = 1, var%num_bcs - if (var%bc(n)%num_fields <= 0) cycle - file_nm = trim(var%bc(n)%ice_restart_file) - if (ocn_rest) file_nm = trim(var%bc(n)%ocean_restart_file) - do f = 1, num_rest_files - if (trim(file_nm) == trim(rest_file_names(f))) exit - enddo - if (f>num_rest_files) then - num_rest_files = num_rest_files + 1 - rest_file_names(f) = trim(file_nm) - endif - enddo - - if (num_rest_files == 0) return - - ! Register the fields with the restart files - allocate(bc_rest_files(num_rest_files)) - do n = 1, var%num_bcs - if (var%bc(n)%num_fields <= 0) cycle - - file_nm = trim(var%bc(n)%ice_restart_file) - if (ocn_rest) file_nm = trim(var%bc(n)%ocean_restart_file) - do f = 1, num_rest_files - if (trim(file_nm) == trim(rest_file_names(f))) exit - enddo - - var%bc(n)%rest_type => bc_rest_files(f) - do m = 1, var%bc(n)%num_fields - var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(bc_rest_files(f),& - & rest_file_names(f), var%bc(n)%field(m)%name, var%bc(n)%field(m)%values,& - & mpp_domain, mandatory=.not.var%bc(n)%field(m)%may_init ) - enddo - enddo - end subroutine mpp_io_CT_register_restarts_2d - - !! @brief Register the fields in a coupler_2d_bc_type to be saved to restart files - !! - !! This subroutine registers the fields in a coupler_2d_bc_type to be saved in the specified - !! restart file. - subroutine mpp_io_CT_register_restarts_to_file_2d(var, file_name, rest_file, mpp_domain, varname_prefix) - type(coupler_2d_bc_type), intent(inout) :: var !< BC_type structure to be registered for restarts - character(len=*), intent(in) :: file_name !< The name of the restart file - type(restart_file_type), pointer :: rest_file !< A (possibly associated) structure describing - !! the restart file - type(domain2D), intent(in) :: mpp_domain !< The FMS domain to use for this registration call - character(len=*), optional, intent(in) :: varname_prefix !< A prefix for the variable name - !! in the restart file, intended to allow - !! multiple BC_type variables to use the - !! same restart files. - - character(len=128) :: var_name - integer :: n, m - - ! Register the fields with the restart file - if (.not.associated(rest_file)) allocate(rest_file) - do n = 1, var%num_bcs - if (var%bc(n)%num_fields <= 0) cycle - - var%bc(n)%rest_type => rest_file - do m = 1, var%bc(n)%num_fields - var_name = trim(var%bc(n)%field(m)%name) - if (present(varname_prefix)) var_name = trim(varname_prefix)//trim(var_name) - var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(rest_file,& - & file_name, var_name, var%bc(n)%field(m)%values,& - & mpp_domain, mandatory=.not.var%bc(n)%field(m)%may_init ) - enddo - enddo - end subroutine mpp_io_CT_register_restarts_to_file_2d + end subroutine register_axis_wrapper !! @brief Register the fields in a coupler_3d_bc_type to be saved in restart files !! This subroutine registers the fields in a coupler_2d_bc_type to be saved in restart files @@ -3540,93 +3440,6 @@ subroutine CT_register_restarts_3d(var, bc_rest_files, num_rest_files, mpp_domai end subroutine CT_register_restarts_3d - !! @brief Register the fields in a coupler_3d_bc_type to be saved to restart files - !! - !! This subroutine registers the fields in a coupler_3d_bc_type to be saved in restart files - !! specified in the field table. - subroutine mpp_io_CT_register_restarts_3d(var, bc_rest_files, num_rest_files, mpp_domain, ocean_restart) - type(coupler_3d_bc_type), intent(inout) :: var !< BC_type structure to be registered for restarts - type(restart_file_type), dimension(:), pointer :: bc_rest_files !< Structures describing the restart files - integer, intent(out) :: num_rest_files !< The number of restart files to use - type(domain2D), intent(in) :: mpp_domain !< The FMS domain to use for this registration call - logical, optional, intent(in) :: ocean_restart !< If true, use the ocean restart file name. - - character(len=80), dimension(max(1,var%num_bcs)) :: rest_file_names - character(len=80) :: file_nm - logical :: ocn_rest - integer :: f, n, m - - ocn_rest = .true. - if (present(ocean_restart)) ocn_rest = ocean_restart - - ! Determine the number and names of the restart files - num_rest_files = 0 - do n = 1, var%num_bcs - if (var%bc(n)%num_fields <= 0) cycle - file_nm = trim(var%bc(n)%ice_restart_file) - if (ocn_rest) file_nm = trim(var%bc(n)%ocean_restart_file) - do f = 1, num_rest_files - if (trim(file_nm) == trim(rest_file_names(f))) exit - enddo - if (f>num_rest_files) then - num_rest_files = num_rest_files + 1 - rest_file_names(f) = trim(file_nm) - endif - enddo - - if (num_rest_files == 0) return - - ! Register the fields with the restart files - allocate(bc_rest_files(num_rest_files)) - do n = 1, var%num_bcs - if (var%bc(n)%num_fields <= 0) cycle - file_nm = trim(var%bc(n)%ice_restart_file) - if (ocn_rest) file_nm = trim(var%bc(n)%ocean_restart_file) - do f = 1, num_rest_files - if (trim(file_nm) == trim(rest_file_names(f))) exit - enddo - - var%bc(n)%rest_type => bc_rest_files(f) - do m = 1, var%bc(n)%num_fields - var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(bc_rest_files(f),& - & rest_file_names(f), var%bc(n)%field(m)%name, var%bc(n)%field(m)%values,& - & mpp_domain, mandatory=.not.var%bc(n)%field(m)%may_init ) - enddo - enddo - end subroutine mpp_io_CT_register_restarts_3d - - !> @brief Register the fields in a coupler_3d_bc_type to be saved to restart files - !! - !! Registers the fields in a coupler_3d_bc_type to be saved in the specified restart file. - subroutine mpp_io_CT_register_restarts_to_file_3d(var, file_name, rest_file, mpp_domain, varname_prefix) - type(coupler_3d_bc_type), intent(inout) :: var !< BC_type structure to be registered for restarts - character(len=*), intent(in) :: file_name !< The name of the restart file - type(restart_file_type), pointer :: rest_file !< A (possibly associated) structure describing the restart file - type(domain2D), intent(in) :: mpp_domain !< The FMS domain to use for this registration call - character(len=*), optional, intent(in) :: varname_prefix !< A prefix for the variable name - !! in the restart file, intended to allow - !! multiple BC_type variables to use the - !! same restart files. - - character(len=128) :: var_name - integer :: n, m - - ! Register the fields with the restart file - if (.not.associated(rest_file)) allocate(rest_file) - do n = 1, var%num_bcs - if (var%bc(n)%num_fields <= 0) cycle - - var%bc(n)%rest_type => rest_file - do m = 1, var%bc(n)%num_fields - var_name = trim(var%bc(n)%field(m)%name) - if (present(varname_prefix)) var_name = trim(varname_prefix)//trim(var_name) - var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(rest_file,& - & file_name, var_name, var%bc(n)%field(m)%values,& - & mpp_domain, mandatory=.not.var%bc(n)%field(m)%may_init ) - enddo - enddo - end subroutine mpp_io_CT_register_restarts_to_file_3d - subroutine CT_restore_state_2d(var, use_fms2_io, directory, all_or_nothing, all_required, test_by_field) type(coupler_2d_bc_type), intent(inout) :: var !< BC_type structure to restore from restart files character(len=*), optional, intent(in) :: directory !< A directory where the restart files should @@ -3689,76 +3502,6 @@ subroutine CT_restore_state_2d(var, use_fms2_io, directory, all_or_nothing, all_ endif end subroutine CT_restore_state_2d - !> @brief Reads in fields from restart files into a coupler_2d_bc_type - !! - !! This subroutine reads in the fields in a coupler_2d_bc_type that have been saved in restart - !! files. - subroutine mpp_io_CT_restore_state_2d(var, directory, all_or_nothing, all_required, test_by_field) - type(coupler_2d_bc_type), intent(inout) :: var !< BC_type structure to restore from restart files - character(len=*), optional, intent(in) :: directory !< A directory where the restart files should - !! be found. The default for FMS is 'INPUT'. - logical, optional, intent(in) :: all_or_nothing !< If true and there are non-mandatory - !! restart fields, it is still an error if some - !! fields are read successfully but others are not. - logical, optional, intent(in) :: all_required !< If true, all fields must be successfully - !! read from the restart file, even if they were - !! registered as not mandatory. - logical, optional, intent(in) :: test_by_field !< If true, all or none of the variables - !! in a single field must be read successfully. - - integer :: n, m, num_fld - character(len=80) :: unset_varname - logical :: any_set, all_set, all_var_set, any_var_set, var_set - - any_set = .false. - all_set = .true. - num_fld = 0 - unset_varname = "" - - do n = 1, var%num_bcs - any_var_set = .false. - all_var_set = .true. - do m = 1, var%bc(n)%num_fields - var_set = .false. - if (var%bc(n)%field(m)%id_rest > 0) then - var_set = query_initialized(var%bc(n)%rest_type, var%bc(n)%field(m)%id_rest) - if (.not.var_set) then - call restore_state(var%bc(n)%rest_type, var%bc(n)%field(m)%id_rest,& - & directory=directory, nonfatal_missing_files=.true.) - var_set = query_initialized(var%bc(n)%rest_type, var%bc(n)%field(m)%id_rest) - endif - endif - - if (.not.var_set) unset_varname = trim(var%bc(n)%field(m)%name) - if (var_set) any_set = .true. - if (all_set) all_set = var_set - if (var_set) any_var_set = .true. - if (all_var_set) all_var_set = var_set - enddo - - num_fld = num_fld + var%bc(n)%num_fields - if ((var%bc(n)%num_fields > 0) .and. present(test_by_field)) then - if (test_by_field .and. (all_var_set .neqv. any_var_set)) call mpp_error(FATAL,& - & "mpp_io_CT_restore_state_2d: test_by_field is true, and "//& - & trim(unset_varname)//" was not read but some other fields in "//& - & trim(trim(var%bc(n)%name))//" were.") - endif - enddo - - if ((num_fld > 0) .and. present(all_or_nothing)) then - if (all_or_nothing .and. (all_set .neqv. any_set)) call mpp_error(FATAL,& - & "mpp_io_CT_restore_state_2d: all_or_nothing is true, and "//& - & trim(unset_varname)//" was not read but some other fields were.") - endif - - if (present(all_required)) then - if (all_required .and. .not.all_set) then - call mpp_error(FATAL, "mpp_io_CT_restore_state_2d: all_required is true, but "//& - & trim(unset_varname)//" was not read from its restart file.") - endif - endif - end subroutine mpp_io_CT_restore_state_2d - !> @brief Read in fields from restart files into a coupler_3d_bc_type !! !! This subroutine reads in the fields in a coupler_3d_bc_type that have been saved in restart @@ -3826,78 +3569,6 @@ subroutine CT_restore_state_3d(var, use_fms2_io, directory, all_or_nothing, all_ endif end subroutine CT_restore_state_3d - !> @brief Read in fields from restart files into a coupler_3d_bc_type - !! - !! This subroutine reads in the fields in a coupler_3d_bc_type that have been saved in restart - !! files. - subroutine mpp_io_CT_restore_state_3d(var, directory, all_or_nothing, all_required, test_by_field) - type(coupler_3d_bc_type), intent(inout) :: var !< BC_type structure to restore from restart files - character(len=*), optional, intent(in) :: directory !< A directory where the restart files should - !! be found. The default for FMS is 'INPUT'. - logical, optional, intent(in) :: all_or_nothing !< If true and there are non-mandatory - !! restart fields, it is still an error if some - !! fields are read successfully but others are not. - logical, optional, intent(in) :: all_required !< If true, all fields must be successfully - !! read from the restart file, even if they were - !! registered as not mandatory. - logical, optional, intent(in) :: test_by_field !< If true, all or none of the variables - !! in a single field must be read successfully. - - integer :: n, m, num_fld - character(len=80) :: unset_varname - logical :: any_set, all_set, all_var_set, any_var_set, var_set - - any_set = .false. - all_set = .true. - num_fld = 0 - unset_varname = "" - - do n = 1, var%num_bcs - any_var_set = .false. - all_var_set = .true. - do m = 1, var%bc(n)%num_fields - var_set = .false. - if (var%bc(n)%field(m)%id_rest > 0) then - var_set = query_initialized(var%bc(n)%rest_type, var%bc(n)%field(m)%id_rest) - if (.not.var_set) then - call restore_state(var%bc(n)%rest_type, var%bc(n)%field(m)%id_rest,& - & directory=directory, nonfatal_missing_files=.true.) - var_set = query_initialized(var%bc(n)%rest_type, var%bc(n)%field(m)%id_rest) - endif - endif - - if (.not.var_set) unset_varname = trim(var%bc(n)%field(m)%name) - - if (var_set) any_set = .true. - if (all_set) all_set = var_set - if (var_set) any_var_set = .true. - if (all_var_set) all_var_set = var_set - enddo - - num_fld = num_fld + var%bc(n)%num_fields - if ((var%bc(n)%num_fields > 0) .and. present(test_by_field)) then - if (test_by_field .and. (all_var_set .neqv. any_var_set)) call mpp_error(FATAL,& - & "mpp_io_CT_restore_state_3d: test_by_field is true, and "//& - & trim(unset_varname)//" was not read but some other fields in "//& - & trim(trim(var%bc(n)%name))//" were.") - endif - enddo - - if ((num_fld > 0) .and. present(all_or_nothing)) then - if (all_or_nothing .and. (all_set .neqv. any_set)) call mpp_error(FATAL,& - & "mpp_io_CT_restore_state_3d: all_or_nothing is true, and "//& - & trim(unset_varname)//" was not read but some other fields were.") - endif - - if (present(all_required)) then - if (all_required .and. .not.all_set) then - call mpp_error(FATAL, "mpp_io_CT_restore_state_3d: all_required is true, but "//& - & trim(unset_varname)//" was not read from its restart file.") - endif - endif - end subroutine mpp_io_CT_restore_state_3d - - !> @brief Potentially override the values in a coupler_2d_bc_type subroutine CT_data_override_2d(gridname, var, Time) character(len=3), intent(in) :: gridname !< 3-character long model grid ID diff --git a/coupler/ensemble_manager.F90 b/coupler/ensemble_manager.F90 index 5290a01f87..0bce514911 100644 --- a/coupler/ensemble_manager.F90 +++ b/coupler/ensemble_manager.F90 @@ -32,8 +32,7 @@ module ensemble_manager_mod use mpp_mod, only : mpp_npes, stdout, stdlog, mpp_error, FATAL use mpp_mod, only : mpp_pe, mpp_declare_pelist use mpp_mod, only : input_nml_file - use fms2_io_mod, only : fms2_io_set_filename_appendix=>set_filename_appendix - use fms_io_mod, only : fms_io_set_filename_appendix=>set_filename_appendix + use fms2_io_mod, only : set_filename_appendix IMPLICIT NONE @@ -410,8 +409,7 @@ subroutine ensemble_pelist_setup(concurrent, atmos_npes, ocean_npes, land_npes, !Append ensemble_id to the restart filenames !< Both calls are needed for cases where both fms2io/fmsio are used - call fms2_io_set_filename_appendix(trim(text)) - call fms_io_set_filename_appendix(trim(text)) + call set_filename_appendix(trim(text)) endif end subroutine ensemble_pelist_setup diff --git a/data_override/data_override.F90 b/data_override/data_override.F90 index 8a00be7b62..719902da3e 100644 --- a/data_override/data_override.F90 +++ b/data_override/data_override.F90 @@ -54,8 +54,7 @@ module data_override_mod reset_src_data_region, & NO_REGION, INSIDE_REGION, OUTSIDE_REGION, & get_external_fileobj -use fms_mod, only: write_version_number, field_exist, lowercase, check_nml_error -use axis_utils_mod, only: get_axis_bounds +use fms_mod, only: write_version_number, lowercase, check_nml_error use axis_utils2_mod, only : nearest_index, axis_edges use mpp_domains_mod, only : domain2d, mpp_get_compute_domain, NULL_DOMAIN2D,operator(.NE.),operator(.EQ.) use mpp_domains_mod, only : mpp_get_global_domain, mpp_get_data_domain diff --git a/diag_integral/diag_integral.F90 b/diag_integral/diag_integral.F90 index d8bc427cc2..b280e7880b 100644 --- a/diag_integral/diag_integral.F90 +++ b/diag_integral/diag_integral.F90 @@ -70,7 +70,7 @@ module diag_integral_mod operator(==), operator(>=), & operator(/=) use mpp_mod, only: input_nml_file -use fms_mod, only: open_file, error_mesg, & +use fms_mod, only: error_mesg, & check_nml_error, & fms_init, & mpp_pe, mpp_root_pe,& @@ -379,7 +379,7 @@ subroutine diag_integral_init (Time_init, Time, blon, blat, area_in) file_name = ensemble_file_name(file_name) endif nc = len_trim(file_name) - diag_unit = open_file (file_name(1:nc), action='write') + open(newunit=diag_unit, file=file_name(1:nc), action='write') endif !------------------------------------------------------------------------------- @@ -952,6 +952,7 @@ subroutine diag_integral_end (Time) ! deallocate module variables. !------------------------------------------------------------------------------- deallocate (area) + if (diag_unit /= 0) close(diag_unit) !------------------------------------------------------------------------------- ! mark the module as uninitialized. diff --git a/diag_manager/diag_manager.F90 b/diag_manager/diag_manager.F90 index 056fe00181..f4a45fdfd0 100644 --- a/diag_manager/diag_manager.F90 +++ b/diag_manager/diag_manager.F90 @@ -215,7 +215,6 @@ MODULE diag_manager_mod USE fms_mod, ONLY: error_mesg, FATAL, WARNING, NOTE, stdout, stdlog, write_version_number,& & fms_error_handler, check_nml_error, lowercase - USE fms_io_mod, ONLY: get_instance_filename USE diag_axis_mod, ONLY: diag_axis_init, get_axis_length, get_axis_num, get_domain2d, get_tile_count,& & diag_axis_add_attribute, axis_compatible_check, CENTER, NORTH, EAST USE diag_util_mod, ONLY: get_subfield_size, log_diag_field_info, update_bounds,& diff --git a/diag_manager/diag_util.F90 b/diag_manager/diag_util.F90 index ce73068f53..2f88112748 100644 --- a/diag_manager/diag_util.F90 +++ b/diag_manager/diag_util.F90 @@ -63,8 +63,8 @@ MODULE diag_util_mod USE diag_output_mod, ONLY: diag_field_write, diag_write_time !=), OPERATOR(<=), OPERATOR(==) USE mpp_mod, ONLY: mpp_npes - USE fms_io_mod, ONLY: get_mosaic_tile_file_ug USE constants_mod, ONLY: SECONDS_PER_DAY, SECONDS_PER_HOUR, SECONDS_PER_MINUTE - USE fms2_io_mod, fms2_io_get_instance_filename => get_instance_filename #ifdef use_netCDF USE netcdf, ONLY: NF90_CHAR #endif @@ -1598,7 +1596,7 @@ SUBROUTINE opening_file(file, time, filename_time) ! Add ensemble ID to filename fname=base_name - call fms2_io_get_instance_filename(fname, base_name) + call get_instance_filename(fname, base_name) ! Set the filename filename = TRIM(base_name)//TRIM(suffix) @@ -1920,19 +1918,11 @@ SUBROUTINE opening_file(file, time, filename_time) & cart_name, dir, edges, Domain, domainU, DATA) CALL get_diag_axis( time_bounds_id(1), timeb_name, timeb_units, timeb_longname,& & cart_name, dir, edges, Domain, domainU, DATA) - IF ( do_cf_compliance() ) THEN - ! CF Compliance requires the unit on the _bnds axis is the same as 'time' - files(file)%f_bounds = write_field_meta_data(files(file)%file_unit,& - & TRIM(time_name)//'_bnds', (/time_bounds_id,time_axis_id/),& - & time_units, TRIM(time_name)//' axis boundaries', pack=pack_size , & - & fileob=fileob) - ELSE - files(file)%f_bounds = write_field_meta_data(files(file)%file_unit,& - & TRIM(time_name)//'_bnds', (/time_bounds_id,time_axis_id/),& - & TRIM(time_unit_list(files(file)%time_units)),& - & TRIM(time_name)//' axis boundaries', pack=pack_size, & - & fileob=fileob) - END IF + ! CF Compliance requires the unit on the _bnds axis is the same as 'time' + files(file)%f_bounds = write_field_meta_data(files(file)%file_unit,& + & TRIM(time_name)//'_bnds', (/time_bounds_id,time_axis_id/),& + & time_units, TRIM(time_name)//' axis boundaries', pack=pack_size , & + & fileob=fileob) END IF ! Let lower levels know that all meta data has been sent call done_meta_data(files(file)%file_unit) From ecfcdda87873db84bf2e64a2715834f837919d73 Mon Sep 17 00:00:00 2001 From: Eric Stofferahn <7784797+GFDL-Eric@users.noreply.github.com> Date: Thu, 3 Mar 2022 13:41:57 -0500 Subject: [PATCH 2/4] revert coupler/ensemble_manager changes --- coupler/ensemble_manager.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coupler/ensemble_manager.F90 b/coupler/ensemble_manager.F90 index 0bce514911..5290a01f87 100644 --- a/coupler/ensemble_manager.F90 +++ b/coupler/ensemble_manager.F90 @@ -32,7 +32,8 @@ module ensemble_manager_mod use mpp_mod, only : mpp_npes, stdout, stdlog, mpp_error, FATAL use mpp_mod, only : mpp_pe, mpp_declare_pelist use mpp_mod, only : input_nml_file - use fms2_io_mod, only : set_filename_appendix + use fms2_io_mod, only : fms2_io_set_filename_appendix=>set_filename_appendix + use fms_io_mod, only : fms_io_set_filename_appendix=>set_filename_appendix IMPLICIT NONE @@ -409,7 +410,8 @@ subroutine ensemble_pelist_setup(concurrent, atmos_npes, ocean_npes, land_npes, !Append ensemble_id to the restart filenames !< Both calls are needed for cases where both fms2io/fmsio are used - call set_filename_appendix(trim(text)) + call fms2_io_set_filename_appendix(trim(text)) + call fms_io_set_filename_appendix(trim(text)) endif end subroutine ensemble_pelist_setup From 9d3e487f4f0523e370ab3b79dad2b5ac72c88d34 Mon Sep 17 00:00:00 2001 From: Eric Stofferahn <7784797+GFDL-Eric@users.noreply.github.com> Date: Thu, 3 Mar 2022 14:18:07 -0500 Subject: [PATCH 3/4] Fixed close_file fail --- diag_manager/diag_util.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diag_manager/diag_util.F90 b/diag_manager/diag_util.F90 index 2f88112748..5393368755 100644 --- a/diag_manager/diag_util.F90 +++ b/diag_manager/diag_util.F90 @@ -64,7 +64,7 @@ MODULE diag_util_mod USE diag_grid_mod, ONLY: get_local_indexes USE fms_mod, ONLY: error_mesg, FATAL, WARNING, NOTE, mpp_pe, mpp_root_pe, lowercase, fms_error_handler,& & string, write_version_number - USE fms2_io_mod, ONLY: get_instance_filename, FmsNetcdfFile_t, check_if_open + USE fms2_io_mod USE mpp_domains_mod,ONLY: domain1d, domain2d, mpp_get_compute_domain, null_domain1d, null_domain2d,& & OPERATOR(.NE.), OPERATOR(.EQ.), mpp_modify_domain, mpp_get_domain_components,& & mpp_get_ntile_count, mpp_get_current_ntile, mpp_get_tile_id, mpp_mosaic_defined, mpp_get_tile_npes,& From 6a607fa0e9628b9020a1b28029811d07c7df74af Mon Sep 17 00:00:00 2001 From: Eric Stofferahn <7784797+GFDL-Eric@users.noreply.github.com> Date: Thu, 3 Mar 2022 14:19:21 -0500 Subject: [PATCH 4/4] Moved diag_util fms2_io_mod placement --- diag_manager/diag_util.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diag_manager/diag_util.F90 b/diag_manager/diag_util.F90 index 5393368755..de34c14abb 100644 --- a/diag_manager/diag_util.F90 +++ b/diag_manager/diag_util.F90 @@ -64,7 +64,6 @@ MODULE diag_util_mod USE diag_grid_mod, ONLY: get_local_indexes USE fms_mod, ONLY: error_mesg, FATAL, WARNING, NOTE, mpp_pe, mpp_root_pe, lowercase, fms_error_handler,& & string, write_version_number - USE fms2_io_mod USE mpp_domains_mod,ONLY: domain1d, domain2d, mpp_get_compute_domain, null_domain1d, null_domain2d,& & OPERATOR(.NE.), OPERATOR(.EQ.), mpp_modify_domain, mpp_get_domain_components,& & mpp_get_ntile_count, mpp_get_current_ntile, mpp_get_tile_id, mpp_mosaic_defined, mpp_get_tile_npes,& @@ -74,6 +73,7 @@ MODULE diag_util_mod & OPERATOR(<), OPERATOR(>=), OPERATOR(<=), OPERATOR(==) USE mpp_mod, ONLY: mpp_npes USE constants_mod, ONLY: SECONDS_PER_DAY, SECONDS_PER_HOUR, SECONDS_PER_MINUTE + USE fms2_io_mod #ifdef use_netCDF USE netcdf, ONLY: NF90_CHAR #endif