Skip to content

Commit fcdba17

Browse files
committed
Also try removing cnst_ prefix for constituent-dimensioned fields not in registry
1 parent 39cd875 commit fcdba17

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/physics/utils/physics_data.F90

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module physics_data
1+
src/data/registry.xmlmodule physics_data
22

33
use ccpp_kinds, only: kind_phys
44
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
460460
var_found = .false.
461461
call cam_pio_find_var(file, [file_var_name], found_name, vardesc, var_found)
462462

463+
! Some constituents whose names are not specified in the registry
464+
! will have cnst_ prepended to them (e.g., cnst_dst_a1); also try reading
465+
! from file by removing this prefix:
466+
if (.not. var_found) then
467+
if (constituent_name(1:5) == 'cnst_') then
468+
file_var_name = trim(base_var_names(base_idx)) // '_' // trim(constituent_name(6:))
469+
call cam_pio_find_var(file, [file_var_name], found_name, vardesc, var_found)
470+
end if
471+
end if
472+
463473
if (var_found) then
464474
! Read the variable
465475
if (masterproc) then

0 commit comments

Comments
 (0)