Skip to content

Commit

Permalink
Merge branch 'release-v4.5.2' into feature/improve_netcdf4_detection_…
Browse files Browse the repository at this point in the history
…and_linking
  • Loading branch information
rjdave authored Dec 12, 2023
2 parents 33e218e + d69761a commit ee2889e
Show file tree
Hide file tree
Showing 55 changed files with 553 additions and 383 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,8 @@ fseek_test :

# rule used by configure to test if this will compile with netcdf4
nc4_test:
if [ $(USENETCDFPAR) -eq 0 ] ; then \
( cd tools ; /bin/rm -f nc4_test.{exe,nc,o} ; $(SCC) -o nc4_test.exe nc4_test.c -I$(NETCDF_C)/include "$(NETCDF4_DEP_LIB)" ; cd .. ) ; \
if [ -z "$(USENETCDFPAR)" ] || [ $(USENETCDFPAR) -eq 0 ] ; then \
( cd tools ; /bin/rm -f nc4_test.{exe,nc,o} ; $(SCC) -o nc4_test.exe nc4_test.c -I$(NETCDF_C)/include $(NETCDF4_DEP_LIB) ; cd .. ) ; \
else \
( cd tools ; /bin/rm -f nc4_test.{exe,nc,o} ; $(DM_CC) -o nc4_test.exe nc4_test.c -I$(NETCDF_C)/include $(NETCDF4_DEP_LIB) ; cd .. ) ; \
fi
Expand Down
16 changes: 13 additions & 3 deletions arch/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
$sw_time = "" ; # name of a timer to time fortran compiles, e.g. timex or time
$sw_ifort_r8 = 0 ;
$sw_hdf5 = "-lhdf5_hl -lhdf5";
$sw_hdf5_hl_fortran="-lhdf5_hl_fortran";
$sw_zlib = "-lz";
$sw_netcdf4_dep_lib = "";
$sw_gpfs_path = "";
Expand Down Expand Up @@ -349,6 +350,15 @@
$sw_ctsm_mkfile_path = $ENV{WRF_CTSM_MKFILE};
}

if ( $sw_hdf5_path ) {
opendir(my $dh, "$sw_hdf5_path/lib");
($hl) = grep(/hdf5hl_fortran/i, readdir $dh);
closedir($dh);
if ($hl ne "") {
$sw_hdf5_hl_fortran="-lhdf5hl_fortran";
}
}

# parse the configure.wrf file

$validresponse = 0 ;
Expand Down Expand Up @@ -453,6 +463,7 @@
} else {
$sw_terrain_and_landuse =" -DLANDREAD_STUB=1" ;
}

open CONFIGURE_DEFAULTS, "cat ./arch/configure.defaults |" ;
$latchon = 0 ;
while ( <CONFIGURE_DEFAULTS> )
Expand Down Expand Up @@ -732,7 +743,7 @@
}

if ( $sw_hdf5_path )
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib $sw_hdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
$_ =~ s:CONFIGURE_HDF5_FLAG:-DHDF5: ;
}
else
Expand Down Expand Up @@ -1120,7 +1131,7 @@
}

if ( $sw_hdf5_path )
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib $sw_hdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
$_ =~ s:CONFIGURE_HDF5_FLAG:-DHDF5: ;
}
else
Expand Down Expand Up @@ -1200,4 +1211,3 @@
printf "Configuration successful! \n" ;
printf "------------------------------------------------------------------------\n" ;


110 changes: 98 additions & 12 deletions arch/configure.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ DESCRIPTION = INTEL ($SFC/$SCC)
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -350,7 +350,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): Xeon Phi (MIC architecture)
DMPARALLEL = 1
OMPCPP = -D_OPENMP
OMP = -qopenmp -fpp -auto
OMPCC = -qopenmp -fpp -auto
OMPCC = -qopenmp
SFC = ifort -mmic
SCC = icc -mmic
CCOMP = icc -mmic
Expand Down Expand Up @@ -398,7 +398,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): Xeon (SNB with AVX mods)
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -472,7 +472,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): SGI MPT
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -522,7 +522,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): IBM POE
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -602,7 +602,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): ia64
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -686,7 +686,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): SGI Altix
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -868,7 +868,7 @@ DESCRIPTION = INTEL ($SFC/$SCC)
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -1358,7 +1358,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): Cray XC
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ftn
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -1745,7 +1745,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): Open MPI
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -1881,7 +1881,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): HSW/BDW
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -1926,7 +1926,7 @@ DESCRIPTION = INTEL ($SFC/$SCC): KNL MIC
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -fpp -auto
OMPCC = # -qopenmp
SFC = ifort
SCC = icc
CCOMP = icc
Expand Down Expand Up @@ -2124,6 +2124,92 @@ NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

#insert new stanza here

###########################################################
#ARCH Linux x86_64 ppc64le i486 i586 i686, Intel oneAPI compiler with icx #serial smpar dmpar dm+sm
# This mirrors the above Intel build but changes ifort=>ifx icc=>icx

DESCRIPTION = INTEL ($SFC/$SCC) : oneAPI LLVM
DMPARALLEL = # 1
OMPCPP = # -D_OPENMP
OMP = # -qopenmp -fpp -auto
OMPCC = # -qopenmp -auto
SFC = ifx
SCC = icx
CCOMP = icx
DM_FC = mpif90 -f90=$(SFC)
DM_CC = mpicc -cc=$(SCC)
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
RWORDSIZE = CONFIGURE_RWORDSIZE
PROMOTION = -real-size `expr 8 \* $(RWORDSIZE)` -i4
ARCH_LOCAL = -DNONSTANDARD_SYSTEM_FUNC CONFIGURE_D_CTSM
CFLAGS_LOCAL = -w -O3 -ip #-xHost -fp-model fast=2 -no-prec-div -no-prec-sqrt -ftz -no-multibyte-chars # -DRSL0_ONLY
LDFLAGS_LOCAL = -ip #-xHost -fp-model fast=2 -no-prec-div -no-prec-sqrt -ftz -align all -fno-alias -fno-common
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
FCOPTIM = -O3
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0 -fno-inline -no-ip
FCDEBUG = # -g $(FCNOOPT) -traceback # -fpe0 -check noarg_temp_created,bounds,format,output_conversion,pointers,uninit -ftrapuv -unroll0 -u
FORMAT_FIXED = -FI
FORMAT_FREE = -FR
FCSUFFIX =
BYTESWAPIO = -convert big_endian
RECORDLENGTH = -assume byterecl
FCBASEOPTS_NO_G = -ip -fp-model precise -w -ftz -align all -fno-alias $(FORMAT_FREE) $(BYTESWAPIO) #-xHost -fp-model fast=2 -no-heap-arrays -no-prec-div -no-prec-sqrt -fno-common
FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG =
TRADFLAG = CONFIGURE_TRADFLAG
CPP = /lib/cpp CONFIGURE_CPPFLAGS
AR = ar
ARFLAGS = ru
M4 = m4
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH Linux aarch64, armclang compiler OpenMPI # serial smpar dmpar dm+sm
#
DESCRIPTION = armclang ($SFC/$SCC): Aarch64
DMPARALLEL =
OMPCPP = -fopenmp
OMP = -fopenmp
OMPCC = -fopenmp
SFC = armflang
SCC = armclang
CCOMP = armclang
DM_FC = mpif90
DM_CC = mpicc -DMPI2_SUPPORT
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
RWORDSIZE = CONFIGURE_RWORDSIZE
PROMOTION =
ARCH_LOCAL =
CFLAGS_LOCAL = -w -O3 -c -Wno-implicit-function-declaration -Wno-int-conversion -Wno-implicit-int
LDFLAGS_LOCAL = -fopenmp
FCOPTIM = -Ofast -mcpu=native -funroll-loops
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0 -fopenmp -frecursive
FCDEBUG = -g $(FCNOOPT)
FORMAT_FIXED = -ffixed-form -ffixed-line-length-0
FORMAT_FREE = -ffree-form -ffree-line-length-0
FCSUFFIX =
BYTESWAPIO = -fconvert=big-endian -frecord-marker=4
FCBASEOPTS = -w $(FORMAT_FREE) $(BYTESWAPIO)
MODULE_SRCH_FLAG= -I$(WRF_SRC_ROOT_DIR)/main
TRADFLAG = -traditional-cpp
CPP = /lib/cpp CONFIGURE_CPPFLAGS
AR = ar
ARFLAGS = ru
M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC) -Wno-implicit-function-declaration -Wno-int-conversion -Wno-implicit-int

###########################################################
#ARCH Linux aarch64, GCC compiler OpenMPI # serial smpar dmpar dm+sm
#
Expand Down
20 changes: 10 additions & 10 deletions dyn_em/module_advect_em.F
Original file line number Diff line number Diff line change
Expand Up @@ -4620,14 +4620,14 @@ SUBROUTINE advect_w ( w, w_old, tendency, &
! (latitudes are as for u grid, longitudes are displaced)
! Therefore: flow is only from one side for points next to poles
IF ( config_flags%polar .AND. (j == jds+1) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) - mrdy*fqy(i,k,jp1)
END DO
END DO
ELSE IF( config_flags%polar .AND. (j == jde) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) + mrdy*fqy(i,k,jp0)
Expand Down Expand Up @@ -4934,14 +4934,14 @@ SUBROUTINE advect_w ( w, w_old, tendency, &
! (latitudes are as for u grid, longitudes are displaced)
! Therefore: flow is only from one side for points next to poles
IF ( config_flags%polar .AND. (j == jds+1) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) - mrdy*fqy(i,k,jp1)
END DO
END DO
ELSE IF( config_flags%polar .AND. (j == jde) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) + mrdy*fqy(i,k,jp0)
Expand Down Expand Up @@ -5293,14 +5293,14 @@ SUBROUTINE advect_w ( w, w_old, tendency, &
! (latitudes are as for u grid, longitudes are displaced)
! Therefore: flow is only from one side for points next to poles
IF ( config_flags%polar .AND. (j == jds+1) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) - mrdy*fqy(i,k,jp1)
END DO
END DO
ELSE IF( config_flags%polar .AND. (j == jde) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) + mrdy*fqy(i,k,jp0)
Expand Down Expand Up @@ -5525,14 +5525,14 @@ SUBROUTINE advect_w ( w, w_old, tendency, &
! (latitudes are as for u grid, longitudes are displaced)
! Therefore: flow is only from one side for points next to poles
IF ( config_flags%polar .AND. (j == jds+1) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) - mrdy*fqy(i,k,jp1)
END DO
END DO
ELSE IF( config_flags%polar .AND. (j == jde) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) + mrdy*fqy(i,k,jp0)
Expand Down Expand Up @@ -12541,14 +12541,14 @@ SUBROUTINE advect_weno_w ( w, w_old, tendency, &
! (latitudes are as for u grid, longitudes are displaced)
! Therefore: flow is only from one side for points next to poles
IF ( config_flags%polar .AND. (j == jds+1) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) - mrdy*fqy(i,k,jp1)
END DO
END DO
ELSE IF( config_flags%polar .AND. (j == jde) ) THEN
DO k=kts,ktf
DO k=kts+1,ktf+1
DO i = i_start, i_end
mrdy=msftx(i,j-1)*rdy ! see ADT eqn 46 dividing by my, 2nd term RHS
tendency(i,k,j-1) = tendency(i,k,j-1) + mrdy*fqy(i,k,jp0)
Expand Down
5 changes: 2 additions & 3 deletions external/RSL_LITE/buf_for_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ fprintf(stderr,"buffer_for_proc %s %d : was %d, increasing to %d\n",
return(ret) ;
}

int
show_tot_size()
{
int P ;
Expand All @@ -164,9 +165,7 @@ show_tot_size()
}

int
buffer_size_for_proc( P, code )
int P ;
int code ;
buffer_size_for_proc( int P, int code )
{
return( buftab[code][P].size ) ;
}
Loading

0 comments on commit ee2889e

Please sign in to comment.