From d03dff4f0eea143312f9d2fb928b84fcf4869c6b Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 23 Oct 2025 17:12:53 -0400 Subject: [PATCH 1/9] Use cnst_ and pbuf_ alternative ic names when reading constituents not in the registry --- src/data/write_init_files.py | 8 ++++++-- .../sample_files/write_init_files/physics_inputs_4D.F90 | 7 ++++--- .../sample_files/write_init_files/physics_inputs_bvd.F90 | 7 ++++--- .../sample_files/write_init_files/physics_inputs_cnst.F90 | 7 ++++--- .../write_init_files/physics_inputs_constituent_dim.F90 | 7 ++++--- .../sample_files/write_init_files/physics_inputs_ddt.F90 | 7 ++++--- .../sample_files/write_init_files/physics_inputs_ddt2.F90 | 7 ++++--- .../write_init_files/physics_inputs_ddt_array.F90 | 7 ++++--- .../write_init_files/physics_inputs_host_var.F90 | 7 ++++--- .../write_init_files/physics_inputs_initial_value.F90 | 7 ++++--- .../sample_files/write_init_files/physics_inputs_mf.F90 | 7 ++++--- .../write_init_files/physics_inputs_no_horiz.F90 | 7 ++++--- .../write_init_files/physics_inputs_noreq.F90 | 7 ++++--- .../write_init_files/physics_inputs_param.F90 | 7 ++++--- .../write_init_files/physics_inputs_protect.F90 | 7 ++++--- .../write_init_files/physics_inputs_scalar.F90 | 7 ++++--- .../write_init_files/physics_inputs_simple.F90 | 7 ++++--- 17 files changed, 70 insertions(+), 50 deletions(-) diff --git a/src/data/write_init_files.py b/src/data/write_init_files.py index 838c5f1b0..ae3c50def 100644 --- a/src/data/write_init_files.py +++ b/src/data/write_init_files.py @@ -1173,8 +1173,12 @@ def write_phys_read_subroutine(outfile, host_dict, host_vars, host_imports, outfile.write("end do", 4) outfile.write("call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found)", 4) outfile.write("else", 3) - outfile.comment("If not in standard names list, then just use constituent name as input file name:",4) - outfile.write("call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found)", 4) + outfile.comment("If not in standard names list, then attempt constituent name",4) + outfile.comment("and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names:",4) + # The , cnst_, pbuf_ prefix default fallbacks + # allows us to not enumerate all needed constituents from snapshots in the + # registry, yet allow reading their values from CAM snapshots. + outfile.write("call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found)", 4) outfile.write("end if", 3) outfile.write("if(.not. var_found) then", 3) outfile.write("constituent_has_default = .false.", 4) diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 index d3326cfc4..36daac9fc 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 index 4d5020972..e4ea026c7 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 index 836b44d1c..b1cfde422 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 index 599148b16..30975a9c7 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 @@ -205,9 +205,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 index c1820be82..1c78468cd 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 index 72727daf3..6d716bfd0 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 index 1e66b2f29..481384c06 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 index ec1ca6a0b..1072ac020 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 @@ -194,9 +194,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 index 2a460d699..1e5e9d33f 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 index 8fc4f7d49..18b5e4e6f 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 @@ -198,9 +198,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 index a44bd1f77..aa8038175 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 index 6f64e83e5..5391c8f36 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 @@ -190,9 +190,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 index 3ea2ff058..5ae222da0 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 @@ -200,9 +200,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 index 917d2031f..cec4e9004 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 index 575e87fbd..e7eb8aa9c 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 index 1d798e7b4..6ffbe721e 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. From fcdba171f0f9a217ea19bd4a33f934ddcf3c6634 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 24 Nov 2025 11:49:41 -0500 Subject: [PATCH 2/9] Also try removing cnst_ prefix for constituent-dimensioned fields not in registry --- src/physics/utils/physics_data.F90 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/physics/utils/physics_data.F90 b/src/physics/utils/physics_data.F90 index 7cf1f8ef5..342999f52 100644 --- a/src/physics/utils/physics_data.F90 +++ b/src/physics/utils/physics_data.F90 @@ -1,4 +1,4 @@ -module physics_data +src/data/registry.xmlmodule physics_data use ccpp_kinds, only: kind_phys use shr_kind_mod, only: cl=>shr_kind_cl @@ -460,6 +460,16 @@ subroutine read_constituent_dimensioned_field_2d(const_props, file, std_name, ba var_found = .false. call cam_pio_find_var(file, [file_var_name], found_name, vardesc, var_found) + ! Some constituents whose names are not specified in the registry + ! will have cnst_ prepended to them (e.g., cnst_dst_a1); also try reading + ! from file by removing this prefix: + if (.not. var_found) then + if (constituent_name(1:5) == 'cnst_') then + file_var_name = trim(base_var_names(base_idx)) // '_' // trim(constituent_name(6:)) + call cam_pio_find_var(file, [file_var_name], found_name, vardesc, var_found) + end if + end if + if (var_found) then ! Read the variable if (masterproc) then From 69f8e27a6d6782480c8a8414c810970904ebac1a Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 24 Nov 2025 11:51:02 -0500 Subject: [PATCH 3/9] Fix typo --- src/physics/utils/physics_data.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics/utils/physics_data.F90 b/src/physics/utils/physics_data.F90 index 342999f52..b5c183a25 100644 --- a/src/physics/utils/physics_data.F90 +++ b/src/physics/utils/physics_data.F90 @@ -1,4 +1,4 @@ -src/data/registry.xmlmodule physics_data +module physics_data use ccpp_kinds, only: kind_phys use shr_kind_mod, only: cl=>shr_kind_cl From 81093a4528562433ca366ffea460865e04fe0c46 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 5 Jan 2026 17:43:32 -0500 Subject: [PATCH 4/9] Remove input file names for constituents with the same name only with pbuf_ prefix --- src/data/registry.xml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 98da28a49..8d68f0d64 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -628,36 +628,11 @@ units="kg kg-1" type="real" constituent="true"> Q cnst_Q - - CO2 cnst_CO2 - - - N2O cnst_N2O - - - CH4 cnst_CH4 - - - CFC12 cnst_CFC12 - CFC11STAR pbuf_CFC11STAR - - O2 pbuf_O2 - From af914b41aaa7626453e0f7831b61c44b80916643 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 29 Jun 2026 16:48:31 -0400 Subject: [PATCH 5/9] Update to correct implementation, including physics_data_check. --- src/data/write_init_files.py | 10 +++++++--- .../write_init_files/physics_inputs_4D.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_bvd.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_cnst.F90 | 14 ++++++++------ .../physics_inputs_constituent_dim.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_ddt.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_ddt2.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_ddt_array.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_host_var.F90 | 14 ++++++++------ .../physics_inputs_initial_value.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_mf.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_no_horiz.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_noreq.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_param.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_protect.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_scalar.F90 | 14 ++++++++------ .../write_init_files/physics_inputs_simple.F90 | 14 ++++++++------ 17 files changed, 135 insertions(+), 99 deletions(-) diff --git a/src/data/write_init_files.py b/src/data/write_init_files.py index 7fba1c5b9..139f5f22a 100644 --- a/src/data/write_init_files.py +++ b/src/data/write_init_files.py @@ -1199,7 +1199,7 @@ def write_phys_read_subroutine(outfile, host_dict, host_vars, host_imports, # The , cnst_, pbuf_ prefix default fallbacks # allows us to not enumerate all needed constituents from snapshots in the # registry, yet allow reading their values from CAM snapshots. - outfile.write("call read_field(file, std_name, [std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found)", 4) + outfile.write("call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found)", 4) outfile.write("end if", 3) outfile.write("if(.not. var_found) then", 3) outfile.write("constituent_has_default = .false.", 4) @@ -1505,8 +1505,12 @@ def write_phys_check_subroutine(outfile, host_dict, host_vars, host_imports, outfile.write("overall_diff_found = .true.", 5) outfile.write("end if", 4) outfile.write("else", 3) - outfile.comment("If not in standard names list, then just use constituent name as input file name:",4) - outfile.write("call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found)", 4) + outfile.comment("If not in standard names list, then attempt constituent name",4) + outfile.comment("and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names:",4) + # The , cnst_, pbuf_ prefix default fallbacks + # allows us to not enumerate all needed constituents from snapshots in the + # registry, yet allow reading their values from CAM snapshots. + outfile.write("call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found)", 4) outfile.write("if (diff_found) then", 4) outfile.write("overall_diff_found = .true.", 5) outfile.write("end if", 4) diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 index 225cb1bfc..cfa9d2ece 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 @@ -199,9 +199,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -374,9 +375,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 index 10c6f8e34..a6e65efab 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 index a2a751019..f334af13b 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 index 78505db09..70fa221d2 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 @@ -204,9 +204,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -379,9 +380,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 index 33ec286fb..67c86053b 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 index 0c6488610..4d5ab09eb 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 index bc45fc807..130d79be5 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 index bf9174ade..769ec05c8 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 @@ -193,9 +193,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -363,9 +364,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 index 0cc8f402f..6588627d2 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 index 73366e220..4a1216136 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 @@ -197,9 +197,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -372,9 +373,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 index 1b59d28b3..410783b82 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 index c0d933460..968998b88 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 @@ -189,9 +189,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -359,9 +360,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 index 3bafa98f6..31e0cb87b 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 @@ -199,9 +199,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -374,9 +375,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 index 791a01f16..01b598631 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 index 9e992f73b..488d05708 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -371,9 +372,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 index 01f5bfa8e..11638b27c 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 @@ -196,9 +196,10 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia call read_field(file, std_name, input_var_names(:,const_input_idx), 'lev', timestep, field_data_ptr(:,:,constituent_idx), & mark_as_read=.false., error_on_not_found=.false., var_found=var_found) else - ! If not in standard names list, then just use constituent name as input file name: - call read_field(file, std_name, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., & - error_on_not_found=.false., var_found=var_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then constituent_has_default = .false. @@ -378,9 +379,10 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, overall_diff_found = .true. end if else - ! If not in standard names list, then just use constituent name as input file name: - call check_field(file, [std_name], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, & - is_first, diff_found) + ! If not in standard names list, then attempt constituent name + ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: + call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. end if From cae7e87672cea6712fa4ef97b3fc2af6fcc298b6 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 2 Jul 2026 00:16:40 -0400 Subject: [PATCH 6/9] Update src/data/write_init_files.py Co-authored-by: Jesse Nusbaumer --- src/data/write_init_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/write_init_files.py b/src/data/write_init_files.py index 139f5f22a..953cb8615 100644 --- a/src/data/write_init_files.py +++ b/src/data/write_init_files.py @@ -1199,7 +1199,7 @@ def write_phys_read_subroutine(outfile, host_dict, host_vars, host_imports, # The , cnst_, pbuf_ prefix default fallbacks # allows us to not enumerate all needed constituents from snapshots in the # registry, yet allow reading their values from CAM snapshots. - outfile.write("call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found)", 4) + outfile.write("call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found)", 4) outfile.write("end if", 3) outfile.write("if(.not. var_found) then", 3) outfile.write("constituent_has_default = .false.", 4) From 02632248daa70922df4535707ae4497f458b8941 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 2 Jul 2026 00:16:48 -0400 Subject: [PATCH 7/9] Update src/data/write_init_files.py Co-authored-by: Jesse Nusbaumer --- src/data/write_init_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/write_init_files.py b/src/data/write_init_files.py index 953cb8615..98e52617a 100644 --- a/src/data/write_init_files.py +++ b/src/data/write_init_files.py @@ -1510,7 +1510,7 @@ def write_phys_check_subroutine(outfile, host_dict, host_vars, host_imports, # The , cnst_, pbuf_ prefix default fallbacks # allows us to not enumerate all needed constituents from snapshots in the # registry, yet allow reading their values from CAM snapshots. - outfile.write("call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found)", 4) + outfile.write("call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found)", 4) outfile.write("if (diff_found) then", 4) outfile.write("overall_diff_found = .true.", 5) outfile.write("end if", 4) From ad2e967f088243c5dec9bed047e0a1a680d03e8e Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 2 Jul 2026 20:53:29 -0400 Subject: [PATCH 8/9] Update test files for Python unit tests. --- .../sample_files/write_init_files/physics_inputs_4D.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_bvd.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_cnst.F90 | 4 ++-- .../write_init_files/physics_inputs_constituent_dim.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_ddt.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_ddt2.F90 | 4 ++-- .../write_init_files/physics_inputs_ddt_array.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_host_var.F90 | 4 ++-- .../write_init_files/physics_inputs_initial_value.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_mf.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_no_horiz.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_noreq.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_param.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_protect.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_scalar.F90 | 4 ++-- .../sample_files/write_init_files/physics_inputs_simple.F90 | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 index cfa9d2ece..869575ca2 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90 @@ -201,7 +201,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -377,7 +377,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 index a6e65efab..dc8fda6d1 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 index f334af13b..53d1169d6 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 index 70fa221d2..90c43f4ba 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90 @@ -206,7 +206,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -382,7 +382,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 index 67c86053b..07c980311 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 index 4d5ab09eb..8201666f1 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 index 130d79be5..dfca01355 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 index 769ec05c8..3517c215f 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90 @@ -195,7 +195,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -366,7 +366,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 index 6588627d2..0670e5657 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_initial_value.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 index 4a1216136..e09849edc 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_mf.F90 @@ -199,7 +199,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -375,7 +375,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 index 410783b82..119e086ef 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_no_horiz.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 index 968998b88..158f9be55 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_noreq.F90 @@ -191,7 +191,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -362,7 +362,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 index 31e0cb87b..57aeac7d6 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_param.F90 @@ -201,7 +201,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -377,7 +377,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 index 01b598631..363c3ce46 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_protect.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 index 488d05708..ccb1a2c1e 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_scalar.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -374,7 +374,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. diff --git a/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 b/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 index 11638b27c..bf46c963b 100644 --- a/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 +++ b/test/unit/python/sample_files/write_init_files/physics_inputs_simple.F90 @@ -198,7 +198,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call read_field(file, std_name, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & + call read_field(file, std_name, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', & timestep, field_data_ptr(:,:,constituent_idx), mark_as_read=.false., error_on_not_found=.false., var_found=var_found) end if if(.not. var_found) then @@ -381,7 +381,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference, else ! If not in standard names list, then attempt constituent name ! and cnst_, pbuf_ prefixes used by CAM snapshots (advected, non-advected) as input names: - call check_field(file, [character(len=std_name_len) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & + call check_field(file, [character(len=std_name_len+5) :: std_name, 'cnst_'//trim(std_name), 'pbuf_'//trim(std_name)], 'lev', timestep, & field_data_ptr(:,:,constituent_idx), std_name, min_difference, min_relative_value, is_first, diff_found) if (diff_found) then overall_diff_found = .true. From d93be388b824099f784e2d16e48a4b4e62d4ce7b Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 6 Jul 2026 11:15:35 -0400 Subject: [PATCH 9/9] Restyle comments at top of constituents section in the registry. --- src/data/registry.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/data/registry.xml b/src/data/registry.xml index 3cf9061e6..01490c398 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -594,8 +594,12 @@ - - + + +