-
Notifications
You must be signed in to change notification settings - Fork 322
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
Dynamic urban #1546
Merged
Merged
Dynamic urban #1546
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
310eab4
Created a new branch
fang-bowen eac83c1
Merge pull request #1 from fang-bowen/dynamic_urban
fang-bowen e729e7f
Revert "Merge pull request #1 from fang-bowen/dynamic_urban"
fang-bowen 106f657
Create dynurbanFileMod.F90
fang-bowen 0c5225e
Update dynSubgridControlMod.F90
fang-bowen c7c1f46
Update dynSubgridDriverMod.F90
fang-bowen 397799d
Add do_transient_urban namelist variable
fang-bowen 078f4f8
Update CLMBuildNamelist.pm
fang-bowen 71abc82
Update UrbanParamsType.F90
fang-bowen 53e0c15
Update ch4Mod.F90
fang-bowen 0a863a0
Update dynSubgridControlMod.F90
fang-bowen 3dbb695
Update dynSubgridControlMod.F90
fang-bowen bc4e56e
Merge branch 'ESCOMP:master' into dynamic_urban
fang-bowen dbaac5f
Update code comments
fang-bowen a7defab
Merge branch 'dynamic_urban' of https://github.com/fang-bowen/CTSM in…
fang-bowen 5860d35
Update dynurbanFileMod.F90
fang-bowen ce645fd
Merge branch 'ESCOMP:master' into dynamic_urban
fang-bowen 2b4ec0a
Add a dynamic urban test and a design document
olyson 5ac86f7
Add more information in smallville test user_nl_clm
olyson b33640c
Update path for landuse file
olyson 4996326
Add ncl script to testmods_dir for dynamic urban test
olyson 7416cd2
Merge tag 'ctsm5.1.dev066' into dynamic_urban
olyson 38870f6
Merge tag 'ctsm5.1.dev067' into dynamic_urban
olyson 47b64af
Merge tag 'ctsm5.1.dev068' into dynamic_urban
olyson 398408c
Update ChangeLog/ChangeSum
olyson 248de30
Updated originators in ChangeLog
olyson 0e960d8
Remove irrelevant lines from ChangeLog
olyson 43d4253
Update ChangeLog time
olyson 9402bb4
Update originators
olyson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
cime_config/testdefs/testmods_dirs/clm/smallville_dynurban_monthly/include_user_mods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../monthly |
63 changes: 63 additions & 0 deletions
63
...estdefs/testmods_dirs/clm/smallville_dynurban_monthly/modify_smallville_with_dynurban.ncl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
; NCL script | ||
; modify_smallville_with_dynurban.ncl | ||
; Keith Oleson, Dec 2021 | ||
; Purpose is to create a dynamic urban file for the smallville grid for test | ||
; ERS_Lm25.1x1_smallvilleIA.IHistClm50BgcCropQianRs.cheyenne_gnu.clm-smallville_dynurban_monthly | ||
;************************************** | ||
|
||
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" | ||
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" | ||
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" | ||
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" | ||
|
||
begin | ||
|
||
print ("=========================================") | ||
print ("Start Time: "+systemfunc("date") ) | ||
print ("=========================================") | ||
|
||
infile = "/glade/p/cgd/tss/people/oleson/modify_surfdata/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc" | ||
outfile = "/glade/p/cgd/tss/people/oleson/modify_surfdata/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_dynUrban_c211206.nc" | ||
|
||
system("cp " + infile + " " + outfile) | ||
|
||
outf = addfile(outfile,"w") | ||
|
||
numurbl = 3 | ||
|
||
pct_crop = outf->PCT_CROP | ||
printVarSummary(pct_crop) | ||
pct_urban = new((/dimsizes(pct_crop(:,0,0)),numurbl,dimsizes(pct_crop(0,:,0)),dimsizes(pct_crop(0,0,:))/),double,"No_FillValue") | ||
pct_urban!0 = "time" | ||
pct_urban&time = pct_crop&time | ||
pct_urban!1 = "numurbl" | ||
pct_urban!2 = pct_crop!1 | ||
pct_urban!3 = pct_crop!2 | ||
pct_urban@long_name = "percent urban for each density type (tbd, hd, md)" | ||
pct_urban@units = "unitless" | ||
printVarSummary(pct_urban) | ||
|
||
hasurban = new((/numurbl,dimsizes(pct_crop(0,:,0)),dimsizes(pct_crop(0,0,:))/),double,"No_FillValue") | ||
hasurban!0 = pct_urban!1 | ||
hasurban!1 = pct_urban!2 | ||
hasurban!2 = pct_urban!3 | ||
hasurban = 1.d | ||
printVarSummary(hasurban) | ||
|
||
pct_urban(:,0,0,0) = (/0.d,20.d,10.d,10.d,10.d,10.d/) | ||
pct_urban(:,1,0,0) = (/0.d,15.d, 8.d, 8.d, 8.d, 8.d/) | ||
pct_urban(:,2,0,0) = (/0.d,10.d, 5.d, 5.d, 5.d, 5.d/) | ||
|
||
pct_crop(:,0,0) = (/0.,25.,12.,12.,12.,12./) | ||
|
||
outf->HASURBAN = hasurban | ||
outf->PCT_URBAN = pct_urban | ||
outf->PCT_CROP = pct_crop | ||
|
||
outf@history = "This file was created with the following NCL script: /glade/p/cgd/tss/people/oleson/modify_surfdata/modify_smallville_with_dynurban.ncl. The file used as a template is: /glade/p/cesm/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc. Key points are that urban area starts as 0, increases after the first year, then decreases after the second year. PCT_CROP is also changed so that PCT_URBAN + PCT_CROP <= 100. (Here, PCT_CROP increases and decreases at the same time as PCT_URBAN in order to exercise the simultaneous increase or decrease of two landunits, but that isn't a critical part of this test.). Note that the use of this file means that this testmod can only be used with the 1x1_smallvilleIA grid." | ||
|
||
print ("=========================================") | ||
print ("Finish Time: "+systemfunc("date") ) | ||
print ("=========================================") | ||
|
||
end |
12 changes: 12 additions & 0 deletions
12
cime_config/testdefs/testmods_dirs/clm/smallville_dynurban_monthly/user_nl_clm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
do_transient_urban = .true. | ||
!KO The following run_zero_weight_urban setting is temporary until the HASURBAN methdology is implemented. | ||
run_zero_weight_urban = .true. | ||
|
||
! This file was created with the following NCL script: | ||
! /glade/p/cgd/tss/people/oleson/modify_surfdata/modify_smallville_with_dynurban.ncl | ||
! The file used as a template is: | ||
! /glade/p/cesm/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc | ||
! Key points are that urban area starts as 0, increases after the first year, then decreases after the second year. | ||
! PCT_CROP is also changed so that PCT_URBAN + PCT_CROP <= 100. (Here, PCT_CROP increases and decreases at the same time as PCT_URBAN in order to exercise the simultaneous increase or decrease of two landunits, but that isn't a critical part of this test.) | ||
! Note that the use of this file means that this testmod can only be used with the 1x1_smallvilleIA grid. | ||
flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_dynUrban_c211206.nc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.. sectnum:: | ||
|
||
.. contents:: | ||
|
||
================================== | ||
Overview of this design document | ||
================================== | ||
|
||
This documents some of the high-level design decisions made during implementation of | ||
dynamic urban landunits. | ||
|
||
============================================================================ | ||
The use of dzsoi_decomp for urban landunits to calculate totcolch4 in ch4Mod.F90 | ||
============================================================================ | ||
During the first test simulation for dynamic urban, we encountered a methane conservation | ||
error the first time PCT_URBAN changed. The dynamic adjustments for conc_ch4_sat_col and | ||
conc_ch4_unsat_col (the column_state_updater in subroutine DynamicColumnAdjustments within | ||
ch4Mod.F90) were distributing non-zero values for roof and walls for layers 1,nlevsoi. | ||
When the total column ch4 is summed over the soil layers (or in this case, urban layers), the | ||
summation is done over nlevsoi, not nlevurb, using dz. dz is 1.e36 for roof/wall layers | ||
that are greater than nlevurb, thus creating an imbalance. | ||
|
||
Rather than trying to keep the BGC variables physically meaningful in urban landunits, | ||
we will just pack these variables in a way that should conserve these variables, even if | ||
the values in each of the urban columns is somewhat nonsensical. Specifically: we'll take | ||
col%wtgcell at face value in urban columns in dynColumnStateUpdaterMod - i.e., for the sake | ||
of storing / conserving these BGC variables, we'll act as if that gives the true column | ||
weight on the grid cell. This way we'll end up storing all of the C & N from the vegetated | ||
column in the urban columns, and there shouldn't be any that is lost from the system. If that | ||
urban landunit later shrinks, the stored C & N should be restored symmetrically. It shouldn't | ||
really matter that it was stored in a non-physical way (e.g., with some C & N stored in urban | ||
walls), since the BGC variables are irrelevant over the urban areas and we just want to be able | ||
to restore the amount that was originally stored if an urban landunit grows and then later shrinks. | ||
But for this to work right, we need to treat the relevant BGC variables as having the same dz over | ||
all urban columns as over the soil column. Note that there already seems to be an implicit assumption | ||
that dz is the same for all columns in the dynamic column state updates, in that dz doesn't enter | ||
into the conservation equations. In terms of what needs to change, we think that the only relevant | ||
code is the code that sums up total C / N / CH4 for the sake of balance checks: these balance checks | ||
need to be consistent with the assumptions made in the conservation code. The C and N summations | ||
already use dzsoi_decomp, which is the same for all columns, so this is already what we want. | ||
The only thing that needs to change is the use of dz in totcolch4 in ch4Mod.F90: we've changed that to now use | ||
dzsoi_decomp over urban columns. (This begs the question of why this isn't already using | ||
dzsoi_decomp for consistency with the C & N code; we're not sure about this.) | ||
|
||
See issue #1445 for the original discussion on this topic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Added modify_smallville_with_dynurban.ncl to cime_config/testdefs/testmods_dirs/clm/smallville_dynurban_monthly