Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Add diabatic heating to CAM6 (CESM2.1.3)

baih

New Member
Hello!

I'm trying to add diabatic heating to the tropics in CAM6 (CESM2.1.3). I succeeded adding heating to CAM5 before by modifying physpkg.F90, so I basically wanted to adapt my CAM5 modifications to CAM6 but failed.

The steps I took to add heating are:
1. create a new variable of added temperature tendency (added_temp) in both physpkg.F90 and physics_types.F90

2. update the temperature tendency to ptend in "subroutine tphysac" in physpkg.F90 using the following code commands:
ptend%psetcols = state%psetcols
ptend%name = "added heating"
ptend%lq(:) = .false.
ptend%ls = .true.
ptend%lu = .false.
ptend%lv = .false.
ptend%s = added_temp*cpair
call physics_update(state, ptend, ztodt, tend)

Again, I succeeded adding heating to CAM5 using the above method. As I did several tests, the problem seems to occur when I set ptend%ls to "true", which must be done to update the added heating to the model. The model runs "functionally properly" when I set ptend%ls to false. I'm attaching the last lines of my cesm.log file (and I got no other error messages in atm.log or cesm.log). My guess is it may have something to do with the difference in the model energy checking b/t CAM5 and CAM6?

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
cesm.exe 0000000002F899D1 Unknown Unknown Unknown
cesm.exe 0000000002F88127 Unknown Unknown Unknown
libnetcdff.so.6 00002B8DA2370252 Unknown Unknown Unknown
libnetcdff.so.6 00002B8DA23700A6 Unknown Unknown Unknown
libnetcdff.so.6 00002B8DA2356C2C Unknown Unknown Unknown
libnetcdff.so.6 00002B8DA235AC98 Unknown Unknown Unknown
libpthread.so.0 00002B8DA75847E0 Unknown Unknown Unknown
cesm.exe 000000000071599B physics_types_mp_ 284 physics_types.F90
cesm.exe 000000000074AD49 physpkg_mp_tphysa 2116 physpkg.F90
cesm.exe 0000000000747196 physpkg_mp_phys_r 1563 physpkg.F90
cesm.exe 000000000051F12D cam_comp_mp_cam_r 296 cam_comp.F90
cesm.exe 00000000005109B6 atm_comp_mct_mp_a 500 atm_comp_mct.F90
cesm.exe 000000000042BEF1 component_mod_mp_ 737 component_mod.F90
cesm.exe 000000000040EF46 cime_comp_mod_mp_ 2823 cime_comp_mod.F90
cesm.exe 000000000042BB87 MAIN__ 133 cime_driver.F90
cesm.exe 000000000040C96E Unknown Unknown Unknown
libc.so.6 00002B8DA7A35D20 Unknown Unknown Unknown
cesm.exe 000000000040C809 Unknown Unknown Unknown

Any insight would be appreciated!

Cheers,
Hedanqiu
 

nusbaume

Jesse Nusbaumer
CSEG and Liaisons
Staff member
Hi Hedanqiu,

Have you tried running with the compiler debug flags set to true (i.e. have you set DEBUG to TRUE in env_build.xml)? If not, then can you do so, and then send along the generated cesm.log.* and atm.log.* files? Also, can you send along your modified physpkg.F90 file, along with physics_types.F90, if you modified that file as well? All of these additions will hopefully provide a more precise traceback, as well as allow us to determine the exact source code lines that are causing this seg fault.

Thanks, and have a great day!

Jesse
 

baih

New Member
Hi Jesse,

Thanks very much for your reply!

I'm attaching my modified *.F90 files, as well as the cesm.log.* and atm.log.* files, with DEBUG set to TRUE. And the cesm.log.* file only contains the last thousands of lines because the system would't let me upload such a big file.

PS. I'm not running CAM6 on one of the supported machines and my batch system is LSF, in case it's of any use.

Cheers,
Hedanqiu
 

Attachments

  • addheat.zip
    112.9 KB · Views: 29

nusbaume

Jesse Nusbaumer
CSEG and Liaisons
Staff member
Hi Hedanqiu,

It looks like the vertical dimension loop is going out-of-bound during the tendency calculation in physics_update. I believe this is fixable by adding the lines:

Code:
ptend%top_level = 1
ptend%bot_level = pver

to your list of ptend settings in tphysac. I should note that it might also make sense to create your own "ptend" copy so that you don't mistakenly impact the other parameterizations.

Finally, it is also possible that this specific error wasn't the original cause of the seg fault, so I would recommend doing another quick run with DEBUG set to TRUE to make sure no other errors crop up. If they do, then please send me the cesm.log.* and atm.log.* files again (just sending the last 1000 lines of the cesm.log file is fine) and we can try and track down the issue.

Thanks, and have a great day!

Jesse
 

baih

New Member
Hi Jesse,

Thanks for your reply! It works by adding the two lines and I didn't get any error messages this time.

Best,
Hedanqiu
 
Top