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

RRTMG SW behaviour undocumented #112

Open
suhasdl opened this issue Aug 15, 2019 · 2 comments
Open

RRTMG SW behaviour undocumented #112

suhasdl opened this issue Aug 15, 2019 · 2 comments
Assignees

Comments

@suhasdl
Copy link
Contributor

suhasdl commented Aug 15, 2019

  • CliMT version: 0.16.9
  • Python version: 3.7.3
  • Operating System: Ubuntu

Description

I was trying to vary the solar constant by changing the stellar_irradiance value. However when its set to 0 the solar constant defaults to the original value of about 1360. But it works fine even for a small value of say 10^-3.

I am attaching a sample code which demonstrates this.

#########################################
import climt
from sympl import (
    PlotFunctionMonitor, NetCDFMonitor,
    TimeDifferencingWrapper, UpdateFrequencyWrapper,
    set_constant, DataArray
)
import numpy as np
from datetime import timedelta

set_constant('stellar_irradiance', value=0, units='W m^-2')
model_time_step = timedelta(minutes=10)

# Create components
convection     = climt.EmanuelConvection()
simple_physics = TimeDifferencingWrapper(climt.SimplePhysics())
radiation_step = timedelta(hours=1)
radiation_lw   = UpdateFrequencyWrapper(
    climt.RRTMGLongwave(), radiation_step)
radiation_sw   = UpdateFrequencyWrapper(
    climt.RRTMGShortwave(), radiation_step)
slab_surface   = climt.SlabSurface()
dycore = climt.GFSDynamicalCore(
    [simple_physics, slab_surface, radiation_sw,
     radiation_lw, convection], number_of_damped_levels=5)


grid = climt.get_grid(nx=128, ny=64)
# Create model state
my_state = climt.get_default_state([dycore], grid_state=grid)

# Set initial/boundary conditions
latitudes  = my_state['latitude'].values
longitudes = my_state['longitude'].values
surface_shape = latitudes.shape
zenith_angle = np.radians(latitudes)
my_state['zenith_angle'].values = zenith_angle

# Set SST profile
my_state['surface_temperature'] = DataArray(
    300.*np.ones(surface_shape),
    dims=['lat', 'lon'], attrs={'units': 'degK'})

my_state['eastward_wind'].values[:] = np.random.randn(
    *my_state['eastward_wind'].shape)

my_state['ocean_mixed_layer_thickness'].values[:] = 50

tmax  = my_state['time'] + timedelta(days=1000)
tNext = my_state['time']

while (my_state['time'] <= tmax):
    diag, my_state = dycore(my_state, model_time_step)
    my_state.update(diag)
    my_state['time'] += model_time_step
    print('max. downwelling short wave flux: ', np.amax(my_state['downwelling_shortwave_flux_in_air'].values))

#####################################################

@JoyMonteiro
Copy link
Member

This is simply the behaviour of the RRTMG SW code. See the comments in

real(kind=rb), intent(in) :: scon ! Solar constant (W/m2)
! Total solar irradiance averaged
! over the solar cycle.
! If scon = 0.0, the internal solar
! constant, which depends on the
! value of isolvar, will be used.
! For isolvar=-1, scon=1368.22 Wm-2,
! For isolvar=0,1,3, scon=1360.85 Wm-2,
! If scon > 0.0, the internal solar
! constant will be scaled to the
! provided value of scon.

This should be documented better. I will keep this issue open to remind me of the same.

@JoyMonteiro JoyMonteiro changed the title Error in prescribing solar constant RRTMG SW behaviour undocumented Aug 15, 2019
@JoyMonteiro JoyMonteiro self-assigned this Aug 15, 2019
@suhasdl
Copy link
Contributor Author

suhasdl commented Aug 15, 2019

Thanks Joy.

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

No branches or pull requests

2 participants