Skip to content

Vector-complement check aborts on history tapes that are not interpolated #1670

Description

@PeterHjortLauritzen

What happened?

setup_interpolation_and_define_vector_complements in src/control/cam_history.F90 requires that every field registered as part of a vector pair (via register_vector_field) have its partner on the same history tape. This requirement should only apply to tapes that are actually interpolated, but the check is currently applied to all tapes whenever any tape has interpolate_output = .true.:

  if (any(interpolate_output)) then
    call setup_history_interpolation(interp_ok, ptapes-2, ...)
    do hf = 1, ptapes - 2
      if((.not. is_satfile(hf)) .and. (.not. is_initfile(hf))) then
        do fld = 1, nflds(hf)
          if (field_part_of_vector(trim(tape(hf)%hlist(fld)%field%name), mname, zname)) then
            ...
            call endrun(trim(subname)//': No meridional match for '//trim(tape(hf)%hlist(fld)%field%name))

(src/control/cam_history.F90, subroutine starting at line 984; the loop over hf has no per-tape interpolate_output(hf) guard — only satellite and IC tapes are excluded.)

What are the steps to reproduce the bug?

SE dycore case with, e.g.:

 fincl6 = 'PS:I','U:I','V:I','T:I','OMEGA:I','Q:I','PMID:I'
 fincl7 = 'Uzm','Vzm','Wzm','THzm','VTHzm','WTHzm','UVzm','UWzm','UTEND_CORE','UTEND_PHYSTOT','UTEND_GWDTOT'
 interpolate_output = .true.,.false.,.true.,.true.,.false.,.false.,.false.

Tape 7 is not interpolated, yet the run aborts during history initialization with:

setup_interpolation_and_define_vector_complements: No meridional match for UTEND_CORE because UTEND_CORE is registered as a vector pair with VTEND_CORE (src/physics/cam/physpkg.F90) and VTEND_CORE is not on the tape. Removing interpolate_output (all .false.) makes the identical fincl7 run fine, which shows the check on tape 7 is a side effect of interpolating other tapes.

What CAM tag were you using?

cam6_4_199

What machine were you running CAM on?

CISL machine (e.g. derecho)

What compiler were you using?

Intel

Path to a case directory, if applicable

No response

Will you be addressing this bug yourself?

Yes

Extra info

Suggested fix

Skip non-interpolated tapes in the loop:

do hf = 1, ptapes - 2
  if((.not. is_satfile(hf)) .and. (.not. is_initfile(hf)) .and. interpolate_output(hf)) then

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working correctlymisc tagissue or PR candidate for upcoming misc tag

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions