diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index 23715f9e..0f1acd8b 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -39,7 +39,7 @@ - + diff --git a/src/data/write_init_files.py b/src/data/write_init_files.py index 3006fd61..ccb71784 100644 --- a/src/data/write_init_files.py +++ b/src/data/write_init_files.py @@ -1341,12 +1341,6 @@ def write_phys_check_subroutine(outfile, host_dict, host_vars, host_imports, outfile.write("deallocate(file)", 2) outfile.write("nullify(file)", 2) - # Endrun if differences were found on this timestep - outfile.comment("Endrun if differences were found on this timestep and err_on_fail=TRUE", 2) - outfile.write("if (overall_diff_found .and. err_on_fail .and. masterproc) then", 2) - outfile.write("call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__)", 3) - outfile.write("end if", 2) - # Check if no differences were found outfile.write("if (is_first) then", 2) outfile.write("if (masterproc) then", 3) @@ -1363,6 +1357,12 @@ def write_phys_check_subroutine(outfile, host_dict, host_vars, host_imports, outfile.write("write(iulog,*) ''", 3) outfile.write("end if", 2) + # Endrun if differences were found on this timestep + outfile.comment("Endrun if differences were found on this timestep and err_on_fail=TRUE", 2) + outfile.write("if (overall_diff_found .and. err_on_fail .and. masterproc) then", 2) + outfile.write("call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__)", 3) + outfile.write("end if", 2) + # End subroutine: outfile.write("end subroutine physics_check_data", 1) diff --git a/test/unit/sample_files/write_init_files/physics_inputs_4D.F90 b/test/unit/sample_files/write_init_files/physics_inputs_4D.F90 index 90ff22f7..4dd9b73f 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_4D.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_4D.F90 @@ -361,10 +361,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -376,6 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_4D diff --git a/test/unit/sample_files/write_init_files/physics_inputs_bvd.F90 b/test/unit/sample_files/write_init_files/physics_inputs_bvd.F90 index 8d68e02d..43c3c6d9 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_bvd.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_bvd.F90 @@ -361,10 +361,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -376,6 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_bvd diff --git a/test/unit/sample_files/write_init_files/physics_inputs_cnst.F90 b/test/unit/sample_files/write_init_files/physics_inputs_cnst.F90 index e7c76b7a..f8c4c595 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_cnst.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_cnst.F90 @@ -362,10 +362,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -377,6 +373,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_cnst diff --git a/test/unit/sample_files/write_init_files/physics_inputs_ddt.F90 b/test/unit/sample_files/write_init_files/physics_inputs_ddt.F90 index b51a3a28..83c4d0a7 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_ddt.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_ddt.F90 @@ -362,10 +362,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -377,6 +373,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_ddt diff --git a/test/unit/sample_files/write_init_files/physics_inputs_ddt2.F90 b/test/unit/sample_files/write_init_files/physics_inputs_ddt2.F90 index 4f3374c0..3460cc6d 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_ddt2.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_ddt2.F90 @@ -362,10 +362,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -377,6 +373,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_ddt2 diff --git a/test/unit/sample_files/write_init_files/physics_inputs_ddt_array.F90 b/test/unit/sample_files/write_init_files/physics_inputs_ddt_array.F90 index 04f63195..73842fe9 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_ddt_array.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_ddt_array.F90 @@ -362,10 +362,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -377,6 +373,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_ddt_array diff --git a/test/unit/sample_files/write_init_files/physics_inputs_host_var.F90 b/test/unit/sample_files/write_init_files/physics_inputs_host_var.F90 index 9bda9bb9..3d26b3c0 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_host_var.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_host_var.F90 @@ -355,10 +355,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -370,6 +366,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_host_var diff --git a/test/unit/sample_files/write_init_files/physics_inputs_mf.F90 b/test/unit/sample_files/write_init_files/physics_inputs_mf.F90 index 27cbdb85..8b9d96f5 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_mf.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_mf.F90 @@ -364,10 +364,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -379,6 +375,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_mf diff --git a/test/unit/sample_files/write_init_files/physics_inputs_no_horiz.F90 b/test/unit/sample_files/write_init_files/physics_inputs_no_horiz.F90 index 40c01a80..9f241873 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_no_horiz.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_no_horiz.F90 @@ -361,10 +361,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -376,6 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_no_horiz diff --git a/test/unit/sample_files/write_init_files/physics_inputs_noreq.F90 b/test/unit/sample_files/write_init_files/physics_inputs_noreq.F90 index cb3d4d07..920def1f 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_noreq.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_noreq.F90 @@ -346,10 +346,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -361,6 +357,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_noreq diff --git a/test/unit/sample_files/write_init_files/physics_inputs_param.F90 b/test/unit/sample_files/write_init_files/physics_inputs_param.F90 index 529f4872..fae09b02 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_param.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_param.F90 @@ -368,10 +368,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -383,6 +379,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_param diff --git a/test/unit/sample_files/write_init_files/physics_inputs_protect.F90 b/test/unit/sample_files/write_init_files/physics_inputs_protect.F90 index ab426b65..9d53b010 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_protect.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_protect.F90 @@ -362,10 +362,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -377,6 +373,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_protect diff --git a/test/unit/sample_files/write_init_files/physics_inputs_scalar.F90 b/test/unit/sample_files/write_init_files/physics_inputs_scalar.F90 index 1b7d754b..f1e97b2b 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_scalar.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_scalar.F90 @@ -361,10 +361,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -376,6 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_scalar diff --git a/test/unit/sample_files/write_init_files/physics_inputs_simple.F90 b/test/unit/sample_files/write_init_files/physics_inputs_simple.F90 index 89430896..ec906fda 100644 --- a/test/unit/sample_files/write_init_files/physics_inputs_simple.F90 +++ b/test/unit/sample_files/write_init_files/physics_inputs_simple.F90 @@ -362,10 +362,6 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, call cam_pio_closefile(file) deallocate(file) nullify(file) - ! Endrun if differences were found on this timestep and err_on_fail=TRUE - if (overall_diff_found .and. err_on_fail .and. masterproc) then - call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) - end if if (is_first) then if (masterproc) then write(iulog,*) '' @@ -377,6 +373,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, write(iulog,*) '********** End Physics Check Data Results **********' write(iulog,*) '' end if + ! Endrun if differences were found on this timestep and err_on_fail=TRUE + if (overall_diff_found .and. err_on_fail .and. masterproc) then + call endrun('ERROR: Difference(s) found during ncdata check', file=__FILE__, line=__LINE__) + end if end subroutine physics_check_data end module physics_inputs_simple