Main menu

Navigation

NETCDF issue when porting to a new machine.

3 posts / 0 new
Last post
xlong@...
NETCDF issue when porting to a new machine.

Hi,

I have some NETCDF issue when porting CESM1_2_2_1 to new machine.

The new machine use module to manage the software.

The NETCDF-C and NETCDF-FORTRAN are installed on different locations.

The admin told me I only need to load the fortran module because  the fortran one depends on the C one.

This is netcdf-fortran module:


 - Homepage: http://www.unidata.ucar.edu/software/netcdf/

]])

whatis("Description: NetCDF (network Common Data Form) is a set of software libraries

 and machine-independent data formats that support the creation, access, and sharing of array-oriented

 scientific data.")

whatis("Homepage: http://www.unidata.ucar.edu/software/netcdf/")

conflict("data/netCDF-Fortran")

load("data/netCDF/4.6.2-intel-2018.5.274")

prepend_path("CPATH","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274/include")

prepend_path("LD_LIBRARY_PATH","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274/lib")

prepend_path("LIBRARY_PATH","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274/lib")

prepend_path("MANPATH","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274/share/man")

prepend_path("PATH","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274/bin")

prepend_path("PKG_CONFIG_PATH","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274/lib/pkgconfig")

setenv("EBROOTNETCDFMINFORTRAN","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274")

setenv("EBVERSIONNETCDFMINFORTRAN","4.4.5")

 

setenv("EBDEVELNETCDFMINFORTRAN","/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274/easybuild/data-netCDF-Fortran-4.4.5-intel-2018.5.274-easybuild-devel")


I built the model after loading the modules,

I got error when compiling pio,

WARNING: did not find netcdf fortran library



So I add one line in the env_mach_specific:

setenv NETCDF /opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274

 

but it still has another error:-- Could NOT find NETCDF (missing: NETCDF_INCLUDE_DIR)

 

Even with this warning, the pio build is completed, but it is stuck at building the csm_share.

 

home/xlong/cesm1_2_2_1/models/drv/shr/seq_io_mod.F90(1170): error #6404: This name does not have a type, and must have an explicit type.   [PIO_UNLIMITED]

 

      rcode = pio_def_dim(cpl_io_file,'time',PIO_UNLIMITED,dimid(1))

 

 

I guess all the errors are due to that the netcdf lib is not set correctly?

 

Could anyone give some suggestion how to link the netcdf C and fortran library, and also let the model know the location of include files?

 

 

jedwards

Based on the error, even though the pio bld completed I don't think that it worked.  Try setting in env_mach_specific

NETCDF=/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274

the remove the bld directory and try again.   1.2.2.1 is not set up to handle seperate netcdf c and fortran directories so you may need to create a directory tree that links the 

installed libs into something that will make sence to the build,  that is create netcdf/lib and netcdf/include directories, from these lnk the files from the netcdf-c and netcdf-fortran 

directories and set netcdf to that newly created directory.   

CESM Software Engineer

xlong@...

Thanks.

I did explicitly set the env varibale :

setenv NETCDF /opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274, in the env_mach_specific file

But after doing this, the pio build still say "Could NOT find NETCDF (missing: NETCDF_INCLUDE_DIR)"

As you suggeted,

I should make a local directory like netcdf, the link the files in the netcdf-c/lib, netcdf-c/include, netcdf-fortran/lib, netcdf-fortran/include

I think I also need to link the bin directory ?


So that the model only access netcdf through my local directory?


Log in or register to post comments

Who's new

  • praveenmaniyatt@...
  • arjunbabun11@...
  • lama@...
  • sisi393@...
  • 1658093099@...