Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

no difference in grid-level urban fields when do_transient_urban is true

Yuan Sun

Yuan Sun
Member
What version of the code are you using?
ctsm5.2.005


Have you made any changes to files in the source tree?
no


Describe every step you took leading up to the problem:
I tried to compare the difference of urban files with transient-urban functionality in land-only regional simulations. However, grid-level urban fields (e.g. TSA_U) did not show any differences.

ds_tran = xr.open_dataset(f'{home_path}0_uk_tran_urban/archive/UKwest/lnd/hist/UKwest.clm2.h0.2014-11.nc')
ds_cntl = xr.open_dataset(f'{home_path}0_uk_tran_urban/archive/UKwest_cntl/lnd/hist/UKwest_cntl.clm2.h0.2014-11.nc')
print((ds_tran['TSA'] - ds_cntl['TSA']).mean().item(),
(ds_tran['TSA_U'] - ds_cntl['TSA_U']).mean().item(),
(ds_tran['TSA_R'] - ds_cntl['TSA_R']).mean().item())

returns 0.0011819609208032489 0.0 -0.00016095749742817134


It seems the TSA increased with urban fraction weight increase, but TSA_U difference is 0 between transient simulations and cntl simulation (the only jobscript difference is do_transient_urban).

I had no idea yet. Thanks for any comments
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
The urban output doesn't have any built-in dependence on the size of the urban area. The size of the urban area only affects the grid cell averages of quantities. Unless the proportions of the three density types (TBD, HD, and MD) within a grid cell changes, then quantities like TSA_U should show differences.
 

Yuan Sun

Yuan Sun
Member
Dear Keith,

Thanks for your suggestion.

My transient simulation used both fsurdat = '/work/n02/n02/yuansun/cesm/cesm_inputdata/lnd/project4/surfdata_005x005_UKeast_hist_2000_78pfts_c240605.nc' and flanduse_timeseries = '/work/n02/n02/yuansun/cesm/cesm_inputdata/lnd/project4/landuse.timeseries_005x005_UKeast_hist_2000-2015_78pfts_c240605.nc' while the cntl simulation only set fsurdat and the flanduse_timeseries = ' '

TBD, HD, and MD fractions changed in 2015 of flanduse_timeseries but both simulations showed the same TSA_U. It should show a difference but not.

I atteched the jobscript.

#!/bin/bash --login
# Yuan Sun, 2025-4-15, Manchester, UK
# testing run for the transient urban project
# squeue -u yuansun

export CESM_ROOT="/work/n02/n02/yuansun/cesm"
export VERSION=my_cesm_sandbox_ctsm5.2
export CASE_SCRIPT="/work/n02/n02/yuansun/cesm/${VERSION}/cime/scripts"
export LOCATION=UKeast
export CASE_NAME="/work/n02/n02/yuansun/cesm/runs/transient_uk/${LOCATION}_test_tran"
export CASE_DOCS="CaseDocs"
export COMPSET=HIST_DATM%GSWP3v1_CLM60%SP_SICE_SOCN_SROF_SGLC_SWAV
export RES=CLM_USRDAT
export MACH=archer2
export CELL=0.05
export GRIDSIZE=005
export RESLABEL=${GRIDSIZE}x${GRIDSIZE}_${LOCATION}
export INPUT="${CESM_ROOT}/cesm_inputdata/lnd"
export STARTYEAR=2014
export ENDYEAR=2014
export CDATE=c240605
export SURF=${INPUT}/project4/surfdata_${RESLABEL}_hist_2000_78pfts_${CDATE}.nc
export LNDMESH=${INPUT}/project4/lnd_mesh_${LOCATION}.nc
export MASKMESH=${INPUT}/project4/mask_mesh_${LOCATION}.nc
export TRANSURF=${INPUT}/project4/landuse.timeseries_${RESLABEL}_hist_2000-2015_78pfts_${CDATE}.nc
export QUE=short
export WALLTIME=00:20:00

