Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

WPS compiling problem

anelito

New member
I work in Ubuntu 24.04.1 LTS, 64bits

Trying to compile WPS-4.3 after a successfully WRF-4.3 installation I got this error:

/usr/bin/ld: int2nc.o: en la función `MAIN__':
int2nc.f90:(.text+0x23d3): undefined reference to `nf_close_'
collect2: error: ld returned 1 exit status
make[1]: [Makefile:76: int2nc.exe] Error 1 (no tiene efecto)
make[1]: se sale del directorio '/home/a/W2/WPS-4.3/util/src'

I do this:
tar xzvf WPS-4.3.tar.gz
cd WPS-4.3/
./clean
export WRF_DIR=/home/a/W2/WRF-4.3
#./configure
echo 3 | ./configure

All Ok up to this point and when I try:
logsave compile.log ./compile

I got the error mentioned bellow.

I attach the wps compile log and configure.wps files.

What should I do to fix this problem?

Thanks in advance
 

Attachments

  • configure.wps
    3.3 KB · Views: 2
  • compile.log
    207.5 KB · Views: 3
usually this error occurs when either netcdf wasn't installed properly or the exports to the file location wasn't exported.
How can I know if netcdf was installed properly if I got a successfull instalation message? What should I check?

How can I know if the exports to the file location was exported successfully? What should I check?

In the next post I show how I install the libs:
netcdf-fortran configure error

Could you help me please?
Thanks in advance
 
How can I know if netcdf was installed properly if I got a successfull instalation message? What should I check?

How can I know if the exports to the file location was exported successfully? What should I check?

In the next post I show how I install the libs:
netcdf-fortran configure error

Could you help me please?
Thanks in advance
I can't really explain in depth because it would take a long time. But there is a website that walks you though all the steps and tests to install WRF hosted by NCAR.

 
did you remember to do the exports?
I did.
I did.

Previously I installed/updated all these packages:

sudo apt-get install build-essential csh gfortran m4 curl perl libopenmpi-dev libhdf5-openmpi-dev libpng-dev netcdf-bin libnetcdff-dev

then using the next script I installed the libraries:



#!/bin/bash

export DIR=$(pwd)
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran
export FFLAGS="-fallow-argument-mismatch -m64"
export FCFLAGS="-fallow-argument-mismatch -m64"
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
export LDFLAGS=-L$DIR/grib2/lib:-L$DIR/netcdf/lib
export CPPFLAGS=-I$DIR/grib2/include:-I$DIR/netcdf/include
export LD_LIBRARY_PATH=$DIR/grib2/lib:$LD_LIBRARY_PATH
echo "Rutas establecidas"

tar xzvf netcdf-c-4.9.2.tar.gz
cd netcdf-c-4.9.2
./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared
make
make install
export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
cd ..
echo "netcdf-c-4.9.2 instalado"

export LIBS="-lnetcdf"
tar xzvf netcdf-fortran-4.6.1.tar.gz
cd netcdf-fortran-4.6.1
./configure --prefix=$DIR/netcdf --disable-shared
make
make install
export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
cd ..
echo "netcdf-fortran-4.6.1 instalado"

tar xzvf mpich-4.2.3.tar.gz
cd mpich-4.2.3
export FFLAGS=-fallow-argument-mismatch
./configure --prefix=$DIR/mpich
#./configure --prefix=$DIR/mpich --with-device=ch3:nemesis --enable-fast=all,O3 --disable-float --enable-threads=multiple
make
make install
export PATH=$DIR/mpich/bin:$PATH
cd ..
echo "mpich-4.2.3 instalado"

#zlib1g en synaptic
tar xzvf zlib-1.3.1.tar.gz #or just .tar if no .gz present
cd zlib-1.3.1
./configure --prefix=$DIR/grib2
make
make install
cd ..
echo "zlib-1.3.1 instalado"

#anntes en synaptic
tar xzvf libpng-1.2.50.tar.gz #or just .tar if no .gz present
cd libpng-1.2.50
./configure --prefix=$DIR/grib2
make
make install
cd ..
echo "libpng-1.2.50 instalado"

tar xzvf jasper-1.900.1.tar.gz #or just .tar if no .gz present
cd jasper-1.900.1
./configure --prefix=$DIR/grib2
make
make install
cd ..
echo "jasper-1.900.1 instalado"

exec bash
exit
Then I install WRF
tar xzvf WRF-4.3.tar.gz
cd WRF-4.3
export NETCDF_classic=1
( echo 34 ; echo 1 ) | ./configure
sed -i 's/-DBUILD_RRTMG_FAST=0/-DBUILD_RRTMG_FAST=1/g' configure.wrf
sed -i 's# -L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz#-lnetcdff -lnetcdf#g' configure.wrf
logsave compile.log ./compile em_real
cd ..

and then I call to the WPS script below and I got the error mentioned.

any idea? Please,
thanks in advance,
 
I did.

Previously I installed/updated all these packages:



then using the next script I installed the libraries:




Then I install WRF


and then I call to the WPS script below and I got the error mentioned.

any idea? Please,
thanks in advance,
you need to export the WRF Directory after installing WRF

WRF_DIR = (path/to/WRF-4.3)

Then run the wps install


HTML:
After the WRF model is built, the next step is building the WPS program (if you plan to run real cases, as opposed to idealized cases). The WRF model MUST be properly built prior to trying to build the WPS programs. You can obtain the WPS code by following the same directions for obtaining WRF.

Go into the WPS directory:
cd WPS
Similar to the WRF model, make sure the WPS directory is clean, by issuing:
./clean
The next step is to configure WPS, however, you first need to set some paths for the ungrib libraries:
setenv JASPERLIB $DIR/grib2/lib

setenv JASPERINC $DIR/grib2/include
and then you can configure:
./configure
You should be given a list of various options for compiler types, whether to compile in serial or parallel, and whether to compile ungrib with GRIB2 capability. Unless you plan to create extremely large domains, it is recommended to compile WPS in serial mode, regardless of whether you compiled WRF in parallel. It is also recommended that you choose a GRIB2 option (make sure you do not choose one that states "NO_GRIB2"). You may choose a non-grib2 option, but most data is now in grib2 format, so it is best to choose this option. You can still run grib1 data when you have built with grib2.

Choose the option that lists a compiler to match what you used to compile WRF, serial, and grib2. **Note: The option number will likely be different than the number you chose to compile WRF

the metgrid.exe and geogrid.exe programs rely on the WRF model's I/O libraries. There is a line in the configure.wps file that directs the WPS build system to the location of the I/O libraries from the WRF model:
WRF_DIR = ../WRF
Above is the default setting. As long as the name of the WRF model's top-level directory is "WRF" and the WPS and WRF directories are at the same level (which they should be if you have followed exactly as instructed on this page so far), then the existing default setting is correct and there is no need to change it. If it is not correct, you must modify the configure file and then save the changes before compiling.

You can now compile WPS:
./compile >& log.compile
Compilation should only take a few minutes.

If the compilation is successful, there should be 3 executables in the WPS top-level directory, that are linked to their corresponding src/ directories:
geogrid.exe -> geogrid/src/geogrid.exe
ungrib.exe -> ungrib/src/ungrib.exe
metgrid.exe -> metgrid/src/metgrid.exe
Verify that they are not zero-sized (inside the */src/ directory). To see file size, you can type (for e.g.,):
ls -ls geogrid/src/geogrid.exe
 
@anelito

The first error I see in your WPS compile log is

Code:
parallel_module.f90:922:24:

  922 |          call MPI_Bcast(rval, 1, MPI_REAL, from_whom, comm, mpi_ierr)
      |                        1
......
  948 |          call MPI_Bcast(cval, n, MPI_CHARACTER, from_whom, comm, mpi_ierr)
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/CHARACTER(*)).
parallel_module.f90:924:24:

  924 |          call MPI_Bcast(rval, 1, MPI_REAL, IO_NODE, comm, mpi_ierr)
      |                        1
......
  948 |          call MPI_Bcast(cval, n, MPI_CHARACTER, from_whom, comm, mpi_ierr)
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/CHARACTER(*)).

1) Did you make any modifications to the WPS code, or are you compiling a clean "out-of-the-box" version?

2) I also notice you say you're compiling WPSV4.3, but the compile log says V4.2. I just want to make sure you sent the right log, and that you're compiling the version you expect to be building.
 
