#1 NetCDF Inc file

Đã đóng
%! (template.HTML=5 năm trước cách đây)đang mở bởi fmasson · 6 ý kiến

Hi @pbarriat,

I'm compiling the ensemble Kalman filter code on Zenobe and the Fortran code needs at some point a file called netcdf.inc which should be in the directory of the NetCDF libraries:

From nfw.F90:

...
!                                         length, v)
! 06/11/2009 PS: added nfw_dim_exists(ncid, name)
!                nfw_put_att_real(fname, ncid, varid, attname, type, length, v)
!                nfw_get_att_real(fname, ncid, varid, attname, v)

module nfw_mod
  implicit none
  include 'netcdf.inc'

  character(*), private, parameter :: nfw_version = "0.03"
  integer, private, parameter :: logunit = 6
  character(*), private, parameter :: errprefix = "nfw: error: "
  private quit1, quit2, quit3

contains
...

The file is not there:

fmasson@frontal1 09:17:54 ~/git/EnKF/EnKF-MPI-TOPAZ 11 > ls /projects/acad/ecearth/opt/software/netCDF/4.4.1-foss-2016b/include/
netcdf.h  netcdf_mem.h  netcdf_meta.h

but I know what it should be from previous runs at BSC:


bsc32526@login3:/gpfs/scratch/bsc32/bsc32526> ls /apps/NETCDF/4.3.2/INTEL/IMPI/include/
netcdf4_f03.mod            netcdf4_nf_interfaces.mod  netcdf_fortv2_c_interfaces.mod  netcdf.inc  netcdf_nc_data.mod        netcdf_nf_data.mod        netcdf_par.h
netcdf4_nc_interfaces.mod  netcdf_f03.mod             netcdf.h                        netcdf.mod  netcdf_nc_interfaces.mod  netcdf_nf_interfaces.mod  typesizes.mod

The file is on my home:

ls /home/acad/ucl-elic/fmasson/netcdf.inc

Could you copy it to the lib directory?

Not sure it will fix my compilation error but I can still try.

Thanks,

François

Hi @pbarriat, I'm compiling the ensemble Kalman filter code on Zenobe and the Fortran code needs at some point a file called `netcdf.inc` which should be in the directory of the NetCDF libraries: From `nfw.F90`: ```fortran ... ! length, v) ! 06/11/2009 PS: added nfw_dim_exists(ncid, name) ! nfw_put_att_real(fname, ncid, varid, attname, type, length, v) ! nfw_get_att_real(fname, ncid, varid, attname, v) module nfw_mod implicit none include 'netcdf.inc' character(*), private, parameter :: nfw_version = "0.03" integer, private, parameter :: logunit = 6 character(*), private, parameter :: errprefix = "nfw: error: " private quit1, quit2, quit3 contains ... ``` The file is not there: ```bash fmasson@frontal1 09:17:54 ~/git/EnKF/EnKF-MPI-TOPAZ 11 > ls /projects/acad/ecearth/opt/software/netCDF/4.4.1-foss-2016b/include/ netcdf.h netcdf_mem.h netcdf_meta.h ``` but I know what it should be from previous runs at BSC: ``` bsc32526@login3:/gpfs/scratch/bsc32/bsc32526> ls /apps/NETCDF/4.3.2/INTEL/IMPI/include/ netcdf4_f03.mod netcdf4_nf_interfaces.mod netcdf_fortv2_c_interfaces.mod netcdf.inc netcdf_nc_data.mod netcdf_nf_data.mod netcdf_par.h netcdf4_nc_interfaces.mod netcdf_f03.mod netcdf.h netcdf.mod netcdf_nc_interfaces.mod netcdf_nf_interfaces.mod typesizes.mod ``` The file is on my home: ```bash ls /home/acad/ucl-elic/fmasson/netcdf.inc ``` Could you copy it to the `lib` directory? Not sure it will fix my compilation error but I can still try. Thanks, François
Pierre-Yves Barriat đã nhận xét 5 năm trước cách đây
Người hợp tác

Hi @fmasson,

This file comes with the netCDF-Fortran module.

