wrf-model / WPS

The official repository for the WRF Preprocessing System (WPS)
201 stars 159 forks source link

WPS compile :Syntax error in argument list #259

Open aganji2 opened 4 days ago

aganji2 commented 4 days ago

I am trying to compile WPS, but I got the error below.

==============================================================================================

Version 4.6.0

Linux nia-login02.scinet.local 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

GNU Fortran (GCC) 13.2.0 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

==============================================================================================

Compiling WPS and all utilities

make[1]: Entering directory `~/WRFmodel/WPS/geogrid/src' /bin/rm -f module_debug.o module_debug.mod /scinet/niagara/software/2019b/opt/base/gcc/13.2.0/bin/cpp -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DBIT32 -DNO_SIGNAL -D_MPI -D_GEOGRID -DUSE_JPEG2000 -DUSE_PNG -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_netcdf -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib_share -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib1 -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_int -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/inc -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/netcdf/include module_debug.F > module_debug.f90 mpif90 -ffree-form -O -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -c module_debug.f90 -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_netcdf -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib_share -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib1 -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_int -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/inc -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/netcdf/include /bin/rm -f gridinfo_module.o gridinfo_module.mod /scinet/niagara/software/2019b/opt/base/gcc/13.2.0/bin/cpp -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DBIT32 -DNO_SIGNAL -D_MPI -D_GEOGRID -DUSE_JPEG2000 -DUSE_PNG -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_netcdf -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib_share -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib1 -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_int -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/inc -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/netcdf/include gridinfo_module.F > gridinfo_module.f90 gridinfo_module.F:470:25: warning: missing terminating ' character 470 | ! If the user hasn't supplied a known_x and known_y, assume the center of domain 1 | ^ mpif90 -ffree-form -O -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -c gridinfo_module.f90 -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_netcdf -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib_share -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_grib1 -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/external/io_int -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/WPS/../WRF/inc -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/netcdf/include gridinfo_module.F:308:73:

308 | 'A valid wrf_core must be specified in the namelist. '// & | 1 Error: Syntax error in argument list at (1) gridinfo_module.F:309:21:

309 | 'Currently, only "ARW" and "NMM" are supported.') | 1 Error: Invalid character in name at (1) gridinfo_module.F:312:73:

weiwangncar commented 3 days ago

@aganji2 Did you compile WRF first?

aganji2 commented 3 days ago

Yes, I compiled for em_real (3d real case) and em_quarter_ss (3d ideal case); it was successful, and all the required exe files were generated. I copied the last part of the log file here:

build started: Sun Sep 22 20:22:49 EDT 2024 build completed: Sun Sep 22 20:24:44 EDT 2024

---> Executables successfully built <---

-rwxr-x--- 1 ganjiarm mhatzo 44406136 Sep 22 20:21 main/ideal.exe -rwxr-x--- 1 ganjiarm mhatzo 46616808 Sep 22 20:24 main/ndown.exe -rwxr-x--- 1 ganjiarm mhatzo 46756112 Sep 22 20:24 main/real.exe -rwxr-x--- 1 ganjiarm mhatzo 45908416 Sep 22 20:24 main/tc.exe -rwxr-x--- 1 ganjiarm mhatzo 55250928 Sep 22 20:22 main/wrf.exe

weiwangncar commented 3 days ago

@aganji2 I tried with gcc 13.2.0 on our system, and it compiles WPS just fine. So not sure yet what your problem is.

aganji2 commented 3 days ago

The error arises when trying to call the mprintf subroutine, specifically with the string that is being split across two lines. The continuation character & is intended to indicate that the statement continues on the next line, but the compiler is not recognizing the syntax correctly. for Example for
780 | call mprintf(.true., INFORM, 'For %s, couldn''t find interpolator sequence for '// & | 1 Error: Syntax error in argument list at (1)

Is there any flag that I have to add for compilation? I copied configure.wps here:

COMPRESSION_LIBS = -L/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/grib2/lib -ljasper -lpng -lz COMPRESSION_INC = -I/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/grib2/include FDEFS = -DUSE_JPEG2000 -DUSE_PNG SFC = gfortran SCC = gcc DM_FC = mpif90 DM_CC = mpicc FC = $(SFC) CC = $(SCC) LD = $(FC) FFLAGS = $(FORMAT_FREE) -O -fconvert=big-endian -frecord-marker=4 F77FLAGS = $(FORMAT_FIXED) -O -fconvert=big-endian -frecord-marker=4 FORMAT_FREE = -ffree-form FORMAT_FIXED = -ffixed-form FCCOMPAT = -fallow-argument-mismatch FCSUFFIX = FNGFLAGS = $(FFLAGS) LDFLAGS = CFLAGS = CPP = /usr/bin/cpp -P -traditional CPPFLAGS = -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DBIT32 -DNO_SIGNAL RANLIB = ranlib

weiwangncar commented 3 days ago

@aganji2 Which compile option did you choose when you typed 'configure'? Can you show me the option line?

aganji2 commented 3 days ago

I tested both 1 and 3: (py38WRF) ganjiarm@nia-login06:~/models/MainModel/WRFmodel/WPS$ ./configure Will use NETCDF in dir: /gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/netcdf Found what looks like a valid WRF I/O library in ../WRF Found Jasper environment variables for GRIB2 support... $JASPERLIB = /gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/grib2/lib $JASPERINC = /gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/grib2/include

Please select from among the following supported platforms.

  1. Linux x86_64, gfortran (serial)
  2. Linux x86_64, gfortran (serial_NO_GRIB2)
  3. Linux x86_64, gfortran (dmpar)
  4. Linux x86_64, gfortran (dmpar_NO_GRIB2)
  5. Linux x86_64, PGI compiler (serial)
  6. Linux x86_64, PGI compiler (serial_NO_GRIB2)
  7. Linux x86_64, PGI compiler (dmpar)
  8. Linux x86_64, PGI compiler (dmpar_NO_GRIB2)
  9. Linux x86_64, PGI compiler, SGI MPT (serial)
    1. Linux x86_64, PGI compiler, SGI MPT (serial_NO_GRIB2)
    2. Linux x86_64, PGI compiler, SGI MPT (dmpar)
    3. Linux x86_64, PGI compiler, SGI MPT (dmpar_NO_GRIB2)
    4. Linux x86_64, IA64 and Opteron (serial)
    5. Linux x86_64, IA64 and Opteron (serial_NO_GRIB2)
    6. Linux x86_64, IA64 and Opteron (dmpar)
    7. Linux x86_64, IA64 and Opteron (dmpar_NO_GRIB2)
    8. Linux x86_64, Intel oneAPI compilers (serial)
    9. Linux x86_64, Intel oneAPI compilers (serial_NO_GRIB2)
    10. Linux x86_64, Intel oneAPI compilers (dmpar)
    11. Linux x86_64, Intel oneAPI compilers (dmpar_NO_GRIB2)
    12. Linux x86_64, Intel Classic compilers (serial)
    13. Linux x86_64, Intel Classic compilers (serial_NO_GRIB2)
    14. Linux x86_64, Intel Classic compilers (dmpar)
    15. Linux x86_64, Intel Classic compilers (dmpar_NO_GRIB2)
    16. Linux x86_64, Intel Classic compilers, SGI MPT (serial)
    17. Linux x86_64, Intel Classic compilers, SGI MPT (serial_NO_GRIB2)
    18. Linux x86_64, Intel Classic compilers, SGI MPT (dmpar)
    19. Linux x86_64, Intel Classic compilers, SGI MPT (dmpar_NO_GRIB2)
    20. Linux x86_64, Intel Classic compilers, IBM POE (serial)
    21. Linux x86_64, Intel Classic compilers, IBM POE (serial_NO_GRIB2)
    22. Linux x86_64, Intel Classic compilers, IBM POE (dmpar)
    23. Linux x86_64, Intel Classic compilers, IBM POE (dmpar_NO_GRIB2)
    24. Linux x86_64 g95 compiler (serial)
    25. Linux x86_64 g95 compiler (serial_NO_GRIB2)
    26. Linux x86_64 g95 compiler (dmpar)
    27. Linux x86_64 g95 compiler (dmpar_NO_GRIB2)
    28. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial)
    29. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial_NO_GRIB2)
    30. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar)
    31. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar_NO_GRIB2)
    32. Cray XC CLE/Linux x86_64, Intel Classic compilers (serial)
    33. Cray XC CLE/Linux x86_64, Intel Classic compilers (serial_NO_GRIB2)
    34. Cray XC CLE/Linux x86_64, Intel Classic compilers (dmpar)
    35. Cray XC CLE/Linux x86_64, Intel Classic compilers (dmpar_NO_GRIB2)

Enter selection [1-44] : 3

Configuration successful. To build the WPS, type: compile

Testing for NetCDF, C and Fortran compiler

This installation NetCDF is 64-bit C compiler is 64-bit Fortran compiler is 64-bit

weiwangncar commented 3 days ago

@aganji2 Did you install the grib2 library separately from compiling WPS?

aganji2 commented 3 days ago

I installed it from

/home/m/mhatzo/ganjiarm/models/MainModel/WRFmodel/LIBRARIES/jasper-1.900.1

before WPS compiling using this command:

./configure --prefix=/gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/grib2

weiwangncar commented 3 days ago

@aganji2 Can you first do 'clean -a' to remove all built code, and then do 'configure --build-grib2-libs' ? This will build grib2/png/zlib libraries from the code included from the WPS tar file. I wonder if the newer grib2 code downloaded is newer than what we support in WPS.

aganji2 commented 3 days ago

I used the command in the WPS folder, and got the same error types for mprintf subroutine (please see below). However the number of options for compile reduced:

797 | call mprintf(.true., INFORM, 'Could not find interpolator sequence for requested resolution '// & | 1 Error: Syntax error in argument list at (1)

(py38WRF) ganjiarm@nia-login02:~/models/MainModel/WRFmodel/WPS$ ./configure --build-grib2-libs Will use NETCDF in dir: /gpfs/fs0/scratch/m/mhatzo/ganjiarm/Models/MainModel/WRFmodel/LIBRARIES/netcdf Found what looks like a valid WRF I/O library in ../WRF


The zlib, libpng, and JasPer libraries will be compiled from source and installed in /home/m/mhatzo/ganjiarm/models/MainModel/WRFmodel/WPS/grib2 .

The environment variables JASPERLIB and JASPERINC will be ignored.



Please select from among the following supported platforms.

  1. Linux x86_64, gfortran (serial)
  2. Linux x86_64, gfortran (dmpar)
  3. Linux x86_64, PGI compiler (serial)
  4. Linux x86_64, PGI compiler (dmpar)
  5. Linux x86_64, PGI compiler, SGI MPT (serial)
  6. Linux x86_64, PGI compiler, SGI MPT (dmpar)
  7. Linux x86_64, IA64 and Opteron (serial)
  8. Linux x86_64, IA64 and Opteron (dmpar)
  9. Linux x86_64, Intel oneAPI compilers (serial)
    1. Linux x86_64, Intel oneAPI compilers (dmpar)
    2. Linux x86_64, Intel Classic compilers (serial)
    3. Linux x86_64, Intel Classic compilers (dmpar)
    4. Linux x86_64, Intel Classic compilers, SGI MPT (serial)
    5. Linux x86_64, Intel Classic compilers, SGI MPT (dmpar)
    6. Linux x86_64, Intel Classic compilers, IBM POE (serial)
    7. Linux x86_64, Intel Classic compilers, IBM POE (dmpar)
    8. Linux x86_64 g95 compiler (serial)
    9. Linux x86_64 g95 compiler (dmpar)
    10. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial)
    11. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar)
    12. Cray XC CLE/Linux x86_64, Intel Classic compilers (serial)
    13. Cray XC CLE/Linux x86_64, Intel Classic compilers (dmpar)

Enter selection [1-22] : 2

Configuration successful. To build the WPS, type: compile

Testing for NetCDF, C and Fortran compiler

This installation NetCDF is 64-bit C compiler is 64-bit Fortran compiler is 64-bit

weiwangncar commented 3 days ago

@aganji2 Let's wait for others to comment.