Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up initial conditions of aerosol in the RRTMG radiation model? #195

Open
cflsepyt opened this issue Nov 22, 2023 · 3 comments
Open

Comments

@cflsepyt
Copy link

I found out that there are inputs related with aerosol in the RRTMG radiation model (eg. tauaer_sw). However, after changing the parameters arbitrarily and integrating both models (one with no aerosol) for 100 days, it seems that the temperature profile of the two models are the same.
Below is my code, is there anything that I did wrong? Thanks.

import climlab
state = climlab.column_state(num_lev=30)
h2o = climlab.radiation.ManabeWaterVapor(name='WaterVapor', state=state)
radiationmodel = climlab.radiation.RRTMG(name='Radiation', state=state, specific_humidity=h2o.q, albedo=0.3, timestep = climlab.constants.seconds_per_day,)

radiationmodel_aer = climlab.process_like(radiationmodel)
radiationmodel_aer.tauaer_sw=1
radiationmodel_aer.ssaaer_sw=1
radiationmodel_aer.asmaer_sw=0.7
radiationmodel_aer.ecaer_sw=0.5
radiationmodel_aer.tauaer_lw=0

for n in range(100):
radiationmodel.step_forward()
for n in range(100):
radiationmodel_aer.step_forward()

radiationmodel.state
AttrDict({'Ts': Field([295.16616236]), 'Tatm': Field([237.34582607, 217.3324979 , 209.71102436, 206.11319015, 203.11578988, 200.52676178, 198.69619914, 197.56918926, 197.86829802, 199.43229056, 201.68411689, 204.31712517, 207.19959915, 210.24687785, 213.40269339, 216.64858376, 219.95946131, 223.292144 , 226.60650618, 229.9092025 , 233.21760744, 236.59401773, 240.15785704, 244.05454828, 248.40491102, 253.28859656, 258.78242647, 265.01149682, 272.16566274, 280.79077162])})

radiationmodel_aer.state
AttrDict({'Ts': Field([295.16616236]), 'Tatm': Field([237.34582607, 217.3324979 , 209.71102436, 206.11319015, 203.11578988, 200.52676178, 198.69619914, 197.56918926, 197.86829802, 199.43229056, 201.68411689, 204.31712517, 207.19959915, 210.24687785, 213.40269339, 216.64858376, 219.95946131, 223.292144 , 226.60650618, 229.9092025 , 233.21760744, 236.59401773, 240.15785704, 244.05454828, 248.40491102, 253.28859656, 258.78242647, 265.01149682, 272.16566274, 280.79077162])})

@FireWx42
Copy link

FireWx42 commented Nov 28, 2023

Similar issue. Set an array of values for tau, ssa, and asm in dictionaries and am getting a similar issue of no change between base model and other models. Code below for initializing the smoke layers and creating a model with smoke at 975mb. Base is same model setup. Verified by printing model parameters that the parameter fields in shortwave and longwave were updated.

state = climlab.column_state(num_lat = 180, num_lev = 100)
ssaaer = np.zeros_like(state.Tatm)
tauaer = np.zeros_like(state.Tatm)
asmaer = np.zeros_like(state.Tatm)

sfc = 97 #975 mb
mid = 49 #495 mb
high = 2 #25 mb

ssa_sfc = ssaaer
ssa_mid = ssaaer
ssa_high = ssaaer

tau_sfc = tauaer
tau_mid = tauaer
tau_high = tauaer

asm_sfc = asmaer
asm_mid = asmaer
asm_high = asmaer

ssa_sfc[:, sfc] = 0.9
asm_sfc[:, sfc] = 0.58
tau_sfc[:, sfc] = 1.0

ssa_mid[:, mid] = 0.9
asm_mid[:, mid] = 0.58
tau_mid[:, mid] = 1.0

ssa_high[:, high] = 0.9
asm_high[:, high] = 0.58
tau_high[:, high] = 1.0