It seems that BSC merge netCDF and netCDF-Fortran during the install process.

You should load netCDF-Fortran/4.4.4-foss-2016b and you will have:

ls /projects/acad/ecearth/opt/software/netCDF-Fortran/4.4.4-foss-2016b/include/
netcdf4_f03.mod  netcdf4_nc_interfaces.mod  netcdf4_nf_interfaces.mod  netcdf_f03.mod  netcdf_fortv2_c_interfaces.mod  netcdf.inc  netcdf.mod  netcdf_nc_data.mod  netcdf_nc_interfaces.mod  netcdf_nf_data.mod  netcdf_nf_interfaces.mod  typesizes.mod
Hi @fmasson, This file comes with the netCDF-Fortran module. It seems that BSC merge netCDF and netCDF-Fortran during the install process. You should load `netCDF-Fortran/4.4.4-foss-2016b` and you will have: ```bash ls /projects/acad/ecearth/opt/software/netCDF-Fortran/4.4.4-foss-2016b/include/ netcdf4_f03.mod netcdf4_nc_interfaces.mod netcdf4_nf_interfaces.mod netcdf_f03.mod netcdf_fortv2_c_interfaces.mod netcdf.inc netcdf.mod netcdf_nc_data.mod netcdf_nc_interfaces.mod netcdf_nf_data.mod netcdf_nf_interfaces.mod typesizes.mod ```
Pierre-Yves Barriat đã nhận xét 5 năm trước cách đây
Người hợp tác

@fmasson,

On zenobe (frontal3), just do:

module purge
module load netCDF-Fortran/4.4.4-foss-2016b

And:

cd ~/git/EnKF/EnKF-MPI-TOPAZ
make

FYI, make.inc with GNU is:

# Library and include

INC_NETCDFF = -I${EBROOTNETCDFMINFORTRAN}/include
INC_NETCDF = -I${EBROOTNETCDF}/include
LIB_NETCDF = -L${EBROOTNETCDF}/lib64 -lnetcdf
LIB_NETCDFF = -L${EBROOTNETCDFMINFORTRAN}/lib -lnetcdff
INC_LAPACK = -I${EBROOTSCALAPACK}/include
LIB_LAPACK = -L${EBROOTSCALAPACK}/lib -lscalapack
LIB_BLAS = -L${EBROOTOPENBLAS}/lib -lopenblas
INC_BLAS = -I${EBROOTOPENBLAS}/include
INC_FFT = -I${EBROOTFFTW}/include
LIB_FFT = -L${EBROOTFFTW}/lib -lfftw3 -lfftw3_mpi

INCS = $(INC_NETCDF) $(INC_FFT) $(INC_NETCDFF) $(INC_LAPACK) $(INC_BLAS)
LIBS = $(LIB_NETCDF) $(LIB_NETCDFF) $(LIB_FFT) $(LIB_LAPACK) $(LIB_BLAS)

CF90 = mpif90
CPPFLAGS = -D_G95_ -DQMPI
CF77 = $(CF90)
LD = $(CF90)
CPP = cpp -traditional-cpp
CC = mpicc

CPPARCH =
CPPFLAGS +=

SIZEO = -fdefault-real-8
OPTO = -O3
DEBUG_FLAGS = #-g -traceback -W1 -warn unused -warn uncalled -debug extended -debug-parameters -ftrapuv -fpe0

FFLAGS = $(SIZEO) $(OPTO) $(DEBUG_FLAGS) $(INCS)
CFLAGS = -Df2cFortran $(OPTO) $(INCS)
LINKFLAGS = $(SIZEO) $(OPTO) $(DEBUG_FLAGS) $(LIBS)

# language-specific flags
#
F77FLG =
F90FLG =

That's OK with the following bug fix (it's done) in EnKF.F90:

integer, external :: iargc

becomes:

#if defined(_G95_)
  integer, intrinsic :: iargc
#else
  integer, external :: iargc
