Skip to content

Commit

Permalink
bug fix for compile setup of different compiler for NCAR Derecho HPC
Browse files Browse the repository at this point in the history
  • Loading branch information
cenlinhe committed Jan 6, 2024
1 parent 423c132 commit aa2ee8a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 24 deletions.
10 changes: 5 additions & 5 deletions hrldas/HRLDAS_forcing/lib/cio.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

/* ****************************************************************** */

copen(nunit, name, mode, err, oflag)
int copen(nunit, name, mode, err, oflag)
/*
* nunit = UNIX file descriptor associated with file named *name*
* name = UNIX file name
Expand Down Expand Up @@ -145,7 +145,7 @@ copen(nunit, name, mode, err, oflag)
}

/* ****************************************************************** */
bnseek(fd, bread, mode, iprint)
int bnseek(fd, bread, mode, iprint)

/* Move the read/write file pointer
fd : Unix file descriptor.
Expand Down Expand Up @@ -183,7 +183,7 @@ bnseek(fd, bread, mode, iprint)

/* ****************************************************************** */

bnread(fd, buf, nbuf, bread, ios, idiag)
int bnread(fd, buf, nbuf, bread, ios, idiag)
/*
* fd = UNIX file descriptor number (NOT a Fortran unit)
* buf = area into which to read
Expand Down Expand Up @@ -234,7 +234,7 @@ bnread(fd, buf, nbuf, bread, ios, idiag)

/* ****************************************************************** */

bnwrit(fd, buf, nbuf, bwritten, err, idiag)
int bnwrit(fd, buf, nbuf, bwritten, err, idiag)
int *fd, *nbuf, buf[], *bwritten, *err, *idiag;

/*
Expand Down Expand Up @@ -268,7 +268,7 @@ bnwrit(fd, buf, nbuf, bwritten, err, idiag)

/* ****************************************************************** */

cclose(nunit, iprint, err)
int cclose(nunit, iprint, err)
/*
Close a C (UNIX?) file descriptor:
nunit : (INPUT) : The C (UNIX?) file descriptor to close.
Expand Down
2 changes: 1 addition & 1 deletion hrldas/IO_code/module_NoahMP_hrldas_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ subroutine land_driver_ini(NTIME_out,wrfits,wrfite,wrfjts,wrfjte)
! For SF_URBAN_PHYSICS > 0 read 2D map of urban parameters
!------------------------------------------------------------------------

NoahmpIO%FRC_URB2D = 0.0
if (NoahmpIO%SF_URBAN_PHYSICS > 0) then
NoahmpIO%FRC_URB2D = 0.0
call READ_URBAN_MAP(NoahmpIO%HRLDAS_SETUP_FILE, NoahmpIO%XSTART, NoahmpIO%XEND, NoahmpIO%YSTART, NoahmpIO%YEND, NoahmpIO%FRC_URB2D)
endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@

#=============================================================================================
# Options for Linux with Intel Fortran MPI
# Options for Linux with gnu gfortran MPI
# Please change the library paths according to your computer setup
#=============================================================================================

COMPILERF90 = mpif90
MPPFLAG = YES
FREESOURCE = -free
F90FLAGS = -convert big_endian -g -O0 -fpe0 # -traceback
FREESOURCE = -ffree-form -ffree-line-length-none
F90FLAGS = -g -fconvert=big-endian -fbounds-check -fno-range-check -fallow-argument-mismatch
MODFLAG = -I ../MPP
HYDRO_LIB = ../MPP/mpp_land.o ../MPP/CPL_WRF.o
LDFLAGS =
CPP = cpp
CPPFLAGS = -P -traditional -DMPP_LAND # -DSPATIAL_SOIL
CPPFLAGS = -P -traditional -DMPP_LAND -D_GFORTRAN_ # -DSPATIAL_SOIL
LIBS =
LIBJASPER = -ljasper
INCJASPER = -I/usr/include/jasper
NETCDFMOD = -I/glade/u/apps/ch/opt/netcdf/4.8.1/intel/19.1.1/include
NETCDFLIB = -L/glade/u/apps/ch/opt/netcdf/4.8.1/intel/19.1.1/lib -lnetcdf -lnetcdff
NETCDFMOD = -I${NCAR_INC_NETCDF}
NETCDFLIB = -L${NCAR_LDFLAGS_NETCDF} -lnetcdf -lnetcdff
BZIP2 = NO
# BZIP2_INCLUDE = -I/usr/include
# BZIP2_LIB = -L/usr/lib64 -lbz2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
COMPILERF90 = mpif90
MPPFLAG = YES
FREESOURCE = -free
F90FLAGS = -convert big_endian -g -O0 -fpe0 # -traceback
F90FLAGS = -convert big_endian -g -O0 -fpe0 -traceback
MODFLAG = -I ../MPP
HYDRO_LIB = ../MPP/mpp_land.o ../MPP/CPL_WRF.o
LDFLAGS =
CPP = cpp
CPPFLAGS = -P -traditional -DMPP_LAND # -DSPATIAL_SOIL
LIBS =
LIBJASPER = -ljasper
INCJASPER = -I/glade/u/apps/derecho/23.06/opt/include/jasper
INCJASPER = -I/usr/include/jasper
NETCDFMOD = -I${NCAR_INC_NETCDF}
NETCDFLIB = -L${NCAR_LDFLAGS_NETCDF} -lnetcdf -lnetcdff
BZIP2 = NO
Expand Down
32 changes: 22 additions & 10 deletions hrldas/configure
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@

print " 1. Linux PGI compiler serial \n";
print " 2. Linux PGI compiler MPI \n";
print " 3. Linux ifort compiler serial \n";
print " 4. Linux ifort compiler MPI \n";
print " 5. Linux gfortran compiler serial \n";
print " 6. Linux gfortran compiler MPI \n";
print " 7. Linux gfortran compiler MPI for Docker container \n";
print " 3. Linux intel compiler serial \n";
print " 4. Linux intel compiler MPI \n";
print " 5. Linux intel compiler MPI (NCAR/Derecho) \n";
print " 6. Linux gfortran/gcc compiler serial \n";
print " 7. Linux gfortran/gcc compiler MPI \n";
print " 8. Linux gfortran/gcc compiler MPI (NCAR/Derecho) \n";
print " 9. Linux gfortran/gcc compiler MPI (Docker container) \n";
print " 0. exit only \n";

printf "\nEnter selection [%d-%d] : ",1,7 ;
printf "\nEnter selection [%d-%d] : ",0,9 ;

$response = <STDIN> ;
chop($response);
Expand All @@ -34,26 +36,36 @@
}

case 3 {
# serial ifort
# serial intel
system "cp arch/user_build_options.ifort.serial user_build_options";
}

case 4 {
# MPI ifort
# MPI intel
system "cp arch/user_build_options.ifort.mpi user_build_options";
}

case 5 {
# MPI intel (NCAR/Derecho)
system "cp arch/user_build_options.ifort.mpi.derecho user_build_options";
}

case 6 {
# serial GFORTRAN
system "cp arch/user_build_options.gfortran.serial user_build_options";
}

case 6 {
case 7 {
# MPI GFORTRAN
system "cp arch/user_build_options.gfortran.mpi user_build_options";
}

case 7 {
case 8 {
# MPI GFORTRAN (NCAR/Derecho)
system "cp arch/user_build_options.gfortran.mpi.derecho user_build_options";
}

case 9 {
# MPI GFORTRAN for Docker container
system "cp arch/user_build_options.gfortran.mpi.container user_build_options";
}
Expand Down

0 comments on commit aa2ee8a

Please sign in to comment.