1) I Did not any modifications to the WPS code and I dont nkow what clean "out-of-the-box" version is.

2) I downloaded WPS-4.3.tar.gz from:
How can I know if this is the correct version to work with WRF-4.3?

How can I fix the Type mismatch error you pointed out?

thanks,
 
@anelito

The first error I see in your WPS compile log is

Code:
parallel_module.f90:922:24:

  922 |          call MPI_Bcast(rval, 1, MPI_REAL, from_whom, comm, mpi_ierr)
      |                        1
......
  948 |          call MPI_Bcast(cval, n, MPI_CHARACTER, from_whom, comm, mpi_ierr)
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/CHARACTER(*)).
parallel_module.f90:924:24:

  924 |          call MPI_Bcast(rval, 1, MPI_REAL, IO_NODE, comm, mpi_ierr)
      |                        1
......
  948 |          call MPI_Bcast(cval, n, MPI_CHARACTER, from_whom, comm, mpi_ierr)
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/CHARACTER(*)).

1) Did you make any modifications to the WPS code, or are you compiling a clean "out-of-the-box" version?

2) I also notice you say you're compiling WPSV4.3, but the compile log says V4.2. I just want to make sure you sent the right log, and that you're compiling the version you expect to be building.
you need to export the WRF Directory after installing WRF

WRF_DIR = (path/to/WRF-4.3)

Then run the wps install


HTML:
After the WRF model is built, the next step is building the WPS program (if you plan to run real cases, as opposed to idealized cases). The WRF model MUST be properly built prior to trying to build the WPS programs. You can obtain the WPS code by following the same directions for obtaining WRF.

Go into the WPS directory:
cd WPS
Similar to the WRF model, make sure the WPS directory is clean, by issuing:
./clean
The next step is to configure WPS, however, you first need to set some paths for the ungrib libraries:
setenv JASPERLIB $DIR/grib2/lib

setenv JASPERINC $DIR/grib2/include
and then you can configure:
./configure
You should be given a list of various options for compiler types, whether to compile in serial or parallel, and whether to compile ungrib with GRIB2 capability. Unless you plan to create extremely large domains, it is recommended to compile WPS in serial mode, regardless of whether you compiled WRF in parallel. It is also recommended that you choose a GRIB2 option (make sure you do not choose one that states "NO_GRIB2"). You may choose a non-grib2 option, but most data is now in grib2 format, so it is best to choose this option. You can still run grib1 data when you have built with grib2.

Choose the option that lists a compiler to match what you used to compile WRF, serial, and grib2. **Note: The option number will likely be different than the number you chose to compile WRF

the metgrid.exe and geogrid.exe programs rely on the WRF model's I/O libraries. There is a line in the configure.wps file that directs the WPS build system to the location of the I/O libraries from the WRF model:
WRF_DIR = ../WRF
Above is the default setting. As long as the name of the WRF model's top-level directory is "WRF" and the WPS and WRF directories are at the same level (which they should be if you have followed exactly as instructed on this page so far), then the existing default setting is correct and there is no need to change it. If it is not correct, you must modify the configure file and then save the changes before compiling.

You can now compile WPS:
./compile >& log.compile
Compilation should only take a few minutes.

If the compilation is successful, there should be 3 executables in the WPS top-level directory, that are linked to their corresponding src/ directories:
geogrid.exe -> geogrid/src/geogrid.exe
ungrib.exe -> ungrib/src/ungrib.exe
metgrid.exe -> metgrid/src/metgrid.exe
Verify that they are not zero-sized (inside the */src/ directory). To see file size, you can type (for e.g.,):
ls -ls geogrid/src/geogrid.exe
I did:
export WRF_DIR=/home/a/W2/WRF-4.3

in the code of the first message I show it.

I followed all the instructions you shared: ./clean, etc.
thanks
 
I did:
export WRF_DIR=/home/a/W2/WRF-4.3

in the code of the first message I show it.

I followed all the instructions you shared: ./clean, etc.
thanks
The only way I know how to fix this is this method:


But @kwerner may know of a different way
 
The only way I know how to fix this is this method:


But @kwerner may know of a different way
Following your advice I did before I try to install WPS:
export FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz -m64"
export FCFLAGS="-fallow-argument-mismatch -fallow-invalid-boz -m64"
Following WRF-MOSIT script I changed mine rearranging it like this:
#!/bin/bash

