Ed note: This issue was originally reported 25 May 2016 and is being manually ported over to GitHub.
here's an example of how I typically try to track a CESM compile+script error
back to its source. I use several augmented unix commands:
alias findfrag grep -iI !* `find . -type f`
alias findfile find . -name "!**" -print
ls_frag.csh (maybe there's a better Unix tool for this, but this does what I want):
#!/bin/csh
# Script to look for a fragment of a filename in the directory tree below
# the execution directory.
if ($#argv == 0) then
echo "Usage: ls_frag.csh frag_to_find #_levels_down_to_search"
exit
endif
set roo = '*'$1'*'
ls -d $roo
set lvl = 1
# :x keeps the *s from being expanded before they should be
while ($lvl <= $2)
set roo = '*/'$roo:x
ls -d $roo
@ lvl++
end
exit
The error I'll chase is
error #5082: Syntax error, found ',' when expecting one of:
( <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM>
<CHARACTER_CONSTANT> <INTEGER_CONSTANT> ...
block_size_x = , & ! size of block in first horiz dimension
ice_domain_size.F90 (line 52)
The error message tells me that block_size_x
is being assigned the value ' ',
which must be coming from a script. I go to the subroutine where that
statement lives, and I see that block_size_x
gets a value from environment variable BLCKX.
I use
to see that BLCKX is not assigned in the cice source code,
So I look next in the ice log file. Searching in there reveals that the program
was compiled without a BLCKX value being supplied:
...' -DBLCKX= -DBLCKY= '...
Then I look in the $CASEROOT directory for where BLCKX should be defined.
grep BLCKX *
env_build.xml: <entry id="CICE_BLCKX" value="">
So then I look in env_build.xml for why it's not set there.
It tells me that it shouldn't be set there if CICE_AUTO_DECOMP is TRUE, which it is.
So now the question is "why is CICE_AUTO_DECOMP not being used to set BLCKX?"
It's not anywhere in the CASEROOT directory, (using 'findfrag CICE_AUTO_DECOMP') so I go back to the source code, in the directories controlling building CICE.
It's not set in ...components/cice/...
so I go to .../cesm1_5_beta06/cime
and search in there.
The most promising result is in doc/usersguide/faq.xml
:
"The scripts that generate the decompositions are
$CASEROOT/Buildconf/generate_cice_decomp.pl. Those tools leverage
decompositions stored in xml files,
$CIMEROOT/../components/cice/bld/cice_decomp.xml"
Then I use findfile generate_cice_decomp.pl
to see that generate_....
doesn't exist in the Buildconf directory, so I search for it.
I don't find it, or anything with 'generate_cice' in the name
(ls_frag.csh generate_cice 4), so apparently the documentation is out of date.
This may be related to the switch from perl to python in cesm1_5_beta06.
At this point it would be reasonable to ask CSEG where to find the place where BLCKX
and CICE_AUTO_DECOMP are set. Look in the ChangeLog fileS for people to pester,
or submit a bugzilla issue.
Or I look in an older CESM, to see the contents of generate_cice_decomp.pl,
so that I can search in beta06 for something similar.
I find cesm1_5_beta03/components/cice/bld/generate_cice_decomp.pl
.
It is called by other scripts, so my interest shifts to those:
./bld/check_decomp.csh: set config = \
` ./generate_cice_decomp.pl -res $res[$grid] -nproc $tasks -thrds $thrd -output all`
./bld/configure: my $cice_decomp_gen = \
"$cesmroot/components/cice/bld/generate_cice_decomp.pl";
./cime_config/buildnml: my $config_args = \
`./generate_cice_decomp.pl -ccsmroot $SRCROOT -res $hgrid \
-nx $ICE_NX -ny $ICE_NY -nproc $ntasks -thrds $NTHRDS_ICE -output all `;
I suspect that bld/configure may be used in some kind of stand-alone context,
and cime is the environment I'm working in, so I pursue cime_config/buildnml first.
Where is that used? I don't find it in the beta03 tree, so I look in $CASEROOT.
Buildnml is called by preview_namelists for every component.
I confirm that the buildnml being used is the one I was looking for by tracking back
the CONFIG_ICE_... and find that
env_case.xml: <entry id="CONFIG_ICE_FILE"
value="/glade/scratch/bitz/darttest/cesm1_5_beta06c/components/cice/\
cime_config/config_component.xml">
So cime_config/buildnml is the one to focus on.
Case.build calls preview_namelists, and gets CONFIG_ICE_FILE from env_case.xml too.
Comparing cime_config/buildnml in beta03 and beta06 using xxdiff I see that
the lines defining BLCKX, etc. have been commented out in beta06.
So we know where the crime was committed, but not who did it, or why.
To track down who did it I look in cesm1_5_beta06/components/cice/docs/ChangeLog.
There are other ChangeLogs higher up in the directory tree, but this one tells me
Originator: dbailey
Date: 09 Mar 2016
One-line Summary: New CIME bld changes.
M cime_config/buildnml
Farther down is
Originator: klindsay
Date: 13 Nov, 2015
but that's older, and seems not directly related.
So I would start with Dave Bailey to as about why those lines are commented out.