Skip to content

Commit

Permalink
feat: add tile number to the filename for subregional files (#1376)
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 authored Oct 5, 2023
1 parent 5933858 commit 85f409e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion diag_manager/diag_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 85f409e

Please sign in to comment.