diff --git a/contrib/get_aerosol_climo.sh b/contrib/get_aerosol_climo.sh index 2039dc73..695d1c7a 100755 --- a/contrib/get_aerosol_climo.sh +++ b/contrib/get_aerosol_climo.sh @@ -20,7 +20,7 @@ data_files=("FV3_aeroclim1" "FV3_aeroclim2" "FV3_aeroclim3" "FV3_aeroclim_optics cd $BASEDIR/scm/data/physics_input_data/ for file in "${data_files[@]}"; do echo "Retrieving $file.tar.gz" - wget https://github.com/NCAR/ccpp-scm/releases/download/v6.0.0/${file}.tar.gz + wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/${file}.tar.gz tar -xvf ${file}.tar.gz rm -f ${file}.tar.gz done diff --git a/contrib/get_mg_inccn_data.sh b/contrib/get_mg_inccn_data.sh index 70881ced..e98c277a 100755 --- a/contrib/get_mg_inccn_data.sh +++ b/contrib/get_mg_inccn_data.sh @@ -16,7 +16,7 @@ BASEDIR=$MYDIR/.. # Change to directory containing the physics input data, download and extract archive cd $BASEDIR/scm/data/physics_input_data/ -wget https://github.com/NCAR/ccpp-scm/releases/download/v6.0.0/MG_INCCN_data.tar.gz +wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/MG_INCCN_data.tar.gz tar -xvf MG_INCCN_data.tar.gz rm -f MG_INCCN_data.tar.gz cd $BASEDIR/ diff --git a/contrib/get_thompson_tables.sh b/contrib/get_thompson_tables.sh index 9657ec90..86a9487b 100755 --- a/contrib/get_thompson_tables.sh +++ b/contrib/get_thompson_tables.sh @@ -15,7 +15,7 @@ BASEDIR=$MYDIR/.. # Change to directory containing the physics input data, download and extract archive cd $BASEDIR/scm/data/physics_input_data/ -wget https://github.com/NCAR/ccpp-scm/releases/download/v6.0.0/thompson_tables.tar.gz +wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/thompson_tables.tar.gz tar -xvf thompson_tables.tar.gz rm -f thompson_tables.tar.gz cd $BASEDIR/ diff --git a/scm/src/CMakeLists.txt b/scm/src/CMakeLists.txt index 7fe4a546..4938e1b5 100644 --- a/scm/src/CMakeLists.txt +++ b/scm/src/CMakeLists.txt @@ -24,7 +24,7 @@ else() OUTPUT_STRIP_TRAILING_WHITESPACE ) set(_ccpp_suites_arg "--suites=${suite_string}") - message("Calling CCPP code generator (ccpp_prebuild.py) for SUPPORTED suites ${_ccpp_suites_arg} ...") + message("Calling CCPP code generator (ccpp_prebuild.py) for suites listed in scm/src/suite_info.py: ${_ccpp_suites_arg}.") endif() # Run CCPP prebuild.py message (STATUS "Running ccpp_prebuild.py for CCPP") diff --git a/scm/src/run_scm.py b/scm/src/run_scm.py index e610475b..b879dd82 100755 --- a/scm/src/run_scm.py +++ b/scm/src/run_scm.py @@ -261,7 +261,7 @@ def __init__(self, case, suite, runtime, runtime_mult, levels, npz_type, vert_co if runtime_mult: self._runtime_mult = runtime_mult - message = 'Existing case namelist runtime multiplied by {0}'.format(self._runtime_mult) + message = 'Existing case namelist or DEPHY runtime multiplied by {0}'.format(self._runtime_mult) logging.debug(message) else: self._runtime_mult = None @@ -460,11 +460,9 @@ def setup_rundir(self): message = 'The --runtime_mult argument must be greater than 0 ({0} was entered)'.format(self._runtime_mult) logging.critical(message) raise Exception(message) - try: - old_runtime = case_nml['case_config']['runtime'] - case_nml['case_config']['runtime'] = old_runtime*self._runtime_mult - except KeyError: - logging.info('The runtime multiplier argument was set, but the runtime is not set in {0} '.format(self._namelist)) + else: + case_nml['case_config']['runtime_mult'] = self._runtime_mult + # If the number of levels is specified, set the namelist value if self._levels: case_nml['case_config']['n_levels'] = self._levels diff --git a/scm/src/scm_input.F90 b/scm/src/scm_input.F90 index 8d3d2cda..4bb6b3c0 100644 --- a/scm/src/scm_input.F90 +++ b/scm/src/scm_input.F90 @@ -41,6 +41,7 @@ subroutine get_config_nml(scm_state) character(len=character_length) :: case_name !< name of case initialization and forcing dataset real(kind=dp) :: dt !< time step in seconds real(kind=dp) :: runtime !< total runtime in seconds + real(kind=dp) :: runtime_mult !< runtime multiplier integer :: n_itt_out !< multiple of timestep for writing output integer :: n_itt_diag !< multiple of timestep for resetting diagnostics (overwrites fhzero from physics namelist if present) integer :: n_levels !< number of model levels (currently only 64 supported) @@ -77,7 +78,7 @@ subroutine get_config_nml(scm_state) CHARACTER(LEN=*), parameter :: experiment_namelist = 'input_experiment.nml' - NAMELIST /case_config/ npz_type, vert_coord_file, case_name, dt, runtime, n_itt_out, n_itt_diag, & + NAMELIST /case_config/ npz_type, vert_coord_file, case_name, dt, runtime, runtime_mult, n_itt_out, n_itt_diag, & n_levels, output_dir, thermo_forcing_type, model_ics, & lsm_ics, do_spinup, C_RES, spinup_timesteps, mom_forcing_type, relax_time, sfc_type, sfc_flux_spec, & sfc_roughness_length_cm, reference_profile_choice, year, month, day, hour, min, & @@ -95,7 +96,8 @@ subroutine get_config_nml(scm_state) case_name = 'twpice' dt = 600.0 time_scheme = 1 - runtime = 2138400.0 + runtime = 0.0 + runtime_mult = 1.0 n_itt_out = 1 n_itt_diag = -999 n_levels = 127 @@ -179,6 +181,7 @@ subroutine get_config_nml(scm_state) scm_state%n_itt_out = n_itt_out scm_state%n_itt_diag = n_itt_diag scm_state%runtime = runtime + scm_state%runtime_mult = runtime_mult scm_state%time_scheme = time_scheme scm_state%init_year = year scm_state%init_month = month @@ -211,7 +214,7 @@ end subroutine get_config_nml subroutine get_case_init(scm_state, scm_input) use scm_type_defs, only : scm_state_type, scm_input_type use NetCDF_read, only: NetCDF_read_var, check, missing_value - type(scm_state_type), intent(in) :: scm_state + type(scm_state_type), intent(inout) :: scm_state type(scm_input_type), target, intent(inout) :: scm_input integer :: input_nlev !< number of levels in the input file @@ -932,6 +935,9 @@ subroutine get_case_init(scm_state, scm_input) scm_input%input_emis_ice = input_emis_ice scm_input%input_lai = input_lai + if (scm_state%runtime_mult /= 1.0) then + scm_state%runtime = scm_state%runtime*scm_state%runtime_mult + end if !> @} end subroutine get_case_init @@ -1867,7 +1873,14 @@ subroutine get_case_init_DEPHY(scm_state, scm_input) scm_state%init_day = init_day scm_state%init_hour = init_hour scm_state%init_min = init_min - scm_state%runtime = elapsed_sec + if (scm_state%runtime > 0.0) then + !runtime is provided in the case configuration namelist - should override what is in the DEPHY file + if (scm_state%runtime_mult /= 1.0) then + scm_state%runtime = scm_state%runtime*scm_state%runtime_mult + end if + else + scm_state%runtime = elapsed_sec*scm_state%runtime_mult + end if scm_input%input_time = input_time scm_input%input_pres_surf(1) = input_pres_surf(active_init_time) !perhaps input_pres_surf should only be equal to input_force_pres_surf? diff --git a/scm/src/scm_type_defs.F90 b/scm/src/scm_type_defs.F90 index 664b91de..49a8c71d 100644 --- a/scm/src/scm_type_defs.F90 +++ b/scm/src/scm_type_defs.F90 @@ -135,6 +135,7 @@ module scm_type_defs real(kind=dp) :: dt !< physics time step (s) real(kind=dp) :: dt_now !< time step currently being used (if it changes due to time-stepping scheme) real(kind=dp) :: runtime !< total runtime (s) + real(kind=dp) :: runtime_mult !< runtime multiplier real(kind=dp) :: output_period !< how often output is written (s) real(kind=dp) :: relax_time !< time scale for hor. wind nudging (s) real(kind=dp) :: deg_to_rad_const !< conversion constant from degrees to radians @@ -561,6 +562,7 @@ subroutine scm_state_create(scm_state, n_columns, n_levels, n_soil, n_snow, n_ti scm_state%dt = real_zero scm_state%dt_now = real_zero scm_state%runtime = real_zero + scm_state%runtime_mult = 1.0 scm_state%output_period = real_zero scm_state%relax_time = real_zero scm_state%deg_to_rad_const = real_zero diff --git a/scm/src/suite_info.py b/scm/src/suite_info.py index 299ca4d6..494b5dff 100755 --- a/scm/src/suite_info.py +++ b/scm/src/suite_info.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +import sys, os + +#DEFAULT_SUITE_BEHAVIOR = 'supported' +DEFAULT_SUITE_BEHAVIOR = 'regression_test' + class suite(object): DEFAULT_MAX_TIMESTEP = 1800.0 @@ -72,9 +77,34 @@ def main(): #print supported suites separated by commas suite_string = '' - for s in suite_list: - if s._supported: - suite_string += s._name + ',' + s._name + '_ps' + ',' + + if DEFAULT_SUITE_BEHAVIOR == 'regression_test': + dir_path = os.path.dirname(os.path.realpath(__file__)) + sys.path.insert(1, dir_path + '/../../test/') + + rt_suite_list = [] + + import rt_test_cases + import rt_test_cases_sp + import rt_test_cases_nvidia + + for item in rt_test_cases.run_list: + rt_suite_list.append(item.get("suite")) + + for item in rt_test_cases_sp.run_list: + rt_suite_list.append(item.get("suite")) + + for item in rt_test_cases_nvidia.run_list: + rt_suite_list.append(item.get("suite")) + + unique_suite_list = list(set(rt_suite_list)) + + for s in unique_suite_list: + suite_string += s + ',' + s + '_ps' + ',' + else: + for s in suite_list: + if s._supported: + suite_string += s._name + ',' + s._name + '_ps' + ',' print(suite_string[:-1]) if __name__ == '__main__':