Skip to content

Commit 876e43e

Browse files
committed
Merge remote-tracking branch 'public/develop' into cleanup-part1
2 parents 1c5f52e + 9bcf386 commit 876e43e

File tree

3 files changed

+92
-90
lines changed

3 files changed

+92
-90
lines changed

src/programs/ectrans-benchmark.F90

Lines changed: 87 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,17 @@ subroutine parse_grid(cgrid,ndgl,nloen)
10151015

10161016
!===================================================================================================
10171017

1018+
subroutine str2int(str, int, stat)
1019+
1020+
character(len=*), intent(in) :: str
1021+
integer, intent(out) :: int
1022+
integer, intent(out) :: stat
1023+
read(str, *, iostat=stat) int
1024+
1025+
end subroutine str2int
1026+
1027+
!===================================================================================================
1028+
10181029
function get_int_value(cname, iarg) result(value)
10191030

10201031
integer :: value
@@ -1051,6 +1062,80 @@ function get_str_value(cname, iarg) result(value)
10511062

10521063
!===================================================================================================
10531064

1065+
subroutine print_help(unit)
1066+
1067+
integer, optional :: unit
1068+
integer :: nout = 6
1069+
if (present(unit)) then
1070+
nout = unit
1071+
endif
1072+
1073+
write(nout, "(a)") ""
1074+
1075+
if (jprb == jprd) then
1076+
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-dp"
1077+
else
1078+
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-sp"
1079+
end if
1080+
write(nout, "(a)") ""
1081+
1082+
write(nout, "(a)") "DESCRIPTION"
1083+
write(nout, "(a)") " This program tests ecTrans by transforming fields back and forth&
1084+
& between spectral "
1085+
if (jprb == jprd) then
1086+
write(nout, "(a)") " space and grid-point space (double-precision version)"
1087+
else
1088+
write(nout, "(a)") " space and grid-point space (single-precision version)"
1089+
end if
1090+
write(nout, "(a)") ""
1091+
1092+
write(nout, "(a)") "USAGE"
1093+
if (jprb == jprd) then
1094+
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-dp [options]"
1095+
else
1096+
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-sp [options]"
1097+
end if
1098+
write(nout, "(a)") ""
1099+
1100+
write(nout, "(a)") "OPTIONS"
1101+
write(nout, "(a)") " -h, --help Print this message"
1102+
write(nout, "(a)") " -v Run with verbose output"
1103+
write(nout, "(a)") " -t, --truncation T Run with this triangular spectral truncation&
1104+
& (default = 79)"
1105+
write(nout, "(a)") " -g, --grid GRID Run with this grid. Possible values: O<N>, F<N>"
1106+
write(nout, "(a)") " If not specified, O<N> is used with N=truncation+1&
1107+
& (cubic relation)"
1108+
write(nout, "(a)") " -n, --niter NITER Run for this many inverse/direct transform&
1109+
& iterations (default = 10)"
1110+
write(nout, "(a)") " --niter-warmup Number of warm up iterations,&
1111+
& for which timing statistics should be ignored (default = 3)"
1112+
write(nout, "(a)") " -f, --nfld NFLD Number of scalar fields (default = 1)"
1113+
write(nout, "(a)") " -l, --nlev NLEV Number of vertical levels (default = 1)"
1114+
write(nout, "(a)") " --vordiv Also transform vorticity-divergence to wind"
1115+
write(nout, "(a)") " --scders Compute scalar derivatives (default off)"
1116+
write(nout, "(a)") " --uvders Compute uv East-West derivatives (default off). Only&
1117+
& when also --vordiv is given"
1118+
write(nout, "(a)") " --flt Run with fast Legendre transforms (default off)"
1119+
write(nout, "(a)") " --nproma NPROMA Run with NPROMA (default no blocking: NPROMA=ngptot)"
1120+
write(nout, "(a)") " --norms Calculate and print spectral norms of transformed&
1121+
& fields"
1122+
write(nout, "(a)") " The computation of spectral norms will skew overall&
1123+
& timings"
1124+
write(nout, "(a)") " --meminfo Show diagnostic information from FIAT's ec_meminfo&
1125+
& subroutine on memory usage, thread-binding etc."
1126+
write(nout, "(a)") " --nprtrv Size of V set in spectral decomposition"
1127+
write(nout, "(a)") " --nprtrw Size of W set in spectral decomposition"
1128+
write(nout, "(a)") " -c, --check VALUE The multiplier of the machine epsilon used as a&
1129+
& tolerance for correctness checking"
1130+
write(nout, "(a)") ""
1131+
write(nout, "(a)") "DEBUGGING"
1132+
write(nout, "(a)") " --dump-values Output gridpoint fields in unformatted binary file"
1133+
write(nout, "(a)") ""
1134+
1135+
end subroutine print_help
1136+
1137+
!===================================================================================================
1138+
10541139
subroutine parsing_failed(message)
10551140

10561141
character(len=*), intent(in) :: message
@@ -1069,8 +1154,9 @@ subroutine parsing_failed(message)
10691154
subroutine get_command_line_arguments(nsmax, cgrid, iters, iters_warmup, nfld, nlev, lvordiv, lscders, luvders, &
10701155
& luseflt, nopt_mem_tr, nproma, verbosity, ldump_values, lprint_norms, &
10711156
& lmeminfo, nprtrv, nprtrw, ncheck)
1157+
10721158
#ifdef _OPENACC
1073-
use openacc
1159+
use openacc, only: acc_init, acc_get_device_type
10741160
#endif
10751161

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

