ESCOMP / ESCOMP/CAM

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

Open
#1,670 0 comments 0 reactions 2 assignees Claimed by @cacraigucar View on GitHub
bug misc tag
Dominant language
No language data
Stars
91
Forks
183
Avg merge
6d 2m
Merged PRs (30d)
9

Description

### 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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.