noaa-ocs-modeling / CoastalApp

CoastalApp will be deprecated. Please switch to https://github.com/oceanmodeling/ufs-coastal . CoastalApp is a NUOPC application implemented following UFS best practices to couple coastal ocean models and other domains (Sea Ice, Atmosphere, Wave, Inland Hydrology, ...)
https://github.com/oceanmodeling/ufs-coastal
Creative Commons Zero v1.0 Universal
13 stars 32 forks source link

ADCIRC fails with gfortran on arm-darwin #161

Closed platipodium closed 1 year ago

platipodium commented 1 year ago

When compiling with gfortran (on arm-darwin), ADCIRC fails:

/opt/conda/envs/schism/bin/mpifort -DADCNETCDF -I/opt/conda/envs/schism/include -DHAVE_NETCDF4 -DNETCDF_CAN_DEFLATE -DADCNETCDF -I/opt/conda/envs/schism/include -DHAVE_NETCDF4 -DNETCDF_CAN_DEFLATE -c  -DADCNETCDF -I/opt/conda/envs/schism/include -DHAVE_NETCDF4 -DNETCDF_CAN_DEFLATE -DREAL8 -DCSCA -DLINUX -DCMPI -DNETCDF_DEBUG -I /Users/Lemmen/devel/noaa/CoastalApp/ADCIRC/work/odircp/ -o /Users/Lemmen/devel/noaa/CoastalApp/ADCIRC/work/odircp/sizes.o  /Users/Lemmen/devel/noaa/CoastalApp/ADCIRC/src/sizes.F
/Users/Lemmen/devel/noaa/CoastalApp/ADCIRC/src/sizes.F:257:42:

  257 |      &                  cmdlinearg(1:4),"' is not valid and will be ignored."
      |                                          1
Error: Unterminated character constant beginning at (1)
platipodium commented 1 year ago

Fixed by adding -ffixed-line-length-none to FFLAGS1

platipodium commented 1 year ago

BTW: this is the updated cmplflags.mk within ADCIRC

########################################################################
# arm-apple-darwin22.3.0 using conda

ifneq (,$(findstring arm-darwin,$(MACHINE)-$(OS)))
  DA        :=  -DREAL8 -DCSCA -DLINUX
  DP        :=  -DREAL8 -DCSCA -DLINUX -DCMPI -DNETCDF_DEBUG
  DPRE      :=  -DREAL8 -DLINUX
  IMODS     :=  -I
  FFLAGS1   :=  $(FFLAGS1) $(INCDIRS) -O2 -ffixed-line-length-none -m64
  FFLAGS2   :=  $(FFLAGS1)
  FFLAGS3   :=  $(FFLAGS1)

  CCBE          :=  $(CC)
  CFLAGS        :=  $(CFLAGS) $(INCDIRS) -O3 -DLINUX
  $(warning (INFO) Corresponding machine found in cmplrflags.mk.)
  ifneq ($(FOUND),TRUE)
     FOUND := TRUE
  else
     MULTIPLE := TRUE
  endif
endif
########################################################################