export DIR=$(pwd)
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran

#############################zlib############################
tar xzvf zlib-1.3.1.tar.gz #or just .tar if no .gz present
cd zlib-1.3.1
./configure --prefix=$DIR/grib2
make
make install
cd ..
echo "zlib-1.3.1 instalado"
##############################MPICH############################
export FFLAGS=-fallow-argument-mismatch
export FCFLAGS=-fallow-argument-mismatch
tar xzvf mpich-4.2.3.tar.gz
cd mpich-4.2.3
./configure --prefix=$DIR/mpich --with-device=ch3
make
make install
export PATH=$DIR/mpich/bin:$PATH
cd ..
echo "mpich-4.2.3 instalado"
#############################libpng############################
export LDFLAGS=-L$DIR/grib2/lib
export CPPFLAGS=-I$DIR/grib2/include
export FFLAGS="-fallow-argument-mismatch -m64"
export FCFLAGS="-fallow-argument-mismatch -m64"
tar xzvf libpng-1.2.50.tar.gz #or just .tar if no .gz present
cd libpng-1.2.50
./configure --prefix=$DIR/grib2
make
make install
cd ..
echo "libpng-1.2.50 instalado"
#############################JasPer############################
tar xzvf jasper-1.900.1.tar.gz #or just .tar if no .gz present
cd jasper-1.900.1
./configure --prefix=$DIR/grib2
make
make install
cd ..
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
echo "jasper-1.900.1 instalado"
##############################Install NETCDF C Library############################
tar xzvf netcdf-c-4.9.2.tar.gz
cd netcdf-c-4.9.2
export LIBS="-lz -lcurl -lgfortran -lgcc -lm -ldl"
./configure --enable-shared --enable-netcdf4 --disable-dap --enable-netcdf-4 --prefix=$DIR/netcdf --disable-hdf5
make
make install
cd ..
export PATH=$DIR/NETCDF/bin:$PATH
export NETCDF=$DIR/NETCDF
echo "netcdf-c-4.9.2 instalado"
##############################NetCDF fortran library############################
export LD_LIBRARY_PATH=$DIR/NETCDF/lib:$LD_LIBRARY_PATH
export LIBS="-lnetcdf -lcurl -lz -lm -ldl -lgcc -lgfortran"
export CPPFLAGS="-I$DIR/NETCDF/include -I$DIR/grib2/include"
export LDFLAGS="-L$DIR/NETCDF/lib -L$DIR/grib2/lib"
tar xzvf netcdf-fortran-4.6.1.tar.gz
cd netcdf-fortran-4.6.1
./configure --prefix=$DIR/NETCDF --enable-netcdf-4 --enable-netcdf4 --enable-shared --enable-hdf5
make
make install
cd ..
echo "netcdf-fortran-4.6.1 instalado"
cd ..
#WRF******************************************************
tar xzvf WRF-4.3.tar.gz
cd WRF-4.3
export NETCDF_classic=1
( echo 34 ; echo 1 ) | ./configure
sed -i 's# -L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz#-lnetcdff -lnetcdf#g' configure.wrf
logsave compile.log ./compile em_real
cd ..
#WPS
export FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz -m64"
export FCFLAGS="-fallow-argument-mismatch -fallow-invalid-boz -m64"
tar xzvf WPS-4.3.tar.gz
cd WPS-4.3/
./clean
export WRF_DIR=/home/a/W1/WRF-4.3
echo 3 | ./configure
logsave compile.log ./compile
cd ..

exec bash
exit
And I got the same error:
671 | CALL SBYTE (IFOVAL,NMIN,IFOPTR,KBDS(11))
| 2
......
794 | CALL SBYTE (BDS11,LENBDS,0,24)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(1)/INTEGER(4)).
w3fi75.f:796:18:

671 | CALL SBYTE (IFOVAL,NMIN,IFOPTR,KBDS(11))
| 2
......
796 | CALL SBYTE (BDS11,IBDSFL(1),24,1)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(1)/INTEGER(4)).
w3fi75.f:797:18:

Any other idea, please?
Thanks in advance
 
Last edited:
Top