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

Some more hardcoded parameters to the params file #1164

Merged
merged 200 commits into from
Sep 2, 2021

Conversation

ekluzek
Copy link
Contributor

@ekluzek ekluzek commented Sep 27, 2020

Description of changes

Brings more hardcoded parameters to the paramsfile. Some bit-for-bit cleanup. A fix for HumanStressIndex. Adding IWUELN and VPD_2M diagnostic to history output. Add in ability to run Medlyn photosynthesis for non-PHS cases (not turned on yet though).

I have added two new diagnostic fields available for history outuput.
IWUELN: the intrinsic water use efficiency at local noon (umolCO2/molH2O)
VPD_2M: vapor pressure deficit at 2m reference height (pascals)

The Medlyn stomatal conductance functionality was deployed for CLM5. It had not been implemented for use_hydrstress=.false (i.e. SMS).
Previously if we opted for:
use_hydrstress=.false and stomatalcond_method = 'Medlyn2011', the model would actually use the Ball-Berry stomatal conductance model.

Specific notes

Contributors other than yourself, if any: @olyson @djk2120 J Buzan

Both are patch-level variables. I have added VPD_2M for users who want to calculate ecosystem scale inherent water use efficiency relevant for flux tower point simulations.

CTSM Issues Fixed (include github issue #):

Fixes #1472 Done
Fixes #1469 Done
Fixes #1468 Done
Fixes #1427 Done
Fixes #1403 Done
Fixes #1401 Done
Fixes #1399 Done
Fixes #1296 Done
Fixes #1245 Done
Fixes #1250 Done
Fixes #1284 Done
Fixes #1382 Done
Fixes #1379 Done
Fixes #1185 Done
Fixes #1168 Done
Partial work on #1356 (but use_lch4, use_nitrif_dentrif remain)
Fixes #886 Done
Fixes #808 Done

Medlyn change relates to #139

Are answers expected to change (and if so in what way)? No (a few diagnostic fields change for one test)

extra-outputs test mod changes answers for diagnostic variables because of fix in human-stress module
Many answers will change when use_hydrstress=.false., stomatalcond_method = 'Medlyn2011' including FPSN, QVEGT, etc.
use_vertsoilc=FALSE and BGC=CN are no longer options
There are some new options for handling arctic seasonal deciduous plants which also changes answers if activated

There are two new diagnostic variables for Medlyn-PHS

Any User Interface Changes (namelist or namelist defaults changes)?

Two new history fields: IWUELN and VPD_2M

New params file. Remove some namelist items.

Testing performed, if any: regular OK

olyson and others added 7 commits July 9, 2020 16:25
See hardcodep branch for previous commits.
BFB according to following tests:
aux_clm test suite w/intel
aux_clm test suite w/gnu
There was one unexpected failure:
FUNITCTSM_P1x1.f10_f10_musgs.I2000Clm50SpGs.cheyenne_intel

It failed with a divide by zero here in subroutine NewSnowBulkDensity within SnowHydrologyMod:

bifall(c) = bifall(c) + (266.861_r8 * ((1._r8 + &
            TANH(forc_wind(g)/params_inst%wind_snowcompact_fact))/2._r8)**8.8_r8)

This is a unit test that tests various configurations of NewSnowBulkDensity within SnowHydrologyMod
(test_SnowHydrology_newSnowBulkDensity.pf).
The change I made here was to replace the hardcoded value in the denominator with params_inst%wind_snowcompact_fact.
The unit test doesn't have access to the parameter file since it is calling NewSnowBulkDensity directly, so this is
just a test setup failure rather than a model failure (confirmed by Erik K.).

Parameters moved or changed:
wind_snowcompact_fact (was hardcoded as 5 in SnowHydrologyMod)
min_wind_snowcompact (this namelist variable was removed since it wasn't being used)
rho_max (in SnowHydrologyMod)
tau_ref (was set to 48 * 3600 in SnowHydrologyMod)
xdrdt (in SnowSnicarMod)
snw_rds_refrz (in SnowSnicarMod)
snowcan_unload_temp_fact (was hardcoded as 1.87e5 in CanopyHydrologyMod)
snowcan_unload_wind_fact (was hardcoded as 0.5 in CanopyHydrologyMod)
scvng_fct_mlt_sf (did not exist previously, this new parameter modifies all of the scvng_fct_mlt_* hardcoded parameters)
bsw_sf (renamed from bsw_adjustfactor)
hksat_sf (renamed from hksat_adjustfactor)
sucsat_sf (renamed from sucsat_adjustfactor)
watsat_sf (renamed from watsat_adjustfactor)
BFB according to the following tests:
ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive
ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput
ERS_D_Ld6.f10_f10_musgs.I1850Clm45BgcCrop.cheyenne_intel.clm-clm50CMIP6frc

Parameters moved or changed:
ceta (in SnowHydrologyMod)
BFB according to the following tests:
ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive
ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput
ERS_D_Ld6.f10_f10_musgs.I1850Clm45BgcCrop.cheyenne_intel.clm-clm50CMIP6frc

Parameters moved or changed:
sand_pf (did not exist previously, SoilStateInitTimeConstMod.F90)
clay_pf (did not exist previously, SoilStateInitTimeConstMod.F90)
BFB according to the following tests:
ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive
ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput
ERS_D_Ld6.f10_f10_musgs.I1850Clm45BgcCrop.cheyenne_intel.clm-clm50CMIP6frc

Parameters moved or changed: None
Add PCT_SAND and PCT_CLAY to primary history file.  These fields will only be
written out when htape_timeconst3D is called (similar to WATSAT, HKSAT, etc).
Fang Li's latest Fire version - includes allowing clm5.1 phys version. New physics option is added
called "clm5_1", with currently the new feature to use the latest fire changes. This has some
adjustments to the fire model and includes some changes to the parameter file. Other new features
will be added into clm5_1 in future tags.

Also bring in mksurfdata changes for the raw urban dataset change. This adds some changes to
mksurfdata for a new urban raw dataset, as well as preparation for new changes for some other
urban changes that will be a future part of clm5_1. Also use the half degree lightning dataset
by default for clm5_1.

Start adding a new test list ctsm_sci that tests all the scientifically supported compsets.
Some of those tests fail due to existing issues, that will be fixed later.

Some more work done to change clm to ctsm, and allow for ctsm as a component.

 Conflicts:
	bld/namelist_files/namelist_defaults_ctsm.xml
	src/main/histFileMod.F90
BFB according to the following tests:
ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive
ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput
ERS_D_Ld6.f10_f10_musgs.I1850Clm45BgcCrop.cheyenne_intel.clm-clm50CMIP6frc

Parameters moved or changed:
vcmaxse_sf (did not exist previously, PhotosynthesisMod.F90)
jmaxse_sf (did not exist previously, PhotosynthesisMod.F90)
tpuse_sf (did not exist previously, PhotosynthesisMod.F90)
jmax25top_sf (did not exist previously, PhotosynthesisMod.F90)
Get UNIT test to work by setting a parameter that will be a divisor" src/biogeophys/SnowHydrologyMod.F90

 Conflicts:
	bld/namelist_files/namelist_defaults_ctsm.xml
@ekluzek ekluzek added type: enhancement new capability or improved behavior of existing capability tag: simple bfb easy to fix, bit-for-bit PR status: ready PR: author feels this is ready to merge in tag: enh - new science enhancement that brings in new science capabilities labels Sep 27, 2020
@ekluzek ekluzek added this to the ctsm5.1.0 milestone Sep 27, 2020
@ekluzek ekluzek self-assigned this Sep 27, 2020
Call correct routine to calculate btran2 for CNFireLi2021

Due to a subtle code bug, CNFireLi2021 was using the btran2 calculating
routine from the base class rather than the new one that is specific to
this formulation.
… recently pulled out to the parameter file have returned to being hard-coded in this version of the fire code: prh30 and ignition_efficiency
Fix reading netcdf variable into a different data type

Main change is to fix the reading of a variable that is one type on a
NetCDF file but a different data type in memory. Previously, this could
lead to memory corruption (not just of the variable in question, but
other variables as well). This was not causing any problems in
out-of-the-box configurations, but it sometimes tripped up some
developers when they added new fields on datasets.

In addition, this adds new self-test code to test ncdio_pio. This module
is hard to get under unit test, but we want to have some tests of it, to
pick up problems like the one fixed in this tag. So as a compromise
solution for now, I have introduced unit test-like tests that are built
into a standard build of CTSM and run in a standard run if a given
namelist flag is set. A better long-term solution would be to integrate
these tests into the pFUnit-based unit testing framework, but that would
take some work. I have added tests of the new code, and a bit of testing
of other code in ncdio_pio, but there's still a lot in ncdio_pio that is
not tested. I figure we can gradually add tests as we make changes to
ncdio_pio.

Finally, an unrelated change to the unit test build: files generated by
genf90 now appear in the unit test build directory rather than the
source tree.

Resolves ESCOMP#1091 (Memory corruption when reading a netcdf
variable into a variable of a different type, at least with PIO1)

Resolves ESCOMP#1188 (In unit test build: files generated by
genf90 should go in build dir rather than source dir)
@ekluzek ekluzek modified the milestones: ctsm5.1.0, ctsm5.2.0 Nov 12, 2020
@wwieder wwieder modified the milestones: ctsm5.2.0, ctsm5.1.0 Nov 12, 2020
djk2120 and others added 10 commits January 11, 2021 17:14
Add heat stored in biomass (for trees and shrubs) to the surface energy balance calculation. Add
a switch for it and turn it on by default for clm5_1 physics. It's turned off for clm4_5, clm5_0
physics and when FATES is turned on. Those cases are identical to before, answers only change
when it's turned on.

