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

Convection fails in very hot climates

bitz@uw_edu

New Member
I have had CAM4 fail when running integrations with very hot climates. The error message indicates it is in zm_conv.F90 which is the convection scheme. I twiddled some parameters but had no success. I have heard rumors that there is a fix to this problem. I'd be grateful to know how to take care of it.Thanks!
 

rneale

Rich Neale
CAM Project Scientist
Staff member
We have had problems running CAM in hot climates, for example RCP8.5 out to 2300. Although the crash is in the deep convection it is symptom rather than a course we think. We have not yet got to the bottom of this. How hot a climate are we talking about?
 

santos

Member
There have been a couple of problems that caused crashes in zm_conv for very hot climates, one of which is still outstanding, as Rich says. (My personal opinion is that it is specific to a CAM5 parameterization, but that's just conjecture on my part.)However, the other problem has to do with an improper handling of saturation vapor pressures comparable to the total pressure, which can occur when the deep convection is running at very high temperatures. This is a bug that was fixed in CAM 5.3 (CESM 1.2). If you can try running the same hot CAM4 case in CESM 1.2, it would be helpful to know if this solves your problem.
 

bitz@uw_edu

New Member
Thanks for the helpful information. I had turned up the solar constant to 110% of normal so the maximum temperature was about 310K when the model died. Unfortunately I'm not ready to make the leap to CAM5.3 Maybe I can figure out how to modify the code in CAM4 based on the changes in CAM5.3
 

santos

Member
I did put together a version of zm_conv several months ago that should prevent this crash, and I will try to dig it up. But the same bug may pop up in other modules; I would still recommend trying a newer version of the source code, because that fixes this issue uniformly across all the CAM physics.To clarify, there is some ambiguity here, between the source code version and the actual model that you are running. The CAM 5.3 source code has backwards compatibility and can still run the CAM4 model, and that's what I was suggesting. That is, we are still maintaining CAM4 with the same climate as in earlier versions, including with bug fixes like this one, within the CAM 5 development code.
 

santos

Member
I found the changed zm_conv.F90 file in my email, so I'm attaching it. I don't remember the changes very clearly, but here's the text of the email I sent with it:I have a quick-and-dirty fix in the form of a modified zm_conv module you can SourceMods in. This is compile-tested, but I don't have a quick way to do a real validation. I have a fair degree of confidence that this is the best "minimal" change that's consistent with what's on my branch; the saturation vapor pressure is limited, but nothing else is changed from the CESM1.1 version of zm_conv.

Hopefully, ZM is the only place with this kind of crash. I know that using MMR over dry mass makes it more vulnerable to these errors, since the saturation specific humidity returned by qsat is partially limited already, and also crashes at higher temperature/lower pressure. But if this problem pops up elsewhere, the only other option I can see is for you to use one of my branches.

(About that: cam5_2_02 was almost a complete rewrite of saturation vapor pressure code across CAM. In the previous version it was very difficult to modify most of this code correctly; I almost had to rewrite it just to find most of the bugs. So I am very reluctant to modify this code in earlier tags, except in places like ZM or MG that were mostly separate from wv_saturation to start with.)

-Sean
 

ruk15@psu_edu

New Member
Thanks Santos, I have the same problem and I downloaded your zm_conv.f90 code. I am running the model with this new zm_conv and will let you know soon how things go.
 

ruk15@psu_edu

New Member
I used the new zm_conv.F90 (copied it into the models/atm/cam/src/physics/cam) and ran a 10% increase in the solar luminosity. The code died at about the same place with the same error :*** ZM_CONV: IENTROPY: Failed and about to exit, info follows ****
ZM_CONV: IENTROPY. Details: call#,lchnk,icol= 2 155   1 lat:  26.00 lon:  75.00 P(mb)= 578.42 Tfg(K)= 295.43 qt(g/kg) =  28.30 qsat(g/kg) =   7.44, s(J/kg) = 421.99
 ENDRUN:**** ZM_CONV IENTROPY: Tmix did not converge **** I am using the f45_g37 grid.Any suggestions?ThanksRavi KopparapuPennsylvania State University
 

shields

New Member
Hi Ravi,   I have had some success swapping out the entrophy closure method for the following reference by:

! Brent, R. P. Ch. 3-4 in Algorithms for Minimization Without Derivatives. Englewood Cliffs, NJ: Prentice-Hall, 1973.

I have attached my version to this post. It is an old CAM4 cesm1.0 version. You will need to make the appropriate changes in your CAM5 version. I have not tried this in CAM5 and it has not been extensively tested.  That said, please give it a go and let us know if it works for you! 

Christine
shields@ucar.edu
 

ruk15@psu_edu

New Member
Hi Christine,Thanks for providing the code. It seems to be working !  I am using E_2000 component set (CESM 1.0.5) which I think uses CAM4. I swapped the current zm_con.F90 with your's and ran the code for 10% increase in solar luminosity, 30x present CO2. For both the cases, the code did not crash. I am also having trouble finding a component set that uses CAM 5, present day, slab ocean, active atmosphere model (and rest inactive). the 'E_1850_CAM5' models are for preindustrial. ThanksRaviPennsylvania State University
 

ruk15@psu_edu

New Member
Hi Christine,I ran your version of zm_conv.F90 for 50 years with E_2000 component set for (1)30 times present CO2 (2) 90 tme present CO2 and (3) 200 times present CO2 cases. The 30 & 90times present CO2 cases ran fine, but the 200 time present CO2 stopped at year 14 with the following error message:****************************findsp not converging at point i, k           15           5
  t, q, p, enin    227.698203219823       3.268937352816688E-002
   3723.02900000001        321419.290023057
  tsp, qsp, enout    255.816994171481       2.308661315931521E-002
   321419.478846114
 ENDRUN:FINDSP********************The issue comes from the subroutine 'cldwat.F90' in a place wetbulb temperature and saturation mixingratio are determined. Apparently, the guess values  of temperature and mixingratio (227.69 K & 3.26 e-2) to this routine are the source of the problem. Have you encountered this situation when you ran the model in hotclimates? (and if you did, can you share how solved this problem?)ThanksRaviPennsylvania State University
 

santos

Member
Hmm. Your output doesn't look like any bug I've seen so far. Also, the output shows a state that is nearly converged; maybe the state is such that the "findsp" routine is having a hard time in this regime. I would suggest simply increasing the value of "iter" in cldwat.F90 from 8 to some larger value (say, 16).This is another bit of code that has been significantly modified in newer versions of CAM, but this does not look like the bug that was fixed in that case (which had to do with much lower temperatures, ~173 K).
 

ruk15@psu_edu

New Member
Thank you, I will try it out now & see how it goes. I want to eventually use CAM5 and trying to determine which component set would be best to use for slab ocean case.Will report back once I update the code with your edit.RaviPennsylvania State University
 

ruk15@psu_edu

New Member
Hi Santos,Your suggestion on increasing the value of "iter" worked !!  At least the code is running beyond the time it crashed before for 200xCO2. Thank you much for your suggestion. I will look at the output to see if it is doing fine.RaviPennsylvania State University
 
Top