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 select a special region to run the CLM from the global model in CLM?

jteymoori

Javad Teymoori
Member
Hi
I am running the CLM model, but this model is global, and I want to select a special region ( the U.S.) for my case. How can I do it and select just this region from the global model?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I would recommend using subset_data which is available in tools/site_and_regional.
 

jteymoori

Javad Teymoori
Member
As I said I am working on CLM, and the tools/site_and_regional are in the CTSM not CLM.
in The CLM code, has a direction that includes " tools":
cd / glade/work/jteymoori/code_cesm/my_cesm_code/cime/tools
tools> : configure cprnc load_balancing_tool MakeRedsky.sh mapping Readme.configure statistical_ensemble_test utils ChangeLog_template config doc LICENSE.TXT scripts tools
It does not include site_and_regional

but in the CTSM it has a direction which is including " tools":
cd / glade/work/jteymoori/code_ctsm/CTSM/tools
tools> : contrib mkmapgrids mksurfdata_map ncl_scripts README.filecopies site_and_regional mkmapdata mkprocdata_map modify_input_files README README.testing

In this situation, must I first run the CTSM, select the specific region by site_and_regional, and finally link it to CLM?
If it is true, how do I do it?
 

jteymoori

Javad Teymoori
Member
As I said I am working on CLM, and the tools/site_and_regional are in the CTSM not CLM.
in The CLM code, has a direction that includes " tools":
cd / glade/work/jteymoori/code_cesm/my_cesm_code/cime/tools
tools> : configure cprnc load_balancing_tool MakeRedsky.sh mapping Readme.configure statistical_ensemble_test utils ChangeLog_template config doc LICENSE.TXT scripts tools
It does not include site_and_regional

but in the CTSM it has a direction which is including " tools":
cd / glade/work/jteymoori/code_ctsm/CTSM/tools
tools> : contrib mkmapgrids mksurfdata_map ncl_scripts README.filecopies site_and_regional mkmapdata mkprocdata_map modify_input_files README README.testing

In this situation, must I first run the CTSM, select the specific region by site_and_regional, and finally link it to CLM?
If it is true, how do I do it?
 

slevis

Moderator
I understand the confusion between CTSM and CLM. Yes, first run the tool that @oleson recommended to subset the global surface dataset. Then run the CLM with the new surface dataset.
 

jteymoori

Javad Teymoori
Member
Based on the instructions for using CTSM, I tried to make it using these scripts:

cd /glade/work/jteymoori
mkdir cases

git clone GitHub - ESCOMP/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM)
cd CTSM
./manage_externals/checkout_externals

cd / CTSM/cime/scripts
./create_newcase -case ~/cases --compset I2000Clm50BgcCropGs --res CLM_USRDAT --machine cheyenne --run-unsupported --project UCNN0040

But after running this last line script for create a case I faced this error:


Traceback (most recent call last):
File "./create_newcase", line 15, in <module>
from CIME.scripts.create_newcase import _main_func
File "/glade/work/jteymoori/CTSM/cime/CIME/scripts/create_newcase.py", line 179
f"The default is {srcroot_default}",
^
SyntaxError: invalid syntax
 

jteymoori

Javad Teymoori
Member
I loaded Python, and my problem with that part was solved.
After creating a case with the below script:
./create_newcase --case ~/cases/test1 --mach cheyenne --compset I2000Clm50Fates --res CLM_USRDAT --run-unsupported --project UCNN0040

And select the united states with the below scripts:
./subset_data region --lat1 24.5 --lat2 49.4 --lon1 235 --lon2 294 --reg united_states --create_domain True --create_surface True

when I want to set up my case with : ./case.setup in my case directory, I face this error:

/glade/work/jteymoori/cases/test1> ./case.setup
No such file or directory

If it is normal after creating the case, run this script to set it up. But it doesn't work for me.
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Part of the problem might be that you are specifying your case here: ~/cases/test1
but then you are running ./case.setup from here /glade/work/jteymoori/cases/test1
 

jteymoori

