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

Cannot compile ARWpost (successful configuration, but compilation has errors and no ARWpost.exe file is created)

beuraieon_a

Member
Hello, I need help in compiling ARWpost. I followed the instructions in WRF Model Updates. I chose "PC Linux i486 i586 i686 x86_64, gfortran compiler" and the configuration went smoothly. I checked my NetCDF's directory using "echo $NETCDF" and it returned with "/usr", the same directory during configuration. But I got stuck at compilation: when I enter "./compile", the compilation had errors and ARWpost.exe was not created. Here's the log.compile of the compilation process for your reference. Thank you very much in advance.
Screenshot from 2023-10-23 23-01-23.png
Screenshot from 2023-10-23 23-01-36.png
 
Apparently, the log.compile file failed to be attached in the original post, so here it is in txt format. Once again, thank you in advance for your help.
 

Attachments

  • log.compile.txt
    14.3 KB · Views: 9
Hi,
The error in your compile log is

Code:
gfortran -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4  -I/usr/include -c module_get_file_names.f
module_get_file_names.f:1:2:

    1 | /* Copyright (C) 1991-2022 Free Software Foundation, Inc.
      |  1
Error: Invalid character in name at (1)

Take a look at this previous post, which discusses the error you are seeing, and see if their solution works for you.
 
Hello, Sir. I have done the suggested troubleshoot strategies in "ARWpost compilation error", but all of them failed. Here are the attached compile logs for your perusal:
1. compile2 - for CPP = /lib/cpp -P -traditional
2. compile3 - for CPP = /lib/cpp -C -P -nostdinc
3. compile4 - for -L$(NETCDF)/lib -I$(NETCDF)/include -lnetcdff -lnetcdf in Makefile and CPP = /lib/cpp -P -traditional
Also, I have checked that the netCDF path (when I enter echo $NETCDF) is "/usr". My gcc is version 11.4.0 and my GNU Fortran is version 11.4.0.

Thank you in advance for your advice and recommendations.
 

Attachments

  • compile2.txt
    10.6 KB · Views: 3
  • compile3.txt
    12.1 KB · Views: 3
  • compile4.txt
    10.6 KB · Views: 4
Hello, I also tried configuring and compiling ARWpost using the following snippet from this precoded WRF building script (which I revised to reflect the actual paths in my computer):
Code:
  ######################## ARWpost V3.1  ############################
  ## ARWpost
  ##Configure #3
  ###################################################################
  cd /home/brianwrf/Build_WRF/WRF-4.5.1-ARW/Downloads
  wget -c http://www2.mmm.ucar.edu/wrf/src/ARWpost_V3.tar.gz
  tar -xvzf ARWpost_V3.tar.gz -C /home/brianwrf/Build_WRF/WRF-4.5.1-ARW/
  cd /home/brianwrf/Build_WRF/WRF-4.5.1-ARW/ARWpost
  ./clean -a
  sed -i -e 's/-lnetcdf/-lnetcdff -lnetcdf/g' /home/brianwrf/Build_WRF/WRF-4.5.1-ARW/ARWpost/src/Makefile
  export NETCDF=$DIR/NETCDF


  if [ ${auto_config} -eq 1 ]
    then
      echo 3 | ./configure  #Option 3 gfortran compiler with distributed memory
    else
      ./configure  #Option 3 gfortran compiler with distributed memory
  fi


  export GCC_VERSION=$(/usr/bin/gcc -dumpfullversion | awk '{print$1}')
  export GFORTRAN_VERSION=$(/usr/bin/gfortran -dumpfullversion | awk '{print$1}')
  export GPLUSPLUS_VERSION=$(/usr/bin/g++ -dumpfullversion | awk '{print$1}')

  export GCC_VERSION_MAJOR_VERSION=$(echo $GCC_VERSION | awk -F. '{print $1}')
  export GFORTRAN_VERSION_MAJOR_VERSION=$(echo $GFORTRAN_VERSION | awk -F. '{print $1}')
  export GPLUSPLUS_VERSION_MAJOR_VERSION=$(echo $GPLUSPLUS_VERSION | awk -F. '{print $1}')

  export version_10="10"

  if [ $GCC_VERSION_MAJOR_VERSION -ge $version_10 ] || [ $GFORTRAN_VERSION_MAJOR_VERSION -ge $version_10 ] || [ $GPLUSPLUS_VERSION_MAJOR_VERSION -ge $version_10 ]
  then
    sed -i '32s/-ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4/-ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4 ${fallow_argument} /g' configure.arwp
  fi


  sed -i -e 's/-C -P -traditional/-P -traditional/g' /home/brianwrf/Build_WRF/WRF-4.5.1-ARW/ARWpost/configure.arwp
  ./compile


  export PATH=/home/brianwrf/Build_WRF/WRF-4.5.1-ARW/ARWpost/ARWpost.exe:$PATH

  echo " "
But it still ended up in an error, as reflected in the attached compile log:
 

Attachments

  • compile5.txt
    17.5 KB · Views: 4
Hi,
Let's focus on the compile logs 2, 3, and 4 (since 5 was built with a script, the issues are likely related to the script, itself).

So it does look like you were able to get past the initial "copyright" error. Your new error is

Code:
gfortran -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4  -I/usr/include -c input_module.f
input_module.f:108:51:

  105 |           CALL NCVGT(ncid,field_number,istart,iend,real_array,istatus)
      |                                                   2
......
  108 |           CALL NCVGT(ncid,field_number,istart,iend,tmp3D_int,istatus)
      |                                                   1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(4)).

Did you happen to modify any code, or is this out-of-the-box, pristine ARWpost code? If it's pristine code, can you please attach the files
src/input_module.f90
src/input_module.f
configure.arwp

Thanks!
 
Hello, Sir, and thank you very much for your response.

I'm not really sure since I have made more than one attempt to compile ARWpost (to troubleshoot the errors) that I have at least 2 folders containing the ARWpost files. And I lost track of what I did since I was quite desperate at that time to fix the error; it's already days since I left my ARWpost compilation unfinished.

But if my memory serves me right, I made a small edit in the "configure.defaults", "postamble" and "preamble" files (in ARWpost/arch folder). It was recommended to change CPP to either "/lib/cpp -P -traditional" or "/lib/cpp -C -P -nostdinc" in the "configure.arwp" file. I noticed in "configure.arwp" that the header says:
# configure.arwp
#
# This file was automatically generated by the configure script in the
# top level directory. You may make changes to the settings in this
# file but be aware they will be overwritten each time you run configure.
# Ordinarily, it is necessary to run configure once, when the code is
# first installed.
#
# To permanently change options, change the settings for your platform
# in the file arch/configure.defaults, the preamble, and the postamble -
# then rerun configure.
#
Because of that, I also made the same recommended edits in "configure.defaults", "postamble" and "preamble" to make the edits "permanent."

Furthermore, I added the following line (path to the WRF-ARW folder) in "configure.defaults", "postamble" and "preamble"
WRF_DIR = /home/brianwrf/Build_WRF/WRF-4.5.1-ARW
since I read somewhere (outside the forum) that this can somehow help in solving the problem. I just forgot which source was it nor the link to the source.

Just to be sure, here is the Google Drive folder containing the requested files for your perusal (although there's no "input_module.f" file in my src folder):
I included two versions of these files, one from each of the ARWpost folders present in my computer. I uploaded them to a Google Drive folder since the file format is not accepted by the forum website. I also included copies of the "configure.defaults", "postamble" and "preamble" files, just in case it helps finding the source of the error. Just tell me if I need to redo the whole ARWpost configuration-conpilation process if can help in the troubleshooting process.

Thanks!
 
Hi,
Thanks for sending those files. You mention above:

I lost track of what I did since I was quite desperate at that time to fix the error; it's already days since I left my ARWpost compilation unfinished.
Does this mean that you are not still trying to use ARWpost? I just want to check before I did further into the code to try to figure out the compile error. Thanks!
 
Hello, Sir, and thank you very much for the response.

I still really intend to use ARWpost because I want to use GrADS as a visualization and post-processing tool for my WRFout files. What I meant is that the compilation of ARWpost in my computer was put on hold because I'm still waiting for any advise or recommendations on the Forum on how to troubleshoot the aforementioned errors and proceed with the process.
 
Ok thank you for clarification. I believe the issue is that the ARWpost code is pretty old, and you are using a newer GNU compiler. Can you clean the code again, and try adding "-fallow-argument-mismatch" to the FFLAGS line in the configure.arwp file? So it should now look like:

Code:
FFLAGS          =       -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch

Make sure to also keep

Code:
CPP = /lib/cpp -P -traditional

and then recompile and let me know if that makes a difference.
 
Hello, Sir. Once again, thank you very much for the response.

Thankfully, I have finally accomplished the compilation process and the "ARWpost.exe" executable files is now present in my ARWpost directory.

But this was not without prior failures. I followed your most recent troubleshoot instructions and they still ended up with non-compilation of "ARWpost.exe", although I noticed that, this time, no more "error" lines were present in the compile log except for the last two lines:
collect2: error: ld returned 1 exit status
make: [Makefile:18: ARWpost.exe] Error 1 (ignored)
And instead of "errors", some "warnings" appeared along the way, such as:
/bin/cp input_module.f90 input_module.f
gfortran -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -I/usr/include -c input_module.f
input_module.f:108:51:

105 | CALL NCVGT(ncid,field_number,istart,iend,real_array,istatus)
| 2
......
108 | CALL NCVGT(ncid,field_number,istart,iend,tmp3D_int,istatus)
| 1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(4)).
.
.
.
/bin/cp module_interp.f90 module_interp.f
gfortran -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -I/usr/include -c module_interp.f
module_interp.f:741:41:

732 | CALL NCVGT(ncid,iloc,istart,iend,tmp3D,istatus)
| 2
......
741 | CALL NCVGT(ncid,iloc,istart,iend,tmp1D,istatus)
| 1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
I have attached the configure log for your perusal.

Because of this, I tried combining your suggested troubleshoot strategy with one of those in the "ARWpost compilation error" thread, particularly the one which suggests editing "Makefile". Thus, I did the following:
1. Cleaned the code (./clean -a) and reconfigure (./configure), choosing no. 3 (PC Linux i486 i586 i686 x86_64, gfortran compiler)
2. Edited "configure.arwp" with
FFLAGS = -ffree-form -O -fno-second-underscore -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch
and
CPP = /lib/cpp -P -traditional
3. Edited the "Makefile"
-L$(NETCDF)/lib -I$(NETCDF)/include -lnetcdff -lnetcdf
4. Compilation (./compile)

And this resulted to a successful compilation, which resulted to the "ARWpost.exe" file now present in the ARWpost directory. I have also attached the resulting compile log for this successful compilation.

Thank you very much for your help and for patiently responding to my queries.

Screenshot from 2023-11-08 20-42-01.png
 

Attachments

  • compile_log_Nov8_SUCCESS.txt
    10.7 KB · Views: 6
  • compile_log_Nov8.txt
    18.2 KB · Views: 4
I'm so glad to hear that! Thank you so much for the update and for provided the details of the solution.
 
Top