Skip to content

Commit

Permalink
Merge remote-tracking branch 'public/develop' into cleanup-part1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasm91 committed Nov 18, 2024
2 parents 1c5f52e + 9bcf386 commit 876e43e
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 90 deletions.
172 changes: 87 additions & 85 deletions src/programs/ectrans-benchmark.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,17 @@ subroutine parse_grid(cgrid,ndgl,nloen)

!===================================================================================================

subroutine str2int(str, int, stat)

character(len=*), intent(in) :: str
integer, intent(out) :: int
integer, intent(out) :: stat
read(str, *, iostat=stat) int

end subroutine str2int

!===================================================================================================

function get_int_value(cname, iarg) result(value)

integer :: value
Expand Down Expand Up @@ -1051,6 +1062,80 @@ function get_str_value(cname, iarg) result(value)

!===================================================================================================

subroutine print_help(unit)

integer, optional :: unit
integer :: nout = 6
if (present(unit)) then
nout = unit
endif

write(nout, "(a)") ""

if (jprb == jprd) then
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-dp"
else
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-sp"
end if
write(nout, "(a)") ""

write(nout, "(a)") "DESCRIPTION"
write(nout, "(a)") " This program tests ecTrans by transforming fields back and forth&
& between spectral "
if (jprb == jprd) then
write(nout, "(a)") " space and grid-point space (double-precision version)"
else
write(nout, "(a)") " space and grid-point space (single-precision version)"
end if
write(nout, "(a)") ""

write(nout, "(a)") "USAGE"
if (jprb == jprd) then
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-dp [options]"
else
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-sp [options]"
end if
write(nout, "(a)") ""

write(nout, "(a)") "OPTIONS"
write(nout, "(a)") " -h, --help Print this message"
write(nout, "(a)") " -v Run with verbose output"
write(nout, "(a)") " -t, --truncation T Run with this triangular spectral truncation&
& (default = 79)"
write(nout, "(a)") " -g, --grid GRID Run with this grid. Possible values: O<N>, F<N>"
write(nout, "(a)") " If not specified, O<N> is used with N=truncation+1&
& (cubic relation)"
write(nout, "(a)") " -n, --niter NITER Run for this many inverse/direct transform&
& iterations (default = 10)"
write(nout, "(a)") " --niter-warmup Number of warm up iterations,&
& for which timing statistics should be ignored (default = 3)"
write(nout, "(a)") " -f, --nfld NFLD Number of scalar fields (default = 1)"
write(nout, "(a)") " -l, --nlev NLEV Number of vertical levels (default = 1)"
write(nout, "(a)") " --vordiv Also transform vorticity-divergence to wind"
write(nout, "(a)") " --scders Compute scalar derivatives (default off)"
write(nout, "(a)") " --uvders Compute uv East-West derivatives (default off). Only&
& when also --vordiv is given"
write(nout, "(a)") " --flt Run with fast Legendre transforms (default off)"
write(nout, "(a)") " --nproma NPROMA Run with NPROMA (default no blocking: NPROMA=ngptot)"
write(nout, "(a)") " --norms Calculate and print spectral norms of transformed&
& fields"
write(nout, "(a)") " The computation of spectral norms will skew overall&
& timings"
write(nout, "(a)") " --meminfo Show diagnostic information from FIAT's ec_meminfo&
& subroutine on memory usage, thread-binding etc."
write(nout, "(a)") " --nprtrv Size of V set in spectral decomposition"
write(nout, "(a)") " --nprtrw Size of W set in spectral decomposition"
write(nout, "(a)") " -c, --check VALUE The multiplier of the machine epsilon used as a&
& tolerance for correctness checking"
write(nout, "(a)") ""
write(nout, "(a)") "DEBUGGING"
write(nout, "(a)") " --dump-values Output gridpoint fields in unformatted binary file"
write(nout, "(a)") ""

end subroutine print_help

!===================================================================================================

subroutine parsing_failed(message)

character(len=*), intent(in) :: message
Expand All @@ -1069,8 +1154,9 @@ subroutine parsing_failed(message)
subroutine get_command_line_arguments(nsmax, cgrid, iters, iters_warmup, nfld, nlev, lvordiv, lscders, luvders, &
& luseflt, nopt_mem_tr, nproma, verbosity, ldump_values, lprint_norms, &
& lmeminfo, nprtrv, nprtrw, ncheck)

#ifdef _OPENACC
use openacc
use openacc, only: acc_init, acc_get_device_type
#endif

integer, intent(inout) :: nsmax ! Spectral truncation
Expand Down Expand Up @@ -1170,16 +1256,6 @@ function cubic_octahedral_gaussian_grid(nsmax) result(cgrid)

end function

!===================================================================================================

subroutine str2int(str, int, stat)

character(len=*), intent(in) :: str
integer, intent(out) :: int
integer, intent(out) :: stat
read(str, *, iostat=stat) int

end subroutine str2int

!===================================================================================================

Expand Down Expand Up @@ -1219,80 +1295,6 @@ end function get_median

!===================================================================================================

subroutine print_help(unit)

integer, optional :: unit
integer :: nout = 6
if (present(unit)) then
nout = unit
endif

write(nout, "(a)") ""

if (jprb == jprd) then
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-dp"
else
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-sp"
end if
write(nout, "(a)") ""

write(nout, "(a)") "DESCRIPTION"
write(nout, "(a)") " This program tests ecTrans by transforming fields back and forth&
& between spectral "
if (jprb == jprd) then
write(nout, "(a)") " space and grid-point space (double-precision version)"
else
write(nout, "(a)") " space and grid-point space (single-precision version)"
end if
write(nout, "(a)") ""

write(nout, "(a)") "USAGE"
if (jprb == jprd) then
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-dp [options]"
else
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-sp [options]"
end if
write(nout, "(a)") ""

write(nout, "(a)") "OPTIONS"
write(nout, "(a)") " -h, --help Print this message"
write(nout, "(a)") " -v Run with verbose output"
write(nout, "(a)") " -t, --truncation T Run with this triangular spectral truncation&
& (default = 79)"
write(nout, "(a)") " -g, --grid GRID Run with this grid. Possible values: O<N>, F<N>"
write(nout, "(a)") " If not specified, O<N> is used with N=truncation+1&
& (cubic relation)"
write(nout, "(a)") " -n, --niter NITER Run for this many inverse/direct transform&
& iterations (default = 10)"
write(nout, "(a)") " --niter-warmup Number of warm up iterations,&
& for which timing statistics should be ignored (default = 3)"
write(nout, "(a)") " -f, --nfld NFLD Number of scalar fields (default = 1)"
write(nout, "(a)") " -l, --nlev NLEV Number of vertical levels (default = 1)"
write(nout, "(a)") " --vordiv Also transform vorticity-divergence to wind"
write(nout, "(a)") " --scders Compute scalar derivatives (default off)"
write(nout, "(a)") " --uvders Compute uv East-West derivatives (default off). Only&
& when also --vordiv is given"
write(nout, "(a)") " --flt Run with fast Legendre transforms (default off)"
write(nout, "(a)") " --nproma NPROMA Run with NPROMA (default no blocking: NPROMA=ngptot)"
write(nout, "(a)") " --norms Calculate and print spectral norms of transformed&
& fields"
write(nout, "(a)") " The computation of spectral norms will skew overall&
& timings"
write(nout, "(a)") " --meminfo Show diagnostic information from FIAT's ec_meminfo&
& subroutine on memory usage, thread-binding etc."
write(nout, "(a)") " --nprtrv Size of V set in spectral decomposition"
write(nout, "(a)") " --nprtrw Size of W set in spectral decomposition"
write(nout, "(a)") " -c, --check VALUE The multiplier of the machine epsilon used as a&
& tolerance for correctness checking"
write(nout, "(a)") ""
write(nout, "(a)") "DEBUGGING"
write(nout, "(a)") " --dump-values Output gridpoint fields in unformatted binary file"
write(nout, "(a)") ""

end subroutine print_help

!===================================================================================================

subroutine initialize_spectral_arrays(nsmax, zsp, sp3d)

integer, intent(in) :: nsmax ! Spectral truncation
Expand Down
6 changes: 3 additions & 3 deletions src/trans/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ function(generate_backend_sources)

ecbuild_list_add_pattern( LIST files
GLOB
algor/*
internal/*
external/*
algor/*.F90
internal/*.F90
external/*.F90
QUIET
)

Expand Down
4 changes: 2 additions & 2 deletions src/trans/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ function(generate_backend_sources)

ecbuild_list_add_pattern( LIST files
GLOB
internal/*
external/*
internal/*.F90
external/*.F90
QUIET
)
list( APPEND files
Expand Down

0 comments on commit 876e43e

Please sign in to comment.