Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ltarchive_updates
Browse files Browse the repository at this point in the history
Make sure the ltarchive_updates branch is up-to-date with the master.
  • Loading branch information
bertinia committed Nov 22, 2015
2 parents e99dda1 + c6c789f commit fddbba4
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 105 deletions.
6 changes: 3 additions & 3 deletions cime_config/cesm/machines/config_compilers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ for mct, etc.
<FIXEDFLAGS> -qsuffix=f=f -qfixed=132 </FIXEDFLAGS>
<FREEFLAGS> -qsuffix=f=f90:cpp=F90 </FREEFLAGS>
<FFLAGS> -g -qfullpath -qmaxmem=-1 </FFLAGS>
<ADD_FFLAGS DEBUG="FALSE"> -O2 -qstrict -Q </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="FALSE"> -O2 -qstrict -qinline=auto </ADD_FFLAGS>
<ADD_CFLAGS DEBUG="FALSE"> -O3 </ADD_CFLAGS>
<ADD_FFLAGS compile_threaded="true"> -qsmp=omp </ADD_FFLAGS>
<ADD_CFLAGS compile_threaded="true"> -qsmp=omp </ADD_CFLAGS>
Expand Down Expand Up @@ -598,7 +598,7 @@ for mct, etc.
<SCC> blrts_xlc </SCC>
<MPICC> blrts_xlc </MPICC>
<CFLAGS> -O3 -qstrict </CFLAGS>
<ADD_FFLAGS DEBUG="FALSE"> -O3 -qstrict -Q </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="FALSE"> -O3 -qstrict -qinline=auto </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="TRUE"> -qinitauto=FF911299 -qflttrap=ov:zero:inv:en </ADD_FFLAGS>
<MLIBS> -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts </MLIBS>
<ADD_CPPDEFS> -DLINUX -DnoI8 </ADD_CPPDEFS>
Expand All @@ -619,7 +619,7 @@ for mct, etc.

<compiler COMPILER="ibm" OS="BGQ">
<FFLAGS> -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush </FFLAGS>
<ADD_FFLAGS DEBUG="FALSE"> -O3 -qstrict -Q </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="FALSE"> -O3 -qstrict -qinline=auto </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="FALSE" compile_threaded="true"> -qsmp=omp </ADD_FFLAGS>
<ADD_FFLAGS DEBUG="TRUE" compile_threaded="true"> -qsmp=omp:noopt </ADD_FFLAGS>
<ADD_CPPDEFS> -DLINUX </ADD_CPPDEFS>
Expand Down
6 changes: 3 additions & 3 deletions cime_config/cesm/machines/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,10 @@
<command name="use">/global/project/projectdirs/ccsm1/modulefiles/cori</command>
</modules>
<modules compiler="intel" mpilib="!mpi-serial" >
<command name="load">esmf/6.3.0rp1-defio-intel2016-mpi-0</command>
<command name="load">esmf/6.3.0rp1-defio-intel2016-mpi-O</command>
</modules>
<modules compiler="intel" mpilib="mpi-serial" >
<command name="load">esmf/6.3.0rp1-defio-intel2016-mpiuni-0</command>
<command name="load">esmf/6.3.0rp1-defio-intel2016-mpiuni-O</command>
</modules>

<modules compiler="cray">
Expand Down Expand Up @@ -1139,7 +1139,7 @@
<BATCHQUERY>qstat</BATCHQUERY>
<BATCHSUBMIT>qsub</BATCHSUBMIT>
<BATCHREDIRECT></BATCHREDIRECT>
<SUPPORTED_BY> mickelso -at- mcs.anl.gov</SUPPORTED_BY>
<SUPPORTED_BY> cseg </SUPPORTED_BY>
<GMAKE_J>4</GMAKE_J>
<MAX_TASKS_PER_NODE>64</MAX_TASKS_PER_NODE>
<PES_PER_NODE>8</PES_PER_NODE>
Expand Down
8 changes: 4 additions & 4 deletions cime_config/cesm/machines/template.cesmrun
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ sub doPreRunChecks()
$logger->info(" - To prestage restarts, untar a restart.tar file into $config{'RUNDIR'}");

# Run preview namelists.. should turn this into a module at some point..
system("./preview_namelists -loglevel $opts{loglevel}");
system("./preview_namelists -loglevel $opts{loglevel} ");

if($?)
{
Expand Down Expand Up @@ -248,7 +248,7 @@ sub checkInputData()
$out.="expected location, and are not from the input data repository.\n";
$out.="This is informational only.\n";
$logger->warn($out);
system("./check_input_data -inputdata $config{'DIN_LOC_ROOT'} -check -loglevel $opts{loglevel}");
system("./check_input_data -inputdata $config{'DIN_LOC_ROOT'} -check -loglevel $opts{loglevel} ");
}

