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

Problem with porting CESM_1_2_1 to a generic machine

Dear users,

I'm porting CESM1.2.1 on my machine, following user's guide, but I'm having problems.
First of all I' ve set environment variables this way:

export CASE=teste5
export CCSMROOT=/home/CLIMA/CESM/cesm1_2_1
export CSMDATA=$CCSMROOT/inputdata
export CASEROOT=$CCSMROOT/$CASE-----------------------------------------------------------
The content of .bashrc is the following:

export PATH=/usr/local/ncarg/bin:$PATH:/usr/lib64/openmpi/bin/
export NCARG_ROOT=/usr/local/ncarg
export PATH=$NCARG_ROOT/bin:$PATH
export NCARG_LIB=$NCARG_ROOT/lib/ncarg
export NCARG_FONTCAPS=$NCARG_LIB/fontcaps
export NCARG_GRAPHCAPS=$NCARG_LIB/graphcaps
export NCARG_DATABASE=$NCARG_LIB/database
export NCARG_NCARG=$NCARG_LIB
export NCARG_USRRESFILE=/home/CLIMA/.hluresfile
export DISPLAY=:0.0
export FC=gfortran
export F77=gfortran
export F90=gfortran
export CC=gcc
export MPI=/usr/lib64/openmpi/
export MPI_INC=/usr/include/openmpi-x86_64/
export MPI_LIB=$MPI/lib
export MPIFC=mpif90
export MPIF77=mpif90
export MPIF90=mpif90
export MPICC=mpicc
export PNETCDF_PATH=/usr/local/PNETCDF
export NETCDF_PATH=/usr/local/NETCDF4
export PIO=/usr/local/PIO
export NETCDF=/usr/local/NETCDF4
export PNETCDF=/usr/local/PNETCDF
export METIS=/usr/local/METIS
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/:/usr/local/lib:$MPI_LIB

----------------------------------------------
The command nc-config --all gives:

[CLIMA@localhost bin]$ nc-config --all

This netCDF 4.3.2 has been built with the following features:

  --cc        -> gcc
  --cflags    ->  -I/usr/include -I/usr/include/hdf
  --libs      ->

  --has-c++   -> no
  --cxx       ->
  --has-c++4  -> no
  --cxx4      ->

  --fc        -> gfortran
  --fflags    -> -I/usr/include
  --flibs     -> -lnetcdff 
  --has-f90   -> yes

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> yes
  --has-pnetcdf-> no

  --prefix    -> /usr
  --includedir-> /usr/include
  --version   -> netCDF 4.3.2


----------------------------------------------
The machine is user defined (which name is "labmeta"), and I added this block into config_machines.xml:


        Labmeta                                
        LINUX                             
        gnu    
        openmpi               
                  
        $CCSMROOT/$CASE/run                      
        $CCSMROOT/$CASE/bld                    
        $CCSMROOT/inputdata          
        USERDEFINED_optional_build
        FALSE                                           
        USERDEFINED_optional_run              
        USERDEFINED_optional_run          
        USERDEFINED_optional_run          
        USERDEFINED_optional_test               
        USERDEFINED_optional_run
        USERDEFINED_optional_run
        USERDEFINED_optional
        1
        2


--------------------------------------------------------------------
The block regarding GNU inside config_compilers.xml is:


 
  -DFORTRANUNDERSCORE -DNO_R16
  -fopenmp
  -fopenmp
  -fopenmp
  -D CISM_GNU=ON
    -ffixed-form
  -ffree-form
  -g -Wall
 
  -O -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none
  -O0
  -fdefault-real-8
  gfortran
  gcc
  g++
  mpif90
  mpicc 
  mpicxx
  FORTRAN
  TRUE


-----------------------------------------------------------------
So, with everything set, I did the following command:
./create_newcase -case $CASEROOT -res f19_g16 -compset BC5CN -mach labmeta
which (apparently) successfully created the case.

The command ./cesm_setup inside directory teste5 gave:
Use of qw(...) as parentheses is deprecated at ./cesm_setup line 252.

So, I changed cesm_setup qw(...) to (qw(...)) and ./cesm_setup again:
Macros script already created ...skipping
 Machine/Decomp/Pes configuration has already been done ...skipping
 Running preview_namelist script
 infile is /home/CLIMA/CESM/cesm1_2_1/teste5/Buildconf/cplconf/cesm_namelist