#endif
@fmasson, On zenobe (frontal3), just do: ```bash module purge module load netCDF-Fortran/4.4.4-foss-2016b ``` And: ```bash cd ~/git/EnKF/EnKF-MPI-TOPAZ make ``` FYI, `make.inc` with GNU is: ```bash # Library and include INC_NETCDFF = -I${EBROOTNETCDFMINFORTRAN}/include INC_NETCDF = -I${EBROOTNETCDF}/include LIB_NETCDF = -L${EBROOTNETCDF}/lib64 -lnetcdf LIB_NETCDFF = -L${EBROOTNETCDFMINFORTRAN}/lib -lnetcdff INC_LAPACK = -I${EBROOTSCALAPACK}/include LIB_LAPACK = -L${EBROOTSCALAPACK}/lib -lscalapack LIB_BLAS = -L${EBROOTOPENBLAS}/lib -lopenblas INC_BLAS = -I${EBROOTOPENBLAS}/include INC_FFT = -I${EBROOTFFTW}/include LIB_FFT = -L${EBROOTFFTW}/lib -lfftw3 -lfftw3_mpi INCS = $(INC_NETCDF) $(INC_FFT) $(INC_NETCDFF) $(INC_LAPACK) $(INC_BLAS) LIBS = $(LIB_NETCDF) $(LIB_NETCDFF) $(LIB_FFT) $(LIB_LAPACK) $(LIB_BLAS) CF90 = mpif90 CPPFLAGS = -D_G95_ -DQMPI CF77 = $(CF90) LD = $(CF90) CPP = cpp -traditional-cpp CC = mpicc CPPARCH = CPPFLAGS += SIZEO = -fdefault-real-8 OPTO = -O3 DEBUG_FLAGS = #-g -traceback -W1 -warn unused -warn uncalled -debug extended -debug-parameters -ftrapuv -fpe0 FFLAGS = $(SIZEO) $(OPTO) $(DEBUG_FLAGS) $(INCS) CFLAGS = -Df2cFortran $(OPTO) $(INCS) LINKFLAGS = $(SIZEO) $(OPTO) $(DEBUG_FLAGS) $(LIBS) # language-specific flags # F77FLG = F90FLG = ``` That's OK with the following bug fix (it's done) in `EnKF.F90`: ```bash integer, external :: iargc ``` becomes: ```bash #if defined(_G95_) integer, intrinsic :: iargc #else integer, external :: iargc #endif ```
Francois Massonnet đã nhận xét 5 năm trước cách đây
Chủ sở hữu

Many thanks, much appreciated and very useful.

François

Many thanks, much appreciated and very useful. François
Francois Massonnet đã nhận xét 3 năm trước cách đây
Chủ sở hữu

Hi @pbarriat,

I'm trying to recompile this code on zenobe but it looks like the commands above do not work anymore:

fmasson@frontal3 13:34:46 ~/git/EnKF 27 > module purge
fmasson@frontal3 13:34:50 ~/git/EnKF 28 > module load netCDF-Fortran/4.4.4-foss-2016b
ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'netCDF-Fortran/4.4.4-foss-2016b'

Still the path to the library exists:

fmasson@frontal3 13:36:04 ~/git/EnKF 30 > ls /projects/acad/ecearth/opt/software/netCDF-Fortran/4.4.4-foss-2016b/include/
netcdf4_f03.mod            netcdf4_nf_interfaces.mod  netcdf_fortv2_c_interfaces.mod  netcdf.mod          netcdf_nc_interfaces.mod  netcdf_nf_interfaces.mod
netcdf4_nc_interfaces.mod  netcdf_f03.mod             netcdf.inc                      netcdf_nc_data.mod  netcdf_nf_data.mod        typesizes.mod

More generally a couple of modules that was I able to load back then, seem not available anymore:

fmasson@frontal3 13:39:21 ~/git/EnKF 36 > module purge
fmasson@frontal3 13:39:23 ~/git/EnKF 37 > module load intel
ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'intel'
fmasson@frontal3 13:39:23 ~/git/EnKF 38 > module load impi
ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'impi'
fmasson@frontal3 13:39:23 ~/git/EnKF 39 > module load MKL
ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'MKL'
fmasson@frontal3 13:39:23 ~/git/EnKF 40 > module load NETCDF/4.4.1.1
ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'NETCDF/4.4.1.1'

