NASA-LIS / NASA-Land-Coupler

NASA Land Coupler
Apache License 2.0
6 stars 11 forks source link

BUG- compiling LIS and generate the lis.mk file #3

Closed metroid2012 closed 2 years ago

metroid2012 commented 3 years ago

Hi, i'm trying to compile LIS-HYDRO on a ubuntu 20.04 workstation. I followed the steps mentioned on the readme file. The configure step runs without problems since all necessary libraries where installed, but when i execute the commands: cd runmodes/nuopc_cpl_mode make nuopcinstall INSTPATH=$LISHYDRO_DIR/LIS-INSTALL the LIS executable was generated successfully, but under "runmodes/nuopc_cpl_mode" when compiling "LIS_ESMF_Extensions.F90", i get the following errors:

Compiling LIS_ESMF_Extensions.o...

mpiifort -c -g -traceback -check arg_temp_created,bounds,format,output_conversion,stack,uninit -fPIC -assume realloc_lhs -m64 -mcmodel=small -pthread -threads -qopenmp -I/home/erdms/lis/extlibs/esmf/mod/modg/Linux.intel.64.intelmpi.default -I/home/erdms/lis/extlibs/esmf/src/include -I/home/erdms/LISHYDRO/src/LISF/LISF-master/lis/make -DESMF_NO_INTEGER_1_BYTE -DESMF_NO_INTEGER_2_BYTE -DESMF_MOAB=1 -DESMF_LAPACK=1 -DESMF_LAPACK_INTERNAL=1 -DESMF_NO_ACC_SOFTWARE_STACK=1 -DESMF_YAMLCPP=1 -DESMF_YAML=1 -DESMF_PIO=1 -DESMF_MPIIO -DESMF_NO_OPENACC -DESMF_BOPT_g -DESMF_TESTCOMPTUNNEL -DSx86_64_small=1 -DESMF_OS_Linux=1 -DESMF_COMM=intelmpi -DESMF_DIR=/home/erdms/lis/extlibs/esmf -DWRF_HYDRO -DESMF_VERSION_MAJOR=8 LIS_ESMF_Extensions.F90 LIS_ESMF_Extensions.F90(40): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [NETCDF] use NETCDF ------^ LIS_ESMF_Extensions.F90(2551): error #6404: This name does not have a type, and must have an explicit type. [NF90_NOWRITE] stat = nf90_open(filename,nf90_NoWrite,ncid) ------------------------------^ LIS_ESMF_Extensions.F90(2551): error #6404: This name does not have a type, and must have an explicit type. [NF90_OPEN] stat = nf90_open(filename,nf90_NoWrite,ncid) -----------^ LIS_ESMF_Extensions.F90(2552): error #6404: This name does not have a type, and must have an explicit type. [NF90_NOERR] if (stat /= nf90_NoErr) then ----------------^ LIS_ESMF_Extensions.F90(2559): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQ_VARID] stat = nf90_inq_varid(ncid,varname,varid) -----------^ LIS_ESMF_Extensions.F90(2562): error #6404: This name does not have a type, and must have an explicit type. [NF90_ENOTVAR] elseif(stat == nf90_eNotVar) then -------------------^ LIS_ESMF_Extensions.F90(2573): error #6404: This name does not have a type, and must have an explicit type. [NF90_CLOSE] stat = nf90_close(ncid) -----------^ LIS_ESMF_Extensions.F90(2736): error #6404: This name does not have a type, and must have an explicit type. [NF90_OPEN] stat = nf90_open(filename,nf90_NoWrite,ncid) -----------^ LIS_ESMF_Extensions.F90(2744): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQ_VARID] stat = nf90_inq_varid(ncid,varname,varid) -----------^ LIS_ESMF_Extensions.F90(2755): error #6632: Keyword arguments are invalid without an explicit interface. [DIMIDS] stat = nf90_inquire_variable(ncid, varid, dimids = dimIDs) ----------------------------------------------^ LIS_ESMF_Extensions.F90(2755): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_VARIABLE] stat = nf90_inquire_variable(ncid, varid, dimids = dimIDs) -----------^ LIS_ESMF_Extensions.F90(2764): error #6632: Keyword arguments are invalid without an explicit interface. [LEN] stat = nf90_inquire_dimension(ncid, dimIDs(1), len = dimCnt(1)) ---------------------------------------------------^ LIS_ESMF_Extensions.F90(2764): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_DIMENSION] stat = nf90_inquire_dimension(ncid, dimIDs(1), len = dimCnt(1)) -----------^ LIS_ESMF_Extensions.F90(2773): error #6632: Keyword arguments are invalid without an explicit interface. [LEN] stat = nf90_inquire_dimension(ncid, dimIDs(2), len = dimCnt(2)) ---------------------------------------------------^ LIS_ESMF_Extensions.F90(2791): error #6632: Keyword arguments are invalid without an explicit interface. [VALUES] stat = nf90_get_var(ncid, varid, values=farray, start=(/start(1),start(2)/), & -------------------------------------^ LIS_ESMF_Extensions.F90(2791): error #6632: Keyword arguments are invalid without an explicit interface. [START] stat = nf90_get_var(ncid, varid, values=farray, start=(/start(1),start(2)/), & ----------------------------------------------------^ LIS_ESMF_Extensions.F90(2792): error #6632: Keyword arguments are invalid without an explicit interface. [COUNT] count=(/size(farray,1),size(farray,2)/)) ------^ LIS_ESMF_Extensions.F90(2791): error #6404: This name does not have a type, and must have an explicit type. [NF90_GET_VAR] stat = nf90_get_var(ncid, varid, values=farray, start=(/start(1),start(2)/), & -----------^ LIS_ESMF_Extensions.F90(2801): error #6404: This name does not have a type, and must have an explicit type. [NF90_CLOSE] stat = nf90_close(ncid) -----------^ LIS_ESMF_Extensions.F90(2730): error #7915: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association - may be used in multiple contained procedures. [NF90_MAX_VAR_DIMS] integer, dimension(nf90_max_var_dims) :: dimIDs -----------------------^ LIS_ESMF_Extensions.F90(2730): error #6404: This name does not have a type, and must have an explicit type. [NF90_MAX_VAR_DIMS] integer, dimension(nf90_max_var_dims) :: dimIDs -----------------------^ LIS_ESMF_Extensions.F90(2844): error #6404: This name does not have a type, and must have an explicit type. [NF90_OPEN] stat = nf90_open(filename,nf90_NoWrite,ncid) -----------^ LIS_ESMF_Extensions.F90(2852): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQ_VARID] stat = nf90_inq_varid(ncid,varname,varid) -----------^ LIS_ESMF_Extensions.F90(2863): error #6632: Keyword arguments are invalid without an explicit interface. [DIMIDS] stat = nf90_inquire_variable(ncid, varid, dimids = dimIDs) ----------------------------------------------^ LIS_ESMF_Extensions.F90(2863): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_VARIABLE] stat = nf90_inquire_variable(ncid, varid, dimids = dimIDs) -----------^ LIS_ESMF_Extensions.F90(2872): error #6632: Keyword arguments are invalid without an explicit interface. [LEN] stat = nf90_inquire_dimension(ncid, dimIDs(1), len = dimCnt(1)) ---------------------------------------------------^ LIS_ESMF_Extensions.F90(2872): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_DIMENSION] stat = nf90_inquire_dimension(ncid, dimIDs(1), len = dimCnt(1)) -----------^ LIS_ESMF_Extensions.F90(2881): error #6632: Keyword arguments are invalid without an explicit interface. [LEN] stat = nf90_inquire_dimension(ncid, dimIDs(2), len = dimCnt(2)) ---------------------------------------------------^ LIS_ESMF_Extensions.F90(2899): error #6632: Keyword arguments are invalid without an explicit interface. [VALUES] stat = nf90_get_var(ncid, varid, values=farray, start=(/start(1),start(2)/), & -------------------------------------^ /tmp/ifortIx0prK.i90(4558): catastrophic error: Too many errors, exiting compilation aborted for LIS_ESMF_Extensions.F90 (code 1) make: *** [Makefile:236: LIS_ESMF_Extensions.o] Error 1

