diff --git a/sorc/chgres_cube.fd/utils.f90 b/sorc/chgres_cube.fd/utils.f90 index ddda0bb90..3a547eede 100644 --- a/sorc/chgres_cube.fd/utils.f90 +++ b/sorc/chgres_cube.fd/utils.f90 @@ -2,13 +2,17 @@ subroutine error_handler(string, rc) implicit none + include 'mpif.h' + character(len=*), intent(in) :: string integer, intent(in) :: rc + integer :: ierr + print*,"- FATAL ERROR: ", string print*,"- IOSTAT IS: ", rc - call mpi_abort + call mpi_abort(mpi_comm_world, 999, ierr) end subroutine error_handler @@ -20,6 +24,7 @@ subroutine netcdf_err( err, string ) integer, intent(in) :: err character(len=*), intent(in) :: string character(len=256) :: errmsg + integer :: iret include "mpif.h" @@ -28,7 +33,7 @@ subroutine netcdf_err( err, string ) print*,'' print*,'FATAL ERROR: ', trim(string), ': ', trim(errmsg) print*,'STOP.' - call mpi_abort(mpi_comm_world, 999) + call mpi_abort(mpi_comm_world, 999, iret) return end subroutine netcdf_err diff --git a/sorc/sfc_climo_gen.fd/interp.F90 b/sorc/sfc_climo_gen.fd/interp.F90 index 67a8cc079..1e6141708 100644 --- a/sorc/sfc_climo_gen.fd/interp.F90 +++ b/sorc/sfc_climo_gen.fd/interp.F90 @@ -308,7 +308,7 @@ subroutine adjust_for_landice(field, vegt, idim, jdim, field_ch) integer, parameter :: landice=15 - integer :: i, j + integer :: i, j, ierr real :: landice_value @@ -364,7 +364,7 @@ subroutine adjust_for_landice(field, vegt, idim, jdim, field_ch) enddo case default print*,'- FATAL ERROR IN ROUTINE ADJUST_FOR_LANDICE. UNIDENTIFIED FIELD : ', field_ch - call mpi_abort(mpi_comm_world, 57) + call mpi_abort(mpi_comm_world, 57, ierr) end select end subroutine adjust_for_landice diff --git a/sorc/sfc_climo_gen.fd/model_grid.F90 b/sorc/sfc_climo_gen.fd/model_grid.F90 index bd0c0b5f0..056a57130 100644 --- a/sorc/sfc_climo_gen.fd/model_grid.F90 +++ b/sorc/sfc_climo_gen.fd/model_grid.F90 @@ -88,12 +88,14 @@ subroutine define_model_grid(localpet, npets) implicit none + include 'mpif.h' + integer, intent(in) :: localpet, npets character(len=500) :: the_file integer :: error, id_dim, id_tiles, ncid - integer :: id_grid_tiles + integer :: id_grid_tiles, ierr integer :: extra, rc, tile integer, allocatable :: decomptile(:,:) @@ -132,7 +134,7 @@ subroutine define_model_grid(localpet, npets) if (mod(npets,num_tiles) /= 0) then print*,'- FATAL ERROR: MUST RUN THIS PROGRAM WITH A TASK COUNT THAT' print*,'- IS A MULTIPLE OF THE NUMBER OF TILES.' - call mpi_abort + call mpi_abort(mpi_comm_world, 44, ierr) endif !----------------------------------------------------------------------- diff --git a/sorc/sfc_climo_gen.fd/output.f90 b/sorc/sfc_climo_gen.fd/output.f90 index b38aa8bea..87016e4af 100644 --- a/sorc/sfc_climo_gen.fd/output.f90 +++ b/sorc/sfc_climo_gen.fd/output.f90 @@ -50,7 +50,7 @@ subroutine output(data_one_tile, lat_one_tile, lon_one_tile, i_mdl, j_mdl, & integer :: initialsiz, fsize, error, j integer :: dim_x, dim_y, id_data - integer :: dim_time, id_times + integer :: dim_time, id_times, ierr integer :: header_buffer_val = 16384 integer :: i_out, j_out, id_lat, id_lon integer :: i_start, i_end, j_start, j_end @@ -86,7 +86,7 @@ subroutine output(data_one_tile, lat_one_tile, lon_one_tile, i_mdl, j_mdl, & out_file_with_halo = "./vegetation_type." // grid_tiles(tile) // ".halo.nc" case default print*,'- FATAL ERROR IN ROUTINE OUTPUT. UNIDENTIFIED FIELD : ', field_names(field_idx) - call mpi_abort(mpi_comm_world, 67) + call mpi_abort(mpi_comm_world, 67, ierr) end select !---------------------------------------------------------------------- diff --git a/sorc/sfc_climo_gen.fd/utils.f90 b/sorc/sfc_climo_gen.fd/utils.f90 index 373ae736c..0941737d1 100644 --- a/sorc/sfc_climo_gen.fd/utils.f90 +++ b/sorc/sfc_climo_gen.fd/utils.f90 @@ -15,6 +15,7 @@ subroutine netcdf_err( err, string ) integer, intent(in) :: err character(len=*), intent(in) :: string character(len=256) :: errmsg + integer :: ierr include "mpif.h" @@ -23,7 +24,7 @@ subroutine netcdf_err( err, string ) print*,'' print*,'FATAL ERROR: ', trim(string), ': ', trim(errmsg) print*,'STOP.' - call mpi_abort(mpi_comm_world, 999) + call mpi_abort(mpi_comm_world, 999, ierr) return end subroutine netcdf_err @@ -36,9 +37,13 @@ subroutine error_handler(string, rc) integer, optional, intent(in) :: rc + integer :: ierr + + include "mpif.h" + print*,"- FATAL ERROR: ", string if (present(rc)) print*,"- IOSTAT IS: ", rc - call mpi_abort + call mpi_abort(mpi_comm_world, 999, ierr) end subroutine error_handler