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

How to make the mode use downloaded CO2 data

Ambition_hhh

Ambition_hhh
New Member
./create_newcase --case HistClm50BgcCrop --res f09_g16 --compset IHistClm50BgcCrop --mach myintel --compiler intel --run-unsupported

I created this case, I want the model to use my own file download of co2 (cmip6 download rcp2.6 data)
/home/hlh/cesm/inputdata/atm/datm7/CO2/fgco2_Oyr_CanESM5_rcp26 - cmip5_r1i1p1f1_gn_2006 - 2100.nc

1. I changed it in the run_run.xml file:
<entry id="DATM_CO2_TSERIES" value="none">
<type>char</type>
<valid_values>none,20tr,20tr.latbnd,rcp2.6,rcp4.5,rcp6.0,rcp8.5</valid_values>
<desc>DATM CO2 time series</desc>
</entry>

2. I changed it in the run_run.xml file:
<entry id="DATM_CLMNCEP_YR_START" value="2006">
<type>integer</type>
<desc>starting year to loop data over</desc>
</entry>
<entry id="DATM_CLMNCEP_YR_END" value="2100">
<type>integer</type>
<desc>ending year to loop data over</desc>
</entry>

3. I changed it in the run_run.xml file:
<entry id="CLM_CO2_TYPE" value="diagnostic">
<type>char</type>
<valid_values>constant,diagnostic,prognostic</valid_values>

4. I added to the user_nl_datm file:
co2_type = 'diagnostic'
fgco2_file = '/home/hlh/cesm/inputdata/atm/datm7/CO2/fgco2_Oyr_CanESM5_rcp26-cmip6_r1i1p1f1_gn_2006-2100.nc'
/

But an error is reported:
hlh@hlh-desktop:~/clm5.0/cime/scripts/my_custom_co2_case$ ./case.build --skip-provenance-check
Building case in directory /home/hlh/clm5.0/cime/scripts/my_custom_co2_case
sharedlib_only is False
model_only is False
Setting resource.RLIMIT_STACK to -1 from (-1, -1)
Generating component namelists as part of build
Creating component namelists
Calling /home/hlh/clm5.0/cime/src/components/data_comps/datm/cime_config/buildnml
ERROR: Variable 'fgco2_file' from file '/home/hlh/clm5.0/cime/scripts/my_custom_co2_case/Buildconf/datmconf/namelist_infile' is not in the namelist definition.


I found that errors occurred when I added contents in the user_nl_datm file and the user_nl_clm file

How do I get the model to use my CO2 data

Thanks for your answer
 

slevis

Moderator
Staff member
For what you are trying to do, I recommend the following troubleshooting steps:
1) Confirm that your version of the model runs without any changes to the files or the code.
2) Confirm that the modified co2 file that you wish to use has the same format as the default one.
3) Now try replacing the default co2 file with yours, and hope that it works correctly.
 
Vote Upvote 0 Downvote

slevis

Moderator
Staff member
...but possibly before all that, the error message says that fgco2_file is not a valid namelist variable. You need to find out what it should be.
 
Vote Upvote 0 Downvote

Ambition_hhh

Ambition_hhh
New Member
你好

您使用的是哪个版本的 CESM?看起来您使用的是相当旧的版本。我建议您更新到较新的版本 - 社区地球系统模型 2 (CESM2) |社区地球系统模型

柯特妮
我的版本是 cesm2.2.0

可能是我刚开始,不知道怎么调试,能帮我解答一下吗?
...但可能在这一切之前,错误消息说 fgco2_file 不是有效的 namelist 变量。你需要找出它应该是什么。
I've tried a lot of names, but I don't understand what a namelist variable is.
 
Vote Upvote 0 Downvote

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Namelist variables are explained in the CESM tutorial:


I think your specific problem is related to the fact that you are using the namelist variable fgco2_file in your user_nl_datm file. That variable doesn't exist. For the historical case you've created, there should be a datm streams file in your CaseDocs directory called:

datm.streams.txt.co2tseries.20tr

Copy that to your case directory and prepend "user_" to the file name, e.g.,

cp CaseDocs/datm.streams.txt.co2tseries.20tr ./user_datm.streams.txt.co2tseries.20tr

and then change the file name as needed in user_datm.streams.txt.co2tseries.20tr.
Then run preview_namelists to see if you are pointing to your file.
 
Vote Upvote 0 Downvote

Ambition_hhh

Ambition_hhh
New Member
Namelist variables are explained in the CESM tutorial:


I think your specific problem is related to the fact that you are using the namelist variable fgco2_file in your user_nl_datm file. That variable doesn't exist. For the historical case you've created, there should be a datm streams file in your CaseDocs directory called:

datm.streams.txt.co2tseries.20tr

Copy that to your case directory and prepend "user_" to the file name, e.g.,

cp CaseDocs/datm.streams.txt.co2tseries.20tr ./user_datm.streams.txt.co2tseries.20tr

and then change the file name as needed in user_datm.streams.txt.co2tseries.20tr.
Then run preview_namelists to see if you are pointing to your file.
Was everything I did before this operation correct? I still report the same mistake
 
Vote Upvote 0 Downvote

Ambition_hhh

Ambition_hhh
New Member
After the create_newcase step, I would go directly to @oleson's instructions:
i'm sorry, I still report the same mistake
 
Vote Upvote 0 Downvote

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Are you still referring to this error:

ERROR: Variable 'fgco2_file' from file '/home/hlh/clm5.0/cime/scripts/my_custom_co2_case/Buildconf/datmconf/namelist_infile' is not in the namelist definition.

Please attach your user_datm.streams.txt.co2tseries.20tr
 
Vote Upvote 0 Downvote
Top