-
Notifications
You must be signed in to change notification settings - Fork 319
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
Fix and improve anomaly forcings for ISSP cases #2686
base: master
Are you sure you want to change the base?
Changes from all commits
208c594
8d628f2
702477d
f59d045
662e536
8df08ff
1416363
4b96267
825fbb6
496c154
0a8df10
634cfce
42b7575
567fcad
597a4de
c4ec313
49382ee
728257b
4da4587
51a8e1b
1644c61
5aae2a6
a2fc1c1
f514ed8
da2f4e8
8cb5854
01967bf
124027b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1989,6 +1989,7 @@ | |
<machines> | ||
<machine name="izumi" compiler="intel" category="aux_clm"/> | ||
<machine name="derecho" compiler="nvhpc" category="aux_clm"/> | ||
<machine name="derecho" compiler="nvhpc" category="ssp"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahhh, adding a new testlist for ssp. That sounds interesting. I do suggest that you use intel or gnu here though, as we know there are problems with nvhpc. |
||
<machine name="izumi" compiler="gnu" category="aux_clm"/> | ||
</machines> | ||
<options> | ||
|
@@ -2513,15 +2514,46 @@ | |
<option name="comment" >Transient production future scenario SSP3-7.0 case with isotopes with a december 2050 start</option> | ||
</options> | ||
</test> | ||
<test name="SMS_D_Ld5" grid="f09_g17" compset="ISSP126Clm50BgcCrop" testmods="clm/datm_ssp126_anom_forc"> | ||
|
||
<test name="SMS_D_Ld5" grid="f09_g17" compset="ISSP126Clm50BgcCrop" testmods="clm/default"> | ||
samsrabin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<machines> | ||
<machine name="derecho" compiler="intel" category="aux_clm"/> | ||
<machine name="derecho" compiler="intel" category="ssp"/> | ||
</machines> | ||
<options> | ||
<option name="wallclock">00:20:00</option> | ||
<option name="comment" >Transient production with anomaly forcing future scenario SSP1-2.6 case</option> | ||
</options> | ||
</test> | ||
<test name="SMS_D_Ld5" grid="f10_f10_mg37" compset="ISSP245Clm50BgcCrop" testmods="clm/default"> | ||
<machines> | ||
<machine name="derecho" compiler="intel" category="ssp"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think maybe we add this one to aux_clm as well. |
||
</machines> | ||
<options> | ||
<option name="wallclock">00:20:00</option> | ||
<option name="comment" >Transient production with anomaly forcing future scenario SSP2-4.5 case</option> | ||
</options> | ||
</test> | ||
<test name="SMS_D_Ld5" grid="f09_g17" compset="ISSP370Clm50BgcCrop" testmods="clm/default"> | ||
<machines> | ||
<machine name="derecho" compiler="intel" category="ssp"/> | ||
</machines> | ||
<options> | ||
<option name="wallclock">00:20:00</option> | ||
<option name="comment" >Transient production with anomaly forcing future scenario SSP3-7.0 case</option> | ||
</options> | ||
</test> | ||
<test name="SMS_D_Ld5" grid="f09_g17" compset="ISSP585Clm50BgcCrop" testmods="clm/default"> | ||
<machines> | ||
<machine name="derecho" compiler="intel" category="ssp"/> | ||
</machines> | ||
<options> | ||
<option name="wallclock">00:20:00</option> | ||
<option name="comment" >Transient production with anomaly forcing future scenario SSP5-8.5 case</option> | ||
</options> | ||
</test> | ||
|
||
|
||
<test name="ERP_D_Ld5" grid="f10_f10_mg37" compset="I1850Clm50Bgc" testmods="clm/nlevgrnd_small"> | ||
<machines> | ||
<machine name="izumi" compiler="intel" category="aux_clm"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You shouldn't need to do this. And you are asking for the ctsm5.2 dataset, which isn't going to work. So I think this testmod should be removed. But, I might be missing something. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
anomaly_forcing = 'Anomaly.Forcing.cmip5.rcp45' |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,41 +5,69 @@ | |
============================== | ||
Running with anomaly forcing | ||
============================== | ||
Because performing fully coupled climate simulations is computationally expensive, an alternate method of running land-only simulations forced by future climate projections was developed for CTSM called 'anomaly forcing'. The anomaly forcing method uses a previously completed fully coupled simulation to create monthly anomalies, relative to the present day, of near-surface atmospheric states and fluxes. These anomalies, representing the evolution of future climate projections, are applied to a repeating cycle of present day atmospheric forcing data, either as an additive (for states) or multiplicative (for fluxes) quantity. Thus, high-frequency variability is obtained from the present day atmospheric forcing data, while the long-term evolution of the climate is determined by the anomaly forcing dataset. | ||
Because performing fully coupled climate simulations is computationally expensive, an alternate method of running land-only simulations forced by future climate projections was developed for CTSM called "anomaly forcing." The anomaly forcing method uses a previously-completed, fully-coupled simulation to create monthly anomalies, relative to the present day, of near-surface atmospheric states and fluxes. These anomalies, representing the evolution of future climate projections, are applied to a repeating cycle of present day atmospheric forcing data, either as an additive (for states) or multiplicative (for fluxes) quantity. Thus, high-frequency variability is obtained from the present day atmospheric forcing data, while the long-term evolution of the climate is determined by the anomaly forcing dataset. | ||
samsrabin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
To enable anomaly forcing in a CTSM simulation, the following namelist variable can be added to the user\_nl\_datm file: | ||
Anomaly climate forcings are automatically enabled for ``ISSP`` compsets (e.g., ``ISSP585``). After the namelist has been created, ``CaseDocs/datm.streams.xml`` will have an entry like this pointing to the anomaly forcing file being used: | ||
|
||
anomaly\_forcing = 'Anomaly.Forcing.Precip','Anomaly.Forcing.Temperature','Anomaly.Forcing.Pressure','Anomaly.Forcing.Humidity','Anomaly.Forcing.Uwind','Anomaly.Forcing.Vwind','Anomaly.Forcing.Shortwave','Anomaly.Forcing.Longwave' | ||
:: | ||
|
||
Any combination or subset of forcing variables can be used, e.g. to modify only a single atmospheric forcing variable, one could use: | ||
<stream_info name="Anomaly.Forcing.cmip6.ssp585"> | ||
... | ||
<datafiles> | ||
<file>/glade/campaign/cesm/cesmdata/inputdata/atm/datm7/anomaly_forcing/CMIP6-SSP5-8.5/af.allvars.CESM.SSP5-8.5.2015-2100_c20220628.nc</file> | ||
</datafiles> | ||
<datavars> | ||
<var>huss Sa_shum_af</var> | ||
<var>pr Faxa_prec_af</var> | ||
<var>ps Sa_pbot_af</var> | ||
<var>rlds Faxa_lwdn_af</var> | ||
<var>rsds Faxa_swdn_af</var> | ||
<var>tas Sa_tbot_af</var> | ||
<var>uas Sa_u_af</var> | ||
<var>vas Sa_v_af</var> | ||
</datavars> | ||
... | ||
</stream_info> | ||
|
||
anomaly\_forcing = 'Anomaly.Forcing.Temperature' | ||
To use alternative data, add a ``user_nl_datm_streams`` namelist file to your case with contents like so: | ||
|
||
which will only adjust the temperature (TBOT). | ||
:: | ||
|
||
After the namelist has been created, the run directory will be populated with files such as these: | ||
Anomaly.Forcing.cmip6.ssp585:datafiles = /path/to/your/datafile | ||
Anomaly.Forcing.cmip6.ssp585:meshfile = /path/to/meshfile/for/your/datafile | ||
|
||
datm.streams.txt.Anomaly.Forcing.Temperature | ||
! List of Data types to use | ||
! Remove the variables you do NOT want to include in the anomaly forcing: | ||
! pr is precipitation | ||
! tas is temperature | ||
! huss is humidity | ||
! uas and vas are U and V winds | ||
! rsds is solare | ||
! rlds is LW down | ||
Anomaly.Forcing.cmip6.ssp585:datavars = pr Faxa_prec_af, \ | ||
tas Sa_tbot_af, \ | ||
ps Sa_pbot_af, \ | ||
huss Sa_shum_af, \ | ||
uas Sa_u_af, \ | ||
vas Sa_v_af, \ | ||
rsds Faxa_swdn_af, \ | ||
rlds Faxa_lwdn_af | ||
|
||
which will contain the location of the default anomaly forcing datasets. To use alternative data, copy these files to the case directory with the 'user\_' prefix, and modify the 'user\_*' files accordingly, e.g.: | ||
To instead disable anomaly forcing in ``ISSP`` compsets, the following can be added to the ``user_nl_datm`` file: | ||
|
||
user\_datm.streams.txt.Anomaly.Forcing.Temperature | ||
:: | ||
|
||
For example, one could use the user\_datm.streams.txt.Anomaly.Forcing.* files to point to these SSP-derived anomaly forcing datasets: | ||
anomaly_forcing = 'none' | ||
|
||
/glade/p/cesmdata/cseg/inputdata/atm/datm7/anomaly\_forcing/CMIP6-SSP3-7.0 | ||
Note that other inputs are also set automatically for ``ISSP`` compsets, including CO2 (``co2tseries``), ozone (``preso3``), N deposition (``presndep``), and aerosols (``presaero``). | ||
|
||
af.huss.cesm2.SSP3-7.0.2015-2100\_c20200329.nc | ||
af.pr.cesm2.SSP3-7.0.2015-2100\_c20200329.nc | ||
af.ps.cesm2.SSP3-7.0.2015-2100\_c20200329.nc | ||
af.rlds.cesm2.SSP3-7.0.2015-2100\_c20200329.nc | ||
af.rsds.cesm2.SSP3-7.0.2015-2100\_c20200329.nc | ||
af.tas.cesm2.SSP3-7.0.2015-2100\_c20200329.nc | ||
For single-point simulations, the global anomaly forcing files can be used, but the map should be nearest-neighbor interpolated by putting the following in ``user_nl_datm_streams``: | ||
|
||
Users may wish to also update files such as the landuse\_timeseries and aerosol and Ndepostion files to correspond to the appropriate SSP. | ||
TODO: IS THIS ACTUALLY NEEDED? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. It could be worth trying it without it to make sure it is required for all the fields. Setting it for some fields was required in the past, but may not be anymore. |
||
|
||
For single point simulations, the global anomaly forcing files can be used, but the map_algo namelist variable should be appended with nearest neighbor values for each of the anomaly forcing fields, e.g. | ||
:: | ||
|
||
mapalgo = 'nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn' (the number of 'nn' values will depend on the number of original streams plus the number of anomaly forcing streams) | ||
! Replace "ssp585" if needed | ||
Anomaly.Forcing.cmip6.ssp585:mapalgo = nn | ||
|
||
The cycling of the present-day (base) climate is controlled through the DATM\_CLMNCEP\_YR\_START and DATM_CLMNCEP\_YR\_END variables in env\_run.xml. | ||
The first and last years over which the present-day (base) climate should cycle are set through the ``DATM_YR_START`` and ``DATM_YR_END`` XML variables. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
set -e | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are these two scripts about? Something temporary needed while the PR is created and then removed at the last moment? If so that's an interesting strategy that sounds useful. |
||
|
||
module load nco | ||
|
||
indir=/glade/campaign/cesm/cesmdata/cseg/inputdata/atm/datm7/anomaly_forcing | ||
outdir=/glade/work/samrabin/ctsm_cdeps_ssp-temperature | ||
|
||
rcp=$1 | ||
if [[ ${rcp} == "" ]]; then | ||
echo "You must provide rcp (e.g., 45)" >&2 | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -d "${indir}" ]]; then | ||
echo "Input directory not found: ${indir}" >&2 | ||
exit 1 | ||
fi | ||
|
||
restoffilename="ccsm4.rcp${rcp}.2006-2300.nc" | ||
|
||
pushd "${indir}" 1>/dev/null | ||
varlist="$(ls af.*.${restoffilename} | grep -v allvars | cut -f2 -d.)" | ||
if [[ "${varlist}" == "" ]]; then | ||
echo "No variables found" >&2 | ||
exit 1 | ||
fi | ||
popd 1>/dev/null | ||
|
||
newfile="${outdir}/af.allvars.${restoffilename}" | ||
|
||
i=0 | ||
for var in ${varlist}; do | ||
echo $var | ||
i=$((i + 1)) | ||
thisfile="${indir}/af.${var}.${restoffilename}" | ||
if [[ ${i} -eq 1 ]]; then | ||
nccopy -k cdf5 "${thisfile}" "${newfile}" | ||
continue | ||
fi | ||
ncks -A -v ${var} "${thisfile}" "${newfile}" | ||
done | ||
|
||
echo Done | ||
|
||
exit 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
ssp=$1 | ||
if [[ ${ssp} == "" ]]; then | ||
echo "You must provide an SSP number (e.g., 245)" >&2 | ||
exit 1 | ||
fi | ||
ssp_punctuation="$(echo ${ssp} | sed -E "s/(.)(.)(.)/\1-\2.\3/")" | ||
|
||
casedir="$HOME/cases_ctsm/test_cdeps_ssp-temperature" | ||
compset="SSP${ssp}_DATM%GSWP3v1_CLM51%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV" | ||
res="f10_f10_mg37" | ||
|
||
if [[ -d "${casedir}" ]]; then | ||
rm -r "${casedir}" | ||
fi | ||
|
||
cime/scripts/create_newcase --run-unsupported --case "${casedir}" --compset ${compset} --res ${res} \ | ||
--handle-preexisting-dirs r | ||
|
||
cd "${casedir}" | ||
./case.setup | ||
|
||
#echo "anomaly_forcing = 'Anomaly.Forcing.Temperature'" >> user_nl_datm | ||
echo "anomaly_forcing = 'Anomaly.Forcing.cmip5.rcp45'" >> user_nl_datm | ||
echo "flanduse_timeseries = '/glade/campaign/cesm/cesmdata/cseg/inputdata/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_10x15_SSP${ssp_punctuation}_78_CMIP6_1850-2100_c230517.nc'" >> user_nl_clm | ||
|
||
echo "Generating namelists..." | ||
./preview_namelists 1>/dev/null | ||
|
||
./xmlquery COMPSET | ||
grep "<file>" CaseDocs/datm.streams.xml | grep anomaly_forcing | grep '.tas.' | ||
|
||
exit 0 |
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.
This of course will need to change once we have a tag here.
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.
I did review the CDEPS PR as well, and have quite a few suggestions there.