Open GilbertCloud opened 1 month ago
Hi @GilbertCloud. The spectralflux
option was originally added to CAM in order to make the spectrally resolved fluxes available to the CARMA aerosol code. That is why those fluxes are added to the physics buffer. But the modifications for CARMA never included the addfld/outfld
calls necessary to output these fields to the history files. I'm not sure why. It seems reasonable to do so. @brianpm, what do you think?
I have looked through your code mods to output the spectrally resolved fluxes and they look well done. Thanks.
I think this is a good idea. There are probably lots of uses for spectrally-resolved output.
What happened?
I was running SCAM on my personal computer (cesm2.1.3, cam_cesm2_1_rel41). I found the bug when I set the
spectralflux
namelist option to true. This should have returned the spectral longwave and shortwave fluxes in addition to broadband fluxes and it didn't. When I added the corresponding fields to the fincl1 namelist option (LD, LU, SD, SU), SCAM stopped with and error because it couldn't find those fields.What are the steps to reproduce the bug?
To reproduce this bug, set 'spectralflux' to true and include the fields LD, LU, SD, SU in the fincl1 namelist option.
What CAM tag were you using?
cam_cesm2_1_rel41
What machine were you running CAM on?
Personal Computer
What compiler were you using?
Other (please specify below)
Path to a case directory, if applicable
No response
Will you be addressing this bug yourself?
No
Extra info
Notes
I am running CAM through SCAM on my personal computer and I am not sure what compiler I am using. I have checked the most recent tag of CAM (cam6_3_160) and this bug is still in the CAM code. The buggy files
radconstants.F90
andradiation.F90
are located at/cam/src/physics/rrtmg
.Fixes
I have produced code that fixes the bug. The files are at
/glade/u/home/glydia/mods/fixedspectral/
.In the radconstants file, I added the longwave and shortwave band midpoints as variables, as well as functions to retrieve them, similar to existing functions in the file to retrieve the band boundaries. I included the midpoints so that the history file has them and the boundaries as dimensions for the spectral fluxes.
The additions I made to the radconstants file are below:
In the radiation file, I added the longwave and shortwave boundaries and midpoints as variables and added the LD, LU, SD, SU fields to the history master field list. I added the longwave and shortwave bands to the history file coordinates and added calls to the pbuf in the longwave and shortwave output functions to output the spectral fluxes to the history file.
The additions/changes I made to the radiation file are below: