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

The dimensions of variables and loop in In the parameterization scheme

I run a case using a BHIST compsets, The monthly output results of specific humidity has a dimension of (32,96,1144). When I check the Fortran code of rrtmg_stat.F90, used for computing the specific humidity, I found the dimention of sp_hum is (16,33). it should has three dimensions. However, I can't found the other loop of the code. I am sincerely asking for help here!Thank you very much !
 

nusbaume

Jesse Nusbaumer
CSEG and Liaisons
Staff member
Hello,

Given that most physics parameterizations in CAM don't need to know what is occurring in the surrounding grid cells, the internal physics grid collapses the two dimensional lat/lon grid (which is what is output in the history files when using the standard BHIST compset) into a one dimensional "number of columns" array. This number of columns is then split-up further into the number of columns per "chunk", which can be thought of as the number of columns managed by a single processor. This is what you are seeing in rrtmg_state.F90, where 16 is the number of columns in a given chunk, and 33 is the number of vertical levels in each column.

So, given that the physics parameterizations automatically convert the 3-D grid into a 2-D array of columns and levels, there is no need to add a third dimension in the model code, or at least in the RRTMG routines.

Hope that helps, and have a great day!

Jesse
 
Hello,

Given that most physics parameterizations in CAM don't need to know what is occurring in the surrounding grid cells, the internal physics grid collapses the two dimensional lat/lon grid (which is what is output in the history files when using the standard BHIST compset) into a one dimensional "number of columns" array. This number of columns is then split-up further into the number of columns per "chunk", which can be thought of as the number of columns managed by a single processor. This is what you are seeing in rrtmg_state.F90, where 16 is the number of columns in a given chunk, and 33 is the number of vertical levels in each column.

So, given that the physics parameterizations automatically convert the 3-D grid into a 2-D array of columns and levels, there is no need to add a third dimension in the model code, or at least in the RRTMG routines.

Hope that helps, and have a great day!

Jesse
Dear Jesse
Thank you for your beautiful reply. Your explanation benefits me a lot. However, there are still some problems worried me. The dimensions of output is Q (32,96,144). The dimensions of sp_hum in RRTMG routines is (16,33). Based on your explanation, I can understand the 33 and 16.Then I check the parameter of chunk. The value of chunk (in the code, the chunks points to lchnk) changes from 81 to 91. It is strange. I think the value of lat/lon dimensions (96x144) should equal to the value of 16 x chunks. Thus I must have missed something! In fact, I want to understand the conversion process of internal dimensions. In order to replace the sp_hum with the climatology of specific humidity.

Thank you again, and have a nice day!
Yours
 

nusbaume

Jesse Nusbaumer
CSEG and Liaisons
Staff member
Hello,

You are correct that the total number of chunks x 16 should equal 96x144. However, unless you set-up the model to run in a serial mode (e.g. NTASKS and NTHRDS = 1) no single processor element is going to contain all of the chunks, as those chunks will be distributed among all of the given tasks or threads, and when you add a write or print statement, it will only output what is on that particular task. I suspect this is why you only see chunk values of 81 to 91, as all of the other chunks are on different processors (which should still output to the log files, although it likely won't be in order).

That being said, you can acquire the lat and lon values for each column by using the get_rlat_p and get_rlon_p functions (or there "all" equivalents), which can be found in the CAM source code file here:

<CESM_DIR>/components/cam/src/physics/cam/phys_grid.F90

Where <CESM_DIR> is the name of the directory where you have your CESM source code. Maybe that will provide the information you need to implement your specific humidity climatology?

Anyways, I hope that helps, and have a great day!

Jesse
 
Top