i'm expecting the lis.mk to be generated but the LIS-INSTALL directory is empty. How can i solve this?

danrosen25 commented 3 years ago

Hi @metroid2012 Did you build and include NetCDF-Fortran when ESMF was built. The error signals that the Fortran compiler cannot find the netcdf module in the included (-I) paths. For example when I build on discover the compiler command includes netcdf 4.7.4-I/discover/nobackup/projects/lis/libs/netcdf/4.7.4_gnu-9.3/include, this will happen automatically if ESMF is built with NetCDF.

metroid2012 commented 3 years ago

Thank you very much, danrosen25 for your comments, i've solved the problem of ESMF with netcdf-fortran following your suggestions, but now i encounter another issue which is the following:

Compiling LIS_NUOPC_DataCopy.o...

mpif90 -c -O -fPIC -m64 -mcmodel=small -pthread -ffree-line-length-none -fopenmp -I/home/erdms/miniconda3/mod -I/home/erdms/miniconda3/include -I/home/erdms/miniconda3/include -I/home/erdms/LISHYDRO/src/LISF/LISF-master/lis/make -DESMF_NO_INTEGER_1_BYTE -DESMF_NO_INTEGER_2_BYTE -DESMF_MOAB=1 -DESMF_LAPACK=1 -DESMF_LAPACK_INTERNAL=1 -DESMF_NO_ACC_SOFTWARE_STACK=1 -DESMF_NETCDF=1 -DESMF_YAMLCPP=1 -DESMF_YAML=1 -DESMF_PIO=1 -DESMF_MPIIO -DESMF_NO_OPENACC -DESMF_BOPT_O -DESMF_TESTCOMPTUNNEL -DSx86_64_small=1 -DESMF_OS_Linux=1 -DESMF_COMM=mpich3 -DESMF_DIR=/home/conda/feedstock_root/build_artifacts/esmf_1619160672873/work -DWRF_HYDRO -DESMF_VERSION_MAJOR=8 LIS_NUOPC_DataCopy.F90 /opt/intel/oneapi/mpi/2021.3.0//bin/mpif90: 1: gfortran: not found /opt/intel/oneapi/mpi/2021.3.0//bin/mpif90: 729: [: Illegal number: /opt/intel/oneapi/mpi/2021.3.0//bin/mpif90: 1: eval: gfortran: not found make: *** [Makefile:236: LIS_NUOPC_DataCopy.o] Error 127

kbergaoui commented 3 years ago

use mpiifort rather than mpif90

danrosen25 commented 2 years ago

Did the change to use the mpiifort wrapper work? I haven't done much testing with gcc compilers and I'm not sure if it's ready yet.

FYI - I've updated the component build system to CMake to better handle dependencies. The updated WRF-Hydro coupling layer (WRF-Hydro Cap) requires ESMF v8.0.1 or later.

metroid2012 commented 2 years ago

Yes, the usage of mpiifort + esmf version prior to 8.0.1 worked for me. We'll try with 8.0.1 after your modifications to the code. Thanks for the help!