CAM writing dry deposition namelist to drv_flds_in
CAM writing namelist to atm_in
CLM configure done.
CLM adding use_case 2000_control defaults for var sim_year with val 2000
CLM adding use_case 2000_control defaults for var sim_year_range with val constant
CLM adding use_case 2000_control defaults for var stream_year_first_ndep with val 2000
CLM adding use_case 2000_control defaults for var stream_year_last_ndep with val 2000
CLM adding use_case 2000_control defaults for var use_case_desc with val Conditions to simulate 2000 land-use
CICE configure done.
POP2 build-namelist: ocn_grid is gx1v6
POP2 build-namelist: ocn_tracer_modules are  iage
See ./CaseDoc for component namelists
If an old case build already exists, might want to run teste5.clean_build before building

Apparently ok, but then, ./teste5.build gave:

[CLIMA@localhost teste5]$ ./teste5.build
-------------------------------------------------------------------------
 CESM BUILDNML SCRIPT STARTING
 - To prestage restarts, untar a restart.tar file into /home/CLIMA/CESM/cesm1_2_1/teste5/run
 infile is /home/CLIMA/CESM/cesm1_2_1/teste5/Buildconf/cplconf/cesm_namelist
CAM writing dry deposition namelist to drv_flds_in
CAM writing namelist to atm_in
CLM configure done.
CLM adding use_case 2000_control defaults for var sim_year with val 2000
CLM adding use_case 2000_control defaults for var sim_year_range with val constant
CLM adding use_case 2000_control defaults for var stream_year_first_ndep with val 2000
CLM adding use_case 2000_control defaults for var stream_year_last_ndep with val 2000
CLM adding use_case 2000_control defaults for var use_case_desc with val Conditions to simulate 2000 land-use
CICE configure done.
POP2 build-namelist: ocn_grid is gx1v6
POP2 build-namelist: ocn_tracer_modules are  iage
 CESM BUILDNML SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM PRESTAGE SCRIPT STARTING
 - Case input data directory, DIN_LOC_ROOT, is /home/CLIMA/CESM/cesm1_2_1/inputdata
 - Checking the existence of input datasets in DIN_LOC_ROOT
 CESM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM BUILDEXE SCRIPT STARTING
 COMPILER is gnu
 - Build Libraries: mct gptl pio csm_share
Wed Nov 25 15:32:59 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/mct/mct.bldlog.151125-153256
Wed Nov 25 15:33:10 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/gptl/gptl.bldlog.151125-153256
Wed Nov 25 15:33:11 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/pio/pio.bldlog.151125-153256
Wed Nov 25 15:33:22 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/csm_share/csm_share.bldlog.151125-153256
Wed Nov 25 15:33:36 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/atm.bldlog.151125-153256
Wed Nov 25 15:35:16 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/lnd.bldlog.151125-153256
Wed Nov 25 15:35:47 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/ice.bldlog.151125-153256
Wed Nov 25 15:36:04 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/ocn.bldlog.151125-153256
Wed Nov 25 15:36:42 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/glc.bldlog.151125-153256
Wed Nov 25 15:36:42 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/wav.bldlog.151125-153256
Wed Nov 25 15:36:42 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/rof.bldlog.151125-153256
Wed Nov 25 15:36:44 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/cesm.bldlog.151125-153256
ERROR: cesm.buildexe.csh failed, see /home/CLIMA/CESM/cesm1_2_1/teste5/bld/cesm.bldlog.151125-153256
ERROR: cat /home/CLIMA/CESM/cesm1_2_1/teste5/bld/cesm.bldlog.151125-153256------------------------------------------------------------------------
File cesm.bldlog.txt is atached.

I've tried to reproduce everything that is here: https://bb.cgd.ucar.edu/regarding-error-during-porting-cesm120-new-machine but I don't know how to apply these suggestions on my machine, since we don't have a system administrator.
I really don't know what to do now ... if anybody could, please, help me, any kind of sugestions will be higly appreciated.

 

jedwards

CSEG and Liaisons
Staff member

> chem_surfvals.F90:(.text+0xa46): undefined reference to `__netcdf_MOD_nf90_open'

You are not linking netcdf correctly - was it built with the same compiler and flags as you are building the model with?


 

jedwards

CSEG and Liaisons
Staff member

> chem_surfvals.F90:(.text+0xa46): undefined reference to `__netcdf_MOD_nf90_open'