Any idea how to fix this? Thanks! François

Hi @pbarriat, I'm trying to recompile this code on zenobe but it looks like the commands above do not work anymore: ``` fmasson@frontal3 13:34:46 ~/git/EnKF 27 > module purge fmasson@frontal3 13:34:50 ~/git/EnKF 28 > module load netCDF-Fortran/4.4.4-foss-2016b ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'netCDF-Fortran/4.4.4-foss-2016b' ``` Still the path to the library exists: ``` fmasson@frontal3 13:36:04 ~/git/EnKF 30 > ls /projects/acad/ecearth/opt/software/netCDF-Fortran/4.4.4-foss-2016b/include/ netcdf4_f03.mod netcdf4_nf_interfaces.mod netcdf_fortv2_c_interfaces.mod netcdf.mod netcdf_nc_interfaces.mod netcdf_nf_interfaces.mod netcdf4_nc_interfaces.mod netcdf_f03.mod netcdf.inc netcdf_nc_data.mod netcdf_nf_data.mod typesizes.mod ``` More generally a couple of modules that was I able to load back then, seem not available anymore: ``` fmasson@frontal3 13:39:21 ~/git/EnKF 36 > module purge fmasson@frontal3 13:39:23 ~/git/EnKF 37 > module load intel ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'intel' fmasson@frontal3 13:39:23 ~/git/EnKF 38 > module load impi ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'impi' fmasson@frontal3 13:39:23 ~/git/EnKF 39 > module load MKL ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'MKL' fmasson@frontal3 13:39:23 ~/git/EnKF 40 > module load NETCDF/4.4.1.1 ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'NETCDF/4.4.1.1' ``` Any idea how to fix this? Thanks! François
Pierre-Yves Barriat đã nhận xét 3 năm trước cách đây
Người hợp tác

Hi @fmasson,

Pfff... the modules on Zenobe, such a shame!

I recently did a function in my ~/.bashrc file to by-pass the official modules system.

my_modules()
{
  module() { eval $($LMOD_CMD bash "$@"); }
  export -f module
  MODULESHOME=""
  export MODULESHOME
  LOADEDMODULES=""
  export LOADEDMODULES
   . /projects/acad/ecearth/opt/lmod/lmod/init/bash
  MODULEPATH="/projects/acad/ecearth/opt/modules/all"
  export MODULEPATH
}

Once this function called, module av should show you some modules installed by myself (with easybuild = state of the art!)

Now, if I take a look in ~fmasson/git/EnKF/EnKF-MPI-TOPAZ, I think you just have to do:

module load netCDF-Fortran/4.4.4-foss-2016b
cd ~fmasson/git/EnKF/EnKF-MPI-TOPAZ
make

That's it!

Hi @fmasson, Pfff... the modules on Zenobe, such a shame! I recently did a function in my `~/.bashrc` file to by-pass the official modules system. ``` my_modules() { module() { eval $($LMOD_CMD bash "$@"); } export -f module MODULESHOME="" export MODULESHOME LOADEDMODULES="" export LOADEDMODULES . /projects/acad/ecearth/opt/lmod/lmod/init/bash MODULEPATH="/projects/acad/ecearth/opt/modules/all" export MODULEPATH } ``` Once this function called, `module av` should show you some modules installed by myself (with easybuild = state of the art!) Now, if I take a look in `~fmasson/git/EnKF/EnKF-MPI-TOPAZ`, I think you just have to do: ``` module load netCDF-Fortran/4.4.4-foss-2016b cd ~fmasson/git/EnKF/EnKF-MPI-TOPAZ make ``` That's it!
Francois Massonnet đã nhận xét 3 năm trước cách đây
Chủ sở hữu

Works, thanks.

François

Works, thanks. François
Đăng nhập để tham gia bình luận.
Không có nhãn
Không có Milestone
Không có người được phân công
2 tham gia
Đang tải...
Hủy bỏ
Lưu
Ở đây vẫn chưa có nội dung nào.