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

Running CLM with transient historic CO2 in CESM_1_1_1

sra

New Member
I am trying to run a stand-alone case of CLM with datm (Qian data atmosphere) and including transient atmospheric CO2 data. There is documentation on how to do this in the CLM manual, but the documentation assumes a structure of the datm.buildnml file that is no longer valid (these files are now completely different in later CESM versions).
I am using the I_1850-2000_CN component set, adn I make these updates for CLM to take diagnostic CO2 from the atmosphere:# Set CCSM_BGC to CO2A so that CO2 will be passed from atmosphere to land
./xmlchange -file env_run.xml -id CCSM_BGC -val CO2A
# Set CLM_CO2_TYPE to diagnostic so that the land will use the value sent from the atmosphere
./xmlchange -file env_run.xml -id CLM_CO2_TYPE -val diagnostic

This automatically puts namelist updates in the user_nl_datm file to include updates for the CO2 data streams:
dtlimit = 1.5,1.5,1.5,1.5,1.5
 fillalgo = 'nn','nn','nn','nn','nn'
 fillmask = 'nomask','nomask','nomask','nomask','nomask'
 mapalgo = 'bilinear','bilinear','bilinear','bilinear','nn'
 mapmask = 'nomask','nomask','nomask','nomask','nomask'
 streams = "datm.streams.txt.CLM_QIAN.Solar 1 1954 2004  ", "datm.streams.txt.CLM_QIAN.Precip 1 1954 2004  ",
         "datm.streams.txt.CLM_QIAN.TPQW 1 1954 2004  ", "datm.streams.txt.presaero.clim_2000 1 1 1",
         "/glade/p/cesm/cseg/collections/cesm1_1_1/models/lnd/clm/doc/UsersGuide/co2_streams.txt 1 1954 2004  "
 taxmode = 'cycle','cycle','cycle','cycle','cycle'
 tintalgo = 'coszen','nearest','linear','linear','linear'
When I try to run, I get the following error:(shr_stream_init) ERROR: unexpected end-of-file while reading
(shr_stream_init)  error code = ^]^@^@^@
(shr_sys_abort) ERROR: (shr_stream_init) ERROR: unexpected end-of-file

I have tried including the co2_streams.txt file in the Buildconf/datmconf/ directory, and also tried copyng it to the name given in the old documentation ( ), and renaming the file in the streams field of the above namelist update. I have also tried copying the co2 streams file (and its alternatively named copy) directly to the run directory. I get the same error.Is there new docuementation available on adding CO2 with the updated file structure?Or has anyone successfully done this? It looks like it should be quite simple. I think the problem is finding out which filename the datm model is expecting for the co2 streams file - I have happy to copy the file manually for now if it has the correct name!Thanks for any help!
Steve.
 

sra

New Member
Sorry, the alternative name I tried for the CO2 streams file was datm.global1val.stream.CO2.txt, as given in the CLM documentation.
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
Hi Steve
The documentation has now been updated. So I'd refer to the latest documentation for cesm1.1. The error you show looks like it does read the file in -- it just has a problem with the file itself. Some problem with reading the field within the file.
 

slevis

Moderator
Staff member
I copied a case of mine that worked with transient co2 to our anonymous ftp site: ftp ftp.cgd.ucar.edulogin: anonymouspasswd: your email addresscd /pub/slevis/clm45bgc_1deg4506_histqian Same case is available to look at in my home directory on yellowstone. This particular case uses clm4.5, which was released a few weeks ago with the cesm1.2. The same model release includes the option of using clm4.0 and the same steps would be required to get the transient co2. Sam Levis
 

sra

New Member
Hi Both, Thanks for this. I was looking at the CESM 1 manual rather than CESM 1.1. I still couldn't get it to work with the manual instructions. Just for info, some of documentation seems incorrect (Page 120 of http://www.cesm.ucar.edu/models/cesm1.1/clm/models/lnd/clm/doc/UsersGuide/clm_ug.pdf): There is no file: datm.streams.txt.co2 under /glade/p/cesm/cseg/collections/cesm1_1_1/models/lnd/clm/doc/UsersGuide/There is only co2_streams.txt (I copied and renamed this and followed the instructions as given).Likewise, there is no file: addco2_user_nl_datm.user_nl under /glade/p/cesm/cseg/collections/cesm1_1_1/models/lnd/clm/doc/UsersGuide/ so I made the changes by hand to my user_nl_datm file as given in the user guide instructions. Is there still some issue here with the versions? i.e. is the file co2_streams.txt some older version with the incorect format, and does datm.streams.txt.co2 (which I don't have) have a different format that the model is expecting?I will take a look at Sam's job and see if I can figure out what is going on.
 