You are not linking netcdf correctly - was it built with the same compiler and flags as you are building the model with?


 
I'm sorry for my late response, but just today I've had access to the computer. Thanks for your response.I've installed netcdf again, but I don' know if it was done correctly. I first downloaded netcdf-4.3.3.1 version and installed locally:./configure --prefix=/home/CLIMA/INSTALACOES/netcdf_f_cmakemake installThen, I downloaded netcdf-fortran-4.4.2 and installed on the same directory:./configure --prefix=/home/CLIMA/INSTALACOES/netcdf_f_cmakemake install
Then, I changed the ~/.bashrc file to:export PATH=/usr/local/ncarg/bin:$PATH:/usr/lib64/openmpi/bin/
export NCARG_ROOT=/usr/local/ncarg
export PATH=$NCARG_ROOT/bin:$PATH
export NCARG_LIB=$NCARG_ROOT/lib/ncarg
export NCARG_FONTCAPS=$NCARG_LIB/fontcaps
export NCARG_GRAPHCAPS=$NCARG_LIB/graphcaps
export NCARG_DATABASE=$NCARG_LIB/database
export NCARG_NCARG=$NCARG_LIB
export NCARG_USRRESFILE=/home/CLIMA/.hluresfile
export DISPLAY=:0.0

export FC=gfortran
export F77=gfortran
export F90=gfortran
export CC=gcc
export MPI=/usr/lib64/openmpi/
export MPI_INC=/usr/include/openmpi-x86_64/
export MPI_LIB=$MPI/lib
export MPIFC=mpif90
export MPIF77=mpif90
export MPIF90=mpif90
export MPICC=mpicc
export PNETCDF_PATH=/home/CLIMA/INSTALACOES/parallel-netcdf
export NETCDF_PATH=/home/CLIMA/INSTALACOES/netcdf_f_c
export PIO=/home/CLIMA/INSTALACOES/PIO2
export NETCDF=/home/CLIMA/INSTALACOES/netcdf_f_c
export PNETCDF=/home/CLIMA/INSTALACOES/parallel-netcdf
export METIS=/usr/local/METIS
export PARMETIS=/usr/local/ParMETIS
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/:/usr/local/lib:/home/CLIMA/INSTALACOES/netcdf_f_c/lib:$PIO/lib:$PNETCDF/lib:$MPI_LIB
The cesm.bldlog is attached, but it shows the same error "chem_surfvals.F90:(.text+0xa46): undefined reference to `__netcdf_MOD_nf90_open'" that you pointed.I really don't know what I'm doing wrong. 
 
I'm sorry for my late response, but just today I've had access to the computer. Thanks for your response.I've installed netcdf again, but I don' know if it was done correctly. I first downloaded netcdf-4.3.3.1 version and installed locally:./configure --prefix=/home/CLIMA/INSTALACOES/netcdf_f_cmakemake installThen, I downloaded netcdf-fortran-4.4.2 and installed on the same directory:./configure --prefix=/home/CLIMA/INSTALACOES/netcdf_f_cmakemake install
Then, I changed the ~/.bashrc file to:export PATH=/usr/local/ncarg/bin:$PATH:/usr/lib64/openmpi/bin/
export NCARG_ROOT=/usr/local/ncarg
export PATH=$NCARG_ROOT/bin:$PATH
export NCARG_LIB=$NCARG_ROOT/lib/ncarg
export NCARG_FONTCAPS=$NCARG_LIB/fontcaps
export NCARG_GRAPHCAPS=$NCARG_LIB/graphcaps
export NCARG_DATABASE=$NCARG_LIB/database
export NCARG_NCARG=$NCARG_LIB
export NCARG_USRRESFILE=/home/CLIMA/.hluresfile
export DISPLAY=:0.0

export FC=gfortran
export F77=gfortran
export F90=gfortran
export CC=gcc
export MPI=/usr/lib64/openmpi/
export MPI_INC=/usr/include/openmpi-x86_64/
export MPI_LIB=$MPI/lib
export MPIFC=mpif90
export MPIF77=mpif90
export MPIF90=mpif90
export MPICC=mpicc
export PNETCDF_PATH=/home/CLIMA/INSTALACOES/parallel-netcdf
export NETCDF_PATH=/home/CLIMA/INSTALACOES/netcdf_f_c
export PIO=/home/CLIMA/INSTALACOES/PIO2
export NETCDF=/home/CLIMA/INSTALACOES/netcdf_f_c
export PNETCDF=/home/CLIMA/INSTALACOES/parallel-netcdf
export METIS=/usr/local/METIS
export PARMETIS=/usr/local/ParMETIS
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/:/usr/local/lib:/home/CLIMA/INSTALACOES/netcdf_f_c/lib:$PIO/lib:$PNETCDF/lib:$MPI_LIB
The cesm.bldlog is attached, but it shows the same error "chem_surfvals.F90:(.text+0xa46): undefined reference to `__netcdf_MOD_nf90_open'" that you pointed.I really don't know what I'm doing wrong. 
 
Top