Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

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

CSEG and Liaisons
Staff member
Based on the error, even though the pio bld completed I don't think that it worked.  Try setting in env_mach_specificNETCDF=/opt/apps/software/data/netCDF-Fortran/4.4.5-intel-2018.5.274the 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.   
 
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 fileBut 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/includeI think I also need to link the bin directory ?
So that the model only access netcdf through my local directory?
 
Top