sra

New Member
Hi Sam, I have looked at your case, and I think I am now more confused!In your namelist you have: streams = "/glade/u/home/slevis/clm45sp_1deg4502_histqian/CaseDocs/datm.streams.txt.CLM_QIAN.Solar 1948 1948 2004",
         "/glade/u/home/slevis/clm45sp_1deg4502_histqian/CaseDocs/datm.streams.txt.CLM_QIAN.Precip 1948 1948 2004",
         "/glade/u/home/slevis/clm45sp_1deg4502_histqian/CaseDocs/datm.streams.txt.CLM_QIAN.TPQW 1948 1948 2004",
         "/glade/u/home/slevis/clm45sp_1deg4502_hist/CaseDocs/datm.streams.txt.presaero.rcp8.5 1849 1849 2104",
         "/glade/u/home/slevis/clm45sp_1deg4502_hist/CaseDocs/co2.streams.txt 1766 1766 2500"


But the CO2 streams file is not in /glade/u/home/slevis/clm45sp_1deg4502_hist/CaseDocs/ (the other 4 stream files are).
The same is true in your run directory:
/glade/scratch/slevis/clm45bgc_1deg4506_histqian/runSo, where is the streams info coming from for CO2?Also, in your log file (/glade/scratch/slevis/archive/clm45bgc_1deg4506_histqian/atm/logs/atm.log.130614-031023), it says:(shr_strdata_print)   streams ( 5) = /glade/u/home/slevis/clm45sp_1deg4502_hist/CaseDocs/co2.streams.txt 1766 1766 2500

Was the CO2 streams file in your CaseDocs at some stage and then removed? And if so, was it just the standard streams file from the UsersGuide directory? Or was it nver there but somehow the model has run??
 

sra

New Member
Sorry, ignore that... You are taking the streams files from a different case, I see now. I still thought a copy would appear in the run directory though.I am going to try my case with a link to your streams files instead. 
 

sra

New Member
Good news... It seems to be running when using Sam's stream file. It seems that there are differences in Sam's file compared to the one availabe under UsersGuide:diff /glade/u/home/slevis/clm45sp_1deg4502_hist/CaseDocs/co2.streams.txt     /glade/p/cesm/cseg/collections/cesm1_1_1/models/lnd/clm/doc/UsersGuide/co2_streams.txt-->>
>      
>       This is a streams file to pass historical CO2 from datm8 to the other
>       surface models. It reads in a historical dataset derived from data used
>       by CAM. The getco2_historical.ncl script in models/lnd/clm2/tools/ncl_scripts
>       was used to convert the CAM file to a streams compatible format (adding domain
>       information and making CO2 have latitude/longitude even if only for a single
>       point.
>      
>
>      
>         Input stream description file for historical CO2 reconstruction data
>
>         04 March 2010: Converted to form that can be used by datm8 by Erik Kluzek
>         18 December 2009: Prepared by B. Eaton using data provided by
>         Jean-Francois Lamarque. All variables except f11 are directly from
>         PRE2005_MIDYR_CONC.DAT. Data from 1765 to 2007 with 2006/2007 just
>         a repeat of 2005.
>      
13c32
             /fis/cgd/cseg/csm/inputdata/atm/datm7/CO2
16c35
             fco2_datm_1765-2007_c100614.nc
24c43
             /fis/cgd/cseg/csm/inputdata/atm/datm7/CO2
27c46
             fco2_datm_1765-2007_c100614.nc
29a49,50
>
> So, I guess the co2 streams file needs to be replaced in UsersGuide for cesm1_1_1 and the documentation checked for the filenames used. Thanks again for your help.Steve.
 
Top