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

Radiation changes #54

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bb68d39
Various changes ref. land and update to Isca master at Execlim
Dec 21, 2017
5ede95e
Merge remote-tracking branch 'upstream/master'
Jun 16, 2018
55db070
Add T21 spectral resolution to experiment.py
Jun 17, 2018
4e7caed
fix T21 in experiment.py
Jun 17, 2018
b1ecfed
eccentricity working in rrtm
Jun 21, 2018
682ecb4
added interp_end for h20 interpolation
Jun 28, 2018
980c033
Add option to input prescribed specific humidity to radiation
Jun 29, 2018
1d741fd
Missed endif
Jun 29, 2018
4fcece5
Added Nakajima 1992 radiation scheme
ntlewis Jun 29, 2018
e4240cd
Included comment containing units for Nakajima radiation scheme const…
ntlewis Jun 29, 2018
60a7253
eccentricity now working in two_stream_gray_rad
ntlewis Jun 29, 2018
2f2e702
Removed #experiment.py#
ntlewis Jun 29, 2018
519db28
Fix additional T21 resolution option
ntlewis Jul 2, 2018
c520a8b
Merge branch 'master' into radiation_changes
jamesp Sep 4, 2018
6ec026d
Merge remote-tracking branch 'upstream/master'
ntlewis Jan 11, 2019
78c0e38
eccentricity working in rrtm
Jun 21, 2018
762bab2
added interp_end for h20 interpolation
Jun 28, 2018
5418487
Add option to input prescribed specific humidity to radiation
Jun 29, 2018
360db40
Missed endif
Jun 29, 2018
aad628a
Added Nakajima 1992 radiation scheme
ntlewis Jun 29, 2018
245b701
Included comment containing units for Nakajima radiation scheme const…
ntlewis Jun 29, 2018
18819e6
eccentricity now working in two_stream_gray_rad
ntlewis Jun 29, 2018
33df7ba
Removed #experiment.py#
ntlewis Jun 29, 2018
e4c680a
remove garbage files
ntlewis Feb 27, 2019
834b028
resolve conflicts in merge
ntlewis Feb 27, 2019
a1ae71e
remove artefact from merge commit
ntlewis Feb 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions exp/test_cases/MiMA/#MiMA_test_case.py#
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
import os

import numpy as np

from isca import IscaCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE

NCORES = 4

# a CodeBase can be a directory on the computer,
# useful for iterative development
cb = IscaCodeBase.from_directory(GFDL_BASE)

# or it can point to a specific git repo and commit id.
# This method should ensure future, independent, reproducibility of results.
# cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1')

# compilation depends on computer specific settings. The $GFDL_ENV
# environment variable is used to determine which `$GFDL_BASE/src/extra/env` file
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('mima_test_experiment', codebase=cb)

exp.inputfiles = [os.path.join(GFDL_BASE,'input/rrtm_input_files/ozone_1990.nc')]

#Tell model how to write diagnostics
diag = DiagTable()
diag.add_file('atmos_monthly', 30, 'days', time_units='days')

#Tell model which diagnostics to write
diag.add_field('dynamics', 'ps', time_avg=True)
diag.add_field('dynamics', 'bk')
diag.add_field('dynamics', 'pk')
diag.add_field('atmosphere', 'precipitation', time_avg=True)
diag.add_field('mixed_layer', 't_surf', time_avg=True)
diag.add_field('dynamics', 'sphum', time_avg=True)
diag.add_field('dynamics', 'ucomp', time_avg=True)
diag.add_field('dynamics', 'vcomp', time_avg=True)
diag.add_field('dynamics', 'temp', time_avg=True)
diag.add_field('dynamics', 'vor', time_avg=True)
diag.add_field('dynamics', 'div', time_avg=True)

exp.diag_table = diag


#Empty the run directory ready to run
exp.clear_rundir()

