Skip to content

Commit 85f409e

Browse files
authored
feat: add tile number to the filename for subregional files (#1376)
1 parent 5933858 commit 85f409e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

diag_manager/diag_output.F90

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ SUBROUTINE diag_output_init (file_name, file_title, file_unit,&
111111
integer, allocatable, dimension(:) :: current_pelist
112112
integer :: mype !< The pe you are on
113113
character(len=9) :: mype_string !< a string to store the pe
114+
character(len=128) :: filename_tile !< Filename with the tile number included
115+
!! It is needed for subregional diagnostics
116+
114117
!---- initialize mpp_io ----
115118
IF ( .NOT.module_is_initialized ) THEN
116119
module_is_initialized = .TRUE.
@@ -135,8 +138,13 @@ SUBROUTINE diag_output_init (file_name, file_title, file_unit,&
135138
fileob => fileobjND
136139
mype = mpp_pe()
137140
write(mype_string,'(I0.4)') mype
141+
!! Add the tile number to the subregional file
142+
!! This is needed for the combiner to work correctly
143+
call get_mosaic_tile_file(file_name, filename_tile, .true., domain)
144+
filename_tile = trim(filename_tile)//"."//trim(mype_string)
145+
138146
if (.not.check_if_open(fileob)) then
139-
call open_check(open_file(fileobjND, trim(file_name)//".nc."//trim(mype_string), "overwrite", &
147+
call open_check(open_file(fileobjND, trim(filename_tile), "overwrite", &
140148
is_restart=.false.))
141149
!< For regional subaxis add the NumFilesInSet attribute, which is added by fms2_io for (other)
142150
!< domains with sufficient decomposition info. Note mppnccombine will work with an entry of zero.

0 commit comments

Comments
 (0)