You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cam history always chooses first averaging flag when using duplicate fields #1149
Be sure your nhtfrq /= 1 for the test, since that overrides everything to "I" anyway.
You can't have nhtfrq = 1 and use the "A" flag? This is useful for outfld calls in the macmic loops. For those variables I often set them to "A" and nhtfrq=1, so it is represents an average over all subcycles in a single time-step.
@adamrher hmmmm... I'm not really familiar with subcycling, but looking at the code, we're overriding the averaging flag with "I" when nhtfrq = 1. So my guess is you're not actually getting an average for those variables.
!
! Initialize history variables
!
do t=1,ptapes
do fld=1,nflds(t)
if (nhtfrq(t) == 1) then
! Override any non-I flags if nhtfrq equals 1
tape(t)%hlist(fld)%avgflag = 'I'
end if
...
It would be ideal to have this functionality -- if I outfld a variable N times in a single time-step, then "A" and nhtfrq=1 should give me the average over those N calls -- but this is not a high priority.
@gold2718 They're two separate issues. #1150 is for subcycling averages, this one is for duplicate fields for all history variables (won't be fixed by removing the override)
The functionality of outputting the same field with ‘I’ and ‘A’ in the same history stream was never supported in CAM (as far as I know). Let’s add an endrun if someone tries to do that.
Activity
adamrher commentedon Sep 13, 2024
Peanut gallery here.
You can't have nhtfrq = 1 and use the "A" flag? This is useful for outfld calls in the macmic loops. For those variables I often set them to "A" and nhtfrq=1, so it is represents an average over all subcycles in a single time-step.
peverwhee commentedon Sep 13, 2024
@adamrher hmmmm... I'm not really familiar with subcycling, but looking at the code, we're overriding the averaging flag with "I" when nhtfrq = 1. So my guess is you're not actually getting an average for those variables.
adamrher commentedon Sep 13, 2024
It's always operated like that? Yikes, noted.
It would be ideal to have this functionality -- if I outfld a variable N times in a single time-step, then "A" and nhtfrq=1 should give me the average over those N calls -- but this is not a high priority.
peverwhee commentedon Sep 13, 2024
@adamrher just checked an it was me in fact who added that override.
So it's definitely probable it used to work that way! I'll make an issue.
gold2718 commentedon Sep 13, 2024
Is this now superseded by #1150?
peverwhee commentedon Sep 13, 2024
@gold2718 They're two separate issues. #1150 is for subcycling averages, this one is for duplicate fields for all history variables (won't be fixed by removing the override)
PeterHjortLauritzen commentedon Sep 23, 2024
The functionality of outputting the same field with ‘I’ and ‘A’ in the same history stream was never supported in CAM (as far as I know). Let’s add an endrun if someone tries to do that.