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

Restructure ozone luna #1370

Merged
merged 50 commits into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1992bc9
( :construction:) Started to build the infrastructure around stress_m…
sunnivin Mar 4, 2021
2dfd8f1
(:construction_worker:) New infrastructure to choose the
sunnivin Mar 8, 2021
ff7943c
(:hammer:) Updated the ozone type and class method to use the ozone_m…
sunnivin Mar 8, 2021
e756728
(:construction:) Added ozone_method dependency for the restart-function.
sunnivin Mar 8, 2021
ca97904
(:bug:) Correction of unconcistent check for the ozone_method.
sunnivin Mar 10, 2021
bd17f5c
(:hammer:) Added new infrastructure for the ozone routines for Falk in
sunnivin Mar 12, 2021
b69b175
(:hammer:) Infrastructure check for the case when ozone is off.
sunnivin Mar 12, 2021
ac7141c
(:wheelchair:) Infrastructure for the .xml-files needed for the
sunnivin Mar 15, 2021
738a920
(:zap:) Updated the body of the modules needed to calculate stress_me…
sunnivin Mar 15, 2021
82f05ab
(:hammer:) Updated/changed the calling structure for the choices use_…
sunnivin Mar 15, 2021
44ac038
(:hammer:) Staged and aded missing link between the LunaMod and Ozone…
sunnivin Mar 30, 2021
7ba3f7f
(:bug:) Corrected name for the OzoneBaseMod
sunnivin Mar 30, 2021
0d309f9
(:construction:) Corrected associate error for end line
sunnivin Mar 30, 2021
c9fd3a6
(:construction:) New construction error
sunnivin Mar 30, 2021
d19df92
(:construction:) Missing comma for the function definition variable c…
sunnivin Mar 30, 2021
6502229
(:construction:) Added missing argument
sunnivin Mar 30, 2021
ece5e37
(:construction:) Forgotten name change
sunnivin Mar 30, 2021
cb28f18
(:bug:) Name correction
sunnivin Mar 30, 2021
392aa0c
(:construction:) ReadNamelist function commented out.
sunnivin Mar 30, 2021
3ced60e
(:construction:) Consistent update of OzoneBaseMod with the stress_me…
sunnivin Mar 30, 2021
310e674
(:construction:) Correctly initializertion of stress_method for the
sunnivin Mar 30, 2021
5f25bbf
(:bug:) Syntax error in procedure initialization
sunnivin Mar 30, 2021
5f24ffa
(:construction:) Check for consistency for the ozone_method in the ca…
sunnivin Mar 31, 2021
d08b750
(:bookmark:) First version of restructure ozone luna complete.
sunnivin Mar 31, 2021
84cce7c
(:bug:) Fixed unconsisted name
sunnivin May 3, 2021
451c7b7
(:lipstick:) Cosmetic change for comment
sunnivin May 3, 2021
146bfd9
(:bug:) Error in truncate lines
sunnivin May 3, 2021
db55eca
:lipstick: Pretty format for spaces before and after a definition
sunnivin May 7, 2021
82b9ee1
Merge master
sunnivin May 9, 2021
321ba47
Remove incomplete namelist option
sunnivin May 26, 2021
68d5b06
Remove uncomplete namelist definition
sunnivin May 26, 2021
c76090f
Added description for ozone_method
sunnivin May 26, 2021
7cc473e
Revert additional space
sunnivin May 26, 2021
12a7fe6
:bug: Corrected type argument to mpi_bcast
sunnivin May 26, 2021
9f4bd68
Removed redunant restart variables
sunnivin May 26, 2021
24f3476
Remove redundant todo-comment
sunnivin May 26, 2021
51ab7b5
Referencing to issue #1381 in the luna code
sunnivin May 26, 2021
dcb20ee
:bug: Updated second argument to mpi_bcast
sunnivin May 26, 2021
e35f57f
:hammer: Tiny adjustments to meet code review.
sunnivin Jun 23, 2021
329a1bb
:arrow_up: Controlling ozone_method through input parameters
sunnivin Jun 23, 2021
c7f9341
:truck: ozone_method --> o3_veg_stress_method
sunnivin Jun 23, 2021
ee0ad66
:books: Correction of spelling mistake
sunnivin Jun 25, 2021
747da0d
:heavy_minus_sign: Remove unwanted dependency
sunnivin Jun 25, 2021
993aaec
:white_check_mark: Testing use_luna=.true. for stress_falk
sunnivin Jun 25, 2021
4987b53
:white_check_mark: Added check is_time_to_run_luna
sunnivin Jun 28, 2021
f0f4fd5
:hammer: Updated is_end_current_day logic for LUNA
sunnivin Jun 28, 2021
1a26993
:lipstick: Name change luna -> LUNA
sunnivin Jun 28, 2021
e43002d
:truck: Testname changes,
sunnivin Jul 5, 2021
852d5cc
:heavy_minus_sign: Remove dangling files from git-repo
sunnivin Jul 5, 2021
41a477d
:bug: oz_veg_stress_method = stress_falk for irrig_o3falk_reduceOutput.
sunnivin Jul 5, 2021
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
21 changes: 21 additions & 0 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@ sub process_namelist_inline_logic {
setup_logic_glacier($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref);
setup_logic_dynamic_plant_nitrogen_alloc($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_luna($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_o3_veg_stress_method($opts, $nl_flags, $definition, $defaults, $nl,$physv);
setup_logic_hydrstress($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_dynamic_roots($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_params_file($opts, $nl_flags, $definition, $defaults, $nl);
Expand Down Expand Up @@ -3033,6 +3034,26 @@ sub setup_logic_dynamic_plant_nitrogen_alloc {

#-------------------------------------------------------------------------------

sub setup_logic_o3_veg_stress_method {
#
# Ozone vegetation stress method
#
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

my $var = 'o3_veg_stress_method';

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var );

my $val = $nl->get_value($var);

if (remove_leading_and_trailing_quotes($val) eq "stress_falk" && not (&value_is_true($nl_flags->{'use_luna'})) ) {
$log->fatal_error(" use_luna=.true. is required for $var='stress_falk'.");
}

}

#-------------------------------------------------------------------------------

sub setup_logic_luna {
#
# LUNA model to calculate photosynthetic capacities based on environmental conditions
Expand Down
3 changes: 3 additions & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<jmaxb1 use_luna=".true." phys="clm5_1" >0.17</jmaxb1>
<jmaxb1 use_luna=".true." phys="clm5_0" >0.17</jmaxb1>

<!-- o3_veg_stress_method-->
<o3_veg_stress_method>unset</o3_veg_stress_method>

<use_grainproduct>.false.</use_grainproduct>
<use_grainproduct use_crop=".true." phys="clm4_5" >.false.</use_grainproduct> <!-- 1-year grain product pool default to off for clm45 if crop is turned on -->
<use_grainproduct use_crop=".true." phys="clm5_0" >.true.</use_grainproduct> <!-- 1-year grain product pool default to on for clm50 if crop is turned on -->
Expand Down
15 changes: 9 additions & 6 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ Type of CO2 feedback.
diagnostic = use the diagnostic value sent from the atmosphere
</entry>


<entry id="suplnitro" type="char*15" category="clm_physics"
group="clm_inparm" valid_values="NONE,ALL" >
Supplemental Nitrogen mode and for what type of vegetation it's turned on for.
Expand Down Expand Up @@ -1096,6 +1095,15 @@ Initial seed Carbon to use at planting
(only used when CN is on as well as crop)
</entry>

<entry id="o3_veg_stress_method" type="char*32" category="physics"
group="clm_inparm" valid_values="unset,stress_lombardozzi2015,stress_falk" value="unset">
Parameter to set the type of ozone vegetation stress method
unset = (default) ozone stress vegetation method is off
stress_lombardozzi2015 = ozone stress vegetation functions from Danica Lombardozzi 2015
stress_falk = ozone stress vegetation functions from Stefanie Falk (issue #1224)
<default>Default: "unset"</default>
</entry>

<entry id="onset_thresh_depends_on_veg" type="logical" category="physics"
group="cnphenology">
Phenology onset depends on the vegetation type
Expand All @@ -1108,11 +1116,6 @@ The minimum critical day length for onset depends on latitude
(only used when CN is on)
</entry>

<entry id="use_ozone" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on ozone stress
</entry>

<entry id="use_snicar_frc" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on calculation of SNow and Ice Aerosol Radiation model (SNICAR) radiative forcing
Expand Down
4 changes: 2 additions & 2 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
<option name="wallclock">00:20:00</option>
</options>
</test>
<test name="ERP_D_Ld5_P48x1" grid="f10_f10_mg37" compset="I2000Clm50Sp" testmods="clm/o3">
<test name="ERP_D_Ld5_P48x1" grid="f10_f10_mg37" compset="I2000Clm50Sp" testmods="clm/o3lombardozzi2015">
<machines>
<machine name="izumi" compiler="nag" category="aux_clm"/>
</machines>
Expand Down Expand Up @@ -1010,7 +1010,7 @@
<option name="wallclock">00:20:00</option>
</options>
</test>
<test name="ERP_P72x2_Ly3" grid="f10_f10_mg37" compset="I2000Clm50BgcCrop" testmods="clm/irrig_o3_reduceOutput">
<test name="ERP_P72x2_Ly3" grid="f10_f10_mg37" compset="I2000Clm50BgcCrop" testmods="clm/irrig_o3falk_reduceOutput">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! explicitly include stuff needed for o3 here rather than including the o3 directory,
! since the o3 directory includes default, and we don't want that for this
! reducedOutput testmod
use_ozone = .true.
o3_veg_stress_method = 'stress_falk'
hist_fincl1 += 'O3UPTAKESUN', 'O3UPTAKESHA'
hist_fincl2 += 'O3UPTAKESUN', 'O3UPTAKESHA'
2 changes: 0 additions & 2 deletions cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
o3_veg_stress_method = 'stress_lombardozzi2015'
hist_fincl2 += 'O3UPTAKESUN', 'O3UPTAKESHA'
10 changes: 5 additions & 5 deletions src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
!
! !USES:
use shr_const_mod , only : SHR_CONST_RGAS, shr_const_pi
use clm_time_manager , only : get_step_size_real, get_prev_date,is_end_curr_day
use clm_time_manager , only : get_step_size_real, get_prev_date
use clm_varcon , only : sb, cpair, hvap, vkc, grav, denice, c_to_b
use clm_varcon , only : denh2o, tfrz, tlsai_crit, alpha_aero
use clm_varcon , only : c14ratio
Expand All @@ -237,6 +237,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
swbgt, hmdex, dis_coi, dis_coiS, THIndex, &
SwampCoolEff, KtoC, VaporPres
use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type
use LunaMod , only : is_time_to_run_LUNA
!
! !ARGUMENTS:
type(bounds_type) , intent(in) :: bounds
Expand Down Expand Up @@ -402,7 +403,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
real(r8) :: h2ocan ! total canopy water (mm H2O)
real(r8) :: dt_veg_temp(bounds%begp:bounds%endp)
integer :: iv
logical :: is_end_day ! is end of current day
real(r8) :: dbh(bounds%begp:bounds%endp) ! diameter at breast height of vegetation
real(r8) :: cp_leaf(bounds%begp:bounds%endp) ! heat capacity of leaves
real(r8) :: cp_stem(bounds%begp:bounds%endp) ! heat capacity of stems
Expand Down Expand Up @@ -615,7 +615,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
! Determine step size

dtime = get_step_size_real()
is_end_day = is_end_curr_day()

! Make a local copy of the exposedvegp filter. With the current implementation,
! this is needed because the filter is modified in the iteration loop.
Expand Down Expand Up @@ -1577,7 +1576,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
surfalb_inst, solarabs_inst, &
temperature_inst)

if(is_end_day)then
if(is_time_to_run_LUNA())then

call Acc240_Climate_LUNA(bounds, fn, filterp, &
o2(begp:endp), &
Expand All @@ -1600,7 +1599,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
surfalb_inst, &
solarabs_inst, &
waterdiagnosticbulk_inst,&
frictionvel_inst)
frictionvel_inst, &
ozone_inst)

call Clear24_Climate_LUNA(bounds, fn, filterp, &
canopystate_inst, photosyns_inst, &
Expand Down
Loading