@@ -8,68 +8,66 @@ BuildCprnc()
8
8
# HOMME_TARGET NP PLEV QSIZE_D
9
9
CreateDynamicsLib("theta-l_kokkos" 4 72 10)
10
10
11
- # We have 3 runs:
12
- # 1) run for 2*N time steps starting from t=0 (baseline run)
13
- # 2) run for N time steps starting from t=0 (init run)
14
- # 3) run for N time steps re-starting from t=N*dt (restarted run)
15
- # We can use the same namelist for all tests, using 3 different input yaml files
11
+ # We have 2 runs:
12
+ # 1) run for 2*N time steps starting from t=0 (base run), write restart files at Nth step
13
+ # 3) run for N time steps re-starting from t=N*dt (rest run)
14
+ # We can use the same namelist for all tests. For input/output yaml files, we use the same
15
+ # yaml template, but need to configure them b/c the run_t0 and the output file prefix differ
16
+ # in the 2 runs.
16
17
17
18
# Create a single executable for all the 3 runs
18
19
CreateADUnitTestExec(model_restart
19
20
LIBS cld_fraction ${dynLibName} shoc p3 scream_rrtmgp)
20
21
21
22
# Set time integration options
22
23
set (CASE_T0 2023-01-01-00000)
23
- set (CASE_TN 2023-01-01-00060 )
24
+ set (RUN_DT 30 )
24
25
25
- # Create the baseline (run all 6 timsteps in a single run)
26
- CreateUnitTestFromExec(model_baseline model_restart
27
- EXE_ARGS "--args -ifile=input_baseline.yaml"
28
- MPI_RANKS ${SCREAM_TEST_MAX_RANKS}
29
- FIXTURES_SETUP baseline_run)
26
+ set (HIST_FREQ 90)
27
+ set (HIST_FREQ_UNITS nsecs)
28
+ set (REST_FREQ 60)
29
+ set (REST_FREQ_UNITS nsecs)
30
30
31
- # Start a simulation, but only run half of the time steps
32
- CreateUnitTestFromExec(model_initial model_restart
33
- EXE_ARGS "--args -ifile=input_initial.yaml"
31
+ # Create the baseline (run all timsteps in a single run) as well as the restart files
32
+ set (SUFFIX "base" )
33
+ set (RUN_T0 2023-01-01-00000)
34
+ set (RUN_NSTEPS 3)
35
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /input .yaml
36
+ ${CMAKE_CURRENT_BINARY_DIR} /input_base.yaml)
37
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /output .yaml
38
+ ${CMAKE_CURRENT_BINARY_DIR} /output_base.yaml)
39
+ CreateUnitTestFromExec(model_restart_base model_restart
40
+ EXE_ARGS "--args -ifile=input_base.yaml"
34
41
MPI_RANKS ${SCREAM_TEST_MAX_RANKS}
35
- FIXTURES_SETUP initial_run
42
+ FIXTURES_SETUP base_run
36
43
PROPERTIES RESOURCE_LOCK rpointer_file)
37
44
38
45
# Restart the simulation, and run the second half of the time steps
39
- CreateUnitTestFromExec(model_restart model_restart
40
- EXE_ARGS "--args -ifile=input_restarted.yaml"
46
+ set (SUFFIX "rest" )
47
+ set (RUN_T0 2023-01-01-00060)
48
+ set (RUN_NSTEPS 1)
49
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /input .yaml
50
+ ${CMAKE_CURRENT_BINARY_DIR} /input_rest.yaml)
51
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /output .yaml
52
+ ${CMAKE_CURRENT_BINARY_DIR} /output_rest.yaml)
53
+ CreateUnitTestFromExec(model_restart_rest model_restart
54
+ EXE_ARGS "--args -ifile=input_rest.yaml"
41
55
MPI_RANKS ${SCREAM_TEST_MAX_RANKS}
42
- FIXTURES_REQUIRED initial_run
43
- FIXTURES_SETUP restarted_run
56
+ FIXTURES_REQUIRED base_run
57
+ FIXTURES_SETUP rest_run
44
58
PROPERTIES RESOURCE_LOCK rpointer_file)
45
59
46
- # Finally, compare the nc outputs generated by the basline and restarted runs
47
- # IMPORTANT: make sure these file names match what baseline/restarted runs produce
48
- set (SRC_FILE model_output_baseline .AVERAGE.nmins_x1 .np${SCREAM_TEST_MAX_RANKS} .${CASE_T0} .nc)
49
- set (TGT_FILE model_output .AVERAGE.nmins_x1 .np${SCREAM_TEST_MAX_RANKS} .${CASE_T0} .nc)
60
+ # Finally, compare the nc outputs generated by the base and rest runs
61
+ # IMPORTANT: make sure these file names match what base/rest runs produced
62
+ set (SRC_FILE model_output_base .AVERAGE.${HIST_FREQ_UNITS} _x ${HIST_FREQ} .np${SCREAM_TEST_MAX_RANKS} .${CASE_T0} .nc)
63
+ set (TGT_FILE model_output_rest .AVERAGE.${HIST_FREQ_UNITS} _x ${HIST_FREQ} .np${SCREAM_TEST_MAX_RANKS} .${CASE_T0} .nc)
50
64
51
- add_test (NAME restarted_vs_monolithic_check_np ${SCREAM_TEST_MAX_RANKS}
65
+ add_test (NAME model_restart_check_np ${SCREAM_TEST_MAX_RANKS}
52
66
COMMAND cmake -P ${CMAKE_BINARY_DIR} /bin/CprncTest.cmake ${SRC_FILE} ${TGT_FILE}
53
67
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
54
- set_tests_properties (restarted_vs_monolithic_check_np ${SCREAM_TEST_MAX_RANKS} PROPERTIES
68
+ set_tests_properties (model_restart_check_np ${SCREAM_TEST_MAX_RANKS} PROPERTIES
55
69
RESOURCE_GROUPS "devices:1"
56
- FIXTURES_REQUIRED "baseline_run;restarted_run" )
57
-
58
- # Configure yaml input file to run directory
59
- set (RUN_T0 2023-01-01-00000)
60
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /input_baseline.yaml
61
- ${CMAKE_CURRENT_BINARY_DIR} /input_baseline.yaml)
62
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /input_initial.yaml
63
- ${CMAKE_CURRENT_BINARY_DIR} /input_initial.yaml)
64
- set (RUN_T0 2023-01-01-00030)
65
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /input_restarted.yaml
66
- ${CMAKE_CURRENT_BINARY_DIR} /input_restarted.yaml)
67
-
68
- # The two yaml files that control the output streams (for the baseline and restart runs)
69
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /model_output.yaml
70
- ${CMAKE_CURRENT_BINARY_DIR} /model_output.yaml COPYONLY )
71
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /model_restart_output.yaml
72
- ${CMAKE_CURRENT_BINARY_DIR} /model_restart_output.yaml COPYONLY )
70
+ FIXTURES_REQUIRED "base_run;rest_run" )
73
71
74
72
# Set homme's test options, so that we can configure the namelist correctly
75
73
# Discretization/algorithm settings
0 commit comments