if(@missing)
Expand Down Expand Up @@ -446,7 +446,7 @@ sub postRun()
}

$logger->debug("lid: $LID");
foreach my $comp (qw(atm cpl ocn wav glc ice rof lnd)){
foreach my $comp (qw(atm cpl ocn wav glc ice rof lnd cesm)){
disposeLog($config{RUNDIR},$config{CASEROOT}, $comp ,$LID,$config{LOGDIR});
}
}
Expand Down Expand Up @@ -490,7 +490,7 @@ sub resubmitCheck()
my $submitscript = "$config{'CASEROOT'}/case.submit";
my $cwd = getcwd;
chdir $config{'CASEROOT'};
my $resubmitcommand = "$submitscript -resubmit -scriptname case. -loglevel $opts{loglevel}";
my $resubmitcommand = "$submitscript -resubmit -scriptname case.";

if(defined $config{TESTCASE} && $config{TESTCASE} eq "ERR"){
$resubmitcommand .= "test";
Expand Down
6 changes: 3 additions & 3 deletions cime_config/cesm/machines/template.st_archive
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Batch system directives
#------------------------------------------------------------------------------
{{ batchdirectives }}

use strict;
if(! -e "./xmlquery" and defined $ENV{'PBS_O_WORKDIR'})
{
chdir $ENV{'PBS_O_WORKDIR'};
Expand All @@ -21,7 +21,7 @@ require Batch::BatchUtils;
use Cwd;
require Log::Log4perl;

my $level = Log::Log4perl::Level::to_priority("DEBUG");
my $level = Log::Log4perl::Level::to_priority("INFO");
Log::Log4perl->easy_init({level=>$level,
layout=>'%m%n'});

Expand Down Expand Up @@ -63,7 +63,7 @@ sub resubmitCheck()
my $submitscript = "$config{'CASEROOT'}/case.submit";
my $cwd = getcwd;
chdir $config{CASEROOT};
my $resubmitcommand = "$submitscript -resubmit -scriptname case.st_archive -loglevel $opts{loglevel}";
my $resubmitcommand = "$submitscript -resubmit -scriptname case.st_archive";
$logger->debug( "running resubmit check $resubmitcommand");
if(-e $testlog){
open(TL,">>$testlog");
Expand Down
56 changes: 35 additions & 21 deletions driver_cpl/shr/seq_flds_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2051,8 +2051,7 @@ subroutine seq_flds_set(nmlfile, ID)
longname = 'Volumetric soil water'
stdname = 'soil_water'
units = 'm3/m3'
attname = trim(carma_fields)
call metadata_set(attname, longname, stdname, units)
call metadata_set(carma_fields, longname, stdname, units)
endif

!-----------------------------------------------------------------------------
Expand All @@ -2068,8 +2067,7 @@ subroutine seq_flds_set(nmlfile, ID)
longname = 'MEGAN emission fluxes'
stdname = 'megan_fluxes'
units = 'molecules/m2/sec'
attname = trim(megan_voc_fields)
call metadata_set(attname, longname, stdname, units)
call metadata_set(megan_voc_fields, longname, stdname, units)
endif

!-----------------------------------------------------------------------------
Expand All @@ -2085,16 +2083,15 @@ subroutine seq_flds_set(nmlfile, ID)
longname = 'wild fire emission fluxes'
stdname = 'fire_emis'
units = 'kg/m2/sec'
attname = trim(fire_emis_fields)
call metadata_set(attname, longname, stdname, units)
call metadata_set(fire_emis_fields, longname, stdname, units)

call seq_flds_add(l2x_states, trim(shr_fire_emis_ztop_token))
call seq_flds_add(x2a_states, trim(shr_fire_emis_ztop_token))
longname = 'wild fire plume height'
stdname = 'fire_plume_top'
units = 'm'
attname = trim(shr_fire_emis_ztop_token)
call metadata_set(attname, longname, stdname, units)

call metadata_set(shr_fire_emis_ztop_token, longname, stdname, units)

endif

Expand All @@ -2109,13 +2106,13 @@ subroutine seq_flds_set(nmlfile, ID)

call seq_drydep_readnl(nlfilename="drv_flds_in", ID=ID, seq_drydep_fields=seq_drydep_fields)
if ( lnd_drydep ) then
attname = trim(seq_drydep_fields)
call seq_flds_add(l2x_states, attname)
call seq_flds_add(x2a_states, attname)
longname = 'dry deposition velocities'
call seq_flds_add(l2x_states, seq_drydep_fields)
call seq_flds_add(x2a_states, seq_drydep_fields)

longname = 'dry deposition velocity'
stdname = 'drydep_vel'
units = 'cm/sec'
call metadata_set(attname, longname, stdname, units)
call metadata_set(seq_drydep_fields, longname, stdname, units)

endif
call seq_drydep_init( )
Expand Down Expand Up @@ -2368,7 +2365,8 @@ subroutine seq_flds_getField(outfield, nfld, cstring)
end subroutine seq_flds_getField

!===============================================================================

! If the attname passed in contains colons it is assumed to be a list of fields
! all of which have the same names and units
subroutine metadata_set(attname , longname, stdname , units )

! !USES:
Expand All @@ -2382,19 +2380,35 @@ subroutine metadata_set(attname , longname, stdname , units )

!EOP
character(len=*),parameter :: subname = '(seq_flds_metadata_set) '

integer :: i, j

i = index(attname,':')
j=1

do while(i>j .and. i<=len_trim(attname))
n_entries = n_entries + 1
lookup_entry(n_entries,1) = attname(j:i-1)
lookup_entry(n_entries,2) = trim(longname)
lookup_entry(n_entries,3) = trim(stdname )
lookup_entry(n_entries,4) = trim(units )
j=i+1
i = index(attname(j:),':') + j - 1
enddo
n_entries = n_entries + 1
if (n_entries > nmax) then
write(logunit,*)'n_entries= ',n_entries,' nmax = ',nmax,' attname= ',trim(attname)
call shr_sys_abort(subname//'ERROR: nmax fields in lookup_entry table exceeded')
end if

lookup_entry(n_entries,1) = trim(attname )
i = len_trim(attname)
lookup_entry(n_entries,1) = attname(j:i)
lookup_entry(n_entries,2) = trim(longname)
lookup_entry(n_entries,3) = trim(stdname )
lookup_entry(n_entries,4) = trim(units )




if (n_entries .ge. nmax) then
write(logunit,*)'n_entries= ',n_entries,' nmax = ',nmax,' attname= ',trim(attname)
call shr_sys_abort(subname//'ERROR: nmax fields in lookup_entry table exceeded')
end if

end subroutine metadata_set

!===============================================================================
Expand Down
2 changes: 1 addition & 1 deletion scripts/Tools/cs.status
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ sub getTestStatus
my $testxml = $parser->parse_file($testlist);
@xfailnodes = $testxml->findnodes("//entry");
foreach my $xfailnode (@xfailnodes) {
my @xfailchild_nodes = $xfailnode->childNodes();
my @xfailchild_nodes = $xfailnode->findnodes(".//");
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/Tools/xmlchange
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ foreach my $id ( keys(%idlist) )
# Do error checking for requested change
my $value = $node->getAttribute('value');
my($type, $valid_values, $is_list_value);
foreach my $childnode ($node->childNodes())
foreach my $childnode ($node->findnodes(".//*"))
{
if ($childnode->nodeName() eq 'type') {
$type = $childnode->textContent();
Expand Down
6 changes: 3 additions & 3 deletions scripts/create_test
Original file line number Diff line number Diff line change
Expand Up @@ -865,11 +865,11 @@ sub ExpandXmlList
foreach my $compset_elem (@compset_elems) {
my $compset_val = $compset_elem->getAttribute('name');

my @grid_elems = $compset_elem->childNodes();
my @grid_elems = $compset_elem->findnodes(".//grid");
foreach my $grid_elem (@grid_elems) {
my $grid_val = $grid_elem->getAttribute('name');

my @test_elems = $grid_elem->childNodes();
my @test_elems = $grid_elem->findnodes(".//test");
foreach my $test_elem (@test_elems) {
my $test_val = $test_elem->getAttribute('name');
if ($opts{'nlcompareonly'}) {
Expand All @@ -881,7 +881,7 @@ sub ExpandXmlList
}
}

my @mach_elems = $test_elem->childNodes();
my @mach_elems = $test_elem->findnodes(".//machine");
foreach my $mach_elem (@mach_elems) {
my $machine_val = $mach_elem->textContent();
my $testtype_val = $mach_elem->getAttribute('testtype');
Expand Down
2 changes: 1 addition & 1 deletion scripts/manage_case
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ sub _queryGrids
print " component grid: $name \n";
}
my $support; my $nx; my $ny; my $desc;
foreach my $child_node ($node->childNodes()) {
foreach my $child_node ($node->findnodes(".//*")) {
my $name = $child_node->nodeName();
my $value = $child_node->textContent();
if ($name eq 'support') {$support= $value;}
Expand Down
2 changes: 1 addition & 1 deletion scripts/manage_pes
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ sub formattedOutput {
}
foreach my $element ('ntasks','nthrds','rootpe') {
foreach my $node_ntasks ($pes_node->findnodes("./$element")) {
my @child_nodes = $node_ntasks->childNodes();
my @child_nodes = $node_ntasks->findnodes(".//");
foreach my $child_node (@child_nodes) {
my $name = $child_node->nodeName();
my $value = $child_node->textContent();
Expand Down
5 changes: 5 additions & 0 deletions utils/perl5lib/Batch/BatchMaker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ sub setQueue()
# Get the queue from env_batch.xml if its defined there
# otherwise get the default from config_machines.xml
# and set it in env_batch.xml
if(! defined $self->{envBatch}){
$logger->logdie("envBatch not defined");
}elsif(! defined $self->{job}){
$logger->logdie("job not defined");
}

my $queue = $self->{envBatch}{$self->{job}}{JOB_QUEUE};

Expand Down
31 changes: 16 additions & 15 deletions utils/perl5lib/Config/ConfigCase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,33 @@ sub add_config_variables
foreach my $node (@nodes)
{
my $id = $node->getAttribute('id');
foreach my $define_node ($node->childNodes())
foreach my $define_node ($node->findnodes(".//*"))
{
my $node_name = $define_node->nodeName();
#
# This creates a hash of values with attribute name and id as keys
#
if($node_name eq "values"){
foreach my $val_node ($define_node->childNodes()){
foreach my $val_node ($define_node->findnodes(".//value")){
if($val_node->hasAttributes()){
my @att = $val_node->attributes();
foreach my $attstr (@att){
$attstr =~ /(\w+)=\"(.*)\"/;
my $att = $1;
my $att_val = $2;
my $val = $val_node->textContent();
$val =~ s/\$MODEL/$model/;
$val =~ s/\$CIMEROOT/$cimeroot/;
if (-d $srcroot) {
$val =~ s/\$SRCROOT/$srcroot/;
}
$self->{$id}{$att}{$att_val} = $val;
my @att = $val_node->attributes();
foreach my $attstr (@att){
my $att = $attstr->nodeName();
my $att_val = $attstr->getValue();
my $val = $val_node->textContent();
$val =~ s/\$MODEL/$model/;
$val =~ s/\$CIMEROOT/$cimeroot/;
if (-d $srcroot) {
$val =~ s/\$SRCROOT/$srcroot/;
}
$self->{$id}{$att}{$att_val} = $val;
}
}
}
}

}else{
# we want to avoid the 'value' nodes which are children of 'values'
next if($node_name eq 'value' and $define_node->parentNode() ne $node);
my $node_value = $define_node->textContent();
if (defined $node_value) {
$node_value =~ s/\$MODEL/$model/;
Expand Down
16 changes: 5 additions & 11 deletions utils/perl5lib/Config/ConfigCompsetGrid.pm
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,9 @@ sub getCompsetLongname

$logger->logdie ("ERROR create_newcase: more than one match for compset alias $input_compset in file $file ");
} else {
my @name_nodes = $alias_nodes[0]->childNodes();
my @name_nodes = $alias_nodes[0]->findnodes(".//lname");
foreach my $name_node (@name_nodes) {
my $debug = $name_node->nodeName();
if ($name_node->nodeName() eq 'lname') {
$compset_longname = $name_node->textContent();
}
$compset_longname = $name_node->textContent();
}
}
$pes_setby = $node_file->getAttribute('component');
Expand All @@ -93,12 +90,9 @@ sub getCompsetLongname
if ($#lname_nodes > 0) {
die "ERROR create_newcase: more than one match for lname element in file $file \n";
} else {
my @name_nodes = $lname_nodes[0]->childNodes();
my @name_nodes = $lname_nodes[0]->findnodes(".//lname");
foreach my $name_node (@name_nodes) {
my $debug = $name_node->nodeName();
if ($name_node->nodeName() eq 'lname') {
$compset_longname = $name_node->textContent();
}
$compset_longname = $name_node->textContent();
}
}
$pes_setby = $node_file->getAttribute('component');
Expand Down Expand Up @@ -194,7 +188,7 @@ sub getGridLongname
}

# set the compset grid alias and longname
foreach my $node ($grid_node->childNodes()) {
foreach my $node ($grid_node->findnodes(".//*")) {
my $name = $node->nodeName();
my $value = $node->textContent();
if ($name eq 'lname') {$grid_longname = $node->textContent();}
Expand Down
2 changes: 1 addition & 1 deletion utils/perl5lib/Config/ConfigPes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ sub _setPESsettings

foreach my $pes (@pes_ntasks, @pes_nthrds, @pes_rootpe) {
next if($pes->nodeType == XML_COMMENT_NODE);
my @children = $pes ->childNodes();
my @children = $pes ->findnodes(".//*");
foreach my $child (@children) {
next if($child->nodeType == XML_COMMENT_NODE);
my $name = uc $child->nodeName();
Expand Down
Loading

0 comments on commit fddbba4

Please sign in to comment.