Skip to content

Commit

Permalink
revert changes for optional variables
Browse files Browse the repository at this point in the history
  • Loading branch information
abrooks1085 committed Nov 27, 2023
1 parent 52e1e1b commit 4086757
Show file tree
Hide file tree
Showing 44 changed files with 328 additions and 328 deletions.
10 changes: 5 additions & 5 deletions coupler/ensemble_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ function get_ensemble_size()
end function get_ensemble_size

!> @brief Gets pe list for current ensemble or a given ensemble component.
subroutine get_ensemble_pelist(pelist, component_name)
subroutine get_ensemble_pelist(pelist, name)

integer, intent(inout) :: pelist(:,:) !< Ensemble pelist
character(len=*), intent(in), optional :: component_name !< Component name.
character(len=*), intent(in), optional :: name !< Component name.

if (size(pelist,1) < ensemble_size) &
call mpp_error(FATAL,'get_ensemble_pelist: size of pelist 1st index < ensemble_size')

if(present(component_name)) then
select case(component_name)
if(present(name)) then
select case(name)
case('ocean')
if (size(pelist,2) < ocean_npes_pm)&
call mpp_error(FATAL,'get_ensemble_pelist: size of pelist 2nd index < ocean_npes_pm')
Expand Down Expand Up @@ -164,7 +164,7 @@ subroutine get_ensemble_pelist(pelist, component_name)
ensemble_pelist_ice(1:ensemble_size,1:ice_npes_pm)

