From 616f625c47f74307c0fcbc54f167e7f4ed4f0e7c Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Tue, 31 Dec 2024 16:45:49 -0300 Subject: [PATCH 1/6] Replaced built-in linear solver with the lapack library subroutines. This should increase the computational efficiency and allow ED2 to leverage future developments from lapack. --- BRAMS/build/bin/Makefile | 4 +- BRAMS/build/bin/include.mk.opt.32intel | 13 ++ BRAMS/build/bin/include.mk.opt.gfortran | 13 ++ BRAMS/build/bin/include.mk.opt.gnu | 13 ++ BRAMS/build/bin/include.mk.opt.intel | 13 ++ BRAMS/build/bin/include.mk.opt.macosx | 13 ++ BRAMS/build/bin/include.mk.opt.nec | 13 ++ BRAMS/build/bin/include.mk.opt.odyssey | 13 ++ BRAMS/build/bin/include.mk.opt.pgi | 13 ++ BRAMS/src/cuparm/grell_cupar_dynamic.f90 | 75 +++++--- BRAMS/src/lib/numutils.f90 | 229 +---------------------- BRAMS/src/surface/leaf3_radiate.f90 | 36 ++-- ED/build/make/Makefile | 6 +- ED/build/make/include.mk.absoft | 32 ++-- ED/build/make/include.mk.arch_linux | 22 ++- ED/build/make/include.mk.bnl | 17 +- ED/build/make/include.mk.bu_geo | 20 +- ED/build/make/include.mk.cannon | 13 ++ ED/build/make/include.mk.cornell | 13 ++ ED/build/make/include.mk.dbg.sdumont | 13 ++ ED/build/make/include.mk.dbg.sunhpc | 13 ++ ED/build/make/include.mk.dmm | 32 ++-- ED/build/make/include.mk.docker | 15 +- ED/build/make/include.mk.docker.gnu | 13 ++ ED/build/make/include.mk.docker.intel | 13 ++ ED/build/make/include.mk.ebi | 33 ++-- ED/build/make/include.mk.gfortran | 22 ++- ED/build/make/include.mk.gfortran2 | 20 +- ED/build/make/include.mk.gnu | 62 +++--- ED/build/make/include.mk.gnu-odyssey | 13 ++ ED/build/make/include.mk.intel | 13 ++ ED/build/make/include.mk.jpl | 13 ++ ED/build/make/include.mk.macos_homebrew | 28 +++ ED/build/make/include.mk.macosx | 14 +- ED/build/make/include.mk.ncsa | 19 +- ED/build/make/include.mk.nec | 41 ++-- ED/build/make/include.mk.pecan2 | 23 ++- ED/build/make/include.mk.pgi | 20 +- ED/build/make/include.mk.sdumont | 13 ++ ED/build/make/include.mk.sunhpc | 13 ++ ED/build/make/include.mk.travisci | 13 ++ ED/build/make/include.mk.ugent | 19 ++ ED/build/make/include.mk.xlf | 20 +- ED/src/dynamics/multiple_scatter.f90 | 30 +-- ED/src/dynamics/twostream_rad.f90 | 30 +-- ED/src/utils/numutils.f90 | 112 ----------- 46 files changed, 646 insertions(+), 595 deletions(-) diff --git a/BRAMS/build/bin/Makefile b/BRAMS/build/bin/Makefile index 3e6a5d8b3..8f3a505a0 100644 --- a/BRAMS/build/bin/Makefile +++ b/BRAMS/build/bin/Makefile @@ -23,7 +23,7 @@ endif #----- Compiler commands. -----------------------------------------------------------------# -INCLUDES = $(PAR_INCS) -I$(UTILS_INCS) $(HDF5_INCS) $(MPI_INCS) +INCLUDES = $(PAR_INCS) -I$(UTILS_INCS) $(HDF5_INCS) $(MPI_INCS) $(LAPACK_INCS) F90_COMMAND = $(F_COMP) -c $(F_OPTS) $(INCLUDES) $(PAR_DEFS) F90_LOWO_COMMAND = $(F_COMP) -c $(F_LOWO_OPTS) $(INCLUDES) $(PAR_DEFS) FPP_COMMAND = $(F_COMP) -c -DUSE_INTERF=$(USE_INTERF) -DUSENC=$(USENC) -D$(CMACH) \ @@ -63,7 +63,7 @@ gendep: $(EXE): $(LIBMODEL) $(MAINOBJ) @echo "" $(LOADER) -o $(EXE) rammain.o $(LOADER_OPTS) $(LIBMODEL) \ - $(HDF4_LIBS) $(HDF5_LIBS) $(PAR_LIBS) $(NC_LIBS) $(LIBS) + $(HDF4_LIBS) $(HDF5_LIBS) $(PAR_LIBS) $(LAPACK_LIBS) $(NC_LIBS) $(LIBS) @echo "" @echo Finished building === $(EXE) @echo "" diff --git a/BRAMS/build/bin/include.mk.opt.32intel b/BRAMS/build/bin/include.mk.opt.32intel index b0f810879..f74b41a79 100644 --- a/BRAMS/build/bin/include.mk.opt.32intel +++ b/BRAMS/build/bin/include.mk.opt.32intel @@ -54,6 +54,19 @@ HDF5_LIBS=-L/n/Moorcroft_Lab/Users/mlongo/util/hdflib/hdf5_32/hdf5/lib \ # may benefit from collective I/O, then use this flag = 1 # Otherwise, set it to zero. + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + USE_COLLECTIVE_MPIO=0 #--------------------------------------------------------------- diff --git a/BRAMS/build/bin/include.mk.opt.gfortran b/BRAMS/build/bin/include.mk.opt.gfortran index 6ae2bb70e..bb3277aba 100644 --- a/BRAMS/build/bin/include.mk.opt.gfortran +++ b/BRAMS/build/bin/include.mk.opt.gfortran @@ -56,6 +56,19 @@ HDF5_LIBS=-lz -L/opt/hdf5/1.8.1/ompi-tcp-gnu41/lib \ +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + # HDF libraries------------------------------------------------- # HDF4 library: Instructions to install: www.cptec.inpe.br/brams # If you run "configure" script, you don't need to edit line bellow diff --git a/BRAMS/build/bin/include.mk.opt.gnu b/BRAMS/build/bin/include.mk.opt.gnu index 0887a8ad0..968d40bc3 100644 --- a/BRAMS/build/bin/include.mk.opt.gnu +++ b/BRAMS/build/bin/include.mk.opt.gnu @@ -62,6 +62,19 @@ HDF4_LIBS=-L./.hdf4_libs -lmfhdf -ldf -lz -ljpeg -lsz USE_MPIWTIME=0 +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #----------------- SGI -n32 ------------------------------------ #CMACH=SGI #F_COMP=f90 diff --git a/BRAMS/build/bin/include.mk.opt.intel b/BRAMS/build/bin/include.mk.opt.intel index f817e1144..adb8dd331 100644 --- a/BRAMS/build/bin/include.mk.opt.intel +++ b/BRAMS/build/bin/include.mk.opt.intel @@ -62,6 +62,19 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/BRAMS/build/bin/include.mk.opt.macosx b/BRAMS/build/bin/include.mk.opt.macosx index 0b1ea1fb5..4c0cf754e 100644 --- a/BRAMS/build/bin/include.mk.opt.macosx +++ b/BRAMS/build/bin/include.mk.opt.macosx @@ -78,6 +78,19 @@ NC_LIBS=-L/dev/null # -------------------------------------------------------------- +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + # MPI_Wtime. --------------------------------------------------- # If USE_MPIWTIME=1, then it will use MPI libraries to compute # the wall time (the only double-precision intrinsic). In case diff --git a/BRAMS/build/bin/include.mk.opt.nec b/BRAMS/build/bin/include.mk.opt.nec index cdb2792de..6b77be350 100644 --- a/BRAMS/build/bin/include.mk.opt.nec +++ b/BRAMS/build/bin/include.mk.opt.nec @@ -63,6 +63,19 @@ HDF4_LIBS= USE_MPIWTIME=1 +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #----------------- SGI -n32 ------------------------------------ #CMACH=SGI #F_COMP=f90 diff --git a/BRAMS/build/bin/include.mk.opt.odyssey b/BRAMS/build/bin/include.mk.opt.odyssey index 06d9b5d0a..2ea67be4a 100644 --- a/BRAMS/build/bin/include.mk.opt.odyssey +++ b/BRAMS/build/bin/include.mk.opt.odyssey @@ -62,6 +62,19 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/BRAMS/build/bin/include.mk.opt.pgi b/BRAMS/build/bin/include.mk.opt.pgi index 00bcf85e7..ed046d6a6 100644 --- a/BRAMS/build/bin/include.mk.opt.pgi +++ b/BRAMS/build/bin/include.mk.opt.pgi @@ -42,6 +42,19 @@ HDF4_LIBS= #HDF4_LIBS=-L.hdf4_libs -lmfhdf -ldf -lz -ljpeg -lsz # -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + # HDF 5 Libraries # ED2 HAS OPTIONAL HDF 5 I/O # If you wish to use this functionality specify USE_HDF5=1 diff --git a/BRAMS/src/cuparm/grell_cupar_dynamic.f90 b/BRAMS/src/cuparm/grell_cupar_dynamic.f90 index f0d705ee4..539d48a35 100644 --- a/BRAMS/src/cuparm/grell_cupar_dynamic.f90 +++ b/BRAMS/src/cuparm/grell_cupar_dynamic.f90 @@ -29,7 +29,7 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max ,dzu_cld & ! intent(in) - Delta-height for updraft calculations [ m] ,exner & ! intent(in) - Forced Exner funtion [ J/kg/K] ,exnersur & ! intent(in) - Surface Exner function [ J/kg/K] - ,mconv & ! intent(in) - Integrated moisture convergence [kg/m�/s] + ,mconv & ! intent(in) - Integrated moisture convergence [kg/m2/s] ,mkx & ! intent(in) - Number of vertical levels [ ---] ,omeg & ! intent(in) - Vertical velocity in pressure, dp/dt: [ Pa/s] ,p & ! intent(in) - Pressure with forcing [ Pa] @@ -42,7 +42,7 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max ,qliqsur & ! intent(in) - surface liquid water mixing ratio [ kg/kg] ,qice & ! intent(in) - Ice mixing ratio with forcing. [ kg/kg] ,qicesur & ! intent(in) - surface ice mixing ratio [ kg/kg] - ,rho & ! intent(in) - Air density [ kg/m�] + ,rho & ! intent(in) - Air density [ kg/m3] ,theiv & ! intent(in) - THETA-Eiv with forcing [ K] ,theivsur & ! intent(in) - Surface ice-vapour equiv. pot. temp. [ K] ,thil & ! intent(in) - THETA-il with forcing [ K] @@ -56,12 +56,12 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max ,cdu & ! intent(out) - Normalised updraft detrainment rate [ ---] ,mentrd_rate & ! intent(out) - Normalised downdraft entrainment rate [ ---] ,mentru_rate & ! intent(out) - Normalised updraft entrainment rate [ ---] - ,dbyd & ! intent(out) - Buoyancy associated with downdrafts [ m/s�] - ,dbyu & ! intent(out) - Buoyancy associated with updrafts [ m/s�] + ,dbyd & ! intent(out) - Buoyancy associated with downdrafts [ m/s2] + ,dbyu & ! intent(out) - Buoyancy associated with updrafts [ m/s2] ,etad_cld & ! intent(out) - normalised downdraft mass flux [ ---] ,etau_cld & ! intent(out) - normalised updraft mass flux [ ---] - ,rhod_cld & ! intent(out) - Downdraft density [ kg/m�] - ,rhou_cld & ! intent(out) - Updraft density [ kg/m�] + ,rhod_cld & ! intent(out) - Downdraft density [ kg/m3] + ,rhou_cld & ! intent(out) - Updraft density [ kg/m3] ,qliqd_cld & ! intent(out) - Liquid water mixing ratio at dndraft [ kg/kg] ,qliqu_cld & ! intent(out) - Liquid water mixing ratio at updraft [ kg/kg] ,qiced_cld & ! intent(out) - Ice mixing ratio at downdraft [ kg/kg] @@ -72,8 +72,8 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max ,x_co2_cup & ! intent(out) - CO2 mixing ratio [ ppm] ,x_co2d_cld & ! intent(out) - CO2 mixing ratio [ ppm] ,x_co2u_cld & ! intent(out) - CO2 mixing ratio [ ppm] - ,x_dbyd & ! intent(out) - Buoyancy acceleration [ m/s�] - ,x_dbyu & ! intent(out) - Buoyancy acceleration [ m/s�] + ,x_dbyd & ! intent(out) - Buoyancy acceleration [ m/s2] + ,x_dbyu & ! intent(out) - Buoyancy acceleration [ m/s2] ,x_exner_cup & ! intent(out) - Exner function [ J/kg] ,x_p_cup & ! intent(out) - Pressure [ Pa] ,x_pwav & ! intent(out) - Integrated condensation [ kg/kg] @@ -99,9 +99,9 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max ,x_qsat_cup & ! intent(out) - Saturation mixing ratio [ kg/kg] ,x_qsatd_cld & ! intent(out) - Sat. mixing ratio [ kg/kg] ,x_qsatu_cld & ! intent(out) - Sat. mixing ratio [ kg/kg] - ,x_rho_cup & ! intent(out) - Density [ kg/m�] - ,x_rhod_cld & ! intent(out) - Density [ kg/m�] - ,x_rhou_cld & ! intent(out) - Density [ kg/m�] + ,x_rho_cup & ! intent(out) - Density [ kg/m3] + ,x_rhod_cld & ! intent(out) - Density [ kg/m3] + ,x_rhou_cld & ! intent(out) - Density [ kg/m3] ,x_t & ! intent(out) - Temperature [ K] ,x_t_cup & ! intent(out) - Temperature [ K] ,x_td_cld & ! intent(out) - Temperature [ K] @@ -192,7 +192,7 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max !---------------------------------------------------------------------------------------! ! Miscellaneous parameters ! !---------------------------------------------------------------------------------------! - real, dimension(maxens_lsf) :: mbprime ! Arbitrary m. flux to modify environm. [kg/m�/s] + real, dimension(maxens_lsf) :: mbprime ! Arbitrary m. flux to modify environm. [kg/m2/s] real, dimension(maxens_lsf) :: one_b ! 1-b, Krishnamurti et al. (1983) [ ---] real, dimension(nclouds) :: edt ! Alias for the downdraft/updraft ratio. !------ Printing aux. variables. -------------------------------------------------------! @@ -489,7 +489,7 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max ! efficiency, static control, and large-scale forcing. Inside this subroutine we ! ! will find all members of the dynamic control for all clouds. The outcome will be ! ! a vector of reference updraft mass flux for that member. ! - ! mass flux will then have maxens_eff � maxens_lsf � maxens_dyn different values. ! + ! mass flux will then have maxens_eff * maxens_lsf * maxens_dyn different values. ! !---------------------------------------------------------------------------------------! stacloop2: do icap=1,maxens_cap @@ -732,7 +732,7 @@ subroutine grell_dyncontrol_ensemble(nclouds,mgmzp,maxens_dyn,cldd,clds,dtime,cl end do mcloop !---------------------------------------------------------------------------------------! - ! 6. Ensemble, based on Grell and D�v�nyi (2002) ! + ! 6. Ensemble, based on Grell and Devenyi (2002) ! ! Here for each different dynamic control style, the first element is the standard, ! ! like in the previous cases, and the others are perturbations. ! !---------------------------------------------------------------------------------------! @@ -859,7 +859,7 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr integer :: jsol ! Yet another cloud index real :: dtimei ! Scratch, inverse of delta-t integer :: nsolv ! # of clouds we are still solving. - logical :: is_sing ! Flag. The kernel was singular. [T|F] + integer :: info ! Lapack Flag for errors (0 means fine). !----- Auxilliary variables, containing flags and references. --------------------------! logical, dimension(nclouds) :: okcld ! This cloud is still ok to use. integer, dimension(nclouds) :: cloud ! Absolute cloud index. @@ -868,6 +868,7 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr real , dimension(:) , allocatable :: diagkke ! Diagonal of kke real , dimension(:) , allocatable :: mfo ! Minus the large-scale forcing real , dimension(:) , allocatable :: mb ! Mass flux + integer, dimension(:) , allocatable :: pivot ! Pivot (needed by Lapack, not used) integer, dimension(:) , allocatable :: cldidx ! Cloud index, to copy back to ensemble !---------------------------------------------------------------------------------------! @@ -915,6 +916,7 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr allocate(diagkke (nsolv)) allocate(mfo (nsolv)) allocate(mb (nsolv)) + allocate(pivot (nsolv)) allocate(cldidx (nsolv)) !----- Store the actual cloud number of the clouds that exist. ----------------------! @@ -943,10 +945,13 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr !------------------------------------------------------------------------------------! - ! Solve the linear system using a Gaussian elimination method. The system, as ! - ! stated in Lord et al. (1982), is : K * Mb = -F. ! + ! Solve the linear system. We invoke the Linear Algebra Package (LAPACK) ! + ! procedure for solving the system efficiently. LAPACK rewrites the right hand side ! + ! vector with the solution, so we first copy the right hand side to the output ! + ! vector. ! !------------------------------------------------------------------------------------! - call lisys_solver(nsolv,kke,mfo,mb,is_sing) + mb(:) = mfo(:) + call sgesv(nsolv,1,kke,nsolv,pivot,mb,nsolv,info) !------------------------------------------------------------------------------------! @@ -954,7 +959,7 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr ! First we check whether the solution is an appropriate one or something went ! ! wrong. ! !------------------------------------------------------------------------------------! - if (is_sing) then + if (info > 0) then !---------------------------------------------------------------------------------! ! The matrix is singular or almost singular, so we cannot solve these clouds. ! ! We can quit this routine after freeing the allocated arrays. ! @@ -963,6 +968,7 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) !---------------------------------------------------------------------------------! exit queq_loop @@ -983,6 +989,7 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) !---------------------------------------------------------------------------------! else @@ -1001,6 +1008,7 @@ subroutine grell_grell_solver(nclouds,cldd,clds,dtime,fac,aatot0,aatot,mfke,ierr deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) !---------------------------------------------------------------------------------! exit queq_loop @@ -1111,6 +1119,7 @@ subroutine grell_arakschu_solver(nclouds,cldd,clds,mgmzp,dtime,p_cup,clim,whlev, allocate(diagkke (nsolv)) allocate(mfo (nsolv)) allocate(mb (nsolv)) + allocate(pivot (nsolv)) allocate(cldidx (nsolv)) !----- Store the actual cloud number of those clouds @@ -1160,12 +1169,14 @@ subroutine grell_arakschu_solver(nclouds,cldd,clds,mgmzp,dtime,p_cup,clim,whlev, - !------------------------------------------------------------------------------------! - ! Solve the linear system using a Gaussian elimination method. The system, as ! - ! stated in Lord et al. (1982), is : K * Mb = -F. ! + ! Solve the linear system. The system, as stated in Lord et al. (1982), is: ! + ! K * Mb = -F. We invoke the Linear Algebra Package (LAPACK) procedure for solving ! + ! the system efficiently. LAPACK rewrites the right hand side vector with the ! + ! solution, so we first copy the right hand side to the output vector. ! !------------------------------------------------------------------------------------! - call lisys_solver(nsolv,kke,mfo,mb,is_sing) + mb(:) = mfo(:) + call sgesv(nsolv,1,kke,nsolv,pivot,mb,nsolv,info) !------------------------------------------------------------------------------------! @@ -1173,7 +1184,7 @@ subroutine grell_arakschu_solver(nclouds,cldd,clds,mgmzp,dtime,p_cup,clim,whlev, ! First we check whether the solution is an appropriate one or something went ! ! wrong. ! !------------------------------------------------------------------------------------! - if (is_sing) then + if (info > 0) then !---------------------------------------------------------------------------------! ! The matrix is singular or almost singular, so we cannot solve these clouds. ! ! We can quit this routine after freeing the allocated arrays. ! @@ -1182,6 +1193,7 @@ subroutine grell_arakschu_solver(nclouds,cldd,clds,mgmzp,dtime,p_cup,clim,whlev, deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) exit queq_loop elseif (any(mb < 0.) .or. any(diagkke == 0.)) then @@ -1200,6 +1212,7 @@ subroutine grell_arakschu_solver(nclouds,cldd,clds,mgmzp,dtime,p_cup,clim,whlev, deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) !---------------------------------------------------------------------------------! else @@ -1218,6 +1231,7 @@ subroutine grell_arakschu_solver(nclouds,cldd,clds,mgmzp,dtime,p_cup,clim,whlev, deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) !---------------------------------------------------------------------------------! exit queq_loop @@ -1321,6 +1335,7 @@ subroutine grell_inre_solver(nclouds,cldd,clds,tscal,fac,aatot0,mfke,ierr,upmf,u allocate(diagkke (nsolv)) allocate(mfo (nsolv)) allocate(mb (nsolv)) + allocate(pivot (nsolv)) allocate(cldidx (nsolv)) !------------------------------------------------------------------------------------! @@ -1350,10 +1365,13 @@ subroutine grell_inre_solver(nclouds,cldd,clds,tscal,fac,aatot0,mfke,ierr,upmf,u !------------------------------------------------------------------------------------! - ! Solve the linear system using a Gaussian elimination method. The system, as ! - ! stated in Lord et al. (1982), is : K * Mb = -F. ! + ! Solve the linear system. The system, as stated in Lord et al. (1982), is: ! + ! K * Mb = -F. We invoke the Linear Algebra Package (LAPACK) procedure for solving ! + ! the system efficiently. LAPACK rewrites the right hand side vector with the ! + ! solution, so we first copy the right hand side to the output vector. ! !------------------------------------------------------------------------------------! - call lisys_solver(nsolv,kke,mfo,mb,is_sing) + mb(:) = mfo(:) + call sgesv(nsolv,1,kke,nsolv,pivot,mb,nsolv,info) !------------------------------------------------------------------------------------! @@ -1371,6 +1389,7 @@ subroutine grell_inre_solver(nclouds,cldd,clds,tscal,fac,aatot0,mfke,ierr,upmf,u deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) exit inre_loop elseif (any(mb < 0.) .or. any(diagkke == 0.)) then @@ -1389,6 +1408,7 @@ subroutine grell_inre_solver(nclouds,cldd,clds,tscal,fac,aatot0,mfke,ierr,upmf,u deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) !---------------------------------------------------------------------------------! else @@ -1407,6 +1427,7 @@ subroutine grell_inre_solver(nclouds,cldd,clds,tscal,fac,aatot0,mfke,ierr,upmf,u deallocate(diagkke) deallocate(mfo ) deallocate(mb ) + deallocate(pivot ) deallocate(cldidx ) !---------------------------------------------------------------------------------! exit inre_loop diff --git a/BRAMS/src/lib/numutils.f90 b/BRAMS/src/lib/numutils.f90 index 8d2f47e81..4da555057 100644 --- a/BRAMS/src/lib/numutils.f90 +++ b/BRAMS/src/lib/numutils.f90 @@ -1811,7 +1811,7 @@ end function expected !==========================================================================================! !==========================================================================================! -! This function simply computes f(x) = exp (-x�). Just to make errorfun neater. ! +! This function simply computes f(x) = exp (-x2). Just to make errorfun neater. ! !------------------------------------------------------------------------------------------! real function expmsq(x) implicit none @@ -1921,233 +1921,6 @@ end function check_real - -!==========================================================================================! -!==========================================================================================! -! This subroutine will solve the linear system AA . X = Y for given AA and Y, using ! -! the Gaussian elimination method with partial pivoting and back-substitution. ! -! This subroutine is based on: ! -! ! -! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! -! in Fortran 77. Cambridge University Press. ! -!------------------------------------------------------------------------------------------! -subroutine lisys_solver(nsiz,AA,Y,X,sing) - implicit none - !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: nsiz ! matrix and vector size - real(kind=4), dimension(nsiz,nsiz), intent(in) :: AA ! matrix - real(kind=4), dimension(nsiz) , intent(in) :: Y ! right-hand side vector - real(kind=4), dimension(nsiz) , intent(out) :: X ! unknown vector - logical , intent(out) :: sing ! The matrix is singular [T|F] - !----- Local variables. ----------------------------------------------------------------! - real(kind=4), dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. - real(kind=4), dimension(nsiz) :: Z ! Copy of Y, for scaling - real(kind=4), dimension(nsiz) :: dumvec ! Dummy vector (row swapping) - real(kind=4) :: pivot ! The pivot - real(kind=4) :: multip ! Multiplier - integer :: r ! Row index - integer :: b ! Row below index - integer :: c ! Column index - integer :: p ! Pivot index - real(kind=4) :: dumsca ! Dummy scalar (row swapping) - !----- Local parameters. ---------------------------------------------------------------! - real(kind=4) , parameter :: tinyoff=1.e-20 - !---------------------------------------------------------------------------------------! - - !----- First thing, we copy AA to EE and Y to Z. ---------------------------------------! - EE(:,:) = AA(:,:) - Z (:) = Y (:) - dumvec = 0. - dumsca = 0. - !---------------------------------------------------------------------------------------! - ! We initialise X with a huge, non-sense value, which will become the answer when ! - ! the matrix is singular. ! - !---------------------------------------------------------------------------------------! - X (:) = -huge(1.) - !----- We first assume that everything will be fine. -----------------------------------! - sing = .false. - - !---------------------------------------------------------------------------------------! - ! 1. Main elimination loop, done row by row. ! - !---------------------------------------------------------------------------------------! - elimloop: do r = 1, nsiz-1 - !------ 1a. Finding the largest element, which will become our pivot ----------------! - p = (r-1) + maxloc(abs(EE(r:nsiz,r)),dim=1) - - pivot = maxval(abs(EE(r:nsiz,r))) - !------------------------------------------------------------------------------------! - ! 1b. Check the pivot and make sure it is a good one. If not, then this matrix is ! - ! singular or almost singular, and we cannot solve it, so we switch the flag and ! - ! return. ! - !------------------------------------------------------------------------------------! - if (pivot < tinyoff) then - sing = .true. - return - end if - - !----- 1c. If the best pivot is not the current row, we must swap them. -------------! - if (p /= r) then - dumvec(r:nsiz) = EE(r,r:nsiz) - dumsca = Z(r) - EE(r,r:nsiz) = EE(p,r:nsiz) - Z(r) = Z(p) - EE(p,r:nsiz) = dumvec(r:nsiz) - Z(p) = dumsca - end if - - !------------------------------------------------------------------------------------! - ! 1d. Eliminate rows below, everything to the left of the (,r) column will become ! - ! zero (we won't compute that, but they will be.). ! - !------------------------------------------------------------------------------------! - belowloop: do b=r+1,nsiz - multip = EE(b,r)/EE(r,r) - EE(b,r:nsiz) = EE(b,r:nsiz) - multip * EE(r,r:nsiz) - Z(b) = Z(b) - multip * Z(r) - end do belowloop - end do elimloop - - !---------------------------------------------------------------------------------------! - ! 2. We may be unlucky and discover that the matrix is singular at the last line, so we ! - ! check the last pivot too. ! - !---------------------------------------------------------------------------------------! - if (abs(EE(nsiz,nsiz)) < tinyoff) then - sing = .true. - return - end if - - !---------------------------------------------------------------------------------------! - ! 3. We now perform the back-substitution, to find the solution. ! - !---------------------------------------------------------------------------------------! - X(nsiz) = Z(nsiz) / EE(nsiz,nsiz) - backsubloop: do r=nsiz-1,1,-1 - b = r+1 - X(r) = (Z(r) - sum(EE(r,b:nsiz)*x(b:nsiz))) / EE(r,r) - end do backsubloop - - return -end subroutine lisys_solver -!==========================================================================================! -!==========================================================================================! - - - - - - - -!==========================================================================================! -!==========================================================================================! -! This subroutine is the double precision version of the linear system solver above. ! -! It will solve the linear system AA . X = Y for given AA and Y, using the Gaussian ! -! elimination method with partial pivoting and back-substitution. This subroutine is ! -! based on: ! -! ! -! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! -! in Fortran 77. Cambridge University Press. ! -!------------------------------------------------------------------------------------------! -subroutine lisys_solver8(nsiz,AA,Y,X,sing) - implicit none - !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: nsiz ! matrix and vector size - real(kind=8), dimension(nsiz,nsiz), intent(in) :: AA ! matrix - real(kind=8), dimension(nsiz) , intent(in) :: Y ! right-hand side vector - real(kind=8), dimension(nsiz) , intent(out) :: X ! unknown vector - logical , intent(out) :: sing ! The matrix was singular [T|F] - !----- Local variables. ----------------------------------------------------------------! - real(kind=8), dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. - real(kind=8), dimension(nsiz) :: Z ! Copy of Y, for scaling - real(kind=8), dimension(nsiz) :: dumvec ! Dummy vector (row swapping) - real(kind=8) :: pivot ! The pivot - real(kind=8) :: multip ! Multiplier - integer :: r ! Row index - integer :: b ! Row below index - integer :: c ! Column index - integer :: p ! Pivot index - real(kind=8) :: dumsca ! Dummy scalar (row swapping) - !----- Local parameters. ---------------------------------------------------------------! - real(kind=8) , parameter :: tinyoff=1.d-20 - !---------------------------------------------------------------------------------------! - - !----- First thing, we copy AA to EE and Y to Z. ---------------------------------------! - EE(:,:) = AA(:,:) - Z (:) = Y (:) - dumvec = 0.d0 - dumsca = 0.d0 - !---------------------------------------------------------------------------------------! - ! We initialise X with a huge, non-sense value, which will become the answer when ! - ! the matrix is singular. ! - !---------------------------------------------------------------------------------------! - X (:) = -huge(1.d0) - !----- We first assume that everything will be fine. -----------------------------------! - sing = .false. - - !---------------------------------------------------------------------------------------! - ! 1. Main elimination loop, done row by row. ! - !---------------------------------------------------------------------------------------! - elimloop: do r = 1, nsiz-1 - !------ 1a. Finding the largest element, which will become our pivot ----------------! - p = (r-1) + maxloc(abs(EE(r:nsiz,r)),dim=1) - - pivot = maxval(abs(EE(r:nsiz,r))) - !------------------------------------------------------------------------------------! - ! 1b. Check the pivot and make sure it is a good one. If not, then this matrix is ! - ! singular or almost singular, and we cannot solve it, so we switch the flag and ! - ! return. ! - !------------------------------------------------------------------------------------! - if (pivot < tinyoff) then - sing = .true. - return - end if - - !----- 1c. If the best pivot is not the current row, we must swap them. -------------! - if (p /= r) then - dumvec(r:nsiz) = EE(r,r:nsiz) - dumsca = Z(r) - EE(r,r:nsiz) = EE(p,r:nsiz) - Z(r) = Z(p) - EE(p,r:nsiz) = dumvec(r:nsiz) - Z(p) = dumsca - end if - - !------------------------------------------------------------------------------------! - ! 1d. Eliminate rows below, everything to the left of the (,r) column will become ! - ! zero (we won't compute that, but they will be.). ! - !------------------------------------------------------------------------------------! - belowloop: do b=r+1,nsiz - multip = EE(b,r)/EE(r,r) - EE(b,r:nsiz) = EE(b,r:nsiz) - multip * EE(r,r:nsiz) - Z(b) = Z(b) - multip * Z(r) - end do belowloop - end do elimloop - - !---------------------------------------------------------------------------------------! - ! 2. We may be unlucky and discover that the matrix is singular at the last line, so we ! - ! check the last pivot too. ! - !---------------------------------------------------------------------------------------! - if (abs(EE(nsiz,nsiz)) < tinyoff) then - sing = .true. - return - end if - - !---------------------------------------------------------------------------------------! - ! 3. We now perform the back-substitution, to find the solution. ! - !---------------------------------------------------------------------------------------! - X(nsiz) = Z(nsiz) / EE(nsiz,nsiz) - backsubloop: do r=nsiz-1,1,-1 - b = r+1 - X(r) = (Z(r) - sum(EE(r,b:nsiz)*x(b:nsiz))) / EE(r,r) - end do backsubloop - - return -end subroutine lisys_solver8 -!==========================================================================================! -!==========================================================================================! - - - - - - !==========================================================================================! !==========================================================================================! ! This function checks whether a number is finite or not. This test will return true ! diff --git a/BRAMS/src/surface/leaf3_radiate.f90 b/BRAMS/src/surface/leaf3_radiate.f90 index c8cf3df65..c192f1fc0 100644 --- a/BRAMS/src/surface/leaf3_radiate.f90 +++ b/BRAMS/src/surface/leaf3_radiate.f90 @@ -1215,7 +1215,8 @@ subroutine leaf3_2stream_lw(grnd_emiss4,grnd_temp4,rlong_top4,nveg,lai,wai,leaf_ integer :: i2p1 integer :: i2m1 integer :: i2p2 - logical :: sing + integer :: info + integer , dimension(:) , allocatable :: xvec real(kind=8), dimension(:) , allocatable :: black real(kind=8), dimension(:) , allocatable :: expl_plus real(kind=8), dimension(:) , allocatable :: expl_minus @@ -1264,6 +1265,7 @@ subroutine leaf3_2stream_lw(grnd_emiss4,grnd_temp4,rlong_top4,nveg,lai,wai,leaf_ allocate(mmat (ncoh2p2,ncoh2p2) ) allocate(yvec (ncoh2p2) ) allocate(xvec (ncoh2p2) ) + allocate(pivot (ncoh2p2) ) allocate(elai (ncohp1) ) allocate(etai (ncohp1) ) allocate(mu (ncohp1) ) @@ -1449,16 +1451,16 @@ subroutine leaf3_2stream_lw(grnd_emiss4,grnd_temp4,rlong_top4,nveg,lai,wai,leaf_ - !---------------------------------------------------------------------------------------! - ! Solve the linear system. In the future we could use a band diagonal solver, ! - ! which is a lot cheaper than the regular Gauss elimination, but for the time being, we ! - ! go with a tested method. ! + ! Solve the linear system. We invoke the Linear Algebra Package (LAPACK) ! + ! procedure for solving the system efficiently. LAPACK rewrites the right hand side ! + ! vector with the solution, so we first copy the right hand side to the output vector. ! !---------------------------------------------------------------------------------------! - call lisys_solver8(nsiz,mmat,yvec,xvec,sing) - if (sing) then + xvec(:) = yvec(:) + call dgesv(nsiz,1,mmat,nsiz,pivot,xvec,nsiz,info) + if (info > 0) then call abort_run('LW radiation failed... The matrix is singular!' & - ,'leaf3_2stream_lw','leaf3_radiate.f90') + ,'leaf3_2stream_lw','leaf3_radiate.f90') end if !---------------------------------------------------------------------------------------! @@ -1522,6 +1524,7 @@ subroutine leaf3_2stream_lw(grnd_emiss4,grnd_temp4,rlong_top4,nveg,lai,wai,leaf_ deallocate(mmat ) deallocate(yvec ) deallocate(xvec ) + deallocate(pivot ) deallocate(elai ) deallocate(etai ) deallocate(mu ) @@ -1620,13 +1623,14 @@ subroutine leaf3_2stream_sw(grnd_alb_par4,grnd_alb_nir4,cosz4,par_beam_norm4 integer :: i2p1 integer :: i2m1 integer :: i2p2 - logical :: sing + integer :: info real(kind=4) :: nir_beam real(kind=4) :: nir_diff real(kind=8) :: leaf_scatter real(kind=8) :: wood_scatter real(kind=8) :: leaf_backscatter real(kind=8) :: wood_backscatter + integer , dimension(:) , allocatable :: pivot real(kind=8), dimension(:) , allocatable :: expl_plus real(kind=8), dimension(:) , allocatable :: expl_minus real(kind=8), dimension(:) , allocatable :: expm0_minus @@ -1692,6 +1696,7 @@ subroutine leaf3_2stream_sw(grnd_alb_par4,grnd_alb_nir4,cosz4,par_beam_norm4 allocate(mmat (ncoh2p2,ncoh2p2)) allocate(yvec (ncoh2p2) ) allocate(xvec (ncoh2p2) ) + allocate(pivot (ncoh2p2) ) allocate(elai (ncohp1) ) allocate(etai (ncohp1) ) allocate(mu (ncohp1) ) @@ -1990,12 +1995,14 @@ subroutine leaf3_2stream_sw(grnd_alb_par4,grnd_alb_nir4,cosz4,par_beam_norm4 !------------------------------------------------------------------------------------! - ! Solve the linear system. In the future we could use a tridiagonal solver, ! - ! which is a lot cheaper than the regular Gauss elimination, but for the time being, ! - ! we go with a tested method. ! + ! Solve the linear system. We invoke the Linear Algebra Package (LAPACK) ! + ! procedure for solving the system efficiently. LAPACK rewrites the right hand side ! + ! vector with the solution, so we first copy the right hand side to the output ! + ! vector. ! !------------------------------------------------------------------------------------! - call lisys_solver8(nsiz,mmat,yvec,xvec,sing) - if (sing) then + xvec(:) = yvec(:) + call dgesv(nsiz,1,mmat,nsiz,pivot,xvec,nsiz,info) + if (info > 0) then call abort_run('SW radiation failed... The matrix is singular!' & ,'leaf3_2stream_sw','leaf3_radiate.f90') end if @@ -2108,6 +2115,7 @@ subroutine leaf3_2stream_sw(grnd_alb_par4,grnd_alb_nir4,cosz4,par_beam_norm4 deallocate(mmat ) deallocate(yvec ) deallocate(xvec ) + deallocate(pivot ) deallocate(elai ) deallocate(etai ) deallocate(mu ) diff --git a/ED/build/make/Makefile b/ED/build/make/Makefile index 6c48ee2e9..54ee8c773 100644 --- a/ED/build/make/Makefile +++ b/ED/build/make/Makefile @@ -25,7 +25,7 @@ ifeq ($(OPT),"dbg") endif #----- Compiler commands. -----------------------------------------------------------------# -INCLUDES = $(PAR_INCS) -I$(ED_INCS) $(HDF5_INCS) $(MPI_INCS) +INCLUDES = $(PAR_INCS) -I$(ED_INCS) $(HDF5_INCS) $(MPI_INCS) $(LAPACK_INCS) F90_COMMAND = $(F_COMP) -c $(F_OPTS) $(INCLUDES) $(PAR_DEFS) F90_LOWO_COMMAND = $(F_COMP) -c $(F_LOWO_OPTS) $(INCLUDES) $(PAR_DEFS) FPP_COMMAND = $(F_COMP) -c -DUSE_INTERF=$(USE_INTERF) -DUSENC=$(USENC) -D$(CMACH) \ @@ -74,8 +74,8 @@ gendep: $(EXE): $(LIBMODEL) $(MAINOBJ) @echo "" - $(LOADER) -o $(EXE) edmain.o $(LOADER_OPTS) $(INCLUDES) $(LIBMODEL) $(HDF5_LIBS) \ - $(PAR_LIBS) $(NC_LIBS) $(LIBS) $(LOADER_OPTS) + $(LOADER) -o $(EXE) edmain.o $(LOADER_OPTS) $(INCLUDES) $(LIBMODEL) $(HDF5_LIBS) \ + $(LAPACK_LIBS) $(PAR_LIBS) $(LIBS) $(LOADER_OPTS) @echo "" @echo Finished building === $(EXE) @echo "" diff --git a/ED/build/make/include.mk.absoft b/ED/build/make/include.mk.absoft index 73c967d72..452769025 100644 --- a/ED/build/make/include.mk.absoft +++ b/ED/build/make/include.mk.absoft @@ -25,18 +25,6 @@ BASE=$(ED_ROOT)/build/ # Activate appropriate parts below, comment out others. -#--------------------------------------------------------------- -# If you are using a real distribution of NCAR Graphics... -#NCARG_DIR=/usr/local/ncarg-4.3.0/lib -#LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl -#--------------------------------------------------------------- - -# HDF libraries ----------------------------------------------- -# HDF4 library: Instructions to install: www.cptec.inpe.br/brams -# If you run "configure" script, you don't need to edit line bellow -#HDF_LIBS=-L.hdf4_libs -lmfhdf -ldf -lz -ljpeg -lsz -# -------------------------------------------------------------- - # HDF 5 Libraries #HDF5_INCS=-I/n/Moorcroft_Lab/Lab/apps/i91/lib -I/n/Moorcroft_Lab/Lab/apps/i91/include #HDF5_LIBS=-L/n/Moorcroft_Lab/Lab/apps/i91/lib -lhdf5 -lm -lhdf5_fortran -lhdf5 -lhdf5_hl \ @@ -69,14 +57,18 @@ USE_COLLECTIVE_MPIO=0 #--------------------------------------------------------------- -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.arch_linux b/ED/build/make/include.mk.arch_linux index 8b934ac90..e56744e95 100644 --- a/ED/build/make/include.mk.arch_linux +++ b/ED/build/make/include.mk.arch_linux @@ -11,14 +11,20 @@ BASE=$(ED_ROOT)/build/ HDF5_INCS= HDF5_LIBS=-lhdf5 -lm -lhdf5_fortran -lhdf5 -lhdf5_hl -lz USE_COLLECTIVE_MPIO=1 - -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null +------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.bnl b/ED/build/make/include.mk.bnl index 6028ded24..a41eb98a7 100644 --- a/ED/build/make/include.mk.bnl +++ b/ED/build/make/include.mk.bnl @@ -12,10 +12,19 @@ HDF5_HOME=/data/software/hdf5/1.8.19-gcc540 HDF5_INCS=-I${HDF5_HOME}/include HDF5_LIBS=-L${HDF5_HOME}/lib -lhdf5 -lm -lhdf5_fortran -lhdf5 -lhdf5_hl -lz USE_COLLECTIVE_MPIO=0 - -# netCDF libraries -USENC=0 -NC_LIBS=-L/dev/null + + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface USE_INTERF=1 diff --git a/ED/build/make/include.mk.bu_geo b/ED/build/make/include.mk.bu_geo index a22538eb9..28ca800ec 100644 --- a/ED/build/make/include.mk.bu_geo +++ b/ED/build/make/include.mk.bu_geo @@ -40,14 +40,18 @@ USE_COLLECTIVE_MPIO=1 #--------------------------------------------------------------- -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.cannon b/ED/build/make/include.mk.cannon index 4e28cf388..38f1c6a10 100644 --- a/ED/build/make/include.mk.cannon +++ b/ED/build/make/include.mk.cannon @@ -30,6 +30,19 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/n/home00/mlongo/Util/Modules/lapack/3.12.0_intel +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.cornell b/ED/build/make/include.mk.cornell index 9614c72d5..529a3b341 100644 --- a/ED/build/make/include.mk.cornell +++ b/ED/build/make/include.mk.cornell @@ -31,6 +31,19 @@ HDF5_LIBS=-L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl -lm -lz #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.dbg.sdumont b/ED/build/make/include.mk.dbg.sdumont index 735886808..1e1ddf080 100644 --- a/ED/build/make/include.mk.dbg.sdumont +++ b/ED/build/make/include.mk.dbg.sdumont @@ -30,6 +30,19 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5 #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/scratch/bramsolam/marcos.longo/Util/lapack-3.12.0/intel +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.dbg.sunhpc b/ED/build/make/include.mk.dbg.sunhpc index f19174a42..a2e81763e 100644 --- a/ED/build/make/include.mk.dbg.sunhpc +++ b/ED/build/make/include.mk.dbg.sunhpc @@ -30,6 +30,19 @@ HDF5_LIBS=-lm -L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -l #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/prj/prjidfca/marcosl/Util/lapack-3.12.0/intel +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.dmm b/ED/build/make/include.mk.dmm index 449f3b684..c3df1136f 100644 --- a/ED/build/make/include.mk.dmm +++ b/ED/build/make/include.mk.dmm @@ -25,31 +25,23 @@ BASE=$(ED_ROOT)/build/ # Activate appropriate parts below, comment out others. -#--------------------------------------------------------------- -# If you are using a real distribution of NCAR Graphics... -#NCARG_DIR=/usr/local/ncarg-4.3.0/lib -#LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl -#--------------------------------------------------------------- - -# HDF libraries ----------------------------------------------- -# HDF4 library: Instructions to install: www.cptec.inpe.br/brams -# If you run "configure" script, you don't need to edit line bellow -#HDF_LIBS=-L.hdf4_libs -lmfhdf -ldf -lz -ljpeg -lsz -# -------------------------------------------------------------- - # HDF 5 Libraries HDF5_INCS=-I/n/Moorcroft_Lab/Lab/apps/i91/lib -I/n/Moorcroft_Lab/Lab/apps/i91/include HDF5_LIBS=-L/n/Moorcroft_Lab/Lab/apps/i91/lib -lhdf5 -lm -lhdf5_fortran \ -lhdf5 -lhdf5_hl -L/n/Moorcroft_Lab/Users/mlongo/util/hdflib/hdf4_64/zlib/lib -lz -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.docker b/ED/build/make/include.mk.docker index a291b0bb2..ad62675d9 100644 --- a/ED/build/make/include.mk.docker +++ b/ED/build/make/include.mk.docker @@ -15,9 +15,18 @@ HDF5_LIBS=-L/usr/lib/x86_64-linux-gnu/hdf5/openmpi -lz -lhdf5_fortran -lhdf5 -lh #HDF5_LIBS=-lz -lhdf5_fortran -lhdf5 -lhdf5_hl USE_COLLECTIVE_MPIO=0 -# netCDF libraries -USENC=0 -NC_LIBS=-L/dev/null + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface USE_INTERF=1 diff --git a/ED/build/make/include.mk.docker.gnu b/ED/build/make/include.mk.docker.gnu index 02a5559dd..5ad2e734e 100644 --- a/ED/build/make/include.mk.docker.gnu +++ b/ED/build/make/include.mk.docker.gnu @@ -23,6 +23,19 @@ HDF5_LIBS= -L/usr/lib/$(shell uname -m)-linux-gnu/hdf5/openmpi -lhdf5_fortran -l #------------------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # # collective I/O, then use this flag = 1. Otherwise, set it to zero. # diff --git a/ED/build/make/include.mk.docker.intel b/ED/build/make/include.mk.docker.intel index 6defd47fe..e58e49607 100644 --- a/ED/build/make/include.mk.docker.intel +++ b/ED/build/make/include.mk.docker.intel @@ -24,6 +24,19 @@ HDF5_LIBS=-L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5_f90cstub -lhdf5_hl -lhdf5 \ -lz -lszaec -laec -lm #------------------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # # collective I/O, then use this flag = 1. Otherwise, set it to zero. # diff --git a/ED/build/make/include.mk.ebi b/ED/build/make/include.mk.ebi index 734137e74..12dedc449 100644 --- a/ED/build/make/include.mk.ebi +++ b/ED/build/make/include.mk.ebi @@ -24,20 +24,6 @@ MAKE=/usr/bin/make BASE=$(ED_ROOT)/build/ LIBUTILS=$(BASE)/libutils-$(UTILS_VERSION)-opt.a -# Activate appropriate parts below, comment out others. - -#--------------------------------------------------------------- -# If you are using a real distribution of NCAR Graphics... -#NCARG_DIR=/usr/local/ncarg-4.3.0/lib -#LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl -#--------------------------------------------------------------- - -# HDF libraries ----------------------------------------------- -# HDF4 library: Instructions to install: www.cptec.inpe.br/brams -# If you run "configure" script, you don't need to edit line bellow -#HDF_LIBS=-L.hdf4_libs -lmfhdf -ldf -lz -ljpeg -lsz -# -------------------------------------------------------------- - # HDF 5 Libraries USE_COLLECTIVE_MPIO=0 HDF5_INCS=-I/home/mdietze/hdf5-1.8.1/hdf5/include @@ -45,14 +31,17 @@ HDF5_LIBS=-L/home/mdietze/hdf5-1.8.1/hdf5/lib -lhdf5 -lm -lhdf5_fortran -lhdf5 - -lz -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.gfortran b/ED/build/make/include.mk.gfortran index 0d09c0aec..32363a884 100644 --- a/ED/build/make/include.mk.gfortran +++ b/ED/build/make/include.mk.gfortran @@ -44,18 +44,22 @@ HDF5C_INCS=-I${HDF5_HOME}/include HDF5_LIBS=-lhdf5 -lhdf5_fortran -lhdf5_hl -lz USE_COLLECTIVE_MPIO=0 + + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# #--------------------------------------------------------------- -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- - # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. # Interfaces usually make the compilation to crash when the diff --git a/ED/build/make/include.mk.gfortran2 b/ED/build/make/include.mk.gfortran2 index 1adc4b389..a378077bb 100644 --- a/ED/build/make/include.mk.gfortran2 +++ b/ED/build/make/include.mk.gfortran2 @@ -76,14 +76,18 @@ USE_COLLECTIVE_MPIO=0 #--------------------------------------------------------------- -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.gnu b/ED/build/make/include.mk.gnu index 370c9bf2a..0b4c2f9b8 100644 --- a/ED/build/make/include.mk.gnu +++ b/ED/build/make/include.mk.gnu @@ -26,41 +26,33 @@ LIBUTILS=$(BASE)/libutils-$(UTILS_VERSION)-opt.a # Activate appropriate parts below, comment out others. -# NCAR Graphics. - -#--------------------------------------------------------------- -# If you are using a standard installation of NCAR Graphics, set: -# LOADER=ncargf90 -# in the machine-dependent sections below -#LIBNCARG= -#--------------------------------------------------------------- -# If you are using the NCAR dummy libraries... - -NCARG_DIR=$(BASE) -#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION) -lncarg_c-$(UTILS_VERSION) \ -# -lncarg_gks-$(UTILS_VERSION) -#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION) -LIBNCARG=$(BASE)/libncarg-$(UTILS_VERSION).a -#--------------------------------------------------------------- -# If you are using a real distribution of NCAR Graphics... -#NCARG_DIR=/usr/local/ncarg-4.3.0/lib -#LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl -#--------------------------------------------------------------- - -# HDF libraries------------------------------------------------- -# HDF4 library: Instructions to install: www.cptec.inpe.br/brams -# If you run "configure" script, you don't need to edit line bellow -HDF_LIBS=-L./.hdf4_libs -lmfhdf -ldf -lz -ljpeg -lsz -# -------------------------------------------------------------- - -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=.TRUE. and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=.FALSE. and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=.FALSE. -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# HDF5 libraries # +# # +# Since ED-2.1, this is no longer optional for real simulations. You must have HDF5 # +# libraries compiled with the same compiler you set for F_COMP and C_COMP. You may still # +# be able to compile without HDF5 but it will not run. # +#------------------------------------------------------------------------------------------# +ZLIB_PATH=/usr/local +HDF5_PATH=/usr/local +HDF5_INCS=-I$(HDF5_PATH)/include +HDF5C_INCS=$(HDF5_INCS) +HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5_hl +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # MPI_Wtime. --------------------------------------------------- # If USE_MPIWTIME=1, then it will use MPI libraries to compute diff --git a/ED/build/make/include.mk.gnu-odyssey b/ED/build/make/include.mk.gnu-odyssey index b9ad5404a..18be174a0 100644 --- a/ED/build/make/include.mk.gnu-odyssey +++ b/ED/build/make/include.mk.gnu-odyssey @@ -26,6 +26,19 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/n/home00/mlongo/Util/Modules/lapack/3.12.0_gnu +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # # collective I/O, then use this flag = 1. Otherwise, set it to zero. # diff --git a/ED/build/make/include.mk.intel b/ED/build/make/include.mk.intel index b110fa806..66634b8b5 100644 --- a/ED/build/make/include.mk.intel +++ b/ED/build/make/include.mk.intel @@ -30,6 +30,19 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/n/home00/mlongo/Util/Modules/lapack/3.12.0_intel +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.jpl b/ED/build/make/include.mk.jpl index 66a1fcf31..e4fefa85c 100644 --- a/ED/build/make/include.mk.jpl +++ b/ED/build/make/include.mk.jpl @@ -30,6 +30,19 @@ HDF5_LIBS= -lm -L$(ZLIB_PATH) -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/home/mlongo/Util/Modules/lapack/3.12.0_intel +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.macos_homebrew b/ED/build/make/include.mk.macos_homebrew index 0473fa1f4..bd859aa65 100644 --- a/ED/build/make/include.mk.macos_homebrew +++ b/ED/build/make/include.mk.macos_homebrew @@ -30,6 +30,34 @@ HDF5_LIBS=-L$(BREW_PREFIX)/lib -lhdf5_fortran -lhdf5 -lhdf5_hl -lz #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# HDF5 libraries # +# # +# Since ED-2.1, this is no longer optional for real simulations. You must have HDF5 # +# libraries compiled with the same compiler you set for F_COMP and C_COMP. You may still # +# be able to compile without HDF5 but it will not run. # +#------------------------------------------------------------------------------------------# +ZLIB_PATH=/usr/local +HDF5_PATH=/usr/local +HDF5_INCS=-I$(HDF5_PATH)/include +HDF5C_INCS=$(HDF5_INCS) +HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5_hl +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # # collective I/O, then use this flag = 1. Otherwise, set it to zero. # diff --git a/ED/build/make/include.mk.macosx b/ED/build/make/include.mk.macosx index 054f1e11b..06b667b1d 100644 --- a/ED/build/make/include.mk.macosx +++ b/ED/build/make/include.mk.macosx @@ -28,6 +28,19 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5 #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local/opt/lapack +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # # collective I/O, then use this flag = 1. Otherwise, set it to zero. # @@ -37,7 +50,6 @@ USE_COLLECTIVE_MPIO=0 - #------------------------------------------------------------------------------------------# # This should be 1 unless you are running with -gen-interfaces. Interfaces usually # # make the compilation to crash when the -gen-interfaces option are on, so this flag # diff --git a/ED/build/make/include.mk.ncsa b/ED/build/make/include.mk.ncsa index 1789d7424..848e81d36 100644 --- a/ED/build/make/include.mk.ncsa +++ b/ED/build/make/include.mk.ncsa @@ -47,14 +47,17 @@ USE_COLLECTIVE_MPIO=0 #--------------------------------------------------------------- -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.nec b/ED/build/make/include.mk.nec index 19dbfd100..c7460c8b2 100644 --- a/ED/build/make/include.mk.nec +++ b/ED/build/make/include.mk.nec @@ -47,20 +47,33 @@ LIBNCARG=$(BASE)/libncarg-$(UTILS_VERSION).a #LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl #--------------------------------------------------------------- -# HDF libraries------------------------------------------------- -# HDF4 library: Instructions to install: www.cptec.inpe.br/brams -# If you run "configure" script, you don't need to edit line bellow -HDF_LIBS=-L./.hdf4_libs -lmfhdf -ldf -lz -ljpeg -lsz -# -------------------------------------------------------------- - -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=.TRUE. and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=.FALSE. and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=.FALSE. -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# HDF5 libraries # +# # +# Since ED-2.1, this is no longer optional for real simulations. You must have HDF5 # +# libraries compiled with the same compiler you set for F_COMP and C_COMP. You may still # +# be able to compile without HDF5 but it will not run. # +#------------------------------------------------------------------------------------------# +ZLIB_PATH=/usr/local +HDF5_PATH=/usr/local +HDF5_INCS=-I$(HDF5_PATH)/include +HDF5C_INCS=$(HDF5_INCS) +HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5_hl +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # MPI_Wtime. diff --git a/ED/build/make/include.mk.pecan2 b/ED/build/make/include.mk.pecan2 index e63fe2494..6a783a5ab 100644 --- a/ED/build/make/include.mk.pecan2 +++ b/ED/build/make/include.mk.pecan2 @@ -48,14 +48,21 @@ USE_COLLECTIVE_MPIO=0 #--------------------------------------------------------------- -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- + + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/fs/data2/rykelly/local +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.pgi b/ED/build/make/include.mk.pgi index 7cadc0dfd..56ea57bfe 100644 --- a/ED/build/make/include.mk.pgi +++ b/ED/build/make/include.mk.pgi @@ -59,15 +59,17 @@ USE_COLLECTIVE_MPIO=0 #--------------------------------------------------------------- - -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS=-L/dev/null -# -------------------------------------------------------------- +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/opt/lapack/X.X.X/ompi-tcp-gnu41 +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # interface ---------------------------------------------------- # This should be 1 unless you are running with -gen-interfaces. diff --git a/ED/build/make/include.mk.sdumont b/ED/build/make/include.mk.sdumont index 2d27a5ad7..82ee44196 100644 --- a/ED/build/make/include.mk.sdumont +++ b/ED/build/make/include.mk.sdumont @@ -30,6 +30,19 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5 #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/scratch/bramsolam/marcos.longo/Util/lapack-3.12.0/intel +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.sunhpc b/ED/build/make/include.mk.sunhpc index 64d5f00cd..82a8dc4c6 100644 --- a/ED/build/make/include.mk.sunhpc +++ b/ED/build/make/include.mk.sunhpc @@ -30,6 +30,19 @@ HDF5_LIBS=-lm -L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -l #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/prj/prjidfca/marcosl/Util/3.12.0/intel +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.travisci b/ED/build/make/include.mk.travisci index 35ade16d0..f31f57971 100644 --- a/ED/build/make/include.mk.travisci +++ b/ED/build/make/include.mk.travisci @@ -29,6 +29,19 @@ HDF5_LIBS=-lz -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi -lhdf5 -lhdf5_fortran -lh #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/usr/local +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # If you have a version of hdf5 compiled in parallel, then you may benefit from # diff --git a/ED/build/make/include.mk.ugent b/ED/build/make/include.mk.ugent index 2fbaf4e2d..3e597675a 100644 --- a/ED/build/make/include.mk.ugent +++ b/ED/build/make/include.mk.ugent @@ -37,6 +37,25 @@ endif #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, and thus it became the new default. # +# Consequently, it is now required to link the lapack libraries during compilation. # +#------------------------------------------------------------------------------------------# +ifeq ($(UNAME_S),Linux) + LAPACK_INCS= + LAPACK_LIBS=-llapack -lblas +endif +ifeq ($(UNAME_S),Darwin) + LAPACK_PATH=/usr/local/lapack-X.X.X + LAPACK_INCS=-I$(LAPACK_PATH)/include + LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +endif +#------------------------------------------------------------------------------------------# + + #################################### COMPILER SETTINGS ##################################### CMACH=PC_INTEL diff --git a/ED/build/make/include.mk.xlf b/ED/build/make/include.mk.xlf index a60ee150e..e470d0386 100644 --- a/ED/build/make/include.mk.xlf +++ b/ED/build/make/include.mk.xlf @@ -61,14 +61,18 @@ HDF5_LIBS=-lz /sw/hdf5-1.8.0-xlf/lib/libhdf5_fortran.a \ /sw/hdf5-1.8.0-xlf/lib/libhdf5_hl.a -# netCDF libraries --------------------------------------------- -# If you have netCDF set USENC=1 and type the lib folder -# at NC_LIBS, with the leading -L (e.g. -L/usr/local/lib). -# If you don't have it, leave USENC=0 and type a dummy -# folder for NC_LIBS (e.g. -L/dev/null or leave it blank) -USENC=0 -NC_LIBS= -# -------------------------------------------------------------- + +#------------------------------------------------------------------------------------------# +# Linear Algebra Package (LAPACK) libraries. # +# # +# Lapack is a well-established package for solving linear systems in Fortran. This is # +# more efficient than the former built-in solution, but now it is required to load the # +# external lapack libraries. # +#------------------------------------------------------------------------------------------# +LAPACK_PATH=/sw/lapack-X.X.X +LAPACK_INCS=-I$(LAPACK_PATH)/include +LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +#------------------------------------------------------------------------------------------# # MPI_Wtime. diff --git a/ED/src/dynamics/multiple_scatter.f90 b/ED/src/dynamics/multiple_scatter.f90 index c04727163..c8b26ad29 100644 --- a/ED/src/dynamics/multiple_scatter.f90 +++ b/ED/src/dynamics/multiple_scatter.f90 @@ -65,7 +65,8 @@ subroutine lw_multiple_scatter(grnd_emiss4,grnd_temp4,rlong_top4,ncoh,pft,lai,wa integer :: i2p1 integer :: i2m1 integer :: i2p2 - logical :: sing + integer :: info + integer , dimension(2*ncoh+2) :: pivot real(kind=8), dimension(ncoh) :: locetai real(kind=8), dimension(ncoh) :: elai real(kind=8), dimension(ncoh) :: etai @@ -274,12 +275,14 @@ subroutine lw_multiple_scatter(grnd_emiss4,grnd_temp4,rlong_top4,ncoh,pft,lai,wa !------------------------------------------------------------------------------------! - ! Solve the linear system. In the future we could use a tridiagonal solver, ! - ! which is a lot cheaper than the regular Gauss elimination, but for the time being, ! - ! we go with a tested method. ! + ! Solve the linear system. We invoke the Linear Algebra Package (LAPACK) ! + ! procedure for solving the system efficiently. LAPACK rewrites the right hand side ! + ! vector with the solution, so we first copy the right hand side to the output ! + ! vector. ! !------------------------------------------------------------------------------------! - call lisys_solver8(nsiz,amat,cvec,lwvec,sing) - if (sing) then + lwvec(:) = cvec(:) + call dgesv(nsiz,1,amat,nsiz,pivot,lwvec,nsiz,info) + if (info > 0) then call fatal_error('LW radiation failed... The matrix is singular!' & ,'lw_multiple_scatter','multiple_scatter.f90') end if @@ -458,7 +461,8 @@ subroutine sw_multiple_scatter(grnd_alb_par4,grnd_alb_nir4,cosaoi4,nir_beam_norm integer :: i2p1 integer :: i2m1 integer :: i2p2 - logical :: sing + integer :: info + integer , dimension(2*ncoh+2) :: pivot real(kind=8) :: alb_par real(kind=8) :: alb_nir real(kind=8) :: mu @@ -805,12 +809,14 @@ subroutine sw_multiple_scatter(grnd_alb_par4,grnd_alb_nir4,cosaoi4,nir_beam_norm !---------------------------------------------------------------------------------! - ! Solve the linear system. In the future we could use a tridiagonal ! - ! solver, which is a lot cheaper than the regular Gauss elimination, but for the ! - ! time being, we go with a tested method. ! + ! Solve the linear system. We invoke the Linear Algebra Package (LAPACK) ! + ! procedure for solving the system efficiently. LAPACK rewrites the right hand ! + ! side vector with the solution, so we first copy the right hand side to the ! + ! output vector. ! !---------------------------------------------------------------------------------! - call lisys_solver8(nsiz,amat,cvec,swvec,sing) - if (sing) then + swvec(:) = cvec(:) + call dgesv(nsiz,1,amat,nsiz,pivot,swvec,nsiz,info) + if (info > 0) then call fatal_error('SW radiation failed... The matrix is singular!' & ,'sw_multiple_scatter','multiple_scatter.f90') end if diff --git a/ED/src/dynamics/twostream_rad.f90 b/ED/src/dynamics/twostream_rad.f90 index b016eebb7..30088ddba 100644 --- a/ED/src/dynamics/twostream_rad.f90 +++ b/ED/src/dynamics/twostream_rad.f90 @@ -70,7 +70,8 @@ subroutine lw_two_stream(grnd_emiss4,grnd_temp4,rlong_top4,ncoh,pft,lai,wai,cai integer :: i2p1 integer :: i2m1 integer :: i2p2 - logical :: sing + integer :: info + integer , dimension(2*ncoh+2) :: pivot real(kind=8), dimension(ncoh+1) :: black real(kind=8), dimension(ncoh+1) :: expl_plus real(kind=8), dimension(ncoh+1) :: expl_minus @@ -284,12 +285,14 @@ subroutine lw_two_stream(grnd_emiss4,grnd_temp4,rlong_top4,ncoh,pft,lai,wai,cai !------------------------------------------------------------------------------------! - ! Solve the linear system. In the future we could use a band diagonal solver, ! - ! which is a lot cheaper than the regular Gauss elimination, but for the time being, ! - ! we go with a tested method. ! + ! Solve the linear system. We invoke the Linear Algebra Package (LAPACK) ! + ! procedure for solving the system efficiently. LAPACK rewrites the right hand side ! + ! vector with the solution, so we first copy the right hand side to the output ! + ! vector. ! !------------------------------------------------------------------------------------! - call lisys_solver8(nsiz,mmat,yvec,xvec,sing) - if (sing) then + xvec(:) = yvec(:) + call dgesv(nsiz,1,mmat,nsiz,pivot,xvec,nsiz,info) + if (info > 0) then call fatal_error('LW radiation failed... The matrix is singular!' & ,'lw_two_stream','twostream_rad.f90') end if @@ -437,7 +440,8 @@ subroutine sw_two_stream(grnd_alb_par4,grnd_alb_nir4,cosaoi4,nir_beam_norm integer :: i2p1 integer :: i2m1 integer :: i2p2 - logical :: sing + integer :: info + integer , dimension(2*ncoh+2) :: pivot real(kind=4), dimension(ncoh) :: nir_beam_flip real(kind=4), dimension(ncoh) :: nir_diff_flip real(kind=8), dimension(ncoh+1) :: expl_plus @@ -783,12 +787,14 @@ subroutine sw_two_stream(grnd_alb_par4,grnd_alb_nir4,cosaoi4,nir_beam_norm !---------------------------------------------------------------------------------! - ! Solve the linear system. In the future we could use a tridiagonal ! - ! solver, which is a lot cheaper than the regular Gauss elimination, but for the ! - ! time being, we go with a tested method. ! + ! Solve the linear system. We invoke the Linear Algebra Package (LAPACK) ! + ! procedure for solving the system efficiently. LAPACK rewrites the right hand ! + ! side vector with the solution, so we first copy the right hand side to the ! + ! output vector. ! !---------------------------------------------------------------------------------! - call lisys_solver8(nsiz,mmat,yvec,xvec,sing) - if (sing) then + xvec(:) = yvec(:) + call dgesv(nsiz,1,mmat,nsiz,pivot,xvec,nsiz,info) + if (info > 0) then call fatal_error('SW radiation failed... The matrix is singular!' & ,'sw_two_stream','twostream_rad.f90') end if diff --git a/ED/src/utils/numutils.f90 b/ED/src/utils/numutils.f90 index 22c830115..2be3bca82 100644 --- a/ED/src/utils/numutils.f90 +++ b/ED/src/utils/numutils.f90 @@ -424,118 +424,6 @@ end subroutine cumsum - - - -!==========================================================================================! -!==========================================================================================! -! This subroutine is the double precision version of the linear system solver above. ! -! It will solve the linear system AA . X = Y for given AA and Y, using the Gaussian ! -! elimination method with partial pivoting and back-substitution. This subroutine is ! -! based on: ! -! ! -! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! -! in Fortran 77. Cambridge University Press. ! -!------------------------------------------------------------------------------------------! -subroutine lisys_solver8(nsiz,AA,Y,X,sing) - implicit none - !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: nsiz ! matrix and vector size - real(kind=8), dimension(nsiz,nsiz), intent(in) :: AA ! matrix - real(kind=8), dimension(nsiz) , intent(in) :: Y ! right-hand side vector - real(kind=8), dimension(nsiz) , intent(out) :: X ! unknown vector - logical , intent(out) :: sing ! The matrix was singular [T|F] - !----- Local variables. ----------------------------------------------------------------! - real(kind=8), dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. - real(kind=8), dimension(nsiz) :: Z ! Copy of Y, for scaling - real(kind=8), dimension(nsiz) :: dumvec ! Dummy vector (row swapping) - real(kind=8) :: pivot ! The pivot - real(kind=8) :: multip ! Multiplier - integer :: r ! Row index - integer :: b ! Row below index - integer :: p ! Pivot index - real(kind=8) :: dumsca ! Dummy scalar (row swapping) - !----- Local parameters. ---------------------------------------------------------------! - real(kind=8) , parameter :: tinyoff=1.d-20 - !---------------------------------------------------------------------------------------! - - !----- First thing, we copy AA to EE and Y to Z. ---------------------------------------! - EE(:,:) = AA(:,:) - Z (:) = Y (:) - dumvec = 0.d0 - dumsca = 0.d0 - !---------------------------------------------------------------------------------------! - ! We initialise X with a huge, non-sense value, which will become the answer when ! - ! the matrix is singular. ! - !---------------------------------------------------------------------------------------! - X (:) = -huge(1.d0) - !----- We first assume that everything will be fine. -----------------------------------! - sing = .false. - - !---------------------------------------------------------------------------------------! - ! 1. Main elimination loop, done row by row. ! - !---------------------------------------------------------------------------------------! - elimloop: do r = 1, nsiz-1 - !------ 1a. Finding the largest element, which will become our pivot ----------------! - p = (r-1) + maxloc(abs(EE(r:nsiz,r)),dim=1) - - pivot = maxval(abs(EE(r:nsiz,r))) - !------------------------------------------------------------------------------------! - ! 1b. Check the pivot and make sure it is a good one. If not, then this matrix is ! - ! singular or almost singular, and we cannot solve it, so we switch the flag and ! - ! return. ! - !------------------------------------------------------------------------------------! - if (pivot < tinyoff) then - sing = .true. - return - end if - - !----- 1c. If the best pivot is not the current row, we must swap them. -------------! - if (p /= r) then - dumvec(r:nsiz) = EE(r,r:nsiz) - dumsca = Z(r) - EE(r,r:nsiz) = EE(p,r:nsiz) - Z(r) = Z(p) - EE(p,r:nsiz) = dumvec(r:nsiz) - Z(p) = dumsca - end if - - !------------------------------------------------------------------------------------! - ! 1d. Eliminate rows below, everything to the left of the (,r) column will become ! - ! zero (we won't compute that, but they will be.). ! - !------------------------------------------------------------------------------------! - belowloop: do b=r+1,nsiz - multip = EE(b,r)/EE(r,r) - EE(b,r:nsiz) = EE(b,r:nsiz) - multip * EE(r,r:nsiz) - Z(b) = Z(b) - multip * Z(r) - end do belowloop - end do elimloop - - !---------------------------------------------------------------------------------------! - ! 2. We may be unlucky and discover that the matrix is singular at the last line, so we ! - ! check the last pivot too. ! - !---------------------------------------------------------------------------------------! - if (abs(EE(nsiz,nsiz)) < tinyoff) then - sing = .true. - return - end if - - !---------------------------------------------------------------------------------------! - ! 3. We now perform the back-substitution, to find the solution. ! - !---------------------------------------------------------------------------------------! - X(nsiz) = Z(nsiz) / EE(nsiz,nsiz) - backsubloop: do r=nsiz-1,1,-1 - b = r+1 - X(r) = (Z(r) - sum(EE(r,b:nsiz)*x(b:nsiz))) / EE(r,r) - end do backsubloop - - return -end subroutine lisys_solver8 -!==========================================================================================! -!==========================================================================================! - - - !==========================================================================================! !==========================================================================================! ! EIFUN8 -- This function computes the exponential integral function, defined by ! From 12f931a274d9a6e95ba528ac26bdb0a3458c56d4 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Tue, 31 Dec 2024 17:49:16 -0300 Subject: [PATCH 2/6] Update ci.yml to install lapack and BLAS libraries. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8edae433..ac22ecfc7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install dependencies - run: sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev + run: sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev libblas-dev liblapack-dev - name: Install ED2 run: | cd ED/build From bde7285410f43aa77cabb06a8f3c99e12014a215 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Mon, 17 Nov 2025 08:24:20 -0300 Subject: [PATCH 3/6] Fix ci.yml, one of the installation instructions was missing the lapack libraries. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac22ecfc7..25dcf1e9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: with: name: ed2-binary - name: Install dependencies - run: sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev + run: sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev libblas-dev liblapack-dev - name: Run ED2 working-directory: ./EDTS/ run: | From 8f35fcee7796b838d46922f6bba99ffd4ceeef25 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Mon, 17 Nov 2025 13:46:39 -0300 Subject: [PATCH 4/6] Updated Docker instructions to install lapack when running GNU and to configure ifort to load the Maths Kernel when running Intel. I also updated all mk files to do the same. Most include.mk files will be removed in an upcoming pull request. --- BRAMS/build/bin/include.mk.opt.32intel | 35 ++++++++++-------- BRAMS/build/bin/include.mk.opt.gfortran | 5 ++- BRAMS/build/bin/include.mk.opt.gnu | 5 ++- BRAMS/build/bin/include.mk.opt.intel | 25 +++++++------ BRAMS/build/bin/include.mk.opt.macosx | 5 ++- BRAMS/build/bin/include.mk.opt.nec | 5 ++- BRAMS/build/bin/include.mk.opt.odyssey | 25 +++++++------ BRAMS/build/bin/include.mk.opt.pgi | 5 ++- Dockerfile.gnu | 4 ++ ED/build/make/include.mk.absoft | 5 ++- ED/build/make/include.mk.arch_linux | 5 ++- ED/build/make/include.mk.bnl | 5 ++- ED/build/make/include.mk.bu_geo | 5 ++- ED/build/make/include.mk.cannon | 35 ++++++++++-------- ED/build/make/include.mk.cornell | 5 ++- ED/build/make/include.mk.dbg.sdumont | 48 +++++++++++++----------- ED/build/make/include.mk.dbg.sunhpc | 44 ++++++++++++---------- ED/build/make/include.mk.dmm | 5 ++- ED/build/make/include.mk.docker | 5 ++- ED/build/make/include.mk.docker.gnu | 5 ++- ED/build/make/include.mk.docker.intel | 37 ++++++++++--------- ED/build/make/include.mk.ebi | 5 ++- ED/build/make/include.mk.gfortran | 5 ++- ED/build/make/include.mk.gfortran2 | 5 ++- ED/build/make/include.mk.gnu | 5 ++- ED/build/make/include.mk.gnu-odyssey | 5 ++- ED/build/make/include.mk.intel | 5 ++- ED/build/make/include.mk.jpl | 5 ++- ED/build/make/include.mk.macos_homebrew | 5 ++- ED/build/make/include.mk.macosx | 7 +++- ED/build/make/include.mk.ncsa | 5 ++- ED/build/make/include.mk.nec | 9 ++--- ED/build/make/include.mk.pecan2 | 5 ++- ED/build/make/include.mk.pgi | 5 ++- ED/build/make/include.mk.sdumont | 35 ++++++++++-------- ED/build/make/include.mk.sunhpc | 49 ++++++++++++++----------- ED/build/make/include.mk.travisci | 5 ++- ED/build/make/include.mk.ugent | 41 ++++++++++----------- ED/build/make/include.mk.xlf | 7 +++- 39 files changed, 319 insertions(+), 207 deletions(-) diff --git a/BRAMS/build/bin/include.mk.opt.32intel b/BRAMS/build/bin/include.mk.opt.32intel index f74b41a79..cd8f33a49 100644 --- a/BRAMS/build/bin/include.mk.opt.32intel +++ b/BRAMS/build/bin/include.mk.opt.32intel @@ -60,11 +60,14 @@ HDF5_LIBS=-L/n/Moorcroft_Lab/Users/mlongo/util/hdflib/hdf5_32/hdf5/lib \ # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/usr/local/opt/lapack -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# USE_COLLECTIVE_MPIO=0 @@ -235,11 +238,11 @@ MOD_EXT=mod # face problems. If it successfully compiles, then you can switch to B. # #------------------------------------------------------------------------------------------# #USE_INTERF=0 -#F_OPTS= -FR -O0 -recursive -Vaxlib -check all -g -fpe0 -ftz -gen-interfaces \ +#F_OPTS= -FR -O0 -recursive -qmkl -Vaxlib -check all -g -fpe0 -ftz -gen-interfaces \ -warn interfaces -debug extended -debug inline_debug_info -debug-parameters all \ -traceback -ftrapuv -fp-stack-check -implicitnone -openmp -static #C_OPTS= -O0 -DLITTLE -g -traceback -debug extended -static -#LOADER_OPTS= -FR -O0 -Vaxlib -check all -g -fpe0 -ftz -gen-interfaces \ +#LOADER_OPTS= -FR -O0 -recursive -qmkl -Vaxlib -check all -g -fpe0 -ftz -gen-interfaces \ -warn interfaces -debug extended -debug inline_debug_info \ -debug-parameters all -traceback -ftrapuv -fp-stack-check -implicitnone -openmp -static #C_LOADER_OPTS=-v -g -traceback @@ -254,13 +257,13 @@ MOD_EXT=mod # Note, however, that if you change arguments you should first try A. # #------------------------------------------------------------------------------------------# USE_INTERF=1 -F_OPTS= -FR -O0 -recursive -Vaxlib -check all -g -fpe0 -ftz -debug extended \ +F_OPTS= -FR -O0 -recursive -qmkl -Vaxlib -check all -g -fpe0 -ftz -debug extended \ -debug inline_debug_info -static -debug-parameters all -traceback -ftrapuv \ -fp-stack-check -implicitnone -openmp C_OPTS= -O0 -DLITTLE -g -traceback -debug extended -static -LOADER_OPTS= -FR -O0 -Vaxlib -static -check all -g -fpe0 -ftz -debug extended \ - -debug inline_debug_info -debug-parameters all -traceback -ftrapuv \ - -fp-stack-check -implicitnone -openmp +LOADER_OPTS= -FR -O0 -recursive -qmkl -Vaxlib -static -check all -g -fpe0 -ftz \ + -debug extended -debug inline_debug_info -debug-parameters all -traceback \ + -ftrapuv -fp-stack-check -implicitnone -openmp C_LOADER_OPTS=-v -g -traceback -static #------------------------------------------------------------------------------------------# @@ -272,11 +275,11 @@ C_LOADER_OPTS=-v -g -traceback -static # failing or giving instabilities, or funny results after a long time. # #------------------------------------------------------------------------------------------# #USE_INTERF=1 -#F_OPTS= -FR -O2 -recursive -Vaxlib -check all -g -fpe0 -ftz -debug extended \ +#F_OPTS= -FR -O2 -recursive -qmkl -Vaxlib -check all -g -fpe0 -ftz -debug extended \ -debug inline_debug_info -debug-parameters all -traceback -ftrapuv \ -fp-stack-check -implicitnone -openmp -static #C_OPTS= -O2 -DLITTLE -g -traceback -debug extended -static -#LOADER_OPTS= -FR -O2 -Vaxlib -check all -g -fpe0 -ftz -debug extended \ +#LOADER_OPTS= -FR -O2 -Vaxlib -recursive -qmkl -check all -g -fpe0 -ftz -debug extended \ -debug inline_debug_info -debug-parameters all -traceback -ftrapuv \ -fp-stack-check -implicitnone -openmp -static #C_LOADER_OPTS=-v -g -traceback -static @@ -289,10 +292,10 @@ C_LOADER_OPTS=-v -g -traceback -static # or if you have a good idea of which problem you are dealing with. # #------------------------------------------------------------------------------------------# #USE_INTERF=1 -#F_OPTS= -FR -O2 -recursive -Vaxlib -check all -fpe0 -ftz -traceback -ftrapuv \ +#F_OPTS= -FR -O2 -recursive -qmkl -Vaxlib -check all -fpe0 -ftz -traceback -ftrapuv \ -fp-stack-check -implicitnone -openmp #C_OPTS= -O2 -DLITTLE -traceback -#LOADER_OPTS= -FR -O2 -Vaxlib -check all -fpe0 -ftz -traceback -ftrapuv \ +#LOADER_OPTS= -FR -O2 -Vaxlib -recursive -qmkl -check all -fpe0 -ftz -traceback -ftrapuv \ -fp-stack-check -implicitnone -openmp #C_LOADER_OPTS=-v -traceback #------------------------------------------------------------------------------------------# @@ -305,9 +308,9 @@ C_LOADER_OPTS=-v -g -traceback -static # velopers. # #------------------------------------------------------------------------------------------# #USE_INTERF=1 -#F_OPTS= -FR -O3 -recursive -Vaxlib -traceback +#F_OPTS= -FR -O3 -recursive -qmkl -Vaxlib -traceback #C_OPTS= -O3 -DLITTLE -traceback -#LOADER_OPTS= -FR -O3 -Vaxlib -traceback +#LOADER_OPTS= -FR -O3 -recursive -qmkl -Vaxlib -traceback #C_LOADER_OPTS=-v -traceback #------------------------------------------------------------------------------------------# diff --git a/BRAMS/build/bin/include.mk.opt.gfortran b/BRAMS/build/bin/include.mk.opt.gfortran index bb3277aba..451175435 100644 --- a/BRAMS/build/bin/include.mk.opt.gfortran +++ b/BRAMS/build/bin/include.mk.opt.gfortran @@ -61,7 +61,10 @@ HDF5_LIBS=-lz -L/opt/hdf5/1.8.1/ompi-tcp-gnu41/lib \ # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/BRAMS/build/bin/include.mk.opt.gnu b/BRAMS/build/bin/include.mk.opt.gnu index 968d40bc3..458b64e30 100644 --- a/BRAMS/build/bin/include.mk.opt.gnu +++ b/BRAMS/build/bin/include.mk.opt.gnu @@ -67,7 +67,10 @@ USE_MPIWTIME=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/BRAMS/build/bin/include.mk.opt.intel b/BRAMS/build/bin/include.mk.opt.intel index adb8dd331..d095b547c 100644 --- a/BRAMS/build/bin/include.mk.opt.intel +++ b/BRAMS/build/bin/include.mk.opt.intel @@ -67,11 +67,14 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/usr/local/opt/lapack -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -143,7 +146,7 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces C_OPTS= -O0 -DLITTLE -g -traceback @@ -152,7 +155,7 @@ ifeq ($(KIND_COMP),A) endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces C_OPTS= -O0 -DLITTLE -g -traceback @@ -161,7 +164,7 @@ ifeq ($(KIND_COMP),B) endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl C_OPTS= -O0 -DLITTLE -g -traceback @@ -170,17 +173,17 @@ ifeq ($(KIND_COMP),C) endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all-fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl + F_OPTS= -FR -O0 -recursive -qmkl -check all-fpe0 -no-ftz -traceback -ftrapuv \ + -fp-stack-check -implicitnone -assume byterecl C_OPTS= -O0 -DLITTLE -g -traceback LOADER_OPTS=$(F_OPTS) #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl C_OPTS= -O3 -DLITTLE -traceback - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl LOADER_OPTS=$(F_OPTS) #---------------------------------------------------------------------------------------# endif diff --git a/BRAMS/build/bin/include.mk.opt.macosx b/BRAMS/build/bin/include.mk.opt.macosx index 4c0cf754e..bd9a95f2f 100644 --- a/BRAMS/build/bin/include.mk.opt.macosx +++ b/BRAMS/build/bin/include.mk.opt.macosx @@ -83,7 +83,10 @@ NC_LIBS=-L/dev/null # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/BRAMS/build/bin/include.mk.opt.nec b/BRAMS/build/bin/include.mk.opt.nec index 6b77be350..e63634577 100644 --- a/BRAMS/build/bin/include.mk.opt.nec +++ b/BRAMS/build/bin/include.mk.opt.nec @@ -68,7 +68,10 @@ USE_MPIWTIME=1 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/BRAMS/build/bin/include.mk.opt.odyssey b/BRAMS/build/bin/include.mk.opt.odyssey index 2ea67be4a..eba7719d2 100644 --- a/BRAMS/build/bin/include.mk.opt.odyssey +++ b/BRAMS/build/bin/include.mk.opt.odyssey @@ -67,11 +67,14 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/usr/local/opt/lapack -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -143,7 +146,7 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces C_OPTS= -O0 -DLITTLE -g -traceback @@ -152,7 +155,7 @@ ifeq ($(KIND_COMP),A) endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces C_OPTS= -O0 -DLITTLE -g -traceback @@ -161,7 +164,7 @@ ifeq ($(KIND_COMP),B) endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl C_OPTS= -O0 -DLITTLE -g -traceback @@ -170,17 +173,17 @@ ifeq ($(KIND_COMP),C) endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all-fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl + F_OPTS= -FR -O0 -recursive -qmkl -check all-fpe0 -no-ftz -traceback -ftrapuv \ + -fp-stack-check -implicitnone -assume byterecl C_OPTS= -O0 -DLITTLE -g -traceback LOADER_OPTS=$(F_OPTS) #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl C_OPTS= -O3 -DLITTLE -traceback - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl LOADER_OPTS=$(F_OPTS) #---------------------------------------------------------------------------------------# endif diff --git a/BRAMS/build/bin/include.mk.opt.pgi b/BRAMS/build/bin/include.mk.opt.pgi index ed046d6a6..d32e2fe91 100644 --- a/BRAMS/build/bin/include.mk.opt.pgi +++ b/BRAMS/build/bin/include.mk.opt.pgi @@ -48,7 +48,10 @@ HDF4_LIBS= # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/Dockerfile.gnu b/Dockerfile.gnu index fac933349..396eccd80 100644 --- a/Dockerfile.gnu +++ b/Dockerfile.gnu @@ -18,6 +18,8 @@ RUN apt-get update \ build-essential \ gfortran \ libhdf5-openmpi-dev \ + libblas-dev \ + liblapack-dev \ && rm -rf /var/lib/apt/lists/* # copy the source only, this prevents a full rebuild in case of changes to Dockerfile or non source files @@ -41,6 +43,8 @@ FROM ubuntu:22.04 RUN apt-get update \ && apt-get install -y --no-install-recommends \ libhdf5-openmpi-103 \ + libblas-dev \ + liblapack-dev \ libgomp1 \ && rm -rf /var/lib/apt/lists/* diff --git a/ED/build/make/include.mk.absoft b/ED/build/make/include.mk.absoft index 452769025..930537d4f 100644 --- a/ED/build/make/include.mk.absoft +++ b/ED/build/make/include.mk.absoft @@ -63,7 +63,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.arch_linux b/ED/build/make/include.mk.arch_linux index e56744e95..6fb7e969a 100644 --- a/ED/build/make/include.mk.arch_linux +++ b/ED/build/make/include.mk.arch_linux @@ -19,7 +19,10 @@ USE_COLLECTIVE_MPIO=1 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.bnl b/ED/build/make/include.mk.bnl index a41eb98a7..204546ad3 100644 --- a/ED/build/make/include.mk.bnl +++ b/ED/build/make/include.mk.bnl @@ -19,7 +19,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.bu_geo b/ED/build/make/include.mk.bu_geo index 28ca800ec..26cc72970 100644 --- a/ED/build/make/include.mk.bu_geo +++ b/ED/build/make/include.mk.bu_geo @@ -46,7 +46,10 @@ USE_COLLECTIVE_MPIO=1 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.cannon b/ED/build/make/include.mk.cannon index 38f1c6a10..eeedc2b31 100644 --- a/ED/build/make/include.mk.cannon +++ b/ED/build/make/include.mk.cannon @@ -35,11 +35,14 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/n/home00/mlongo/Util/Modules/lapack/3.12.0_intel -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -100,12 +103,12 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn declarations -gen-interfaces -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn declarations -gen-interfaces -qopenmp -diag-error=all @@ -113,12 +116,12 @@ ifeq ($(KIND_COMP),A) endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -warn declarations -warn errors -qopenmp -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -warn declarations -warn errors -qopenmp @@ -126,32 +129,32 @@ ifeq ($(KIND_COMP),B) endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp -diag-error=all #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ - -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz \ + -traceback -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ -diag-error=all #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl -qopenmp -static + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl -qopenmp -static C_OPTS= -O3 -DLITTLE -traceback -qopenmp -static - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl -qopenmp -static - LOADER_OPTS=-FR -O3 -recursive -traceback -assume byterecl -qopenmp + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl -qopenmp -static + LOADER_OPTS=-FR -O3 -recursive -qmkl -traceback -assume byterecl -qopenmp #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.cornell b/ED/build/make/include.mk.cornell index 529a3b341..06ac81d1e 100644 --- a/ED/build/make/include.mk.cornell +++ b/ED/build/make/include.mk.cornell @@ -36,7 +36,10 @@ HDF5_LIBS=-L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl -lm -lz # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.dbg.sdumont b/ED/build/make/include.mk.dbg.sdumont index 1e1ddf080..88949d631 100644 --- a/ED/build/make/include.mk.dbg.sdumont +++ b/ED/build/make/include.mk.dbg.sdumont @@ -35,11 +35,14 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/scratch/bramsolam/marcos.longo/Util/lapack-3.12.0/intel -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -97,53 +100,54 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces \ -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ + -gen-interfaces #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl -warn unused -warn uncalled -warn usage + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -static + F_OPTS= -FR -O0 -recursive -qmkl -check all -fpe0 -no-ftz -traceback -ftrapuv \ + -fp-stack-check -implicitnone -assume byterecl -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -fpe0 -no-ftz -traceback -ftrapuv \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -fpe0 -no-ftz -traceback -ftrapuv \ -fp-stack-check -implicitnone -assume byterecl #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl -static + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl -static C_OPTS= -O3 -DLITTLE -traceback -static - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl -static - LOADER_OPTS= -FR -O3 -recursive -traceback -assume byterecl + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl -static + LOADER_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.dbg.sunhpc b/ED/build/make/include.mk.dbg.sunhpc index a2e81763e..41da2f52c 100644 --- a/ED/build/make/include.mk.dbg.sunhpc +++ b/ED/build/make/include.mk.dbg.sunhpc @@ -35,11 +35,14 @@ HDF5_LIBS=-lm -L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -l # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/prj/prjidfca/marcosl/Util/lapack-3.12.0/intel -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -98,12 +101,12 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -gen-interfaces -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -gen-interfaces -qopenmp -diag-error=all @@ -111,42 +114,43 @@ ifeq ($(KIND_COMP),A) endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces \ -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ + -warn interfaces #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -static + F_OPTS= -FR -O0 -recursive -qmkl -check all -fpe0 -no-ftz -traceback -ftrapuv \ + -fp-stack-check -implicitnone -assume byterecl -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -fpe0 -no-ftz -traceback -ftrapuv \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -fpe0 -no-ftz -traceback -ftrapuv \ -fp-stack-check -implicitnone -assume byterecl #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl -static + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl -static C_OPTS= -O3 -DLITTLE -traceback -static - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl -static - LOADER_OPTS= -FR -O3 -recursive -traceback -assume byterecl + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl -static + LOADER_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.dmm b/ED/build/make/include.mk.dmm index c3df1136f..7f0055606 100644 --- a/ED/build/make/include.mk.dmm +++ b/ED/build/make/include.mk.dmm @@ -36,7 +36,10 @@ HDF5_LIBS=-L/n/Moorcroft_Lab/Lab/apps/i91/lib -lhdf5 -lm -lhdf5_fortran \ # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.docker b/ED/build/make/include.mk.docker index ad62675d9..5d428e888 100644 --- a/ED/build/make/include.mk.docker +++ b/ED/build/make/include.mk.docker @@ -21,7 +21,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.docker.gnu b/ED/build/make/include.mk.docker.gnu index 5ad2e734e..f7051965a 100644 --- a/ED/build/make/include.mk.docker.gnu +++ b/ED/build/make/include.mk.docker.gnu @@ -29,7 +29,10 @@ HDF5_LIBS= -L/usr/lib/$(shell uname -m)-linux-gnu/hdf5/openmpi -lhdf5_fortran -l # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.docker.intel b/ED/build/make/include.mk.docker.intel index e58e49607..ce1401593 100644 --- a/ED/build/make/include.mk.docker.intel +++ b/ED/build/make/include.mk.docker.intel @@ -30,11 +30,14 @@ HDF5_LIBS=-L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5_f90cstub -lhdf5_hl -lhdf5 \ # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/opt/lapack -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# @@ -94,12 +97,12 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn declarations -gen-interfaces -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn declarations -gen-interfaces -qopenmp -diag-error=all -static @@ -107,12 +110,12 @@ ifeq ($(KIND_COMP),A) endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -warn declarations -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -warn declarations -qopenmp -diag-error=all -static @@ -120,32 +123,32 @@ ifeq ($(KIND_COMP),B) endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp -diag-error=all -static #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ + F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ - -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ + LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -fpe0 -no-ftz \ + -traceback -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ -diag-error=all -static #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS=-FR -O3 -recursive -traceback -assume byterecl -qopenmp -static - C_OPTS=-O3 -DLITTLE -traceback -qopenmp -static - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl -qopenmp -static - LOADER_OPTS=-FR -O3 -recursive -traceback -assume byterecl -qopenmp -static + F_OPTS=-FR -O3 -recursive -mkl -traceback -assume byterecl -qopenmp -static + C_OPTS=-O3 -DLITTLE -traceback -mkl -qopenmp -static + F_LOWO_OPTS=-FR -O2 -recursive -mkl -traceback -assume byterecl -qopenmp -static + LOADER_OPTS=-FR -O3 -recursive -mkl -traceback -assume byterecl -qopenmp -static #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.ebi b/ED/build/make/include.mk.ebi index 12dedc449..28541c138 100644 --- a/ED/build/make/include.mk.ebi +++ b/ED/build/make/include.mk.ebi @@ -36,7 +36,10 @@ HDF5_LIBS=-L/home/mdietze/hdf5-1.8.1/hdf5/lib -lhdf5 -lm -lhdf5_fortran -lhdf5 - # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.gfortran b/ED/build/make/include.mk.gfortran index 32363a884..9218cfdc4 100644 --- a/ED/build/make/include.mk.gfortran +++ b/ED/build/make/include.mk.gfortran @@ -51,7 +51,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.gfortran2 b/ED/build/make/include.mk.gfortran2 index a378077bb..48eaa5270 100644 --- a/ED/build/make/include.mk.gfortran2 +++ b/ED/build/make/include.mk.gfortran2 @@ -82,7 +82,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.gnu b/ED/build/make/include.mk.gnu index 0b4c2f9b8..7c927e6ea 100644 --- a/ED/build/make/include.mk.gnu +++ b/ED/build/make/include.mk.gnu @@ -47,7 +47,10 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.gnu-odyssey b/ED/build/make/include.mk.gnu-odyssey index 18be174a0..2fd570fb8 100644 --- a/ED/build/make/include.mk.gnu-odyssey +++ b/ED/build/make/include.mk.gnu-odyssey @@ -31,7 +31,10 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/n/home00/mlongo/Util/Modules/lapack/3.12.0_gnu LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.intel b/ED/build/make/include.mk.intel index 66634b8b5..a2c185086 100644 --- a/ED/build/make/include.mk.intel +++ b/ED/build/make/include.mk.intel @@ -35,7 +35,10 @@ HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/n/home00/mlongo/Util/Modules/lapack/3.12.0_intel LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.jpl b/ED/build/make/include.mk.jpl index e4fefa85c..f1dbdee29 100644 --- a/ED/build/make/include.mk.jpl +++ b/ED/build/make/include.mk.jpl @@ -35,7 +35,10 @@ HDF5_LIBS= -lm -L$(ZLIB_PATH) -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/home/mlongo/Util/Modules/lapack/3.12.0_intel LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.macos_homebrew b/ED/build/make/include.mk.macos_homebrew index bd859aa65..f58b45fce 100644 --- a/ED/build/make/include.mk.macos_homebrew +++ b/ED/build/make/include.mk.macos_homebrew @@ -50,7 +50,10 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.macosx b/ED/build/make/include.mk.macosx index ebbf1fb71..87d016cee 100644 --- a/ED/build/make/include.mk.macosx +++ b/ED/build/make/include.mk.macosx @@ -33,9 +33,12 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/usr/local/opt/lapack +LAPACK_PATH=$(HOMEBREW_PREFIX)/opt/lapack LAPACK_INCS=-I$(LAPACK_PATH)/include LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.ncsa b/ED/build/make/include.mk.ncsa index 848e81d36..d4cbab4d0 100644 --- a/ED/build/make/include.mk.ncsa +++ b/ED/build/make/include.mk.ncsa @@ -52,7 +52,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.nec b/ED/build/make/include.mk.nec index c7460c8b2..de77fdcb7 100644 --- a/ED/build/make/include.mk.nec +++ b/ED/build/make/include.mk.nec @@ -68,11 +68,10 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # -#------------------------------------------------------------------------------------------# -LAPACK_PATH=/usr/local -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# compile the code with the Math Kernel Library option instead (-mkl or -qmkl depending on # +# the ifort/icc version). Otherwise, provide the path to Lapack installation. # #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.pecan2 b/ED/build/make/include.mk.pecan2 index 6a783a5ab..9ea14c65d 100644 --- a/ED/build/make/include.mk.pecan2 +++ b/ED/build/make/include.mk.pecan2 @@ -55,7 +55,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# add -qmkl to F_OPTS and LOADER_OPTS instead. Otherwise, provide the path to Lapack # +# installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/fs/data2/rykelly/local LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.pgi b/ED/build/make/include.mk.pgi index 56ea57bfe..4c2a3e877 100644 --- a/ED/build/make/include.mk.pgi +++ b/ED/build/make/include.mk.pgi @@ -64,7 +64,10 @@ USE_COLLECTIVE_MPIO=0 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# add -qmkl to F_OPTS and LOADER_OPTS instead. Otherwise, provide the path to Lapack # +# installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/opt/lapack/X.X.X/ompi-tcp-gnu41 LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.sdumont b/ED/build/make/include.mk.sdumont index 82ee44196..0142084ad 100644 --- a/ED/build/make/include.mk.sdumont +++ b/ED/build/make/include.mk.sdumont @@ -35,11 +35,14 @@ HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5 # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# add -qmkl to F_OPTS and LOADER_OPTS instead. Otherwise, provide the path to Lapack # +# installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/scratch/bramsolam/marcos.longo/Util/lapack-3.12.0/intel -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -96,12 +99,12 @@ ifeq ($(KIND_COMP),) endif ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -gen-interfaces -qopenmp -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -gen-interfaces -qopenmp @@ -109,12 +112,12 @@ ifeq ($(KIND_COMP),A) endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -qopenmp -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -qopenmp @@ -122,30 +125,30 @@ ifeq ($(KIND_COMP),B) endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ - -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz \ + -traceback -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl -qopenmp -static + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl -qopenmp -static C_OPTS= -O3 -DLITTLE -traceback -qopenmp -static - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl -qopenmp -static - LOADER_OPTS=-FR -O3 -recursive -traceback -assume byterecl -qopenmp + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl -qopenmp -static + LOADER_OPTS=-FR -O3 -recursive -qmkl -traceback -assume byterecl -qopenmp #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.sunhpc b/ED/build/make/include.mk.sunhpc index 82a8dc4c6..7d6ce8280 100644 --- a/ED/build/make/include.mk.sunhpc +++ b/ED/build/make/include.mk.sunhpc @@ -35,11 +35,14 @@ HDF5_LIBS=-lm -L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -l # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# add -qmkl to F_OPTS and LOADER_OPTS instead. Otherwise, provide the path to Lapack # +# installation. # #------------------------------------------------------------------------------------------# -LAPACK_PATH=/prj/prjidfca/marcosl/Util/3.12.0/intel -LAPACK_INCS=-I$(LAPACK_PATH)/include -LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -97,54 +100,56 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces \ -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ + -gen-interfaces #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces \ -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ + -warn interfaces #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ - -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ - -assume byterecl + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -g -debug extended \ + -debug-parameters used -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ + -implicitnone -assume byterecl #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -check all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -static + F_OPTS= -FR -O0 -recursive -qmkl -check all -fpe0 -no-ftz -traceback -ftrapuv \ + -fp-stack-check -implicitnone -assume byterecl -static C_OPTS= -O0 -DLITTLE -g -traceback -static - LOADER_OPTS=-FR -O0 -recursive -check all -fpe0 -no-ftz -traceback -ftrapuv \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all -fpe0 -no-ftz -traceback -ftrapuv \ -fp-stack-check -implicitnone -assume byterecl #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl -static + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl -static C_OPTS= -O3 -DLITTLE -traceback -static - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl -static - LOADER_OPTS= -FR -O3 -recursive -traceback -assume byterecl + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl -static + LOADER_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.travisci b/ED/build/make/include.mk.travisci index f31f57971..a287660da 100644 --- a/ED/build/make/include.mk.travisci +++ b/ED/build/make/include.mk.travisci @@ -34,7 +34,10 @@ HDF5_LIBS=-lz -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi -lhdf5 -lhdf5_fortran -lh # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# add -qmkl to F_OPTS and LOADER_OPTS instead. Otherwise, provide the path to Lapack # +# installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/usr/local LAPACK_INCS=-I$(LAPACK_PATH)/include diff --git a/ED/build/make/include.mk.ugent b/ED/build/make/include.mk.ugent index 3e597675a..348134163 100644 --- a/ED/build/make/include.mk.ugent +++ b/ED/build/make/include.mk.ugent @@ -42,17 +42,14 @@ endif # # # Lapack is a well-established package for solving linear systems in Fortran. This is # # more efficient than the former built-in solution, and thus it became the new default. # -# Consequently, it is now required to link the lapack libraries during compilation. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# add -qmkl to F_OPTS and LOADER_OPTS instead. Otherwise, provide the path to Lapack # +# installation. # #------------------------------------------------------------------------------------------# -ifeq ($(UNAME_S),Linux) - LAPACK_INCS= - LAPACK_LIBS=-llapack -lblas -endif -ifeq ($(UNAME_S),Darwin) - LAPACK_PATH=/usr/local/lapack-X.X.X - LAPACK_INCS=-I$(LAPACK_PATH)/include - LAPACK_LIBS=-L$(LAPACK_PATH)/lib -llapack -lblas -endif +LAPACK_PATH= +LAPACK_INCS= +LAPACK_LIBS= #------------------------------------------------------------------------------------------# @@ -102,15 +99,15 @@ endif ################################# DEBUG BUILD ######################################### ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -check -g -debug extended -debug-parameters -traceback -ftrapuv -u \ - -fp-stack-check -assume byterecl -warn unused -warn uncalled -gen-interfaces + F_OPTS= -FR -O0 -qmkl -check -g -debug extended -debug-parameters -traceback -ftrapuv \ + -u -fp-stack-check -assume byterecl -warn unused -warn uncalled -gen-interfaces C_OPTS= -O0 -g -traceback #---------------------------------------------------------------------------------------# endif ############################ LEGACY DEBUG BUILD ######################################### ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -check all -g -debug extended -debug-parameters used \ + F_OPTS= -FR -O0 -recursive -qmkl -check all -g -debug extended -debug-parameters used \ -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check -implicitnone \ -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces C_OPTS= -O0 -DLITTLE -g -traceback @@ -119,33 +116,33 @@ endif ######################## DEBUG BUILD WITH INTEL PROFILING ############################### ifeq ($(KIND_COMP),C) USE_INTERF=0 - F_OPTS= -O0 -check -g -prof-gen=srcpos -debug extended -debug-parameters -traceback -u \ - -ftrapuv -fp-stack-check -assume byterecl -gen-interfaces + F_OPTS= -O0 -qmkl -check -g -prof-gen=srcpos -debug extended -debug-parameters \ + -traceback -u -ftrapuv -fp-stack-check -assume byterecl -gen-interfaces C_OPTS= -O0 -g -traceback #---------------------------------------------------------------------------------------# endif ############################### LEGACY OPTIMIZED BUILD #################################### ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl + F_OPTS= -FR -O3 -recursive -qmkl -traceback -assume byterecl C_OPTS= -O3 -DLITTLE -traceback - F_LOWO_OPTS=-FR -O2 -recursive -traceback -assume byterecl + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl #---------------------------------------------------------------------------------------# endif ###################################### OPTIMIZED BUILD ################################## ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -O3 -xHost -g -assume byterecl + F_OPTS= -O3 -xHost -qmkl -g -assume byterecl C_OPTS= -O3 -xHost -g - F_LOWO_OPTS= -O2 -xHost -g + F_LOWO_OPTS= -O2 -xHost -qmkl -g #---------------------------------------------------------------------------------------# endif ########################### OPTIMIZED BUILD WITH OpenMP ################################# ifeq ($(KIND_COMP),F) USE_INTERF=1 - F_OPTS= -O3 -xHost -g -assume byterecl -qopenmp - C_OPTS= -O3 -xHost -g -qopenmp - F_LOWO_OPTS= -O2 -xHost -g -qopenmp + F_OPTS= -O3 -xHost -qmkl -g -assume byterecl -qopenmp + C_OPTS= -O3 -xHost -qmkl -g -qopenmp + F_LOWO_OPTS= -O2 -xHost -qmkl -g -qopenmp #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/ED/build/make/include.mk.xlf b/ED/build/make/include.mk.xlf index e470d0386..67ea65d42 100644 --- a/ED/build/make/include.mk.xlf +++ b/ED/build/make/include.mk.xlf @@ -66,8 +66,11 @@ HDF5_LIBS=-lz /sw/hdf5-1.8.0-xlf/lib/libhdf5_fortran.a \ # Linear Algebra Package (LAPACK) libraries. # # # # Lapack is a well-established package for solving linear systems in Fortran. This is # -# more efficient than the former built-in solution, but now it is required to load the # -# external lapack libraries. # +# more efficient than the former built-in solution, and thus it became the new default. # +# # +# For those compiling the code with Intel compilers (ifort/icc), leave these empty and # +# add -qmkl to F_OPTS and LOADER_OPTS instead. Otherwise, provide the path to Lapack # +# installation. # #------------------------------------------------------------------------------------------# LAPACK_PATH=/sw/lapack-X.X.X LAPACK_INCS=-I$(LAPACK_PATH)/include From 7b8925eb2ecf8d952892fe984c8b703ae27606c9 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Mon, 17 Nov 2025 14:43:01 -0300 Subject: [PATCH 5/6] Switched deprecated option -mkl with -qmkl --- ED/build/make/include.mk.docker.intel | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ED/build/make/include.mk.docker.intel b/ED/build/make/include.mk.docker.intel index ce1401593..ebfd603f0 100644 --- a/ED/build/make/include.mk.docker.intel +++ b/ED/build/make/include.mk.docker.intel @@ -97,12 +97,12 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn declarations -gen-interfaces -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn declarations -gen-interfaces -qopenmp -diag-error=all -static @@ -110,12 +110,12 @@ ifeq ($(KIND_COMP),A) endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -warn declarations -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ -warn interfaces -warn declarations -qopenmp -diag-error=all -static @@ -123,32 +123,32 @@ ifeq ($(KIND_COMP),B) endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -g -debug extended \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ -implicitnone -assume byterecl -qopenmp -diag-error=all -static #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -mkl -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -mkl -check all,noarg_temp_created -fpe0 -no-ftz \ + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz \ -traceback -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ -diag-error=all -static #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS=-FR -O3 -recursive -mkl -traceback -assume byterecl -qopenmp -static - C_OPTS=-O3 -DLITTLE -traceback -mkl -qopenmp -static - F_LOWO_OPTS=-FR -O2 -recursive -mkl -traceback -assume byterecl -qopenmp -static - LOADER_OPTS=-FR -O3 -recursive -mkl -traceback -assume byterecl -qopenmp -static + F_OPTS=-FR -O3 -recursive -qmkl -traceback -assume byterecl -qopenmp -static + C_OPTS=-O3 -DLITTLE -traceback -qmkl -qopenmp -static + F_LOWO_OPTS=-FR -O2 -recursive -qmkl -traceback -assume byterecl -qopenmp -static + LOADER_OPTS=-FR -O3 -recursive -qmkl -traceback -assume byterecl -qopenmp -static #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# From 9aa50c94e3e1146ce6fb31048246b7532e11a572 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Tue, 18 Nov 2025 11:16:23 -0500 Subject: [PATCH 6/6] Updated instructions for cannon so it is compatible with the most current version of the intel compilers. --- ED/build/make/include.mk.cannon | 66 +++++++++++++++------------------ 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/ED/build/make/include.mk.cannon b/ED/build/make/include.mk.cannon index eeedc2b31..f100fe8e4 100644 --- a/ED/build/make/include.mk.cannon +++ b/ED/build/make/include.mk.cannon @@ -23,8 +23,7 @@ BASE=$(ED_ROOT)/build/ # HDF5 libraries compiled with the same compiler you set for F_COMP and C_COMP. You may # # still be able to compile without HDF5 but the code is not going to run. # #------------------------------------------------------------------------------------------# -#HDF5_PATH=/n/sw/fasrcsw/apps/MPI/intel/17.0.2-fasrc01/impi/2017.2.174-fasrc01/hdf5/1.10.1-fasrc01 -HDF5_PATH=/n/home00/mlongo/Util/Modules/hdf5/1.10.2_intel +HDF5_PATH=$(HOME)/Util/Modules/hdf5/1.14.6_intel HDF5_INCS=-I$(HDF5_PATH)/include HDF5_LIBS= -lz -lm -L$(HDF5_PATH)/lib -lhdf5 -lhdf5_fortran -lhdf5_hl #------------------------------------------------------------------------------------------# @@ -58,13 +57,10 @@ USE_COLLECTIVE_MPIO=0 #################################### COMPILER SETTINGS ##################################### CMACH=ODYSSEY -#F_COMP=mpif90 -fc=ifort -#C_COMP=mpicc -cc=icc -#LOADER=mpif90 -fc=ifort FC_TYPE=INTEL -F_COMP=mpif90 -C_COMP=mpicc -LOADER=mpif90 +F_COMP=ifx +C_COMP=icx +LOADER=ifx LIBS= MOD_EXT=mod #------------------------------------------------------------------------------------------# @@ -103,50 +99,48 @@ endif #------------------------------------------------------------------------------------------# ifeq ($(KIND_COMP),A) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ - -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ - -warn declarations -gen-interfaces -qopenmp -diag-error=all -static + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug full \ + -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -implicitnone \ + -assume byterecl -warn unused -warn uncalled -warn usage -warn declarations \ + -gen-interfaces -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ - -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ - -warn declarations -gen-interfaces -qopenmp -diag-error=all + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug full \ + -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -implicitnone \ + -assume byterecl -warn unused -warn uncalled -warn usage -warn declarations \ + -gen-interfaces -qopenmp -diag-error=all #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),B) USE_INTERF=0 - F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ - -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ - -warn interfaces -warn declarations -warn errors -qopenmp -static + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug full \ + -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -implicitnone \ + -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces \ + -warn declarations -warn errors -qopenmp -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ - -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \ - -warn interfaces -warn declarations -warn errors -qopenmp + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug full \ + -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -implicitnone \ + -assume byterecl -warn unused -warn uncalled -warn usage -warn interfaces \ + -warn declarations -warn errors -qopenmp #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),C) USE_INTERF=1 - F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ - -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -qopenmp -diag-error=all -static + F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug full \ + -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -implicitnone \ + -assume byterecl -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static - LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug extended \ - -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \ - -implicitnone -assume byterecl -qopenmp -diag-error=all + LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -g -debug full \ + -debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -implicitnone \ + -assume byterecl -qopenmp -diag-error=all #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),D) USE_INTERF=1 F_OPTS= -FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz -traceback \ - -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ - -diag-error=all -static + -ftrapuv -implicitnone -assume byterecl -qopenmp -diag-error=all -static C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static LOADER_OPTS=-FR -O0 -recursive -qmkl -check all,noarg_temp_created -fpe0 -no-ftz \ - -traceback -ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \ - -diag-error=all + -traceback -ftrapuv -implicitnone -assume byterecl -qopenmp -diag-error=all #---------------------------------------------------------------------------------------# endif ifeq ($(KIND_COMP),E) @@ -171,8 +165,8 @@ endif MPI_PATH= PAR_INCS= PAR_LIBS= -#PAR_DEFS= -PAR_DEFS=-DRAMS_MPI +PAR_DEFS= +#PAR_DEFS=-DRAMS_MPI #------------------------------------------------------------------------------------------#