Papers describing BHS simulations:
R. Meier, Davin, E., Swenson, S., Lawrence, D., and Schwaab, Jo. (2019). Biomass heat
storage dampens diurnal temperature variations
in forests. Environmental Research Letters. 14. 084026. 10.1088/1748-9326/ab2b4e.

S.C. Swenson, Burns, S. P., and Lawrence, D. M. ( 2019). The impact of biomass heat storage
on the canopy energy balance and atmospheric stability in the community land model, Journal
of Advances in Modeling Earth Systems, 11, 83– 98.
https://doi.org/10.1029/2018MS001476
@ekluzek
Copy link
Contributor Author

ekluzek commented Aug 31, 2021

@olyson and @wwieder I'm bringing this to main-dev today, but go ahead and look at CNPhenology and let me know if you have further suggestions and I'll bring them in a future tag. Also go ahead and go through each of the conversations you started and make sure you agree that I dealt with your comment, and then you can resolve the conversation.

@ekluzek
Copy link
Contributor Author

ekluzek commented Aug 31, 2021

SMS_D_Lm1_Mmpi-serial_Vnuopc.CLM_USRDAT.I1PtClm50SpRs.cheyenne_intel.clm-USUMB_nuopc is failing because it's trying to find the UNSET fatmlndfrc file which it doesn't even need. I'll rework this so it's not needed and rerun the nuopc tests.

@olyson
Copy link
Contributor

olyson commented Aug 31, 2021

I think I resolved the conversations I started.

@ekluzek
Copy link
Contributor Author

ekluzek commented Sep 2, 2021

A few tests are failing because of this in check_input_data

Model ctsm no file specified for finidat

This is because finidat for a cold start is blank, but it's still in the ctsm.input_data_list file, but apparantely new behavior for cime is that this will now trigger an error.

So I just need to remove adding the files to ctsm.input_data_list file if they are blank.

@ekluzek ekluzek merged commit dd9e6d7 into ESCOMP:master Sep 2, 2021
High priority automation moved this from To do to Done Sep 2, 2021
@ekluzek ekluzek deleted the hardcodep2 branch September 2, 2021 07:29
@ekluzek ekluzek restored the hardcodep2 branch September 2, 2021 07:31
@ekluzek ekluzek deleted the hardcodep2 branch September 2, 2021 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment