The OASIS Coupler Forum

  HOME

errors when compiling the NEMO4.2+Xios2-trunk with OASIS3MCT

Up to Starting with OASIS3-MCT (first steps, tutorial, ...)

Posted by Anonymous at April 8 2024

Dear all,
When I compiled the NEMO4.2+Xios2-trunk with OASIS3MCT_4.0 using the intelmpi 2017 and netcdf_parallel. I encountered the following errors at the last step:

touch /../src/nemo-branch_4.2/cfgs/ORCA2_testx/BLD/done/nemogcm.done
mpiifort -o nemo.o -I/../src/nemo-branch_4.2/cfgs/ORCA2_testx/BLD/inc -i4 -r8 -O3 -fp-model strict -xHost -fno-alias -I/../src/xios-2.5/inc -I/../src/oasis3mct_par/include -I/public/software/mathlib/libs-intel/netcdf/4.7.4/include -I/public/software/mathlib/libs-intel/pnetcdf/1.12.3/include -c /public/home/elpt_2023_000203/liuyong/coupling/ciesm/src/nemo-branch_4.2/cfgs/ORCA2_testx/WORK/nemo.f90
fcm_internal load:F nemo nemo.o nemo.exe
ar: creating /../src/nemo-branch_4.2/cfgs/ORCA2_testx/BLD/tmp/lib__fcm__nemo.a
mpiifort -o nemo.exe /../src/nemo-branch_4.2/cfgs/ORCA2_testx/BLD/obj/nemo.o -L/public/home/elpt_2023_000203/liuyong/coupling/ciesm/src/nemo-branch_4.2/cfgs/ORCA2_testx/BLD/lib -l__fcm__nemo -lstdc++ -L/../src/xios-2.5/lib -lxios -lstdc++ -L/../src/oasis3mct_par/lib  -lpsmile -lmct -lmpeu -lscrip -L/public/software/mathlib/libs-intel/netcdf/4.7.4/lib -lnetcdff -lnetcdf -L/public/software/mathlib/libs-intel/pnetcdf/1.12.3/lib -lpnetcdf -L/public/software/mathlib/libs-intel/hdf5/1.10.3/lib -lhdf5_hl -lhdf5
/../src/nemo-branch_4.2/cfgs/ORCA2_testx/BLD/lib/lib__fcm__nemo.a(cpl_oasis3.o): In function `cpl_oasis3_mp_cpl_freq_':
cpl_oasis3.f90:(.text+0x456a): undefined reference to `oasis_get_freqs_'
fcm_internal load failed (256)
make: *** [nemo.exe] Error 1



and the arch.fcm is as follows:
%NCDF_INC            -I%NCDF_F_PREFIX/include -I%PNCDF_PREFIX/include
%NCDF_LIB            -L%NCDF_F_PREFIX/lib -lnetcdff -lnetcdf -L%PNCDF_PREFIX/lib -lpnetcdf -L%HDF5_PREFIX/lib -lhdf5_hl -lhdf5   
%XIOS_INC            -I%XIOS_PREFIX/inc
%XIOS_LIB            -L%XIOS_PREFIX/lib -lxios -lstdc++
%OASIS_INC           -I%OASIS_PREFIX/include
%OASIS_LIB           -L%OASIS_PREFIX/lib  -lpsmile -lmct -lmpeu -lscrip

%CPP	               cpp
%FC                  mpiifort 
#-c -cpp
%FCFLAGS             -i4 -r8 -O3 -fp-model strict -xHost -fno-alias 
### comment out the following line if you want to use the debugging compilation options
#%FCFLAGS            -i4 -r8 -g -O0 -debug all -traceback -fp-model strict -ftrapuv -check all,noarg_temp_created -fpe-all0 -ftz -init=arrays,snan,huge
#%FCFLAGS             -march=core-avx2 -i4 -r8 -O3 -fp-model strict -fno-alias -align array64byte
#%FCFLAGS             -fno-alias -O3 -ip -align -DTREAT_OVERLAY -Duse_netCDF -Duse_comm_MPI1  -i4 -r8 -O3 -fp-model precise -fno-alias -traceback -convert big_endian -assume byterecl

%FFLAGS              %FCFLAGS
%LD                  mpiifort
%LDFLAGS             -lstdc++
%FPPFLAGS            -P -traditional
%AR                  ar
%ARFLAGS             rs
%MK                  make
%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB

%CC                  mpiicc
%CFLAGS              -O0


Can anyone show me some advice to fixed these errors?

Posted by Anonymous at April 8 2024

This looks like a NEMO problem, not an OASIS problem. oasis_get_freqs is a subroutine in OCE/SBC/cpl_oasis3.F90.

The way I'd start debugging this is to look at the ppsrc files for the build to make sure the subroutine is being compiled and is being used properly in cpl_oasis3.f90. 

Nick

Posted by Anonymous at April 9 2024

Hi,
This is indeed a problem in NEMO but oasis_get_freqs is an oasis API routine. It is in oasis3-mct/lib/psmile/src/mod_oasis_auxiliary_routines.F90. From what I see above, you are linking with the psmile library ("-L/../src/oasis3mct_par/lib"). The psmile library should contain the oasis_get_freqs routine unless you use an oasis version olde than OASIS3-MCT_3.0 (into which oasis_get_freqs was reintroduced). Can you check that?
  Regards,
 Sophie

Posted by Anonymous at April 9 2024

Dear Sophie,
Thank you so much for your reply. You are right. It is indeed a NEMO problem that is related to the calling of the oasis_get_freqs function in the file cpl_oasis3.F90, which may be a bug for the model.
I am very appreciated for your kindness and advice.
Yong
Reply to this