Skip to content

Commit

Permalink
Get mapunit_value_max across all processors
Browse files Browse the repository at this point in the history
  • Loading branch information
billsacks committed Sep 6, 2024
1 parent c7527b5 commit 049a734
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/mksurfdata_esmf/src/mksoiltexMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ subroutine mksoiltex(file_mesh_i, file_mapunit_i, file_lookup_i, mesh_o, pioid_o
integer :: k,l,m,n
integer :: nlay ! number of soil layers
integer :: n_scid
integer :: mapunit_value_max_local
integer , allocatable :: mask_i(:)
real(r4), pointer :: dataptr(:)
integer :: mapunit ! temporary igbp soil mapunit
Expand Down Expand Up @@ -202,7 +203,8 @@ subroutine mksoiltex(file_mesh_i, file_mapunit_i, file_lookup_i, mesh_o, pioid_o

! Determine mapunit_value_max (set it as a module variable so that it can be
! accessible to gen_dominant_mapunit) - this is needed in the dynamic mask routine
mapunit_value_max = 32056
mapunit_value_max_local = maxval(dataptr)
call mpi_allreduce(mapunit_value_max_local, mapunit_value_max, 1, MPI_INTEGER, MPI_MAX, mpicom, rcode)

! Determine values in field_o
call ESMF_FieldGet(field_o, farrayptr=dataptr, rc=rc)
Expand Down

0 comments on commit 049a734

Please sign in to comment.