From 85f409e290c4974011db0416916396f3daf4318f Mon Sep 17 00:00:00 2001 From: uramirez8707 <49168881+uramirez8707@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:08:17 -0400 Subject: [PATCH] feat: add tile number to the filename for subregional files (#1376) --- diag_manager/diag_output.F90 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/diag_manager/diag_output.F90 b/diag_manager/diag_output.F90 index ff2042f599..de8605d34b 100644 --- a/diag_manager/diag_output.F90 +++ b/diag_manager/diag_output.F90 @@ -111,6 +111,9 @@ 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=128) :: filename_tile !< Filename with the tile number included + !! It is needed for subregional diagnostics + !---- initialize mpp_io ---- IF ( .NOT.module_is_initialized ) THEN module_is_initialized = .TRUE. @@ -135,8 +138,13 @@ SUBROUTINE diag_output_init (file_name, file_title, file_unit,& fileob => fileobjND mype = mpp_pe() write(mype_string,'(I0.4)') mype + !! Add the tile number to the subregional file + !! This is needed for the combiner to work correctly + call get_mosaic_tile_file(file_name, filename_tile, .true., domain) + filename_tile = trim(filename_tile)//"."//trim(mype_string) + if (.not.check_if_open(fileob)) then - call open_check(open_file(fileobjND, trim(file_name)//".nc."//trim(mype_string), "overwrite", & + call open_check(open_file(fileobjND, trim(filename_tile), "overwrite", & is_restart=.false.)) !< For regional subaxis add the NumFilesInSet attribute, which is added by fms2_io for (other) !< domains with sufficient decomposition info. Note mppnccombine will work with an entry of zero.