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

Error mksurfdata.pl: could not find a data file for this resolution: 0.5x0.5 and type sectorWater and nomask.

sabin_taranu

Sabin
New Member
Hello!

I am working on adding sectoral water usage in CTSM.
There is some input data required for the development, so I followed all the instructions from tools/mksurfdata_map/README.developers.

But instead of putting the rawdata on /glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata (I don't have the rights), I placed it in my own storage: /glade/u/home/staranu/input_data/rawdata/mksrf_sectorWater_0.5x0.5_simyr2000.nc

As a result, when I try the command: ./mksurfdata.pl -r 0.9x1.25 -y 2000
I get the error:
ERROR: could NOT find a mksrf_fsectorWater data file for this resolution: 0.5x0.5 and type: sectorWater and nomask.
./../../bld/queryDefaultNamelist.pl -csmdata /glade/p/cesm/cseg/inputdata -silent -justvalue -namelist clmexp -options hgrid=0.5x0.5,lmask=nomask,mergeGIS=off,crop='on',sim_year=2000 -var mksrf_fsectorWater

I am sure that I indicated the right location in the bld/namelist_files/namelist_defaults_ctsm_tools.xml.

This can be checked following the command:
ncview /glade/p/cesm/cseg/inputdata/../../../../u/home/staranu/input_data/rawdata/mksrf_sectorWater_0.5x0.5_simyr2000.nc

where the "/glade/p/cesm/cseg/inputdata" correspond to the CSMDATA env variable and "../../../../u/home/staranu/input_data/rawdata/mksrf_sectorWater_0.5x0.5_simyr2000.nc" to the location I added in the namelist.

In order to reproduce the error, one can use:
git clone GitHub - TaranuDev/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM) CTSM_test_ST
cd CTSM_test_ST
git checkout read_input data
./manage_externals/checkout_externals
cd tools/mksurfdata_map/src
gmake
cd ..
./mksurfdata.pl -r 0.9x1.25 -y 2000

In addition to see all files I modified (assuming you are in CTSM_test_ST/):
grep -crl "sectorWater"

I hope I can get some suggestions on how to solve the issue.

Best regards,
Sabin
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I experimented with this a bit and changing the case on "Water" to lower case in all appropriate locations seemed to work, e.g., for mksurfdata.pl:

--- a/tools/mksurfdata_map/mksurfdata.pl
+++ b/tools/mksurfdata_map/mksurfdata.pl
@@ -345,7 +345,7 @@ sub write_namelist_file {
map_fsoitex = '$map->{'tex'}'
map_furbtopo = '$map->{'utp'}'
map_fgdp = '$map->{'gdp'}'
- map_fsectorWater = '$map->{'sectorWater'}'
+ map_fsectorwater = '$map->{'sectorwater'}'
map_fpeat = '$map->{'peat'}'
map_fsoildepth = '$map->{'soildepth'}'
map_fabm = '$map->{'abm'}'
@@ -359,7 +359,7 @@ sub write_namelist_file {
mksrf_fvocef = '$datfil->{'voc'}'
mksrf_furbtopo = '$datfil->{'utp'}'
mksrf_fgdp = '$datfil->{'gdp'}'
- mksrf_fsectorWater = '$datfil->{'sectorWater'}'
+ mksrf_fsectorwater = '$datfil->{'sectorwater'}'
mksrf_fpeat = '$datfil->{'peat'}'
mksrf_fsoildepth = '$datfil->{'soildepth'}'
mksrf_fabm = '$datfil->{'abm'}'
@@ -649,7 +649,7 @@ EOF
my $mkopts = "-csmdata $CSMDATA -silent -justvalue -namelist clmexp $usrnam";
my @typlist = ( "lak", "veg", "voc", "tex", "col", "hrv",
"fmx", "lai", "urb", "org", "glc", "glcregion", "utp", "wet",
- "gdp", "sectorWater", "peat","soildepth","abm");
+ "gdp", "sectorwater", "peat","soildepth","abm");


and similar changes to:

../../bld/namelist_files/namelist_defaults_ctsm_tools.xml
../../bld/namelist_files/namelist_definition_ctsm.xml

Some of the changes may not be strictly necessary, I didn't try to sort them all out. I'm not actually sure why the case is important, it sounds vaguely familiar though, perhaps @erik knows why.
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
Yes, @oleson is correct the variable names should be in lowercase. This is because namelist items follow FORTRAN naming standards and are case insensitive. So it converts namelist variables to lowercase. In above sectorWater is a key to a perl hash, so it can be mixed case -- it just needs to be internally consistent. But, yes I'd use lower case for all the uses mksrf_fsectorwater.
 
Top