diff --git a/tests/test_1_fundamental.py b/tests/test_1_fundamental.py index 7cb61de92..6469c9b4f 100644 --- a/tests/test_1_fundamental.py +++ b/tests/test_1_fundamental.py @@ -19,6 +19,18 @@ # Get domain, reference, candidate, and optional output directory from command line arguments # Setup a domain +#List variabls to ignore in tests, primarily accumulation variables +EXCLUDE_VARS = ['ACMELT', + 'ACSNOW', + 'SFCRUNOFF', + 'UDRUNOFF', + 'ACCPRCP', + 'ACCECAN', + 'ACCEDIR', + 'ACCETRAN', + 'qstrmvolrt', + 'reference_time', + 'lake_inflort'] # ################################# # Define tests @@ -193,7 +205,8 @@ def test_ncores_candidate(output_dir): with warnings.catch_warnings(): warnings.simplefilter("ignore") diffs = wrfhydropy.outputdiffs.OutputDataDiffs(candidate_sim_ncores.output, - candidate_sim_expected.output) + candidate_sim_expected.output, + exclude_vars=EXCLUDE_VARS) # Assert all diff values are 0 and print diff stats if not has_diffs = any(value != 0 for value in diffs.diff_counts.values()) @@ -279,7 +292,8 @@ def test_perfrestart_candidate(output_dir): with warnings.catch_warnings(): warnings.simplefilter("ignore") diffs = wrfhydropy.outputdiffs.OutputDataDiffs(candidate_sim_restart.output, - candidate_sim_expected.output) + candidate_sim_expected.output, + exclude_vars=EXCLUDE_VARS) # Assert all diff values are 0 and print diff stats if not has_diffs = any(value != 0 for value in diffs.diff_counts.values()) diff --git a/tests/test_2_regression.py b/tests/test_2_regression.py index 285e22eac..b10467fd2 100644 --- a/tests/test_2_regression.py +++ b/tests/test_2_regression.py @@ -9,6 +9,8 @@ sys.path.insert(0, str(pathlib.Path(__file__).parent)) from utilities import print_diffs +# Ignore reference time in regression test because it depends on wall time of model run +EXCLUDE_VARS = ['reference_time'] # regression question def test_regression_data(output_dir): @@ -33,7 +35,8 @@ def test_regression_data(output_dir): warnings.simplefilter("ignore") data_diffs = wrfhydropy.outputdiffs.OutputDataDiffs( candidate_run_expected.output, - reference_run_expected.output + reference_run_expected.output, + exclude_vars=EXCLUDE_VARS ) # Assert all diff values are 0 and print diff stats if not @@ -66,7 +69,8 @@ def test_regression_metadata(output_dir): with warnings.catch_warnings(): warnings.simplefilter("ignore") meta_data_diffs = wrfhydropy.outputdiffs.OutputMetaDataDiffs(candidate_run_expected.output, - reference_run_expected.output) + reference_run_expected.output, + exclude_vars=EXCLUDE_VARS) # Assert all diff values are 0 and print diff stats if not has_metadata_diffs = any(value != 0 for value in meta_data_diffs.diff_counts.values()) diff --git a/trunk/NDHMS/Routing/module_HYDRO_io.F b/trunk/NDHMS/Routing/module_HYDRO_io.F index 74ce0ee52..09abfb7f6 100644 --- a/trunk/NDHMS/Routing/module_HYDRO_io.F +++ b/trunk/NDHMS/Routing/module_HYDRO_io.F @@ -5905,6 +5905,7 @@ subroutine RESTART_OUT_nc(outFile,did) if(rt_domain(did)%nlakes .gt. 0) then iret = nf_def_var(ncid,"resht",NF_FLOAT,1,(/dimid_lakes/),varid) iret = nf_def_var(ncid,"qlakeo",NF_FLOAT,1,(/dimid_lakes/),varid) + iret = nf_def_var(ncid,"qlakei",NF_FLOAT,1,(/dimid_lakes/),varid) endif if( nlst_rt(did)%channel_only .eq. 0 .and. & @@ -6111,7 +6112,13 @@ subroutine RESTART_OUT_nc(outFile,did) ,rt_domain(did)%lake_index & #endif ) - + + call w_rst_crt_nc1_lake(ncid,rt_domain(did)%nlakes,rt_domain(did)%qlakei,"qlakei" & +#ifdef MPP_LAND + ,rt_domain(did)%lake_index & +#endif + ) + if( nlst_rt(did)%channel_only .eq. 0 .and. & nlst_rt(did)%channelBucket_only .eq. 0 ) & call w_rst_rt_nc2(ncid,rt_domain(did)%ixrt,rt_domain(did)%jxrt,rt_domain(did)%LAKE_INFLORT,"lake_inflort") @@ -6212,6 +6219,7 @@ subroutine RESTART_OUT_bi(outFile,did) write(iunit,ERR=101) rt_domain(did)%cvol write(iunit,ERR=101) rt_domain(did)%resht write(iunit,ERR=101) rt_domain(did)%qlakeo + write(iunit,ERR=101) rt_domain(did)%qlakei write(iunit,ERR=101) rt_domain(did)%LAKE_INFLORT end if if(nlst_rt(did)%GWBASESWCRT.EQ.1) then @@ -6305,6 +6313,7 @@ subroutine RESTART_in_bi(inFileTmp,did) read(iunit,ERR=101) rt_domain(did)%cvol read(iunit,ERR=101) rt_domain(did)%resht read(iunit,ERR=101) rt_domain(did)%qlakeo + read(iunit,ERR=101) rt_domain(did)%qlakei read(iunit,ERR=101) rt_domain(did)%LAKE_INFLORT end if if(nlst_rt(did)%GWBASESWCRT.EQ.1) then @@ -6815,6 +6824,7 @@ subroutine RESTART_IN_NC(inFile,did) if(rt_domain(did)%NLAKES .gt. 0) then call read_rst_crt_nc(ncid,rt_domain(did)%RESHT,rt_domain(did)%NLAKES,"resht") call read_rst_crt_nc(ncid,rt_domain(did)%QLAKEO,rt_domain(did)%NLAKES,"qlakeo") + call read_rst_crt_nc(ncid,rt_domain(did)%QLAKEI,rt_domain(did)%NLAKES,"qlakei") endif if( nlst_rt(did)%channel_only .eq. 0 .and. & diff --git a/trunk/NDHMS/Routing/module_channel_routing.F b/trunk/NDHMS/Routing/module_channel_routing.F index fbe47c753..bdeb64545 100644 --- a/trunk/NDHMS/Routing/module_channel_routing.F +++ b/trunk/NDHMS/Routing/module_channel_routing.F @@ -1309,7 +1309,7 @@ Subroutine drive_CHANNEL(latval,lonval,KT, IXRT,JXRT, SUBRTSWCRT, & call updateLake_grid(QLLAKE, nlakes,lake_index) call updateLake_grid(RESHT, nlakes,lake_index) call updateLake_grid(QLAKEO, nlakes,lake_index) - call updateLake_grid(QLLAKE, nlakes,lake_index) + call updateLake_grid(QLAKEI, nlakes,lake_index) call updateLake_grid(QLAKEIP,nlakes,lake_index) endif #endif