cd ${CASE_SCRIPT}
./create_newcase --case ${CASE_NAME} --compset ${COMPSET} --res ${RES} --machine ${MACH} --queue ${QUE} --walltime ${WALLTIME} --run-
cd ${CASE_NAME}
cp ${CESM_ROOT}/SourceMods/forctsm5.2_dew_point/src.clm/* ${CASE_NAME}/SourceMods/src.clm
./xmlchange RUN_STARTDATE=2014-01-01
./xmlchange LND_DOMAIN_MESH="${LNDMESH}"
./xmlchange ATM_DOMAIN_MESH="${LNDMESH}"
./xmlchange MASK_MESH="${MASKMESH}"
./xmlchange DATM_YR_START=2014
./xmlchange DATM_YR_END=2014
./xmlchange DATM_YR_ALIGN=1
./xmlchange STOP_OPTION=nmonths
./xmlchange STOP_N=1
./xmlchange RESUBMIT=0
./xmlchange NTHRDS=1
./xmlchange NTHRDS_ATM=4 # there would be nan if NTHRDS_ATM=1
./xmlchange CLM_FORCE_COLDSTART=on
./case.setup
./preview_namelists
# set >> user_nl_clm
echo "fsurdat='${SURF}'" >> user_nl_clm
echo "flanduse_timeseries='${TRANSURF}'" >> user_nl_clm
echo "do_transient_urban=.true." >> user_nl_clm
echo "stream_fldfilename_urbantv = '${INPUT}/clm2/urbandata/CTSM52_tbuildmax_OlesonFeddema_2020_0.9x1.25_simyr1849-2106_c200605.nc'">> user_nl_clm
echo "hist_nhtfrq= 0" >> user_nl_clm
echo "hist_mfilt= 1" >> user_nl_clm
echo "hist_empty_htapes = .true." >> user_nl_clm
echo "hist_fincl1 = 'TSA', 'TSA_U', 'TSA_R'" >> user_nl_clm
./case.setup --reset
./case.build
./preview_run
./case.submit
The urban output doesn't have any built-in dependence on the size of the urban area. The size of the urban area only affects the grid cell averages of quantities. Unless the proportions of the three density types (TBD, HD, and MD) within a grid cell changes, then quantities like TSA_U should show differences.
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
It looks like you are just running January of 2014 (not 2015)?

RUN_STARTDATE=2014-01-01
STOP_OPTION=nmonths
STOP_N=1
 

Yuan Sun

Yuan Sun
Member
Yes, I am running test simulations from 2014-01-01 for one month.

The transient simulation log shows:

dynpft_consistency_checks settings:
&DYNPFT_CONSISTENCY_CHECKS
CHECK_DYNPFT_CONSISTENCY=T,
/

Get data for variable PCT_NAT_PFT for year 2014
Attempting to read crop dynamic landuse data .....
(GETFIL): attempting to find local file
landuse.timeseries_005x005_UKeast_hist_2000-2015_78pfts_c240605.nc
(GETFIL): using /work/n02/n02/yuansun/cesm/cesm_inputdata/lnd/project4/landuse.timeseries_005x005_UKeast_hist_2000-2015_78pfts_c240605.nc
Get data for variable PCT_CROP for year 2014
Get data for variable PCT_CFT for year 2014
Get data for variable FERTNITRO_CFT for year 2014
Attempting to read lake dynamic landuse data .....
(GETFIL): attempting to find local file
landuse.timeseries_005x005_UKeast_hist_2000-2015_78pfts_c240605.nc
(GETFIL): using /work/n02/n02/yuansun/cesm/cesm_inputdata/lnd/project4/landuse.timeseries_005x005_UKeast_hist_2000-2015_78pfts_c240605.nc
Get data for variable PCT_LAKE for year 2014
Attempting to read urban dynamic landuse data .....
(GETFIL): attempting to find local file
landuse.timeseries_005x005_UKeast_hist_2000-2015_78pfts_c240605.nc
(GETFIL): using /work/n02/n02/yuansun/cesm/cesm_inputdata/lnd/project4/landuse.timeseries_005x005_UKeast_hist_2000-2015_78pfts_c240605.nc
Get data for variable PCT_URBAN for year 2014

Using cold start initial conditions

And the cntl simulation only use PCT_URBAN from fsurface in 2000.Thus urban fractions in two simulations should be different. :(

Best,
Yuan
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
You had mentioned 2015 above: "TBD, HD, and MD fractions changed in 2015 of flanduse_timeseries but both simulations showed the same TSA_U...", so I was confused because you're just running for 2014, not 2015.
Regardless, I would verify that the urban fractions are indeed different in the two simulations, you said that they should be different, but are they? You can check using PCT_LANDUNIT.
 

Yuan Sun

Yuan Sun
Member
You had mentioned 2015 above: "TBD, HD, and MD fractions changed in 2015 of flanduse_timeseries but both simulations showed the same TSA_U...", so I was confused because you're just running for 2014, not 2015.
Regardless, I would verify that the urban fractions are indeed different in the two simulations, you said that they should be different, but are they? You can check using PCT_LANDUNIT.
Dear Keith,

To save time, I ran testing simulations on 2014-01-01 for one month. Following your suggestion, I re-ran transient and control simulations and output PCT_LANDUNIT, which showed differences between landunits. Unfortunately, the TSA_U was still the same between the two simulations.

Best,
Yuan
 

Attachments

  • transient_urban.png
    transient_urban.png
    459.6 KB · Views: 5

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Ok, thanks. What matters though is if the relative proportions of TBD/HD/MD are changing. And the transient urban setup assumes that although total urban area may increase, the proportions of TBD/HD/MD remain the same. So for example, if the urban PCT_LANDUNITS are:

TBD = 5%
HD = 20%
MD = 25%

so, the total PCT_URBAN in the gridcell is 50%.

So, if initially,

TBD TSA_U = 270K
HD TSA_U = 280K
MD TSA_U = 290K

then initially TSA_U aggregated is (270*0.05 + 280K*0.2 + 290K*0.25)/0.5 = 284K

If the total PCT_URBAN in the gridcell increases to 80%, and the relative proportions remain the same, then:

TBD = 5/50 * 80% = 8%
HD = 20/50 * 80% = 32%
MD = 25/50 * 80% = 40%

and TSA_U aggregated is (270K*0.08 + 280K*0.32 + 290K*0.40)/0.8 = 284K, the same as initially.
 

Yuan Sun

Yuan Sun
Member
Ok, thanks. What matters though is if the relative proportions of TBD/HD/MD are changing. And the transient urban setup assumes that although total urban area may increase, the proportions of TBD/HD/MD remain the same. So for example, if the urban PCT_LANDUNITS are:

TBD = 5%
HD = 20%
MD = 25%

so, the total PCT_URBAN in the gridcell is 50%.

So, if initially,

TBD TSA_U = 270K
HD TSA_U = 280K
MD TSA_U = 290K

then initially TSA_U aggregated is (270*0.05 + 280K*0.2 + 290K*0.25)/0.5 = 284K

If the total PCT_URBAN in the gridcell increases to 80%, and the relative proportions remain the same, then:

TBD = 5/50 * 80% = 8%
HD = 20/50 * 80% = 32%
MD = 25/50 * 80% = 40%

and TSA_U aggregated is (270K*0.08 + 280K*0.32 + 290K*0.40)/0.8 = 284K, the same as initially.
Dear Keith,

Thanks for your insights and prompt reply. Your example is correct.

I checked that the proportion of each urban landunit in total urban landunits is the same in my transient and control simulations. I learned that transient urban data assumed the same urban increase rate for each landunit, at least in my case.

Best,
Yuan
 

Attachments

  • transient_urban_fixed_proportion.png
    transient_urban_fixed_proportion.png
    408 KB · Views: 2
Top