Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

modifying CO2 concentrations in WRF with ra_lw_physics=4 (RRTMG)

Madlene

New member
Dear colleague,
I am trying to modify greenhouse gas concentrations in my WRF simulations (real case study). The ra_lw_physics scheme RRTMG uses a fixed value of carbon dioxide (379 ppmv per WRF documentation). What I would need to do is to adjust the carbon dioxide to any past or future value. Using, for example, the historic record or one of the RCPs would be probably sufficient for my purpose.

I have spent quite some time studying the documentation with regard to two questions:

1.) How can the model setup be changed to use specific (historic or future) carbon dioxide concentrations in a simulation?
2.) How can I test on a running simulation whether the carbon dioxide concentrations, that I intend to be used during a specific model year, have been actually used? Are there any log files for this?

In the documentation I have found a statement that tells me to recompile WRF with a specific macro:
" a. CAM Green House Gases: Provides yearly green house gases from 1765 to 2500. The option is activated by compiling WRF with the macro –DCLWRFGHG added in configure.wrf. Once compiled, CAM, RRTM and RRTMG long-wave schemes will see these gases."

I have done this and new executables have been successfully created. I have not recompiled WPS as I am not sure whether this is necessary.
My problem with point 1.) above is that when I run a simulation with the new executables, I get the following error:

-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE: <stdin> LINE: 193
CLWRF: 'CAMtr_volume_mixing_ratio' does not exist

When searching online for potential solutions to this problem, I found a statement that suggests to replace in the Registry/ folder the files Registry.EM and registry.dimspec by files Registry.EM_CLWRF, registry.dimspec.clwrf; Unfortunately, it is not at all clear to me in which way the contents of the new files shall differ from the old files. The online resource did not provide any obvious information to this.

To sum this up, I seem to have reached a dead-end in trying to setup a simulation with WRF Real case and adjusted values of carbon dioxide. Does anyone have experience with this? Is there any additional documentation that I have overlooked so far, illustrating how to properly setup and compile WRF towards adjusting carbon dioxide with ra_lw_physics=4? If, what I did so far, has been correct, could you please kindly point me towards additional steps that are missing to make such a simulation run? Is there any need for adjustments to namelists or similar configuration files that I have to implement to make WRF find and use the carbon dioxide concentrations?

Any hints would be greatly appreciated. Thank you very much for your time and help.

All the best
Madlene
 
After some research I figured out that apparently from version 4.2 (the version I use) carbon dioxide is automatically updated from year to year in rrtmg. At least this is what the source code suggests to be the case.

Code:
$ for i in WRF/phys/module_ra_rrtmg_*{.f90,F}; do echo $i; cat $i | grep " co2 ="; done
WRF/phys/module_ra_rrtmg_lw.f90
      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
WRF/phys/module_ra_rrtmg_lwf.f90
WRF/phys/module_ra_rrtmg_lwk.f90
WRF/phys/module_ra_rrtmg_sw.f90
      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
WRF/phys/module_ra_rrtmg_swf.f90
WRF/phys/module_ra_rrtmg_swk.f90
WRF/phys/module_ra_rrtmg_lw.F
      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
WRF/phys/module_ra_rrtmg_lwf.F
      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
WRF/phys/module_ra_rrtmg_lwk.F
WRF/phys/module_ra_rrtmg_sw.F
      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
WRF/phys/module_ra_rrtmg_swf.F
      co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
WRF/phys/module_ra_rrtmg_swk.F
 
Hi Madlene,
I've been looking to change CO2 concentration in WRF too. I only find papers using WRF-Chem but I would like to change it in my actual WRF model. Did you find a way to do it?
 
Hi Madlene,
Would you plea take a look at the option ghg_input =1 in namelist.input (&physics) ? With this option turned o, you are able to read in time dependent data for CO2, N2O, CH4, CFC11, CFC12. The data covers the period from 1765 to 2500. Note that the option is available only since WRFv4.4.

if you run older version of WRF, you can read CAM green house eagles corresponding to various scenarios. To do so, you will need to compile WRF with macro –DCLWRFGHG added to configure.wrf.

Please try and let me know if you have any issues.
 
Hi Madlene,
Would you plea take a look at the option ghg_input =1 in namelist.input (&physics) ? With this option turned o, you are able to read in time dependent data for CO2, N2O, CH4, CFC11, CFC12. The data covers the period from 1765 to 2500. Note that the option is available only since WRFv4.4.

if you run older version of WRF, you can read CAM green house eagles corresponding to various scenarios. To do so, you will need to compile WRF with macro –DCLWRFGHG added to configure.wrf.

Please try and let me know if you have any issues.
Hello Ming Chen,
Is there an easy way to manually change CO2 concentration from the default value (in this case a function that deppends on the year)? For example changing it in the source code files. I found in some files a constant value of CO2 is commented, I assume from previous versions:

/WRF/phys/module_ra_rrtmg_sw.F
co2 = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6
! co2 = 379.e-6

If changing this, would it be necessary to recompile the WRF model?
Thanks!
 
Jana,
In this case you can set ghg_input =0, then go to the codes of the scheme you intend to use and modify the code. For example, below is a piece of code in module_ra_rrtm.F. You can always change the value of co2vmr here for your specific case.

IF(ghg_input .EQ. 1 ) THEN


CALL read_CAMgases(yr,julian,.false.,"RRTM",co2vmr,n2ovmr,ch4vmr,cfc11vmr,cfc12vmr)


ELSE


! values used in pre-V3.5


! co2vmr = 330.e-6


! n2ovmr = 0.


! ch4vmr = 0.


! values updated to RRTMG in V3.5


co2vmr = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6


! co2vmr = 379.e-6


n2ovmr = 319.e-9


ch4vmr = 1774.e-9


END IF
 
Jana,
In this case you can set ghg_input =0, then go to the codes of the scheme you intend to use and modify the code. For example, below is a piece of code in module_ra_rrtm.F. You can always change the value of co2vmr here for your specific case.

IF(ghg_input .EQ. 1 ) THEN


CALL read_CAMgases(yr,julian,.false.,"RRTM",co2vmr,n2ovmr,ch4vmr,cfc11vmr,cfc12vmr)


ELSE


! values used in pre-V3.5


! co2vmr = 330.e-6


! n2ovmr = 0.


! ch4vmr = 0.


! values updated to RRTMG in V3.5


co2vmr = (280. + 90.*exp(0.02*(yr-2000)))*1.e-6


! co2vmr = 379.e-6


n2ovmr = 319.e-9


ch4vmr = 1774.e-9


END IF
Thanks! I assume it wouldn't be necessary to recompile the model after doing this change, right?
 
Every time you change the codes, you need to recompile WRF. However, you don't need to recompile all the codes, but just the one you changed.
To do so, you need to type the command in top WRF directory:

./compile em_real

if you change any codes in Registry, you need to recompile all the codes by:
./clean -a
./conigure
./compile em_real
 
Every time you change the codes, you need to recompile WRF. However, you don't need to recompile all the codes, but just the one you changed.
To do so, you need to type the command in top WRF directory:

./compile em_real

if you change any codes in Registry, you need to recompile all the codes by:
./clean -a
./conigure
./compile em_real
Thank you a lot!
 
Top