#Define values for the 'core' namelist
exp.namelist = namelist = Namelist({
'main_nml': {
'days' : 30,
'hours' : 0,
'minutes': 0,
'seconds': 0,
'dt_atmos':600,
'current_date' : [0001,1,1,0,0,0],
'calendar' : 'thirty_day'
},

'idealized_moist_phys_nml': {
'two_stream_gray': False,
'do_rrtm_radiation': True, #Use RRTM radiation, not grey
'convection_scheme': 'SIMPLE_BETTS_MILLER', #Use the simple Betts Miller convection scheme
'do_damping': True,
'turb':True,
'mixed_layer_bc':True,
'do_virtual' :False,
'do_simple': True,
'roughness_mom':3.21e-05,
'roughness_heat':3.21e-05,
'roughness_moist':3.21e-05,
},

'vert_turb_driver_nml': {
'do_mellor_yamada': False, # default: True
'do_diffusivity': True, # default: False
'do_simple': True, # default: False
'constant_gust': 0.0, # default: 1.0
'use_tau': False
},

'diffusivity_nml': {
'do_entrain':False,
'do_simple': True,
},

'surface_flux_nml': {
'use_virtual_temp': False,
'do_simple': True,
'old_dtaudv': True
},

'atmosphere_nml': {
'idealized_moist_model': True
},

#Use a large mixed-layer depth, and the Albedo of the CTRL case in Jucker & Gerber, 2017
'mixed_layer_nml': {
'depth': 100,
'albedo_value': 0.205,
'tconst' : 285.,
'prescribe_initial_dist':True,
'evaporation':True,
'do_qflux': True
},

'qe_moist_convection_nml': {
'rhbm':0.7,
'Tmin':160.,
'Tmax':350.
},

'lscale_cond_nml': {
'do_simple':True,
'do_evap':True
},

'sat_vapor_pres_nml': {
'do_simple':True
},

'damping_driver_nml': {
'do_rayleigh': True,
'trayfric': -0.5, # neg. value: time in *days*
'sponge_pbottom': 50.,
'do_conserve_energy': True,
},

'qflux_nml': {
'qflux_amp': 30.0
},

'rrtm_radiation_nml': {
'solr_cnst': 1360, #s set solar constant to 1360, rather than default of 1368.22
'dt_rad': 7200, #Use long RRTM timestep
'do_read_ozone':True,
'ozone_file':'ozone_1990'
},

# FMS Framework configuration
'diag_manager_nml': {
'mix_snapshot_average_fields': False # time avg fields are labelled with time in middle of window
},

'fms_nml': {
'domains_stack_size': 600000 # default: 0
},

'fms_io_nml': {
'threading_write': 'single', # default: multi
'fileset_write': 'single', # default: multi
},

'spectral_dynamics_nml': {
'damping_order': 4,
'water_correction_limit': 200.e2,
'reference_sea_level_press':1.0e5,
'num_levels':40,
'valid_range_t':[100.,800.],
'initial_sphum':[2.e-6],
'vert_coord_option':'uneven_sigma',
'surf_res':0.5,
'scale_heights' : 11.0,
'exponent':7.0,
'robert_coeff':0.03
}


})
#Lets do a run!
if __name__=="__main__":
exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
Binary file added exp/test_cases/bucket_hydrology/core.90320
Binary file not shown.
Binary file added input/land_masks/earth.nc
Binary file not shown.
Binary file added input/land_masks/ignore.nc
Binary file not shown.
Binary file added input/land_masks/mirrorNH.nc
Binary file not shown.
Binary file added input/land_masks/mirrorSH.nc
Binary file not shown.
11 changes: 7 additions & 4 deletions src/atmos_param/rrtm_radiation/rrtm_radiation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ subroutine run_rrtmg(is,js,Time,lat,lon,p_full,p_half,albedo,q,t,t_surf_rad,tdt,
real(kind=rb),dimension(size(q,1),size(q,2)) :: fracsun

integer :: year_in_s
real :: r_seconds, r_days, r_total_seconds, frac_of_day, frac_of_year, gmt, time_since_ae, rrsun, dt_rad_radians, day_in_s, r_solday, r_dt_rad_avg
real :: r_seconds, r_days, r_total_seconds, frac_of_day, frac_of_year, gmt, time_since_ae, rrsun, dt_rad_radians, day_in_s, r_solday, r_dt_rad_avg, insolation



Expand Down Expand Up @@ -656,6 +656,7 @@ subroutine run_rrtmg(is,js,Time,lat,lon,p_full,p_half,albedo,q,t,t_surf_rad,tdt,
! Seasonal Cycle: Use astronomical parameters to calculate insolation
call diurnal_solar(lat, lon, gmt, time_since_ae, coszen, fracsun, rrsun)
end if
insolation = solr_cnst * rrsun

! input files: only deal with case where we don't need to call radiation at all
if(do_read_radiation .and. do_read_sw_flux .and. do_read_lw_flux) then
Expand Down Expand Up @@ -787,7 +788,7 @@ subroutine run_rrtmg(is,js,Time,lat,lon,p_full,p_half,albedo,q,t,t_surf_rad,tdt,
pfull , phalf , tfull , thalf , tsrf , &
h2o , o3 , co2 , ch4_val*ones , n2o_val*ones , o2_val*ones , &
albedo_rr , albedo_rr, albedo_rr, albedo_rr, &
cosz_rr , solrad , dyofyr , solr_cnst, &
cosz_rr , solrad , dyofyr , insolation, &
inflglw , iceflglw , liqflglw , &
! cloud parameters
zeros , taucld , sw_zro , sw_zro , sw_zro , &
Expand All @@ -801,7 +802,7 @@ subroutine run_rrtmg(is,js,Time,lat,lon,p_full,p_half,albedo,q,t,t_surf_rad,tdt,
pfull , phalf , tfull , thalf , tsrf , &
h2o , o3 , co2 , zeros , zeros, zeros, &
albedo_rr , albedo_rr, albedo_rr, albedo_rr, &
cosz_rr , solrad , dyofyr , solr_cnst, &
cosz_rr , solrad , dyofyr , insolation, &
inflglw , iceflglw , liqflglw , &
! cloud parameters
zeros , taucld , sw_zro , sw_zro , sw_zro , &
Expand Down Expand Up @@ -1057,12 +1058,14 @@ end subroutine write_diag_rrtm
!*****************************************************************************************

subroutine rrtm_radiation_end
use rrtm_vars, only: do_read_ozone,o3_interp, do_read_co2, co2_interp
use rrtm_vars, only: do_read_ozone,o3_interp, do_read_co2, co2_interp, &
do_read_h2o, h2o_interp
use interpolator_mod, only: interpolator_end
implicit none

if(do_read_ozone)call interpolator_end(o3_interp)
if(do_read_co2)call interpolator_end(co2_interp)
if(do_read_h2o)call interpolator_end(h2o_interp) ! NTL change here, interp_end for h2o

end subroutine rrtm_radiation_end

Expand Down
Loading