Javad Teymoori
Member
I want to select a region and make a model for that region. by running the below cod I faced an error:

git clone GitHub - ESCOMP/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM)
cd CTSM
./manage_externals/checkout_externals
cd /CTSM/cime/scripts
module load python
./create_newcase --case ~/cases --mach cheyenne style='font-size:9.0pt;mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:
"Courier New";color:#404040'>--res f09_g16 --compset I2000Clm50BgcCrop
--run-unsupported --project UCNN0040
Cd CTSM/tools/site_and_regional
pip install numpy
pip install xarray
./subset_data region --lat1 24.5 --lat2 49.4 --lon1 235 --lon2 294 --reg united_states --create_domain True --create_surface True

subset_data: error: unrecognized arguments: --create_domain True --create_surface True

How can I define and change the --create-surface , --create-landuse,--create-datm, --create-landuse?
 

jteymoori

Javad Teymoori
Member
in the below code by replacing the "_" with "-", I faced an error again:

./subset_data region --lat1 24.5 --lat2 49.4 --lon1 235 --lon2 294 --reg united_states --create-domain True --create-surface True

subset_data: error: unrecognized arguments: True True
 

slevis

Moderator
I think it may work if you remove the "True" and the "True"

For help using this tool, type:
./subset_data --help
 

jteymoori

Javad Teymoori
Member
I made a model and submitted my case based on the below code:
mkdir cases
git clone GitHub - ESCOMP/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM)
cd CTSM
./manage_externals/checkout_externals
cd /CTSM/cime/scripts
module load python
./create_newcase --case ~/case --mach cheyenne --res f09_g16 --compset I200Clm50BgcCrop --run-unsupported --project UCNN0040
cd CTSM/tools/site_and_regional
pip install numpy
pip install xarray
./subset_data region --lat1 24.5 --lat2 49.4 --lon1 235 --lon2 294 --reg united_states –-create-domain –-create-surface
cd cases
./case.setup
qcmd -- ./case.build
./case.submit

Now How Can I see the output of this model that I made as the map or .nc file or any other version?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
You will need to use the surface dataset you created by specifying it in your user_nl_clm in your case directory. I see you created a domain file but in recent versions of the model you need a mesh file, not a domain file. There is a --create-mesh option in subset_data but it doesn't appear to work. In that case then, I would follow the steps @slevis noted in the post above to create a regional mesh file and point the model to it.
@slevis , do you have anything to add here?

Your case seems to be named "cases", which is a bit odd, is that intentional? Regardless, your land history output would be here:

/glade/scratch/jteymoori/archive/cases/lnd/hist

Even though your (global) case ran successfully, you won't have any output there because you only ran 5 days. You need to run at least a month to get output by default.
 

jteymoori

Javad Teymoori
Member
Thank you for your response
Based on this tutorial by Sam Levis created (Setting up (high-res sparse) regional-grid CTSM simulations · ESCOMP/CTSM · Discussion #1919), I followed step-by-step Instructions for running regional CTSM-FATES at regular 1-degree resolution.
in step B I used these scripts for my work:
./subset_data region --lat1 24.5 --lat2 49.4 --lon1 235 --lon2 294 --reg united_states --create-surface
for next step (C) I used :
cd ctsm/tools/site_and_regional/subset_data_regional
1- module load nco
2- ncks --rgr infer --rgr scrip=scrip.nc <fsurdat_generated_in_B> foo.nc
but I faced an error because it needs to " <fsurdat_generated_in_B>"
what I should replaced with "<fsurdat_generated_in_B>"
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
The surface dataset you generated in B:
/glade/work/jteymoori/CTSM/tools/site_and_regional/subset_data_regional/surfdata_united_states_hist_16pfts_Irrig_CMIP6_simyr2000_c231004.nc
 

jteymoori

Javad Teymoori
Member
In the above instruction, I reached this step: Add this line to user_nl_clm:
fsurdat = ‘surfdata_united_states_hist_16pfts_Irrig_CMIP6_simyr2000_c231004.nc’
How can I add this line to user_nl_clm? By which scripts?
 
Top