Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge drv_flds_in in driver from different components #324

Closed
ekluzek opened this issue Dec 3, 2015 · 2 comments
Closed

Merge drv_flds_in in driver from different components #324

ekluzek opened this issue Dec 3, 2015 · 2 comments

Comments

@ekluzek
Copy link

ekluzek commented Dec 3, 2015

This corresponds to the following bug in CLM:

http://bugs.cgd.ucar.edu/show_bug.cgi?id=2252

In order to make the system robust in dealing with drv_flds_in (which can be created by CAM or CLM) drv_flds_in needs to be deleted from the RUN directory if it exists before the calls to the component buildnml. As it works now, CLM leaves the previous version of the file in place and doesn't replace it even if user_nl_clm was changed appropriately. But, we can't have CLM clobber the file, in case CAM was the one that created it -- in that case we want CAM to override what CLM does.

There's also talk about converting the handling of drv_flds_in so that components only append to the end of it. But, in that paradigm deleting the file before components add to it makes the most sense, rather than leaving the previous incarnation of the file around. So this change works in both cases.

@ekluzek
Copy link
Author

ekluzek commented Dec 3, 2015

Here's what I have to fix this...

[yongi:~/cime/scripts/Tools] erik% git diff preview_namelists
diff --git a/scripts/Tools/preview_namelists b/scripts/Tools/preview_namelists
index 84b5b29..7e6bec6 100755
--- a/scripts/Tools/preview_namelists
+++ b/scripts/Tools/preview_namelists
@@ -170,6 +170,17 @@ my %dirs = ( atm => $CONFIG_ATM_DIR, lnd => $CONFIG_LND_DIR, ice => $CONFIG_IC
ocn => $CONFIG_OCN_DIR, glc => $CONFIG_GLC_DIR, wav => $CONFIG_WAV_DIR,
rof => $CONFIG_ROF_DIR, drv => $CONFIG_DRV_DIR );

+my $drvfldsnl = "${RUNDIR}/drv_flds_in";
+if ( -f $drvfldsnl ) {

  • system( "rm $drvfldsnl" );
  • if ($opts{loglevel} eq "DEBUG") {
  •  print "Remove $drvfldsnl\n";
    
  • }
  • if($? != 0){
  •   $logger->logdie("Removal of $drvfldsnl failed: $?");
    
  • }
    +}

foreach my $model (@modelsorder) {
my $comp = $models{$model};
my $file = "$dirs{$model}/buildnml";

@jedwards4b
Copy link

Erik,

If you are going to provide the fix wouldn't it be better to open a pull
request instead of or as well as an issue?

On Thu, Dec 3, 2015 at 11:31 AM, Erik Kluzek [email protected]
wrote:

Here's what I have to fix this...

[yongi:~/cime/scripts/Tools] erik% git diff preview_namelists
diff --git a/scripts/Tools/preview_namelists
b/scripts/Tools/preview_namelists
index 84b5b29..7e6bec6 100755
--- a/scripts/Tools/preview_namelists
+++ b/scripts/Tools/preview_namelists
@@ -170,6 +170,17 @@ my %dirs = ( atm => $CONFIG_ATM_DIR, lnd =>
$CONFIG_LND_DIR, ice => $CONFIG_IC
ocn => $CONFIG_OCN_DIR, glc => $CONFIG_GLC_DIR, wav => $CONFIG_WAV_DIR,
rof => $CONFIG_ROF_DIR, drv => $CONFIG_DRV_DIR );

+my $drvfldsnl = "${RUNDIR}/drv_flds_in";
+if ( -f $drvfldsnl ) {

  • system( "rm $drvfldsnl" );
  • if ($opts{loglevel} eq "DEBUG") {
  • print "Remove $drvfldsnl\n";
  • }
  • if($? != 0){
  • $logger->logdie("Removal of $drvfldsnl failed: $?");
  • } +} + foreach my $model (@modelsorder) { my $comp =
    $models{$model}; my $file = "$dirs{$model}/buildnml";


Reply to this email directly or view it on GitHub
#324 (comment)
.

Jim Edwards

CESM Software Engineer
National Center for Atmospheric Research
Boulder, CO

@billsacks billsacks added this to the cesm2 milestone May 18, 2016
@ekluzek ekluzek changed the title Remove drv_flds_in in preview_namelist before component buildnml are called Merge drv_flds_in in driver from different components May 18, 2016
@ekluzek ekluzek mentioned this issue Jun 8, 2016
jedwards4b pushed a commit to jedwards4b/cime that referenced this issue Aug 8, 2016
This merge updates the ACME template files to put the batch directives in
the proper location for other batch systems that haven't been added to
the ACME machines yet (such as moab).

Test suite:
Test baseline:
Test namelist changes:
Test status: [bit for bit, roundoff, climate changing]

User interface changes?:

Code review: douglasjacobsen

* wilke/template/directives:
  moved batchdirectives to top of the template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants