From 226aba6c64e9dd85a7a131f5dd09b1e7a9d1e5f6 Mon Sep 17 00:00:00 2001 From: Dan Yu Date: Mon, 25 Mar 2024 17:19:15 -0400 Subject: [PATCH] Fix index error in output_netcdf_pdaf.F90 Add intel-ifx support in Makefile --- Makefile | 8 +++++--- src/PDAF_bindings/Makefile | 4 ++++ src/PDAF_bindings/output_netcdf_pdaf.F90 | 8 ++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1ed49b2..17aaf1d 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,10 @@ ifeq ($(USE_PDAF),ON) LDFLAGS+= -L$(PDAF_LIB_DIR) -lpdaf-d endif ifeq ($(ESMF_COMPILER), intel) -LDFLAGS+=-mkl -lpthread -lm -ldl -LDFLAGS+= -L$(SCHISM_BUILD_DIR)/lib -L. -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -qopenmp -lpthread -lm +#LDFLAGS+=-mkl -lpthread -lm -ldl +LDFLAGS+=-qmkl #-lpthread -lm -ldl +#LDFLAGS+= -L$(SCHISM_BUILD_DIR)/lib -L. -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -qopenmp -lpthread -lm +LDFLAGS+= -L$(SCHISM_BUILD_DIR)/lib -L. -Wl,--start-group $(MKLROOT)/lib/libmkl_intel_lp64.a $(MKLROOT)/lib/libmkl_intel_thread.a $(MKLROOT)/lib/libmkl_core.a -Wl,--end-group -qopenmp -lpthread -lm else ifeq ($(ESMF_COMPILER), gfortran) # @todo still some lapack routines missing, so we need to link with either @@ -53,7 +55,7 @@ endif # as follows: NO_PARMETIS := $(shell echo ${SCHISM_NO_PARMETIS} | tr '[:lower:]' '[:upper:]') ifeq ($(NO_PARMETIS),OFF) - METIS_LDFLAGS = + METIS_LDFLAGS = -L$(SCHISM_BUILD_DIR)/lib ifneq ($(PARMETISHOME),) METIS_LDFLAGS := -L$(PARMETISHOME)/lib endif diff --git a/src/PDAF_bindings/Makefile b/src/PDAF_bindings/Makefile index 7fd776d..3e087b4 100644 --- a/src/PDAF_bindings/Makefile +++ b/src/PDAF_bindings/Makefile @@ -39,7 +39,11 @@ else ifneq (,$(findstring pgf,$(ESMF_FC))) F90FLAGS += -O3 -fast -Mr8 -Mr8intrinsics -Mbyteswapio -Mpreprocess # modern version of -r8 else +ifneq (,$(findstring ifx,$(ESMF_FC))) + F90FLAGS += -r8 -xHOST -O3 #Change to PDAF setting #-real-size 64 # make only real double precision +else $(error "Promotion of real to 8 byte not implemented for $(ESMF_FC)") +endif # intel-ifx endif # pg endif # nag endif # intel diff --git a/src/PDAF_bindings/output_netcdf_pdaf.F90 b/src/PDAF_bindings/output_netcdf_pdaf.F90 index f4a6617..72040d3 100644 --- a/src/PDAF_bindings/output_netcdf_pdaf.F90 +++ b/src/PDAF_bindings/output_netcdf_pdaf.F90 @@ -64,9 +64,9 @@ subroutine write_netcdf_pdaf( step, dim_p, state_p, std_p) real(rkind),intent(in) :: state_p(dim_p),std_p(dim_p) ! local var integer :: itot,i,j,k,num_schism_steps - real,allocatable :: elev(:),salt(:,:),temp(:,:),uu(:,:),vv(:,:),ww(:,:),sla(:),msl(:) - real,allocatable :: elev_std(:),salt_std(:,:),temp_std(:,:),uu_std(:,:),vv_std(:,:),ww_std(:,:) - real,allocatable :: tr_el(:,:,:),tr_nd(:,:,:),su2(:,:),sv2(:,:),we(:,:),zero(:,:) + real(rkind),allocatable :: elev(:),salt(:,:),temp(:,:),uu(:,:),vv(:,:),ww(:,:),sla(:),msl(:) + real(rkind),allocatable :: elev_std(:),salt_std(:,:),temp_std(:,:),uu_std(:,:),vv_std(:,:),ww_std(:,:) + real(rkind),allocatable :: tr_el(:,:,:),tr_nd(:,:,:),su2(:,:),sv2(:,:),we(:,:),zero(:,:) character(len=1) :: typestr character(len=6) :: a_4 character(len=72) :: fdb,it_char @@ -374,7 +374,7 @@ subroutine write_netcdf_pdaf( step, dim_p, state_p, std_p) end do ! Update we do i=1,nea - if(idry_e(j)==1) cycle + if(idry_e(i)==1) cycle do k=kbe(i)+1,nvrt we(k,i)=sum(ww(k,elnode(1:i34(i),i)))/real(i34(i),rkind) end do