case default
call mpp_error(FATAL,'get_ensemble_pelist: unknown argument name='//component_name)
call mpp_error(FATAL,'get_ensemble_pelist: unknown argument name='//name)
end select
else
if (size(pelist,2) < total_npes_pm)&
Expand Down
2 changes: 1 addition & 1 deletion mosaic/grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ subroutine define_cube_mosaic ( component, domain, layout, halo, maskmap )
pe_start=pe_start, pe_end=pe_end, symmetry=.true., &
shalo = ng, nhalo = ng, whalo = ng, ehalo = ng, &
maskmap = maskmap, &
domain_name = trim(component)//'Cubic-Sphere Grid' )
name = trim(component)//'Cubic-Sphere Grid' )

deallocate(nlon,nlat,global_indices,pe_start,pe_end,layout_2d)
deallocate(tile1,tile2)
Expand Down
2 changes: 1 addition & 1 deletion mosaic2/grid2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ subroutine define_cube_mosaic(component, domain, layout, halo, maskmap)
pe_start=pe_start, pe_end=pe_end, symmetry=.true., &
shalo = ng, nhalo = ng, whalo = ng, ehalo = ng, &
maskmap = maskmap, &
domain_name = trim(component)//'Cubic-Sphere Grid' )
name = trim(component)//'Cubic-Sphere Grid' )

deallocate(nlon,nlat,global_indices,pe_start,pe_end,layout_2d)
deallocate(tile1,tile2)
Expand Down
12 changes: 6 additions & 6 deletions mpp/include/mpp_define_nest_domains.inc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
!!
subroutine mpp_define_nest_domains(nest_domain, domain, num_nest, nest_level, tile_fine, tile_coarse, &
istart_coarse, icount_coarse, jstart_coarse, jcount_coarse, npes_nest_tile, &
x_refine, y_refine, extra_halo, domain_name)
x_refine, y_refine, extra_halo, name)
type(nest_domain_type), intent(inout) :: nest_domain !< holds the information to pass data
!! between nest and parent grids.
type(domain2D), target, intent(in ) :: domain !< domain for the grid defined in the current pelist
Expand All @@ -114,7 +114,7 @@ subroutine mpp_define_nest_domains(nest_domain, domain, num_nest, nest_level, ti
!! for each nest
integer, optional, intent(in ) :: extra_halo !< extra halo for passing data from coarse grid to fine grid.
!! default is 0 and currently only support extra_halo = 0.
character(len=*), optional, intent(in ) :: domain_name !< name of the nest domain
character(len=*), optional, intent(in ) :: name !< name of the nest domain

integer :: n, l, m, my_tile_coarse
integer :: npes_level, prev_tile_coarse
Expand All @@ -126,13 +126,13 @@ subroutine mpp_define_nest_domains(nest_domain, domain, num_nest, nest_level, ti
integer :: nnest, nlevels, ntiles_top, ntiles, pos
logical :: is_first

if(PRESENT(domain_name)) then
if(len_trim(domain_name) > NAME_LENGTH) then
if(PRESENT(name)) then
if(len_trim(name) > NAME_LENGTH) then
call mpp_error(FATAL, "mpp_domains_define.inc(mpp_define_nest_domain): "// &
"the len_trim of optional argument name ="//trim(domain_name)// &
"the len_trim of optional argument name ="//trim(name)// &
" is greater than NAME_LENGTH, change the argument name or increase NAME_LENGTH")
endif
nest_domain%domain_name = domain_name
nest_domain%domain_name = name
endif

extra_halo_local = 0
Expand Down
8 changes: 4 additions & 4 deletions mpp/include/mpp_do_check.fh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
!> @{

!> Updates data domain of 3D field whose computational domains have been computed
subroutine MPP_DO_CHECK_3D_( f_addrs, domain, check, d_type, ke, flags, fieldname)
subroutine MPP_DO_CHECK_3D_( f_addrs, domain, check, d_type, ke, flags, name)
integer(i8_kind), intent(in) :: f_addrs(:,:)
type(domain2D), intent(in) :: domain
type(overlapSpec), intent(in) :: check
MPP_TYPE_, intent(in) :: d_type !<creates unique interface
integer, intent(in) :: ke
integer, optional, intent(in) :: flags
character(len=*), optional, intent(in) :: fieldname
character(len=*), optional, intent(in) :: name

MPP_TYPE_ :: field(check%xbegin:check%xend, check%ybegin:check%yend,ke)
pointer(ptr_field, field)
Expand Down Expand Up @@ -67,8 +67,8 @@
!--- The check will be done in the following way: Western boundary data sent to Eastern boundary to check
!--- and Southern boundary to check

if(present(fieldname)) then
field_name = fieldname
if(present(name)) then
field_name = name
else
field_name = "un-named"
end if
Expand Down
8 changes: 4 additions & 4 deletions mpp/include/mpp_do_checkV.fh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

!> Updates data domain of 3D field whose computational domains have been computed
subroutine MPP_DO_CHECK_3D_V_(f_addrsx,f_addrsy, domain, check_x, check_y, &
d_type, ke, flags, fieldname)
d_type, ke, flags, name)
integer(i8_kind), intent(in) :: f_addrsx(:,:), f_addrsy(:,:)
type(domain2d), intent(in) :: domain
type(overlapSpec), intent(in) :: check_x, check_y
integer, intent(in) :: ke
MPP_TYPE_, intent(in) :: d_type ! creates unique interface
integer, intent(in), optional :: flags
character(len=*), intent(in), optional :: fieldname
character(len=*), intent(in), optional :: name

MPP_TYPE_ :: fieldx(check_x%xbegin:check_x%xend, check_x%ybegin:check_x%yend,ke)
MPP_TYPE_ :: fieldy(check_y%xbegin:check_y%xend, check_y%ybegin:check_y%yend,ke)
Expand Down Expand Up @@ -71,8 +71,8 @@
!--- The check will be done in the following way: Western boundary data sent to Eastern boundary to check
!--- and Southern boundary to check

if(present(fieldname)) then
field_name = fieldname
if(present(name)) then
field_name = name
else
field_name = "un-named"
end if
Expand Down
28 changes: 14 additions & 14 deletions mpp/include/mpp_domains_define.inc
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@
!> Define 2D data and computational domain on global rectilinear cartesian domain
!! (isg:ieg,jsg:jeg) and assign them to PEs
subroutine mpp_define_domains2D( global_indices, layout, domain, pelist, xflags, yflags, &
xhalo, yhalo, xextent, yextent, maskmap, domain_name, symmetry, memory_size, &
xhalo, yhalo, xextent, yextent, maskmap, name, symmetry, memory_size, &
whalo, ehalo, shalo, nhalo, is_mosaic, tile_count, tile_id, complete, x_cyclic_offset, y_cyclic_offset )
integer, intent(in) :: global_indices(:) !<(/ isg, ieg, jsg, jeg /)
integer, intent(in) :: layout(:) !< pe layout
Expand All @@ -616,7 +616,7 @@
integer, intent(in), optional :: xhalo, yhalo !< halo sizes for x and y indices
integer, intent(in), optional :: xextent(0:), yextent(0:)
logical, intent(in), optional :: maskmap(0:,0:)
character(len=*), intent(in), optional :: domain_name
character(len=*), intent(in), optional :: name
logical, intent(in), optional :: symmetry
logical, intent(in), optional :: is_mosaic !< indicate if calling mpp_define_domains
!! from mpp_define_mosaic.
Expand Down Expand Up @@ -661,11 +661,11 @@
outunit = stdout()
if( .NOT.module_is_initialized )call mpp_error( FATAL, &
& 'MPP_DEFINE_DOMAINS2D: You must first call mpp_domains_init.' )
if(PRESENT(domain_name)) then
if(len_trim(domain_name) > NAME_LENGTH) call mpp_error(FATAL, &
"mpp_domains_define.inc(mpp_define_domains2D): the len_trim of optional argument name ="//trim(domain_name)// &
if(PRESENT(name)) then
if(len_trim(name) > NAME_LENGTH) call mpp_error(FATAL, &
"mpp_domains_define.inc(mpp_define_domains2D): the len_trim of optional argument name ="//trim(name)// &
" is greater than NAME_LENGTH, change the argument name or increase NAME_LENGTH")
domain%domain_name = domain_name
domain%domain_name = name
endif
if(size(global_indices(:)) .NE. 4) call mpp_error(FATAL, &
"mpp_define_domains2D: size of global_indices should be 4 for "//trim(domain%domain_name) )
Expand Down Expand Up @@ -1006,9 +1006,9 @@
end if
!set up domain%list
if( mpp_pe().EQ.pes(0) .AND. PRESENT(domain_name) )then
if( mpp_pe().EQ.pes(0) .AND. PRESENT(name) )then
logunit = stdlog()
write( logunit, '(/a,i5,a,i5)' )trim(domain_name)//' domain decomposition: ', ndivx, ' X', ndivy
write( logunit, '(/a,i5,a,i5)' )trim(name)//' domain decomposition: ', ndivx, ' X', ndivy
write( logunit, '(3x,a)' )'pe, is, ie, js, je, isd, ied, jsd, jed'
end if
end if ! if( ANY(pes == mpp_pe()) )
Expand Down Expand Up @@ -1102,8 +1102,8 @@
!print out decomposition, this didn't consider maskmap.
if( mpp_pe() .EQ. pes(0) .AND. PRESENT(domain_name) )then
write(*,*) trim(domain_name)//' domain decomposition'
if( mpp_pe() .EQ. pes(0) .AND. PRESENT(name) )then
write(*,*) trim(name)//' domain decomposition'
write(*,'(a,i4,a,i4,a,i4,a,i4)')'whalo = ', whalosz, ", ehalo = ", ehalosz, ", shalo = ", shalosz, &
& ", nhalo = ", nhalosz
write (*,110) (domain%x(1)%list(i)%compute%size, i= 0, layout(1)-1)
Expand Down Expand Up @@ -1197,7 +1197,7 @@ end subroutine check_message_size
subroutine mpp_define_mosaic( global_indices, layout, domain, num_tile, num_contact, tile1, tile2, &
istart1, iend1, jstart1, jend1, istart2, iend2, jstart2, jend2, pe_start, &
pe_end, pelist, whalo, ehalo, shalo, nhalo, xextent, yextent, &
maskmap, domain_name, memory_size, symmetry, xflags, yflags, tile_id )
maskmap, name, memory_size, symmetry, xflags, yflags, tile_id )
integer, intent(in) :: global_indices(:,:) !>The size of first indice is 4,
!! (/ isg, ieg, jsg, jeg /)
!!The size of second indice
Expand All @@ -1217,7 +1217,7 @@ end subroutine check_message_size
integer, intent(in), optional :: whalo, ehalo, shalo, nhalo
integer, intent(in), optional :: xextent(:,:), yextent(:,:)
logical, intent(in), optional :: maskmap(:,:,:)
character(len=*), intent(in), optional :: domain_name
character(len=*), intent(in), optional :: name
integer, intent(in), optional :: memory_size(2)
logical, intent(in), optional :: symmetry
integer, intent(in), optional :: xflags, yflags
Expand Down Expand Up @@ -1439,12 +1439,12 @@ end subroutine check_message_size
end do
call mpp_define_domains(global_indices(:,n), layout(:,n), domain, pelist=pelist_tile, xflags = flags_x, &
yflags = flags_y, whalo=whalo, ehalo=ehalo, shalo=shalo, nhalo=nhalo, &
xextent=xext, yextent=yext, maskmap=mask, domain_name=domain_name, symmetry=is_symmetry, &
xextent=xext, yextent=yext, maskmap=mask, name=name, symmetry=is_symmetry, &
memory_size = memory_size, is_mosaic = .true., tile_id=tile_id_local(n))
else
call mpp_define_domains(global_indices(:,n), layout(:,n), domain, pelist=pelist_tile, &
whalo=whalo, ehalo=ehalo, shalo=shalo, nhalo=nhalo, xextent=xext, yextent=yext, &
maskmap=mask, domain_name=domain_name, symmetry=is_symmetry, memory_size = memory_size, &
maskmap=mask, name=name, symmetry=is_symmetry, memory_size = memory_size, &
is_mosaic = .true., tile_count = tile_count(pe_start(n)), tile_id=tile_id_local(n), &
complete = n==num_tile)
end if
Expand Down
8 changes: 4 additions & 4 deletions mpp/include/mpp_unstruct_domain.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
!> @{
!#####################################################################
subroutine mpp_define_unstruct_domain(UG_domain, SG_domain, npts_tile, grid_nlev, ndivs, npes_io_group, &
& grid_index, domain_name)
& grid_index, name)
type(domainUG), intent(inout) :: UG_domain
type(domain2d), target, intent(in) :: SG_domain
integer, intent(in) :: npts_tile(:) !< number of unstructured points on each tile
Expand All @@ -33,7 +33,7 @@
!! Only pe with same tile_id
!! in the same group
integer, intent(in) :: grid_index(:)
character(len=*), optional, intent(in) :: domain_name
character(len=*), optional, intent(in) :: name
integer, dimension(size(npts_tile(:))) :: ndivs_tile, pe_start, pe_end
integer, dimension(0:ndivs-1) :: ibegin, iend, costs_list
integer :: ntiles, ndivs_used, cur_tile
Expand Down Expand Up @@ -161,8 +161,8 @@
enddo
!--- write out domain decomposition from root pe
if(mpp_pe() == mpp_root_pe() .and. present(domain_name)) then
write(stdout(),*) "unstruct domain name = ", trim(domain_name)
if(mpp_pe() == mpp_root_pe() .and. present(name)) then
write(stdout(),*) "unstruct domain name = ", trim(name)
write(stdout(),*) UG_domain%list(:)%compute%size
endif
Expand Down
Loading

0 comments on commit 4086757

Please sign in to comment.