NOAA-EMC / WW3

WAVEWATCH III
Other
255 stars 504 forks source link

Help Needed: Type Mismatch Error in WW3 Fortran Model Compilation #1236

Open CHARANJULURI opened 1 month ago

CHARANJULURI commented 1 month ago

Dear WW3 Community,

I hope this message finds you well. My name is J.Charan Kumar, and I am a beginner in using Fortran. I am currently trying to run a model written in Fortran as part of my work with the Wave Watch III (WW3) model. While attempting to compile the model, I encountered the following error message:

Screenshot 2024-05-29 145055

w3iosfmd.F90:476:26:

470 | CALL MPI_SEND ( ICPRT, ICSIZ, MPI_REAL, NAPPRT-1, IT, & | 2 ...... 476 | ( DTPRT, 6*DTSIZ, MPI_REAL, NAPPRT-1, & | 1 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/INTEGER(4)). w3iosfmd.F90:513:28:

504 | CALL MPI_RECV ( ICP, ICSIZ, MPI_REAL, JAPROC-1, IT, & | 2 ...... 513 | ( DTP, DIMP*DTSIZ, MPI_REAL, JAPROC-1, & | 1 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/INTEGER(4)).

Screenshot (67)

To provide some context, here are the steps I have taken so far:

  1. I modified the switch file to use the nc4 switch.

  2. I set the environment variables as follows: export WWATCH3_NETCDF=NC4 export NETCDF_CONFIG=/usr/bin/nf-config

  3. I run the setup and compilation commands:

    ./model/bin/w3_setup model -c gnu -s NCEP_st4 ./model/bin/w3_automake

I am using the GNU compiler with the following version: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 and the switch NCEP_st4.

charn@Charan:~/WW3-6.07.1$ mpifort --version GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 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.

Despite following the above steps, This error occurred during the execution of the w3_automake script. As I am still new to Fortran and the WW3 model, I am not entirely sure how to resolve this type mismatch issue. I am unsure how to resolve this issue and would greatly appreciate any guidance or suggestions the community can provide.

Thank you in advance for your assistance.

Best regards,

[J.CHARAN KUMAR]

CarstenHansen commented 1 month ago

I have looked up my bin/comp and bin/link scripts that I used about a year ago for compiling WAVEWAICH v.7 in debug mode with gfortran-13. I see that we needed an extra option -fallow-argument-mismatch to overcome the type mismatch error. The new configurations to build WW3 v.7 with CMake seem to overcome this issue.

In the bin/comp script, I had set

  (...)
  # compilation options
  opt="-c -J$path_m -g -fno-second-underscore -ffree-line-length-none -O0 -Wall -fcheck=all -ffpe-trap=invalid,zero,overflow -frecursive -fbacktrace -march=native"
  # CHA at FCOO: Avoid that some unused format lines cause errors with -Wunused
    opt="$opt -Wno-unused-label"
  # CHA at FCOO: This option allows MPI calls with argument type mismatch:
    opt="$opt -fallow-argument-mismatch"
   (... MPI options, netcdf options, etc. ...)
CHARANJULURI commented 1 month ago

Hello sir thanks for responding my problem But i don't have version v.7 . how can i resolve the problem in version v 6.07. A have small request from my side if you have version v.7 can you please provide.

Processing ww3_multi

ad3 : processing w3iogrmd ad3 : processing w3iorsmd ad3 : processing wmgridmd ad3 : processing w3iopomd 3 errors found, see /home/charn/WW3-6.07.1/model/tmp/w3iorsmd.err compile error file w3iorsmd.o not found make: [makefile:771: /home/charn/WW3-6.07.1/model/obj/w3iorsmd.o] Error 5 make: Waiting for unfinished jobs.... 2 errors found, see /home/charn/WW3-6.07.1/model/tmp/wmgridmd.err compile error file wmgridmd.o not found make: *** [makefile:870: /home/charn/WW3-6.07.1/model/obj/wmgridmd.o] Error 5 charn@Charan:~/WW3-6.07.1/model/bin$

after modify the script code i got an error running automate. in version 6.07

Best regards,

[J.CHARAN KUMAR]

JessicaMeixner-NOAA commented 1 month ago

v7 is in the develop branch: https://github.com/NOAA-EMC/WW3/tree/develop

CHARANJULURI commented 1 month ago

Screenshot (70) Hello mam still i got an error in version v6.07 how can resolve in while generating w3_automke

MatthewMasarik-NOAA commented 1 month ago

Hi @CHARANJULURI, I'm sorry to hear about the compiling issues. If all the dependencies are loaded correctly as you posted, then using the cmake build system we transitioned to will hopefully make the compilation easier. To get the current develop branch of WW3 and build all the executables at once, follow this Quick start example. You should have better luck if you follow this snippet closely. You may or may not need to export NETCDF_ROOT as shown, this could be system dependent. All other parts are important including exporting the C compiler (CC) and Fortran compiler (FC) as cmake will look for these parameters in the environment.

Please give that try and let me know if that solves your build issues.