my_smoke_sfc = {'tauaer_sw':tau_sfc,
           'ssaaer_sw':ssa_sfc,
           'asmaer_sw':asm_sfc,
           'tauaer_lw':tau_sfc}

my_smoke_mid = {'tauaer_sw':tau_mid,
           'ssaaer_sw':ssa_mid,
           'asmaer_sw':asm_mid,
           'tauaer_lw':tau_mid}

my_smoke_high = {'tauaer_sw':tau_high,
           'ssaaer_sw':ssa_high,
           'asmaer_sw':asm_high,
           'tauaer_lw':tau_high}`

state = climlab.column_state(num_lat = 180, num_lev = 100)
insol = climlab.radiation.DailyInsolation(name = 'insol', domains = state['Ts'].domain)
water = climlab.radiation.ManabeWaterVapor(name = 'h2o', state = state)
convadj = climlab.convection.ConvectiveAdjustment(name = 'convection', state=state, adj_lapse_rate = 6.5)
rad = climlab.radiation.RRTMG(name = 'rad', state = state, specific_humidity = water.q, S0 = insol.S0, insolation = insol.insolation, coszen = insol.coszen, iaer = 10)
sw = climlab.radiation.RRTMG_SW(name = 'rad_sw', state = state, specific_humidity = water.q, S0 = insol.S0, insolation = insol.insolation, coszen = insol.coszen, iaer = 10, **my_smoke_sfc)
lw = climlab.radiation.RRTMG_LW(name = 'rad_lw', state = state, specific_humidity = water.q, S0 = insol.S0, insolation = insol.insolation, coszen = insol.coszen, iaer = 10, **my_smoke_sfc)
shf = climlab.surface.SensibleHeatFlux(state = state, Cd=0.5E-3, name = 'SHF')
lhf = climlab.surface.LatentHeatFlux(state = state, Cd=0.5E-3, name = 'LHF')
lhf.q = water.q

llm = climlab.couple([insol, rad, convadj, water, shf, lhf, sw, lw], name = 'LLM')

EDIT: To show verification

print(llm.subprocess['rad_sw'].param)

output
{'tauaer_sw': Field([[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.],
...,
[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.]]), 'ssaaer_sw': Field([[0. , 0. , 0.9, ..., 0.9, 0. , 0. ],
[0. , 0. , 0.9, ..., 0.9, 0. , 0. ],
[0. , 0. , 0.9, ..., 0.9, 0. , 0. ],
...,
[0. , 0. , 0.9, ..., 0.9, 0. , 0. ],
[0. , 0. , 0.9, ..., 0.9, 0. , 0. ],
[0. , 0. , 0.9, ..., 0.9, 0. , 0. ]]), 'asmaer_sw': Field([[0. , 0. , 0.58, ..., 0.58, 0. , 0. ],
[0. , 0. , 0.58, ..., 0.58, 0. , 0. ],
[0. , 0. , 0.58, ..., 0.58, 0. , 0. ],
...,
[0. , 0. , 0.58, ..., 0.58, 0. , 0. ],
[0. , 0. , 0.58, ..., 0.58, 0. , 0. ],
[0. , 0. , 0.58, ..., 0.58, 0. , 0. ]]), 'tauaer_lw': Field([[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.],
...,
[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.],
[0., 0., 1., ..., 1., 0., 0.]]), 'timestep': 86400.0}

@brian-rose
Copy link
Collaborator

Thanks for these reports. I think that support for aerosols has never been properly implemented, e.g. this old issue which is still open #79.

At a minimum, I think that the flag iaer needs to be manually set to either 6 or 10 rather than the default value 0. Otherwise the RRTMG_SW code is going to ignore all those input fields. That is missing from @cflsepyt's example above.

However even when that flag is properly set, I think there are still some issues with interpreting the dimensions of input fields like ssaaer_sw as discussed in #79. I'm looking into this.

@brian-rose
Copy link
Collaborator

#198 finally brings proper support for aerosol parameters. It's now merged into main but not yet released. I'd appreciate any help with testing this code to make sure it's doing something sensible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants