Skip to content

Commit

Permalink
Fix index error in output_netcdf_pdaf.F90
Browse files Browse the repository at this point in the history
Add intel-ifx support in Makefile
  • Loading branch information
danishyo committed Mar 25, 2024
1 parent 5c24e7a commit 226aba6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/PDAF_bindings/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/PDAF_bindings/output_netcdf_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 226aba6

Please sign in to comment.