Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev/ufs-weather-model' into dev/…
Browse files Browse the repository at this point in the history
…ufs-coastal
  • Loading branch information
uturuncoglu committed Oct 22, 2024
2 parents 80a5ad5 + c7004b6 commit 812b8f7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions model/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -c <TARGET>")
endif()

elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(IntelLLVM)$")
set(compile_flags -no-fma -g -traceback -i4 -real-size 32 -fp-model precise -assume byterecl -fno-alias)
set(compile_flags_release -O3)
# SHELL: prefix fixes CMake attempting to de-duplicate the repeated uses of 'all' in -warn, -debug, -check
# See https://cmake.org/cmake/help/latest/command/target_compile_options.html#option-de-duplication
set(compile_flags_debug -O0 "SHELL:-debug all" "SHELL:-warn all" "SHELL:-check all" -check noarg_temp_created -fp-stack-check -heap-arrays -traceback -fpe0)

if(APPLE)
# The linker on macOS does not include `common symbols` (usually module variables without a default value) by default
# Passing the -c flag includes them and fixes an error with undefined symbols
# Only ifort marks these symbols as common, compared to GCC
set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> -c <TARGET>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -c <TARGET>")
endif()

elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(compile_flags -g -fno-second-underscore -ffree-line-length-none)
set(compile_flags_release -O3)
Expand Down
6 changes: 6 additions & 0 deletions model/src/wav_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ subroutine SetScalarField(field, flds_scalar_name, flds_scalar_num, rc)
! local variables
type(ESMF_Distgrid) :: distgrid
type(ESMF_Grid) :: grid
real(ESMF_KIND_R8), pointer :: fldptr2d(:,:)
character(len=*), parameter :: subname='(wav_import_export:SetScalarField)'
! ----------------------------------------------

Expand All @@ -980,6 +981,11 @@ subroutine SetScalarField(field, flds_scalar_name, flds_scalar_num, rc)
ungriddedLBound=(/1/), ungriddedUBound=(/flds_scalar_num/), gridToFieldMap=(/2/), rc=rc) ! num of scalar values
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) return

! initialize fldptr to zero
call ESMF_FieldGet(field, farrayPtr=fldptr2d, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
fldptr2d(:,:) = 0.0

end subroutine SetScalarField

end subroutine fldlist_realize
Expand Down

0 comments on commit 812b8f7

Please sign in to comment.