-
Notifications
You must be signed in to change notification settings - Fork 150
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
cam-fv perfect_model_obs for CESM2_1 #233
Conversation
They're untested. setup_pmo > Modeled after setup_hybrid > May not use perfect_model.csh.template yet perfect_model.csh.template > Modeled after assimilate.csh.template setup_hybrid > Minor improvements stemming from creating setup_pmo assimilate.csh.template > Minor improvements stemming from creating perfect_model.csh.template
It prompted minor changes in other cam-fv scripts. Has passed a multiple cycle test using Observations/Synthetic/UVTRadiosonde_3456. Documentation has not been updated. models/cam-fv/shell_scripts/cesm2_1/setup_pmo > Script to set up a perfect_model case. Modeled after setup_advanced. > (But it has hi-res SST option, like setup_advanced). models/cam-fv/shell_scripts/cesm2_1/perfect_model.csh.template > Template to be transformed by DART_config into the script > called by CESM to harvest the perfect obs. > Modeled after assimilate.csh.template. models/cam-fv/shell_scripts/cesm2_1/DART_config.template > Updated to handle both assimilate.csh and perfect_model.csh. > Added a local variable DART_SCRIPT to be filled by setup_* > with the script name appropriate for this job models/cam-fv/shell_scripts/cesm2_1/assimilate.csh.template > Better, comments, placement of a few commands, and prints. models/cam-fv/shell_scripts/cesm2_1/setup_advanced, setup_hybrid, setup_advanced_Rean_2017 > Added substitution of your_dart_script to the transformation > of DART_config.template to accommodate the perfect_model upgrade. models/cam-fv/work/input.nml > Better name for the perfect_model output state file. > This is what's expecte4d by perfect_model.csh.
Hi Kevin, A couple of questions to clarify what we are reviewing here:
This is just a question for my own understanding ( not something to change for this pull request). The DART CESM scripts, e.g. assimilate.csh.template don't use ./xmlquery to find out machine-specific options, but do use xmlquery for other CESM options. Is this because DART will override some of the machine specific options, or xmlquery does give enough info, or something else? |
one more question, the latest release of CESM is 2.2.1. Do we need to worry about that? |
I wasn't planning to update documentation until we've settled on the code that I would document. The DART_config.template, assimilate.csh.template, setup_advanced are used for filter, Regarding xmlquery, the general answer is probably that we generally only import At some level we need to worry about keeping up with CESM's releases, I had a near death experience trying to get enough changes into the CESM |
|
||
# CESM uses C indexing on loops; cycle = [0,....,$DATA_ASSIMILATION_CYCLES - 1] | ||
# "Fix" that here, so the rest of the script isn't confusing. | ||
|
||
@ cycle = $2 + 1 | ||
|
||
cd ${CASEROOT} | ||
|
||
setenv scomp `./xmlquery COMP_ATM --value` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for xmlquery
This bit of the script uses xmlquery
@@ -98,6 +91,15 @@ else if ($?LSB_HOSTS) then | |||
|
|||
endif | |||
|
|||
if ($?JOBNAME) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for xmlquery (not critical for this review)
this bit (and above) is the machine specific stuff that does not use xmlquery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the sort of variable I mentioned that comes directly from the job environment,
instead of from the CESM environment.
The COMP_ATM variable is not machine specific. It describes the atmospheric component
that's specified in the CESM component set.
@@ -71,7 +71,8 @@ echo "===================" | |||
|
|||
setenv DARTROOT your_dart_path | |||
setenv DART_SCRIPTS_DIR $DARTROOT/models/cam-fv/shell_scripts/your_setup_script_dir | |||
echo "DART_SCRIPTS_DIR = $DART_SCRIPTS_DIR" | |||
setenv DART_SCRIPT your_dart_script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the 'your_dart_script' variable. Is this ever going to be something other than 'assimilate.csh' or 'no_assimilate.csh'? I'm missing what the added flexibility here is for, would someone have variations on assimilate.csh?
sed -e "s#your_dart_script#assimilate.csh#"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generalized this because perfect_model.csh is now one of the possibilities.
I can imagine people using variations of assimilate.csh, but that wasn't my goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok, so the flexibility of 'your_dart_script' is for assimilate.csh or perfect_model.csh
How much similarity do we want to have between I'm happy to take a run at reducing the nuisance differences and then leaving it to Kevin to see if there is anything more he'd like to borrow from one script for the others ... (like when/where to chmod 755 the DART_config) |
-------------- All: Better comments. Improvements from more testing. * This version is untested. -------------- models/cam-fv/shell_scripts/cesm2_1/ compress.csh Handle previously (de)compressed files. DART_config.template Replaced num_instances with CESM's NINST Fixed DART_SCRIPTS_DIR directory redundancy. Define CIMEROOT env variable with value from setup_ to enable xmlchange. Substitute job characteristics into directives in *compress.csh and launch_cf.sh. Updated 'next steps' instructions. assimilate.csh.template Make save_rest_freq handle day of the week (and every Nth day). Better purging of rh and h0 and stages_except_output files. Reduce unneeded listings of files, to save time. More selective hiding of files from the purging process. Only compress cpl history files if they exist. setup_* Made more consistent with each other, including CAM external forcing, which matches what was used in the Reanalysis. Sed more case descriptors into DART_config Added warning about absence of inflation restart file to stage_cesm_files (since they are restarts). ? Maybe that should be done in DART_config. setup_advanced Updated high res. SST file to the 2011-2020 version. Added some error numbers to exits. Added fix of docn.stream time labels after preview_namelists creates them. setup_hybrid Updated for (1 degree) CESM2_1. Added (missing) optional call to DART_config. setup_pmo Consolidated MultiInstanceRefcase into TRUTHinstance. Removed high resolution SST option (excessive for OSSEs). -------------- models/cam-fv/work/input.nml Replaced stage preassim with forecast, to provide uninflated members (the means are identical). Replaced inflation flavor with enhanced adaptive (5). Imported improvement to hlevel_edges to reflect no GPS obs below 200m which improves plot appearance. Changed several variables to values most often used in CAM assims.
setup_pmo setup_hybrid setup_advanced Updated resolution examples, and web site to find more. Replaced generic cesm2_1 cesmtag with one that has a SourceMods. Replaced 1 degree, monthly, SST file with one that extends through 2020 (actually part of 2021). Check whether start_year is withing the SST data file years. Print the git branch. More consistency between these 3 scripts. submit_compress.csh Compress.csh is usually called from assimilate.csh, but sometimes it's run as a separate job. launch_cf.sh Script to run shell script commands in parallel using the "command file" mechanism. Used by compress.csh
I've made the setup_{pmo,hybrid,advanced} scripts more consistent (@timhoar suggestion) @hkershaw-brown can say whether I've answered her questions about the various sources of script variables;
One thing that may need to be fixed before this is acceptable is the question about |
Merge branch 'main' into cam-fv_pmo
Notes: https://dart-documentation--233.org.readthedocs.build/en/233/models/CESM/doc/setup_guidelines.html warning on this page "developed in the context of DART’s Lanai release" Five
|
I haven't updated the documentation in this branch, so the reference to Lanai will (hopefully) disappear. My "setup_*" was misleadint. |
quick question, cesm2_1_relsd_m5.6 does not seem to exist as a tag or branch. I'm guessing I should use one of these tags: release-cesm2.1.0 |
Yes, the cesm version is a question I'm grappling with. You can also grab SourceMods from ~raeder/cesm2_1_relsd_m5.6/SourceMods. Ben has pointed out that the only supported version in that list is cesm2.1.3, |
# This script will delete an existing caseroot with the same name, | ||
# so this script and other things you want to preserve should be kept elsewhere. | ||
# dartroot Location of the root of _your_ DART installation. | ||
# cime_output $cime_root/$CASEROOT is the directory where CESM's build and run directories will be created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$cime_root/$CASEROOT does not match line 209
setenv cime_output /glade/scratch/${USER}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, that description is from an earlier version, which had the additional variable.
The comment should be
# cime_output $cime_output/$USER/$CASEROOT is the directory where CESM's build and run directories will be created.
'File status unknown' can be ignored. | ||
'ERROR: cice.buildlib failed' can be ignored, unless you've changed the CICE code | ||
|
||
2) cd ${RUNDIR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${RUNDIR}
does not seem to print the correct value:
Here is the output
CESM settings which are of special interest:
CONTINUE_RUN: FALSE
RESUBMIT_SETS_CONTINUE_RUN: TRUE
RESUBMIT: 0
RESUBMIT_SETS_CONTINUE_RUN: TRUE
RUN_REFCASE: cesm2_1_relsd_m5.6
RUN_REFDATE: 2016-12-10
RUN_REFDIR: /glade/work/raeder/Models/CAM_init/FV1deg_cesm2_1/2016-12-10-00000
RUN_REFTOD: 00000
RUN_STARTDATE: 2009-08-02
STOP_OPTION: nhours
STOP_N: 6
SSTICE_GRID_FILENAME: /glade/p/cesm/cseg/inputdata/share/domains/domain.ocn.fv0.9x1.25_gx1v7.151020.nc
SSTICE_YEAR_ALIGN: 1850
SSTICE_YEAR_END: 2021
SSTICE_YEAR_START: 1850
SSTICE_DATA_FILENAME: /glade/p/cesm/cseg/inputdata/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2020_c210521.nc
SSTICE_STREAM: CAMDATA
DOUT_S: FALSE
DOUT_S_SAVE_INTERIM_RESTART_FILES: FALSE
DOUT_S_ROOT: /glade/scratch/hkershaw/Kevin_test/Test0/archive
RUNDIR: /glade/scratch/hkershaw/Kevin_test/Test0/run
MPI_RUN_COMMAND: UNSET
AVGHIST_DATE: -999
AVGHIST_N: -999
AVGHIST_OPTION: never
DATA_ASSIMILATION: ['CPL:FALSE', 'ATM:FALSE', 'LND:FALSE', 'ICE:FALSE', 'OCN:FALSE', 'ROF:FALSE', 'GLC:FALSE', 'WAV:FALSE']
DATA_ASSIMILATION_CYCLES: 1
DATA_ASSIMILATION_SCRIPT:
-------------------------------------------------------------------------
Time to check the case.
1) Scan the output from this setup script for errors and warnings:
ERROR, WARNING, 'No such file' (except for MOSART)
'File status unknown' can be ignored.
'ERROR: cice.buildlib failed' can be ignored, unless you've changed the CICE code
2) cd /glade/scratch/hkershaw/Test0/run
Check the files that were staged; follow the links to confirm the data sources.
Check the compatibility between them and the namelists and pointer files.
3) cd /glade/work/hkershaw/Exp/Test0
Verify the CESM XML settings, especially in env_batch.xml and env_run.xml.
./xmlquery --partial <partial_string_of_interest>
is particularly useful.
Check the contents of the user_nl_{component}* files (e.g. do CAM's external
forcing files cover your time period)
4) The default initial configuration is to do no harvesting of observations.
as defined by the 'no_assimilate.csh' in the env_run.xml file.
When you are ready to harvest, change "no_assimilate" to "perfect_model"
and follow the instructions in
/glade/work/hkershaw/Exp/Test0/DART_config.
The rundir from cesm is /glade/scratch/hkershaw/Kevin_test/Test0/run
not /glade/scratch/hkershaw/Test0/run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. RUNDIR in setup_pmo is set (to CESM's default value)
before CESM's CIME_OUTPUT_ROOT is set to the value that you want (with Kevin_test in the name),
which the changes RUNDIR in CESM, but not in setup_pmo.
So the 'setenv RUNDIR' line should be moved to after the './xmlchange CIME_OUTPUT_ROOT' line:
./xmlchange CIME_OUTPUT_ROOT=${cime_output}
# Changing CIME_OUTPUT_ROOT changes RUNDIR in CESM, so change it here too.
setenv RUNDIR./xmlquery RUNDIR --value
I'll commit that change (and in setup_hybrid and setup_advanced).
# If you have modifications to CESM, they should be provided in a | ||
# CESM-structured SourceMods directory, which this script expects to be in | ||
# $user/$cesmtag/SourceMods. | ||
# sourcemods DART does not require a SourceMods directory in order to work with CESM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true?
# sourcemods DART does not require a SourceMods directory in order to work with CESM.
I thought we did need sourcemods?
Hi Kevin, I've only looked at the setup_pmo script. However, I think at some point the scripts could be made more user friendly. For example, I think it is only ~5/10 things a user needs to specify. Can these go in a script that gets sourced at the start of any setup_script?
I might be missing how much a user needs to edit the contents of setup_pmo or other setup scripts. For SourceMods, have the source mods in cesm_X_X scripts directory, and have the setup script copy the SourceMods to the correct location before? |
The "-" lines are what I intended to be in the script.
We've been keeping SourceMods separate from DART in an effort to follow the principle
The set of variables that need to be changed depends on the user's environment and goal.
CESM2.1.0 is a released version, but it's not "scientifically supported",
I think that may not be true for the initial setup on their machine
I actually did something like that for the Reanalysis experiment (I'm glad that we were thinking |
i haven't followed all the details here - but i do have a couple comments.
edit: don't use number sign 2 without escaping it, which i forget how to do. |
Based on the discussion here and in the software standup of 2021-8-19
Here's my rough description of the effort that will be required to implement those decisions.
|
Description:
There are no perfect_model scripts in cam-fv/shell_scripts/cesm2_1.
Some existing scripts which will interact with pmo scripts need updating to do that.
Fixes issue
#225
Types of changes
The last commit message lists the changed scripts and summarizes the changes.
Documentation changes needed?
Tests
The perfect model scripts in this PR have been used to set up and run a multicycle run
to harvest observations from CESM2_1:CAM6.
The test used /glade/p/cisl/dares/Observations/Synthetic/UVTRadiosonde_3456
Other details of the test are embedded in
/glade/work/raeder/Exp/Zagar_OSSE_pmo/setup_pmo.original
Checklist for merging
Testing Datasets