ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 107 forks source link

Syntax error in mpi_abort calls #140

Closed DusanJovic-NOAA closed 4 years ago

DusanJovic-NOAA commented 4 years ago

Compiling UFS_UTILS using latest gnu compiler fails with this error:

[ 87%] Building Fortran object sorc/chgres_cube.fd/CMakeFiles/chgres_cube.dir/utils.f90.o
/home/builder/simple-ufs/src/preproc/sorc/chgres_cube.fd/utils.f90:31:36:

   31 |  call mpi_abort(mpi_comm_world, 999)
      |                                    1
Error: More actual than formal arguments in procedure call at (1)

Subroutine mpi_abort requires three arguments. These are all mpi_abort calls in UfS_UTILS:

$ grep -i -r mpi_abort 
sorc/fre-nctools.fd/shared_lib/mosaic_util.c:  MPI_Abort(MPI_COMM_WORLD, -1);
sorc/fre-nctools.fd/shared_lib/mpp.c:  MPI_Abort(MPI_COMM_WORLD, -1);
sorc/sfc_climo_gen.fd/search.f90:     call mpi_abort(mpi_comm_world, 77, ierr)
sorc/sfc_climo_gen.fd/output.f90:     call mpi_abort(mpi_comm_world, 67)
sorc/sfc_climo_gen.fd/utils.f90: call mpi_abort(mpi_comm_world, 999)
sorc/sfc_climo_gen.fd/utils.f90: call mpi_abort
sorc/sfc_climo_gen.fd/interp.F90:     call mpi_abort(mpi_comm_world, 57)
sorc/sfc_climo_gen.fd/program_setup.f90: call mpi_abort(mpi_comm_world, 10, ierr)
sorc/sfc_climo_gen.fd/program_setup.f90: call mpi_abort(mpi_comm_world, 11, ierr)
sorc/sfc_climo_gen.fd/model_grid.F90:   call mpi_abort
sorc/global_cycle.fd/read_write_data.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 130)
sorc/global_cycle.fd/read_write_data.f90: CALL MPI_ABORT(MPI_COMM_WORLD, 999)
sorc/global_cycle.fd/read_write_data.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 88)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 121)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 121)
sorc/global_cycle.fd/read_write_data.f90:    CALL MPI_ABORT(MPI_COMM_WORLD, 122)
sorc/global_cycle.fd/cycle.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 12)
sorc/chgres_cube.fd/utils.f90: call mpi_abort
sorc/chgres_cube.fd/utils.f90: call mpi_abort(mpi_comm_world, 999)
sorc/chgres_cube.fd/search_util.f90:     call mpi_abort(mpi_comm_world, 77, ierr)

Many of these (fortran) calls that do not have 3 actual arguments should be fixed.

climbfuji commented 4 years ago

A workaround for this is the -fallow-argument-mismatch option that we have been adding to many of the NCEPLIBS-*.

DusanJovic-NOAA commented 4 years ago

In this case I think these errors should be fixed, rather than ignored by adding that flag. That workaround was necessary when we couldn't change the library code to accept different type/kind of arguments (by writing generic subroutines, for example). That's not the case here.

climbfuji commented 4 years ago

In this case I think these errors should be fixed, rather than ignored by adding that flag. That workaround was necessary when we couldn't change the library code to accept different type/kind of arguments (by writing generic subroutines, for example). That's not the case here.

Agree, just saying what you can do if you need to use the library right now with gfortran-10.

GeorgeGayno-NOAA commented 4 years ago

Will work under this branch: https://github.com/GeorgeGayno-NOAA/UFS_UTILS/tree/feature/mpi_abort

GeorgeGayno-NOAA commented 4 years ago

Compiling UFS_UTILS using latest gnu compiler fails with this error:

[ 87%] Building Fortran object sorc/chgres_cube.fd/CMakeFiles/chgres_cube.dir/utils.f90.o
/home/builder/simple-ufs/src/preproc/sorc/chgres_cube.fd/utils.f90:31:36:

   31 |  call mpi_abort(mpi_comm_world, 999)
      |                                    1
Error: More actual than formal arguments in procedure call at (1)

Subroutine mpi_abort requires three arguments. These are all mpi_abort calls in UfS_UTILS:

$ grep -i -r mpi_abort 
sorc/fre-nctools.fd/shared_lib/mosaic_util.c:  MPI_Abort(MPI_COMM_WORLD, -1);
sorc/fre-nctools.fd/shared_lib/mpp.c:  MPI_Abort(MPI_COMM_WORLD, -1);
sorc/sfc_climo_gen.fd/search.f90:     call mpi_abort(mpi_comm_world, 77, ierr)
sorc/sfc_climo_gen.fd/output.f90:     call mpi_abort(mpi_comm_world, 67)
sorc/sfc_climo_gen.fd/utils.f90: call mpi_abort(mpi_comm_world, 999)
sorc/sfc_climo_gen.fd/utils.f90: call mpi_abort
sorc/sfc_climo_gen.fd/interp.F90:     call mpi_abort(mpi_comm_world, 57)
sorc/sfc_climo_gen.fd/program_setup.f90: call mpi_abort(mpi_comm_world, 10, ierr)
sorc/sfc_climo_gen.fd/program_setup.f90: call mpi_abort(mpi_comm_world, 11, ierr)
sorc/sfc_climo_gen.fd/model_grid.F90:   call mpi_abort
sorc/global_cycle.fd/read_write_data.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 130)
sorc/global_cycle.fd/read_write_data.f90: CALL MPI_ABORT(MPI_COMM_WORLD, 999)
sorc/global_cycle.fd/read_write_data.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 88)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 121)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 121)
sorc/global_cycle.fd/read_write_data.f90:    CALL MPI_ABORT(MPI_COMM_WORLD, 122)
sorc/global_cycle.fd/cycle.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 12)
sorc/chgres_cube.fd/utils.f90: call mpi_abort
sorc/chgres_cube.fd/utils.f90: call mpi_abort(mpi_comm_world, 999)
sorc/chgres_cube.fd/search_util.f90:     call mpi_abort(mpi_comm_world, 77, ierr)

Many of these (fortran) calls that do not have 3 actual arguments should be fixed.

@DusanJovic-NOAA Two of the routines you list are 'c' code. Do they need to be changed? I.e.,:

int ierr;
ierr = MPI_Abort(MPI_COMM_WORLD), -1);
DusanJovic-NOAA commented 4 years ago

Compiling UFS_UTILS using latest gnu compiler fails with this error:

[ 87%] Building Fortran object sorc/chgres_cube.fd/CMakeFiles/chgres_cube.dir/utils.f90.o
/home/builder/simple-ufs/src/preproc/sorc/chgres_cube.fd/utils.f90:31:36:

   31 |  call mpi_abort(mpi_comm_world, 999)
      |                                    1
Error: More actual than formal arguments in procedure call at (1)

Subroutine mpi_abort requires three arguments. These are all mpi_abort calls in UfS_UTILS:

$ grep -i -r mpi_abort 
sorc/fre-nctools.fd/shared_lib/mosaic_util.c:  MPI_Abort(MPI_COMM_WORLD, -1);
sorc/fre-nctools.fd/shared_lib/mpp.c:  MPI_Abort(MPI_COMM_WORLD, -1);
sorc/sfc_climo_gen.fd/search.f90:     call mpi_abort(mpi_comm_world, 77, ierr)
sorc/sfc_climo_gen.fd/output.f90:     call mpi_abort(mpi_comm_world, 67)
sorc/sfc_climo_gen.fd/utils.f90: call mpi_abort(mpi_comm_world, 999)
sorc/sfc_climo_gen.fd/utils.f90: call mpi_abort
sorc/sfc_climo_gen.fd/interp.F90:     call mpi_abort(mpi_comm_world, 57)
sorc/sfc_climo_gen.fd/program_setup.f90: call mpi_abort(mpi_comm_world, 10, ierr)
sorc/sfc_climo_gen.fd/program_setup.f90: call mpi_abort(mpi_comm_world, 11, ierr)
sorc/sfc_climo_gen.fd/model_grid.F90:   call mpi_abort
sorc/global_cycle.fd/read_write_data.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 130)
sorc/global_cycle.fd/read_write_data.f90: CALL MPI_ABORT(MPI_COMM_WORLD, 999)
sorc/global_cycle.fd/read_write_data.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 88)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 121)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 111)
sorc/global_cycle.fd/read_write_data.f90:     CALL MPI_ABORT(MPI_COMM_WORLD, 121)
sorc/global_cycle.fd/read_write_data.f90:    CALL MPI_ABORT(MPI_COMM_WORLD, 122)
sorc/global_cycle.fd/cycle.f90:   CALL MPI_ABORT(MPI_COMM_WORLD, 12)
sorc/chgres_cube.fd/utils.f90: call mpi_abort
sorc/chgres_cube.fd/utils.f90: call mpi_abort(mpi_comm_world, 999)
sorc/chgres_cube.fd/search_util.f90:     call mpi_abort(mpi_comm_world, 77, ierr)

Many of these (fortran) calls that do not have 3 actual arguments should be fixed.

@DusanJovic-NOAA Two of the routines you list are 'c' code. Do they need to be changed? I.e.,:

int ierr;
ierr = MPI_Abort(MPI_COMM_WORLD), -1);

No. Only Fortran call statements.

GeorgeGayno-NOAA commented 4 years ago

@DusanJovic-NOAA All the mpi_abort calls have been fixed. Please test the branch when you are ready.

GeorgeGayno-NOAA commented 4 years ago

The branch at 5ee4825 was compiled on Jet, Orion, Hera, WCOSS-Dell and WCOSS-Cray. The grid generation, global cycle and chgres_cube regression tests all passed. Will submit a pull request.

Note, some changes being worked under issue #147.

GeorgeGayno-NOAA commented 4 years ago

Merged to 'develop' at d29cc35. Closing ticket.