schism-dev / schism

Semi-implicit Cross-scale Hydroscience Integrated System Model (SCHISM)
http://ccrm.vims.edu/schismweb/
Apache License 2.0
87 stars 86 forks source link

WWM Compilation fails with gfortran 11.2.1 #57

Closed jamal919 closed 1 year ago

jamal919 commented 2 years ago

Hi all,

I was trying to build SCHISM-WWM, using cmake infrastructure, using gfortran 11.2.1 - but failing. The error occurs when compiling the WWMIII/wwm_hotfile.F90. The error message is below. All of them seems to be inside MPI_PARALL_GRID, but not all blocks of MPI_PARALL_GRID are affected.

/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:405:17:

  405 |         allocate(ac2_hot_rqst(nproc-1), ac2_hot_stat(MPI_STATUS_SIZE,nproc-1), ac2_hot_type(nproc-1), stat=istat)
      |                 1
Error: Allocate-object at (1) is neither a data pointer nor an allocatable variable
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:407:17:

  407 |         allocate(var_oned_hot_rqst(nproc-1), var_oned_hot_stat(MPI_STATUS_SIZE,nproc-1), var_oned_hot_type(nproc-1), stat=istat)
      |                 1
Error: Allocate-object at (1) is neither a data pointer nor an allocatable variable
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:839:26:

  839 |         ne_write=ne_global
      |                          1
Error: Symbol ‘ne_global’ at (1) has no IMPLICIT type; did you mean ‘ne_total’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:838:26:

  838 |         np_write=np_global
      |                          1
Error: Symbol ‘np_global’ at (1) has no IMPLICIT type; did you mean ‘nf90_global’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:776:46:

  776 |       iret=nf90_def_var(ncid,"ac",NF90_RUNTYPE,(/ nfreq_dims, ndir_dims, mnp_dims, ntime_dims/),ac_id)
      |                                              1
Error: Symbol ‘nf90_runtype’ at (1) has no IMPLICIT type; did you mean ‘nf90_ebadtype’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:625:32:

  625 |         WRITE(HOTOUT%FHNDL) IPLG
      |                                1
Error: Symbol ‘iplg’ at (1) has no IMPLICIT type; did you mean ‘ip’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:562:40:

  562 |         ALLOCATE(ACinB(MSC,MDC,NP_GLOBAL), VAR_ONED_B(nbOned, NP_GLOBAL), stat=istat)
      |                                        1
Error: Symbol ‘np_global’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:447:62:

  447 |           call mpi_waitall(nproc-1, ac2_hot_rqst, ac2_hot_stat,ierr)
      |                                                              1
Error: Symbol ‘ac2_hot_stat’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:440:75:

  440 |           call mpi_irecv(ACreturn,1,ac2_hot_type(iProc-1),iProc-1,8123,comm,ac2_hot_rqst(iProc-1),ierr)
      |                                                                           1
Error: Symbol ‘comm’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:440:102:

  440 |           call mpi_irecv(ACreturn,1,ac2_hot_type(iProc-1),iProc-1,8123,comm,ac2_hot_rqst(iProc-1),ierr)
      |                                                                                                      1
Error: Symbol ‘ierr’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:437:43:

  437 |         allocate(ACreturn(MSC,MDC,np_global), stat=istat)
      |                                           1
Error: Symbol ‘np_global’ at (1) has no IMPLICIT type; did you mean ‘ipglob’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:439:24:

  439 |         DO iProc=2,nproc
      |                        1
Error: Symbol ‘nproc’ at (1) has no IMPLICIT type; did you mean ‘iproc’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:450:48:

  450 |         CALL MPI_SEND(AC2, MSC*MDC*NP_RES, rtype, 0, 8123, comm, ierr)
      |                                                1
Error: Symbol ‘rtype’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:464:70:

  464 |           call mpi_waitall(nproc-1,var_oned_hot_rqst,var_oned_hot_stat,ierr)
      |                                                                      1
Error: Symbol ‘var_oned_hot_stat’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:418:101:

  418 |           call mpi_type_create_indexed_block(MNPloc,MSC*MDC,dspl_ac,rtype,ac2_hot_type(iProc-1), ierr)
      |                                                                                                     1
Error: Symbol ‘ierr’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:397:32:

  397 |       integer :: ListFirst(nproc)
      |                                1
Error: Symbol ‘nproc’ at (1) has no IMPLICIT type; did you mean ‘iproc’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:418:73:

  418 |           call mpi_type_create_indexed_block(MNPloc,MSC*MDC,dspl_ac,rtype,ac2_hot_type(iProc-1), ierr)
      |                                                                         1
Error: Symbol ‘rtype’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:240:25:

  240 |       IF (nbProc.eq.nproc) THEN
      |                         1
Error: Symbol ‘nproc’ at (1) has no IMPLICIT type; did you mean ‘iproc’?
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:662:58:

  662 |           iret=nf90_get_var(ncid,ac_id,ACLOC, start=(/1,1,iplg(IP),IHOTPOS_IN/), count = (/MSC, MDC, 1, 1 /))
      |                                                          1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:668:63:

  668 |           iret=nf90_get_var(ncid,var_oned_id,VARLOC, start=(/1,iplg(IP),IHOTPOS_IN/), count = (/nbOned, 1, 1 /))
      |                                                               1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:245:30:

  245 |             eDiff=eDiff + abs(IPLG(IP) - IPLGtot(IP))
      |                              1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:259:16:

  259 |         eStatus(IPLG(IP))=IP
      |                1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:566:32:

  566 |           AC2(:,:,IP)=ACinB(:,:,iplg(IP))
      |                                1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:567:38:

  567 |           VAR_ONED(:,IP)=VAR_ONED_B(:,iplg(IP))
      |                                      1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:419:31:

  419 |           call mpi_type_commit(ac2_hot_type(iProc-1), ierr)
      |                               1
Error: Function ‘ac2_hot_type’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:421:31:

  421 |           call mpi_type_commit(var_oned_hot_type(iProc-1), ierr)
      |                               1
Error: Function ‘var_oned_hot_type’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:440:36:

  440 |           call mpi_irecv(ACreturn,1,ac2_hot_type(iProc-1),iProc-1,8123,comm,ac2_hot_rqst(iProc-1),ierr)
      |                                    1
Error: Function ‘ac2_hot_type’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:443:17:

  443 |           IPglob=iplg(IP)
      |                 1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:457:42:

  457 |           call mpi_irecv(VAR_ONEDreturn,1,var_oned_hot_type(iProc-1),iProc-1,8124,comm,var_oned_hot_rqst(iProc-1),ierr)
      |                                          1
Error: Function ‘var_oned_hot_type’ at (1) has no IMPLICIT type
/home/khan/Models/schism/src/WWMIII/wwm_hotfile.F90:460:17:

  460 |           IPglob=iplg(IP)
      |                 1
Error: Function ‘iplg’ at (1) has no IMPLICIT type
make[2]: *** [WWMIII/CMakeFiles/wwmIII.dir/build.make:296: WWMIII/CMakeFiles/wwmIII.dir/wwm_hotfile.F90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:550: WWMIII/CMakeFiles/wwmIII.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

To note: it compiles fine under Ubuntu 20.04, gfortran 9.3.0 - see #53.

The current test system is following -

Fotran : gcc-gfortran v11.2.1 Message passing : mpich v3.4.1 OS Fedora 35

Any idea? Thanks.

jamal919 commented 1 year ago

As it turns out, the problem was on my part as I was doing a mix use of the Make and CMake build system, and few 'garbage' file that were created in the src directory was causing the problem. I am closing this issue.