ESCOMP / ESCOMP/CTSM

Change history averaging of GAMMAS for MEGAN

Open
#3,525 4 comments 0 reactions 0 assignees View on GitHub
non-b4b priority: low science size: small
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
6d 6h
Merged PRs (30d)
8

Description

### Brief summary of bug

Noticed by Louisa Emmons

The hist_addfld call for GAMMAS in MEGAN averages in lake points as zero's, so it varies on history output even though it shouldn't.

### General bug information

**CTSM version you are using:** ctsm5.3.078 (but goes way back)

**Does this bug cause significantly incorrect results in the model's science?** Yes, just for GAMMAS

**Configurations affected:** When MEGAN is on and GAMMAS is output

### Details of bug

``` fortran
this%gammaS_out_patch(begp:endp) = spval
call hist_addfld1d (fname='GAMMAS', units='non', &
avgflag='A', long_name='gamma S for VOC calc', &
ptr_patch=this%gammaS_out_patch, set_lake=0._r8, default='inactive')
```

This should be changed to:

``` fortran
this%gammaS_out_patch(begp:endp) = spval
call hist_addfld1d (fname='GAMMAS', units='non', &
avgflag='A', long_name='gamma S for VOC calc', &
ptr_patch=this%gammaS_out_patch, set_spec=spval, default='inactive')
```

Changing set_lake=spval, or using set_spec=spval, should be equivalent for how the code is setup now. But, since it shouldn't be set over other landunits it might as well be done with set_spec.

So that zero's from lake and other special landunits won't be averaged in as zero's into history averaging. This likely applies to other fields as well.

### Important output or errors that show the problem

Louisa has plots that show how GAMMAS varies even in a case where it should be constant.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.