11711257
end function
11721258

1173-
!===================================================================================================
1174-
1175-
subroutine str2int(str, int, stat)
1176-
1177-
character(len=*), intent(in) :: str
1178-
integer, intent(out) :: int
1179-
integer, intent(out) :: stat
1180-
read(str, *, iostat=stat) int
1181-
1182-
end subroutine str2int
11831259

11841260
!===================================================================================================
11851261

@@ -1219,80 +1295,6 @@ end function get_median
12191295

12201296
!===================================================================================================
12211297

1222-
subroutine print_help(unit)
1223-
1224-
integer, optional :: unit
1225-
integer :: nout = 6
1226-
if (present(unit)) then
1227-
nout = unit
1228-
endif
1229-
1230-
write(nout, "(a)") ""
1231-
1232-
if (jprb == jprd) then
1233-
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-dp"
1234-
else
1235-
write(nout, "(a)") "NAME ectrans-benchmark-" // VERSION // "-sp"
1236-
end if
1237-
write(nout, "(a)") ""
1238-
1239-
write(nout, "(a)") "DESCRIPTION"
1240-
write(nout, "(a)") " This program tests ecTrans by transforming fields back and forth&
1241-
& between spectral "
1242-
if (jprb == jprd) then
1243-
write(nout, "(a)") " space and grid-point space (double-precision version)"
1244-
else
1245-
write(nout, "(a)") " space and grid-point space (single-precision version)"
1246-
end if
1247-
write(nout, "(a)") ""
1248-
1249-
write(nout, "(a)") "USAGE"
1250-
if (jprb == jprd) then
1251-
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-dp [options]"
1252-
else
1253-
write(nout, "(a)") " ectrans-benchmark-" // VERSION // "-sp [options]"
1254-
end if
1255-
write(nout, "(a)") ""
1256-
1257-
write(nout, "(a)") "OPTIONS"
1258-
write(nout, "(a)") " -h, --help Print this message"
1259-
write(nout, "(a)") " -v Run with verbose output"
1260-
write(nout, "(a)") " -t, --truncation T Run with this triangular spectral truncation&
1261-
& (default = 79)"
1262-
write(nout, "(a)") " -g, --grid GRID Run with this grid. Possible values: O<N>, F<N>"
1263-
write(nout, "(a)") " If not specified, O<N> is used with N=truncation+1&
1264-
& (cubic relation)"
1265-
write(nout, "(a)") " -n, --niter NITER Run for this many inverse/direct transform&
1266-
& iterations (default = 10)"
1267-
write(nout, "(a)") " --niter-warmup Number of warm up iterations,&
1268-
& for which timing statistics should be ignored (default = 3)"
1269-
write(nout, "(a)") " -f, --nfld NFLD Number of scalar fields (default = 1)"
1270-
write(nout, "(a)") " -l, --nlev NLEV Number of vertical levels (default = 1)"
1271-
write(nout, "(a)") " --vordiv Also transform vorticity-divergence to wind"
1272-
write(nout, "(a)") " --scders Compute scalar derivatives (default off)"
1273-
write(nout, "(a)") " --uvders Compute uv East-West derivatives (default off). Only&
1274-
& when also --vordiv is given"
1275-
write(nout, "(a)") " --flt Run with fast Legendre transforms (default off)"
1276-
write(nout, "(a)") " --nproma NPROMA Run with NPROMA (default no blocking: NPROMA=ngptot)"
1277-
write(nout, "(a)") " --norms Calculate and print spectral norms of transformed&
1278-
& fields"
1279-
write(nout, "(a)") " The computation of spectral norms will skew overall&
1280-
& timings"
1281-
write(nout, "(a)") " --meminfo Show diagnostic information from FIAT's ec_meminfo&
1282-
& subroutine on memory usage, thread-binding etc."
1283-
write(nout, "(a)") " --nprtrv Size of V set in spectral decomposition"
1284-
write(nout, "(a)") " --nprtrw Size of W set in spectral decomposition"
1285-
write(nout, "(a)") " -c, --check VALUE The multiplier of the machine epsilon used as a&
1286-
& tolerance for correctness checking"
1287-
write(nout, "(a)") ""
1288-
write(nout, "(a)") "DEBUGGING"
1289-
write(nout, "(a)") " --dump-values Output gridpoint fields in unformatted binary file"
1290-
write(nout, "(a)") ""
1291-
1292-
end subroutine print_help
1293-
1294-
!===================================================================================================
1295-
12961298
subroutine initialize_spectral_arrays(nsmax, zsp, sp3d)
12971299

12981300
integer, intent(in) :: nsmax ! Spectral truncation

src/trans/cpu/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ function(generate_backend_sources)
4444

4545
ecbuild_list_add_pattern( LIST files
4646
GLOB
47-
algor/*
48-
internal/*
49-
external/*
47+
algor/*.F90
48+
internal/*.F90
49+
external/*.F90
5050
QUIET
5151
)
5252

src/trans/gpu/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ function(generate_backend_sources)
8888

8989
ecbuild_list_add_pattern( LIST files
9090
GLOB
91-
internal/*
92-
external/*
91+
internal/*.F90
92+
external/*.F90
9393
QUIET
9494
)
9595
list( APPEND files

0 commit comments

Comments
 (0)