From 3deb607cd07236794af3140d4778d7da2d776b5e Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Mon, 9 Oct 2023 11:00:50 -0600 Subject: [PATCH] Issue 714 Bugfix: need to check if optional arguments are present before assigning them to a variable --- src/MPP/mpp_land.F | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/MPP/mpp_land.F b/src/MPP/mpp_land.F index 005664c3f..0084a2d16 100644 --- a/src/MPP/mpp_land.F +++ b/src/MPP/mpp_land.F @@ -141,22 +141,18 @@ subroutine LOG_MAP2d() return end subroutine log_map2d - - !old subroutine MPP_LAND_INIT(flag, ew_numprocs, sn_numprocs) subroutine MPP_LAND_INIT(in_global_nx,in_global_ny) ! ### initialize the land model logically based on the two D method. ! ### Call this function directly if it is nested with WRF. implicit none integer, optional :: in_global_nx, in_global_ny integer :: ierr, provided - integer :: ew_numprocs, sn_numprocs ! input the processors in x and y direction. logical mpi_inited - global_nx = in_global_nx - global_ny = in_global_ny - - ! left_right_np = ew_numprocs - ! up_down_np = sn_numprocs + if (present(in_global_nx) .and. present(in_global_ny)) then + global_nx = in_global_nx + global_ny = in_global_ny + end if call mpi_initialized( mpi_inited, ierr ) if ( .not. mpi_inited ) then