Main menu

Navigation

user_nl_cam outside of $CASEROOT

8 posts / 0 new
Last post
wagmanbe@...
user_nl_cam outside of $CASEROOT

Hi,

Is there any way to make CAM5 sensitive to changes to "user_nl_cam" when "user_nl_cam" is located somewhere other than $CASEROOT or $RUNDIR? 

My setup is complicated: I am running multiple instances of CAM5 at once, with the same executable, the same $CASEROOT, and the same (cesm)$RUNDIR. I am not rebuilding between runs. At runtime, each cesm executable and runscript get copied into a directory and submitted from there. That's working, but I want each executable to read its own user_nl_cam file--preferably the one that I place in its local directory. That's not working. 

I'm trying to modify the $CASE.run script for each run, to point it to its own, local user_nl_cam file. But so far I've been unsuccessful, because it always reads the user_nl_cam file in $CASEROOT. Any suggestions? 

Sorry if that sounds like a headache. I assure you, it is. 

Thanks,

Benjamin Wagman

 

 

santos

There are probably a lot of references to $CASEROOT in various places, so I'm not surprised, though I'd have to think about this a bit. But I'm curious; why not use the multi-instance capability instead of copying the executable? What version of the model are you using? The scripts are very different between CESM 1.0 and 1.2 releases.

Sean Patrick Santos

CESM Software Engineering Group

wagmanbe@...

Thanks for your reply. I'm working on a wrapper that runs an ensemble in CESM 1.2.2. The multi-instance capability is pretty close to what I need, and I may try to modify that and use it. Because of the way the wrapper works I am hoping to create separate directories for each perturbed model run, otherwise the wrapper might get confused. Also, certain things, like the number of model runs in the ensemble, are not known ahead of time.

Ideally I'd be able to make perturbations to the namelist that would override whatever is in $CASEROOT, without going through a rebuild. I suppose it would be possible if the model could be tought to look in the local directory for user_nl_***, rather than in $CASEROOT. 

 

 

 

 

santos

Thinking about this again, the answer is actually more straightforward. user_nl_cam is not actually read by the model, but rather used by the scripts to generate atm_in, which is what the model actually reads.

You could modify atm_in directly, but you would have to be careful, and you'd have to disable namelist regeneration for each job, which could cause more problems, so I wouldn't do that. Instead what you really want to do is to modify Buildconf/cam.buildnml.csh, and change just the very bottom section where $CASEROOT and $CASEBUILD are being used immediately before and after the CAM build-namelist call. In particular, you want user_nl_cam to be read from $RUNDIR, and you want to avoid writing anything to $CASEBUILD or $CASEROOT, unless suffixed to avoid conflicting with the namelist build for other runs. I imagine that something similar would have to be done for any other component you wanted to change settings for, but with a little tweaking it should theoretically work.

This is all, of course, 100% unsupported and virtually guaranteed to change/break/explode in future versions, unless the multi-instance capability is expanded to cover your use case(s).

Sean Patrick Santos

CESM Software Engineering Group

hannay

If you do this, I suggest that you carefully check the atm_in AFTER the run starts to make sure you disabled the overwriting of atm_in.

Cecile

 

wagmanbe@...

Thank you both very much for your comments. Modifying cam.buildnml.csh has done the job. I've confirmed that the atm_in file in the case directory is not being overwritten, and it is altered to my liking in the perturbed directories. 

 

Benjamin Wagman

wagmanbe@...

Actually it seems that this didn't quite work as I'd hoped. Even though buildnml.csh is producing perturbed atm_in files in $CASEBUILD/camconf (which I'm then copying to the directory from which I actually run cesm.exe -- which is not the $RUNDIR but rather what I call $gendir), and even though I've changed the call to $CODEROOT/atm/cam/bld/build-namelist to point to the perturbed atm_in as its infile, CESM is still reading the original atm_in file in the $RUNDIR at runtime. I can tell because the model output is identical even though the atm_in files and the cesm_namelist files in the $gendir show perturbed physics. 

I'd prefer to leave the original atm_in in the $RUNDIR intact. Is there any way I can disble it from overriding my perturbed atm_in at runtime? 

Thanks! I realize this isn't regular usage of the model so any help I can get here is a bonus. For clarity, I've uploaded my altered cam.buildnml.csh. 

Benjamin Wagman

Attachment: 
wagmanbe@...

Update: Problem resolved.

 

Thank you,

Benjamin Wagman

Log in or register to post comments

Who's new

  • m.kliphuis@...
  • ddc3061993@...
  • hui.ding@...
  • zhouc@...
  • arianna.valmass...