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

hi CAM6 users

dharmendraks841

Dharmendra Kumar Singh
Member
There are 32 vertical layers in CAM6 model and the model's top height is ~40 km
One clarification - are these the layer top heights, or layer centers?
 

peverley

Courtney Peverley
Moderator
Staff member
Hi Dharmendra,

Let me know if this doesn't answer your question, but I think what you're asking about boils down to the difference between pver and pverp in the code. If there are 32 layers, that means that there are 32 midpoints and 33 top points. Any time a quantity is indexed with pver, it's at the midpoint; if it's indexed with pverp (which is pver + 1), it's at the top of the layer.

Hope that helps.
Courtney
 

islas

Moderator
Staff member
Quoting the height of the top is an approximation since the model grid is in hybrid-sigma coordinates, which are coordinates of constrant pressure by the time you're at the model top. In the CAM output you can see the variables hyam and hybm which are the hybrid coefficients for the layer centers, and hyai and hybi which are the hybrid coefficients for the layer interfaces.

The coefficients for the top interface level are hyai ~ 0.0023 and hybi = 0, so the pressure level of this top interface is 1000*hyai + PS*hybi ~2.3hPa. You could convert this into an approximate height assuming a scale height of H~7km and using z = -Hln(2.3/1000.) ~ 43km.

The coefficients for the top mid-level are hyam ~ 0.0036, hybm = 0, so the pressure of the top mid-level is 1000*0.0036 = 3.6hPa. Converting this to height assuming a scale height of 7km gives 39.4km.

But these are only approximate because the exact height of the top mid-level and interface will depend on the surface pressure and temperatures below following the hypsometric equation. See the screenshot below which shows a snapshot of the geopotential height of the top mid-level of CAM.


Screenshot at 2023-08-24 09-10-12.png
 

dharmendraks841

Dharmendra Kumar Singh
Member
Hi Dharmendra,

Let me know if this doesn't answer your question, but I think what you're asking about boils down to the difference between pver and pverp in the code. If there are 32 layers, that means that there are 32 midpoints and 33 top points. Any time a quantity is indexed with pver, it's at the midpoint; if it's indexed with pverp (which is pver + 1), it's at the top of the layer.

Hope that helps.
Courtney
Thanks!!
 

dharmendraks841

Dharmendra Kumar Singh
Member
Quoting the height of the top is an approximation since the model grid is in hybrid-sigma coordinates, which are coordinates of constrant pressure by the time you're at the model top. In the CAM output you can see the variables hyam and hybm which are the hybrid coefficients for the layer centers, and hyai and hybi which are the hybrid coefficients for the layer interfaces.

The coefficients for the top interface level are hyai ~ 0.0023 and hybi = 0, so the pressure level of this top interface is 1000*hyai + PS*hybi ~2.3hPa. You could convert this into an approximate height assuming a scale height of H~7km and using z = -Hln(2.3/1000.) ~ 43km.

The coefficients for the top mid-level are hyam ~ 0.0036, hybm = 0, so the pressure of the top mid-level is 1000*0.0036 = 3.6hPa. Converting this to height assuming a scale height of 7km gives 39.4km.

But these are only approximate because the exact height of the top mid-level and interface will depend on the surface pressure and temperatures below following the hypsometric equation. See the screenshot below which shows a snapshot of the geopotential height of the top mid-level of CAM.


View attachment 4050
Thank you so much for a very nice explanation. I am wondering if you could tell me why we should consider scaling 7km for hight.
 

islas

Moderator
Staff member
From hydrostatic balance, we have, dp/dz = -rho*g. From the ideal law, we have rho = p/RT, so

(1/p)dp/dz = -g/RT
dln(p)/dz = -g/RT

Integrate this with respect to z from surface to height z and you get

p(z) = ps*exp(-gz/RT)

So pressure is falling off with an e-folding distance of RT/g (the scale height) and if you plug in typical values you get somewhere of the order 7-8km or so. It's obviously an approximation because T varies.
 

dharmendraks841

Dharmendra Kumar Singh
Member
From hydrostatic balance, we have, dp/dz = -rho*g. From the ideal law, we have rho = p/RT, so

(1/p)dp/dz = -g/RT
dln(p)/dz = -g/RT

Integrate this with respect to z from surface to height z and you get

p(z) = ps*exp(-gz/RT)

So pressure is falling off with an e-folding distance of RT/g (the scale height) and if you plug in typical values you get somewhere of the order 7-8km or so. It's obviously an approximation because T varies.
Thanks!
 

dharmendraks841

Dharmendra Kumar Singh
Member
Hi islas,
Could you please also look at the following error in my run fail........... (CAM6)

When I ran for only one month (May 2018) with the separate case it was running and archived successfully.

You can see my case directory for 1 month here /glade/work/dksingh/contrail_23/may18_case_spinup

BUT
When I ran from January to December 2018 with a new case, I found the error of May 2018 as previous (ran from January to April was successfully done) and May 2018 failed, Please check the new case below:

/glade/work/dksingh/contrail_23/spcontrail18
 
Top