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

How to add a periodic variation of the solar constant and CO2 forcing in CESM.1.2.2

Shuai Yuan

Shuai Yuan
New Member
Dear all,

These days I meet a problem, I want to add a periodic variation of the solar constant and CO2 forcing in CESM1.2.2, B1850. For example, the first step, the solar constant is 1360 and the next step the solar constant is 1360.1, this is just an example.
I can came up with a very straightforward solution: I can just modify the usr_nl_cam, the 'co2vmr' and 'solar_const', every month or year, and I just run the model for a month or a year, and then continue the model. In this way I can get a quasi-continuous CO2 or solar constant. But it's hassle to operate.
I wonder if there are some simple solutions。
Thanks very much.

Shuai
 

eaton

CSEG and Liaisons
The value of co2vmr is controlled by the chem_surfvals module in file models/atm/cam/src/physics/cam/chem_surfvals.F90. The subroutine chem_surfvals_set is called during each timestep to update values of greenhouse gases. The easiest way to set customized values of co2vmr during a run would be to modify this subroutine. The mods can be placed just in front of the "if(masterproc ..." conditional at line 462. Use a call to subroutine get_curr_date to obtain the calendar information needed to assign co2vmr values at the desired time coordinates.

The value of solar_const is controlled by the solar_data module in file models/atm/cam/src/chemistry/utils/solar_data.F90. In order to use solar_const variable it is necessary to remove the setting of solar_data_file from the namelist. If that is done then the public module variable sol_tsi is initialized to the value of solar_const. It is sol_tsi which is accessed by the radiation code, so that's the variable you'd need to update. Subroutine solar_data_advance is called each timestep to update solar data, so modify that subroutine right at the top before it returns due to fixed_scon=.true.. Subroutine get_model_time can be called to get the calendar info for syncing sol_tsi changes with the time coordinate.
 

Shuai Yuan

Shuai Yuan
New Member
The value of co2vmr is controlled by the chem_surfvals module in file models/atm/cam/src/physics/cam/chem_surfvals.F90. The subroutine chem_surfvals_set is called during each timestep to update values of greenhouse gases. The easiest way to set customized values of co2vmr during a run would be to modify this subroutine. The mods can be placed just in front of the "if(masterproc ..." conditional at line 462. Use a call to subroutine get_curr_date to obtain the calendar information needed to assign co2vmr values at the desired time coordinates.

The value of solar_const is controlled by the solar_data module in file models/atm/cam/src/chemistry/utils/solar_data.F90. In order to use solar_const variable it is necessary to remove the setting of solar_data_file from the namelist. If that is done then the public module variable sol_tsi is initialized to the value of solar_const. It is sol_tsi which is accessed by the radiation code, so that's the variable you'd need to update. Subroutine solar_data_advance is called each timestep to update solar data, so modify that subroutine right at the top before it returns due to fixed_scon=.true.. Subroutine get_model_time can be called to get the calendar info for syncing sol_tsi changes with the time coordinate.
oh thanks very much, and I have find the subroutines you have mentioned.
 
Top