cesm2 tutorial: basic modifications
TRANSCRIPT
CESM2Tutorial:BasicModifications
ChristineShieldsAugust15,2017
CESM2Tutorial:BasicModifications:Review
1. WewillusetheCESMcodelocatedlocallyonCheyenne,noneedtocheckoutordownloadanyinputdata.
2.Wewillrunwithresolutionf19_g17:(atm/lnd =FV1.9x2.5ocn/ice=gx1v7)
3. Defaultscriptswillautomatically beconfiguredforyouusingthecode/scriptbaseprepareduniquelyforthistutorial.
4. ForOn-siteTutorialONLY:Pleaseusecomputenodesforcompilingandloginnodesforallotherwork,includingsubmission.PleasedoNOTcompileunlessyouhaveacompilecard.Tomakethetutorialrunsmoothlyforall,weneedtoregulatethemodelcompiles.Whenyourunfromhome,youdon’tneedtocompileonthecomputenodes.
TutorialCodeandscriptbase:
/glade/p/cesm/tutorial/cesm2_0_alpha07c/
CESM2Tutorial:BasicModifications:Review
1. LogintoCheyenne2. Executecreate_newcase3. Executecase.setup4. Logontocomputenode(compile_node.csh)
5. Compilemodel(case.build)6. Exitcomputenode(type“exit”)7. Runmodel(case.submit)
ThistutorialcontainsstepbystepinstructionsapplicabletoCESM2(whichhasnotbeenofficiallyreleasedyet).
Documentation:Underconstruction!http://www.cesm.ucar.edu/models/cesm2.0/
QuickStartGuide:Underconstruction!http://cesm-development.github.io/cime/doc/build/html/index.html
Forolderreleases,pleaseseepasttutorials.
~/cases/b.day1.0 B1850f19_g17(FV 2deg coupled to gx1 ocean)
What is the casename ?
Which resolution?
CESM2Tutorial:BasicModifications:Review: Creatinganewcase
Which model configuration ?Which set of components ?
MCTDriver/
Mediator
RiverDROF
MOSARTMCT
LandIceCISMMCT
SeaIceDICECICE5MCTOceanDOCNPOP2MCT
WAVEDWAVWW3MCT
ESPDESPDARTMCT
ATMDATMCAM6
MCT LandDLNDCLM5
MCT
create_newcase --case ~/cases/b.day1.0 --res f19_g17 --compsetB1850
create_newcase --help (full list of arguments)
Other arguments you may need when you get home: --project < > (project number; this is not used by default and job would be charged to your default project number)
~/cases/b.day1.0 B1850f19_g17(FV 2deg coupled to gx1 ocean)
What is the casename ?
Which resolution?
CESM2Tutorial:BasicModifications:Review: Creatinganewcase
Which model configuration ?Which set of components ?
MCTDriver/
Mediator
RiverDROF
MOSARTMCT
LandIceCISMMCT
SeaIceDICECICE5MCTOceanDOCNPOP2MCT
WAVEDWAVWW3MCT
ESPDESPDARTMCT
ATMDATMCAM6
MCT LandDLNDCLM5
MCT
Documentation for CESM2 is UNDER CONSTRUCTION, This will CHANGE!
Grid naming conventionhttp://www.cesm.ucar.edu/models/cesm2.0/cesm/grids.html
CESM2Tutorial:BasicModifications:Review: Documentation
Documentation for CESM2 is UNDER CONSTRUCTION, This will CHANGE!Compset naming convention: http://www.cesm.ucar.edu/models/cesm2.0/cesm/compsets.html
B1850= 1850_CAM60_CLM50%BGC_CICE_POP2%ECO_MOSART_CISM2%NOEVOLVE_WW3_BGC%BDRD
CESM2Tutorial:BasicModifications:Review: Documentation
ComponentVersionMode/Physics
ATM = CAM6.0LND = CLM5.0ICE = CICE5OCN = POP2.0ROF = MOSARTWAV = Wave Watch3BGC = diagnostic
CESM2Tutorial:BasicModifications:Review: Creatinganewcase
EXERCISE.0: Createandconfigureanout-of-the-boxcase(setofscripts)called“b.day2.0”onCheyenneusingFV2degatm/lnd coupledto1degocean/iceandcompset B1850.Reviewstepsbutdonotbuildorrun.
1. Changedirectories,(“cd”)totutorialcodebasescriptsdirectory(onslide2).2. Viewcompset andgridchoices.Viewcreate_newcase helppage(hint:goto
webpageslistedinslides4,5and6).3. Createinitialscripts.(Wewillusethesame“cases”subdirectoryasday1).4. “cd”toyourcasedir.5. Setupyourcase.6. Exploreyourdirectories
CESM2Tutorial:BasicModifications:Review: Creatinganewcase
EXERCISE.0: Createandconfigureanout-of-the-boxcase(setofscripts)called“b.day2.0”oncheyenne usingf19_g17andcompset B1850.Reviewstepsbutdonotbuildorrun.
1. cd /glade/p/cesm/tutorial/cesm2_0_alpha07c/cime/scripts2. ./create_newcase --help(webpagescanbeviewedinbrowser)3. ./create_newcase --case~/cases/b.day2.0--resf19_g17--compset B18504.cd ~/cases/b.day2.05../case.setup6. Lookoverdocumentationgeneratedbyscripts7. Whatarethenextstepsifyouweretocompileandrun?
CESM2Tutorial:BasicModifications:Review: Creatinganewcase
EXERCISE.0: Createandconfigureanout-of-the-boxsetofscriptscalled“b.day2.0”oncheyenne usingFV1.9x2.5_gx1v7andcompset B1850.Reviewstepsbutdonotbuildorrun.
1. cd/glade/p/cesm/tutorial/cesm2_0_alpha07c/cime/scripts2. ./create_newcase --help(webpagescanbeviewedinbrowser)3. ./create_newcase --case~/cases/b.day2.0--resf19_g17--compset B18504.cd ~/cases/b.day2.05../case.setup6. Lookoverdocumentationgeneratedbyscripts7. ./case.build8. ./case.submit
CESM2Tutorial:BasicModifications:Review: QueuesandJobs
1. SubmittingCESM2jobs:Type./case.submit
2. Checkingjobs:Typeqstat -u<username>
3.Killingjobs:a.Typeqstat |grep<username> tofindyourJOBIDb. b.Typeqdel <JOBID>,example:qdel 1547261
Cheyenne
CESM2Tutorial:BasicModifications:Review: README
Inyourcasedirectory,inadditiontoyourscripts,youwillfindautomaticallygenerateddocumentationfiles.
1. README.case file:informationonyourcompset,grid,andphysicsmodes
2. CaseDocs/:namelist configurationsforyoucomponents(donotmodify)
3. software_environment.txt:softwareinformation4. CaseStatus:documentsyourxmlchange commands,builds,
submissions,andcompletions(includingerrors)withtimestamps.
README.case, we highly recommend YOU document any changes you make to the default scripts. It is YOUR paper trail and opportunity to list modifications.
Thecreate_clone utilitycreatesanEXACT copyofapreviouslycreatedcase.
Thecreate_clone utilityisveryhandywhentheuserwishestorunaslightlymodifiedversionofapreviousexperiment.
a.Invokecreate_clone tocreateanexactcopyofanoldcasebytypingthefollowingonthecommandline:
create_clone --case<newcase>--clone<casetoclone>
b.Implementdesiredmodificationsbeforebuildingandrunning.(Wewilllearnnumerouswaytomodifythescriptsduringthispresentation).
c.EditandDOCUMENTchangesinREADME.case
CESM2Tutorial:BasicModifications:create_clone
EditandDOCUMENTchangesinREADME.case.
OtherwiseyourREADME.case filewilllookexactlylikeyouroriginalcaseanditwillbemuchhardertobacktrackyourmethodswhentroubleshooting.
CAVEATSforCREATE_CLONE:youneedtouse….1)samemodeltag2)samemachine3)samecompset4)sameresolution5)samerun-type(slide25)
CESM2Tutorial:BasicModifications:create_clone
CESM2Tutorial:BasicModifications: Modelcontrolfiles
We control how we compile and run the model with env_*.xml files.
These files are created with create_newcase.
We modify env_run.xml according to our experimental design. We will practice this in the coming exercises.
We control what we ask of the model components with namelist files,user_nl_<model>.
These files are created after case.setup is invoked.
We modify the model component namelists according to our experimental design. We will practice some basic examples here, and more complex examples on Thursday.
CESM2Tutorial:BasicModifications:EditingMethods/Tools
Recommended:Whenmodifying“xml”files,theusermayalsousethetool,xmlchange.However,theuserisfreetouseher/hiseditorofchoice,i.e.
viemacs
1. Forhelp,type./xmlchange --help2. Example:Singlevariablemodification,original(long)method:
YouwanttomanuallyresubmittinganinitialcasethatpreviouslyhadaRESUBMITvalueof0,(i.e.youdidnotinitiallyresubmittherun).
Editenv_run.xmlviathexmlchange tool,type./xmlchange --fileenv_run.xml --idCONTINUE_RUN--val TRUE
CESM2Tutorial:BasicModifications:EditingMethods/Tools
Forhelp,typexmlchange --help
3. Example:Multiple(orlist)variablemodificationmethod:*:
Youmaywanttochangemorethanoneitematatime,ortousethisabbreviated“list”methodforasinglemodification.Tomanuallyresubmitthemodel,plustellthescriptstoautomaticallydothistwicemore…
a.Editenv_run.xmlviathexmlchange tool,type
./xmlchange CONTINUE_RUN=TRUE,RESUBMIT=2
*Noteformostcomponentnamelist variables,thesinglemodificationmethodisnecessary.
CESM2Tutorial:BasicModifications:EditingMethods/Tools
Forhelp,typexmlchange –help
4.Example:usingSubgroups
Forchangingvariablesinenv filesthathavemultipleinstances,werecommendyouusetheSubgroupfunctionalityinxmlchange tospecifywhichinstanceyouwanttochange.
TochangethedefaultWALLCLOCKtimefrom12hoursto1hourfortheshorttermarchiversubgroup,i.e.<groupid="case.st_archive">,typethefollowingonthecommandline:
./xmlchange --subgroupcase.st_archive JOB_WALLCLOCK_TIME=01:00:00
Namelist variablescanbechangedusing:
user_nl_<model> (e.g.user_nl_cam,user_nl_pop2,etc)
Foracompletelistofnamelists,pleaseseetheon-linedocumentationforeachcomponentmodel.(Moreonthislater)…
http://www.cesm.ucar.edu/models/cesm2.0/namelists/index.html
CESM2Tutorial:BasicModifications:Namelist variables
CESM2Tutorial:BasicModifications:Runtimevariables:env_run.xml
Runtimevariablescanbechangedinenv_run.xmlatanypointduringtherunandcontrolthemechanicsoftherun,i.e length,resbumits,andarchiving.
Commonvariablestochangeinclude
1.RESUBMIT à setsthenumberoftimestoresubmittherun
2.STOP_OPTIONà setstherunlengthtimeintervaltype,i.e.nmonths,ndays,nyears oraspecificdate
3.STOP_N à setsthenumberofintervals(setbySTOP_OPTION)torunthemodelduringthespecifiedwallclock time.Wallclock timeissetinyour*.runfileandisameasureoftheactualtime.
STOP_OPTIONandSTOP_Ncontrolthelengthoftherunpercomputerjobsubmission.Atypicalsimulationiscomprisedofmanyjobsubmissions.(Youcanonlystayinthecomputerqueueforaspecifiedtime.Thisqueuetimelimitisoftenshorterthanthedesiredsimulationlength.
CESM2Tutorial:BasicModifications:Runtimevariables:env_run.xml
1.RESUBMIT à setsthenumberoftimestoresubmittherun2.STOP_OPTIONà nmonths,ndays,nyears oraspecificdate3.STOP_N à setsthenumberofintervals(setbySTOP_OPTION)torun
Question:ThetutorialversionofFV~2deg_gx1CESMoncheyenne simulates~10 modelyearsperwallclock day.
Maximumwallclock requestis12hours.
Ifyouwanttorun100years,whatvaluesshouldbesetforSTOP_OPTION,STOP_N,andRESUBMIT?
CESM2Tutorial:BasicModifications:Runtimevariablesenv_run.xml
Question:Ifyouwanttorun100years,whatvaluesshouldbesetforSTOP_OPTION,STOP_N,andRESUBMIT?
Answer:Assume2jobssubmissionsperday,(212-hrjobs).Modelruns10yrs/day,so10/2=5 modelyearsperjobsubmission.
STOP_OPTION=nyears,STOP_N=5 ,RESUBMIT=19Initialrunof5yrs+(19resubmits*5 yearsperjob)=100years
CESM2Tutorial:BasicModifications:Runtimevariablesenv_run.xml
env_run.xmlcontinued…morecommonruntimevariablestochangeinclude
4.CONTINUE_RUNà ifTRUE,impliesaCONTINUErun.Note:ifRESUBMITis>0anditisaninitialrun(i.e.CONTINUE_RUN=FALSE),CONTINUE_RUNwillautomaticallyupdatetoTRUEuponcompletionofinitialrun.
5.INFO_DBUGà setslevelofstdout (standardout)printstatements.Ifdebugging,ahighervaluemaybeset.
6.DOUT_Sà turnsonshort-termarchiving.DOUT_SisTRUEbydefault.
7.HIST_OPTIONà coupler(”driver”)historyfilespecification.Note:Allothermodelcomponentsspecifyhistoryfileinformationwithinthemodelcomponentnamelists!
8.CCSM_CO2_PPMVà CO2 valuetobepropagatedtoPOPandCLM
CESM2Tutorial:BasicModifications:Run-TYPEvariables:env_run.xml
Run-typevariablesdefinetypeofrun(startup,hybrid)andphysicalcontrols(namelist parameters).Samplevariablesspecifiedinthisfileinclude:
1. RUN_TYPEà startup,hybrid,branch
2. RUN_REFCASEà ifbranch/hybrid,casenameyouarestartingfrom
3. RUN_REFDATEà if““,datestampofreferencecaseyouarestartingfrom
4. GET_REFCASEà default=FALSE;forTRUE,dataneedstobepre-stagedinexecutabledirectory(thisisdifferentfromCESM1).
CESM2Tutorial:BasicModifications:Run-TYPEvariablesenv_run.xml
CESMhasfour“types”ofruns:
STARTUP: Allmodelcomponentsareinitializedfrombasicdefaultinitialconditions.
HYBRID: - Theatmosphereisinitializedfrominitialconditionfilesgeneratedbyauser-specifiedCESMsimulation.
- Theland,oceanandiceareinitializedfromrestartfilesgeneratedbyauser-specifiedCESMsimulation.
- Nocouplerfileisneeded- Initialconditionsandrestartfilesusethesamereferencecaseandreferencedate.
BRANCH: Allmodelcomponentsareinitializedfromrestartfilesgeneratedbyauser-specifiedCESMsimulation.
CONTINUE: Continuationrunsforallruntypes.
CESM2Tutorial:BasicModifications:Run-TYPEvariables:BranchvsHybrid
Branchandhybridrunsareusefulif youhaveanexperimentwhichonlyslightlydiffersfromyourcontrol,butyouwanttomakeaslightmodification,addhistoryoutput,orstartyoursimulationfromaCESMspun-upinitialstate.
Useahybridrun: formostapplicationswhereyoudoNOTneedbitforbitrestart.YouCANspecifyanewstartdateforyourmodelrun.
Usebranchrun:onlyforapplicationswhichrequireexactrestart.YouCANNOTspecifyanewstartdateforyourmodelrun.Itwillbeassignedbythereferencecase(RUN_REFDATE). (Example,ifyouwanttochangethehistoryoutputstreammid-run,youwillneedtobranch).
CESM2Tutorial:BasicModifications:env_run.xml
EXERCISE.1: Createanewfullycoupledstartupcasefrom1850conditionsandincreasetheamountofstandardoutproducedbythemodel.Changethedefaultlocationforthelogfilestoadirectoryon/glade/scratch.Run1month.
1. fromscriptsdirectory,createyourcasescripts:./create_newcase --case~/cases/b.day2.1--resf19_g17--compset B1850
2. fromcasedirectory,changeyourruntimevariables:./xmlchange INFO_DBUG=2,STOP_N=1,STOP_OPTION=nmonths./xmlchange –-subgroup case.run JOB_QUEUE=R1578615 ß tutorial only
./xmlchange –-subgroup case.st_archive JOB_QUEUE=R1578615
./xmlchange JOB_WALLCLOCK_TIME=2:00:00
3.Inenv_run file,specifyanewlogdirectoryonyourscratchspace(warning:don’tcopyandpastehere,addyourusername.Also,cutandpastcharactersmaynottranslate).
./xmlchange --fileenv_run.xml --idLOGDIR--val “/glade/scratch/$LOGNAME/logs/b.day2.1”
Continuednextpage
CESM2Tutorial:BasicModifications:env_run.xml
EXERCISE.1continued:
4../case.setup5.ManuallyupdateyourREADME.case filetodocumentyourchanges(Hint:type“history”
onthecommandlineandyouwillseeallcommandlinemodificationsyouhavemade).6. /glade/p/cesm/tutorial/compile_node.csh (on-sitetutorialonly)tologontocompute
nodeforcompilation)7. ./case.build8. Exitcomputenode.9. Reviewcase.run forinformationalpurposes(normally,youdon’tneedtotouchthis).10../case.submit
Review log files to familiarize yourself with standard out. Start looking at your history files. Checkyour CaseDocs/*_in files. Were your changes applied?
CESM2Tutorial:BasicModifications:HOMEWORK
Setupnowbutdon’tsubmituntilthelast15minutesofclass!
Assumingyourb.day2.1exerciseransuccessfullyinclass….ContinueExercise1toproducetotalof38months.Youhavealreadyrun1month.Thiswillrunovernightinthecheyenne queues.YourdatawillbeusedforthePracticalSessiontomorrowonDiagnosticsandOutput.Inenv_run.xml:1. SetCONTINUE_RUN to “TRUE”2.KeepSTOP_OPTION setto “nmonths”3. SetSTOP_Nto“37”4. Set INFO_DBUGto 15. Changebacktotheregularqueue(oryourjobwillnotrunovernight)
./xmlchange –-subgroup case.run JOB_QUEUE=regular do NOT cut and paste
./xmlchange –-subgroup case.st_archive JOB_QUEUE=regular
./xmlchange JOB_WALLCLOCK_TIME=12:00:00
6.Submit(./case.submit)fromyourb.day2.1casedirectory
CESM1Tutorial:BasicModifications:Ex1:ExampleREADME.case
.
•Not all changes can be made in env_run.xml.
•user_nl_<model> files appear in the case directory after ./case.setup has been invoked), i.e.
user_nl_cam atmosphere
user_nl_cice sea ice
user_nl_cism land ice
user_nl_clm land
user_nl_cpl coupler (driver)
user_nl_mosart river runoff
user_nl_pop ocean
user_nl_ww wave (ocean)
CESM2Tutorial:BasicModifications:Namelist variables:user_nl_<model>
CESM2Tutorial:BasicModifications:Namelist tool:preview_namelists
•Insert namelist syntax for desired variable change into the appropriate file. To find the proper syntax and see all default namelist values, use preview_namelists to create the resolved namelists the model will use at runtime in your run directory (i.e. /glade/scratch/<user>/<case>/run/ ).
•In your case directory, type ./preview_namelists•cd to your run directory and view *_in files:
user_nl_cam modifies atm_inuser_nl_cice modifies ice_inuser_nl_cism modifies cism_inuser_nl_clm modifies lnd_inuser_nl_cpl modifies drv_inuser_nl_mosart modifies mosart_inuser_nl_pop modifies pop_inuser_nl_ww modifies wav_in
CESM2Tutorial:BasicModifications:Namelist tool:preview_namelists
Example: Decrease timestep in the ocean model by increasing dt_count from 24 steps per day to 48 steps per day.
1. Edit (vi or emacs) user_nl_pop
2. Insert correct syntax as a new line at the end of the comment section in the form of: namelist_var = new_namelist_value
i.e., dt_count = 48
3. Invoke preview_namelists again to verify change in your run directory and update the documentation pop_in file in CaseDocs.
Note: POP2 is now coupling every hour, rather than once per day (as in CESM1.2), so choice of dt_count is restricted to multiples of 24. CESM2 POP2 documentation is under construction, for syntax, see the CESM1.2 webpage, however, consult the bulletin board for further details on changing POP timestep.http://www.cesm.ucar.edu/models/cesm1.2/pop2/doc/faq/#nml_general_change_dt
CESM2Tutorial:BasicModifications:Exercise2
EXERCISE.2: BRANCH fromtheendofExercise1anddoubleCO2 foratmosphere,land,andocean.Doublemethanefortheatmosphere.Run1month.Restart1month.Checkyourresolvednamelists inyourrundirectory.
1. ./create_newcase --case~/cases/b.day2.2-resf19_g17--compset B1850
2. cd~/cases/b.day2.2
3. ./xmlchange RUN_TYPE=branch,RUN_REFCASE=b.day2.1,RUN_REFDATE=0001-02-01,STOP_OPTION=nmonths,STOP_N=1,RESUBMIT=1,CCSM_CO2_PPMV=569.4(Notes:nospacesbetweenarguments;CCSM_CO2_PPMVchangeslandandoceanonly)../xmlchange –-subgroup case.run JOB_QUEUE=R1578615 ß tutorial only./xmlchange –-subgroup case.st_archive JOB_QUEUE=R1578615./xmlchange JOB_WALLCLOCK_TIME=2:00:00
4../case.setup
5.Placeacopyyourrestartfilesfromyourbday2.1shorttermarchivespacetoyourbday2.2rundirectory.cp /glade/scratch/$LOGNAME/archive/b.day2.1/rest/0001-02-01-00000/*(space)/glade/scratch/$LOGNAME/b.day2.2/run/
Continuednextpage
CESM2Tutorial:BasicModifications:Exercise2
EXERCISE.2:continued
6. ./preview_namelists
7.CheckCaseDocs/atm_in forco2vmrsyntax(andseedefaultvalues).Cutandpastefromatm_in file,(ortype)intouser_nl_cam:
co2vmr =569.4e-6ch4vmr =1583.2e-9
8../preview_namelists(checkatm_in,lnd_in,andpop_intomakesureyourchangeswereimplemented)
9./glade/p/cesm/tutorial/compile_node.csh./case.buildexit
Continuednextpage
CESM2Tutorial:BasicModifications:Exercise2
EXERCISE.2:continued
10../case.submit
11. Reviewqueuesandlogfiles.Whereareyourlogsfiles(wherearethey)?Howfastdoesthefirstmonthrun(timingfilesareinthecasedirectoryandtherundirectory)?Wasthesecondmonthresubmitted?Whatisthevalueof“CONTINUE_RUN”initially?(Checkbeforethemodelfinishesthefirstmonth).Whatisthevalueafterresubmission?Readtheenv_run.xml documentationforexplanation!(Hint:see”RESUBMIT_SETS_CONTINUE_RUN”).
12.Afterthejobcompletes,gototheshorttermarchivespaceandexplore.
CESM2Tutorial:BasicModifications:env_run.xmlvs.user_nl_<model>
Whatmethodisbestforchanges?
env_run.xml:• Run_type specification(startup,hybrid,branch,continue)• Runtimevariables(stop_option,resubmits,etc.)• CO2changesforlandandocean
user_nl_<model>:• Swappingoutadefaultinputdata setforahome-growndataset• Namelist changesforcomponentmodels
CESM2Tutorial:BasicModifications:env_run.xmlvs.user_nl_<model>
Atruntime,thescriptswillautomaticallyre-populateyourresolvednamelistsbasedonenv_run andtheuser_nl_<model>files,however,itisalwaysgoodtodocumentandcheckyourchangesBEFOREruntime.
Alwayscheckyourresolved*_infiles(rundirectory,i.e./glade/scratch)tomakesureyourchangeshavebeenapplied.
CESM2Tutorial:BasicModifications:PhysicsTimeStepChanges
WhereandWhentoChangeTimeSteps
Whenthemodelcrashesduetolarge,temporaryinstabilities,onemethodtoovercometheproblemistochangethetimestep.
Thisistypicallydoneineithertheatmosphereoroceancomponents.
CAM/CLM:ATM_NCPLinenv_run.xml.
POP:dt_count inPOPnamelist.Editandchangetheuser_nl_pop file.
CESM2Tutorial:BasicModifications:PhysicsTimeStepChanges
1.CAM6timestepissetbyATM_NCPL inenv_run.xml andspecifiesthenumberofcouplingintervalsperdaybetweentheatmosphere/landandthecoupledsystem.BasedonATM_NCPL,thescriptswillautomaticallycomputethetimestepfortheatmosphereandland(DTIME)andpopulatethenamelist filesaccordingly.
2. CLM5timestep=CAM6timestep;thisisautomaticallysetwiththeCAMtimestepviaATM_NCPL.Youcannotsetthisseparately.
3. POP2timestepischangedintheuser_nl_pop fileandisbasedonOCN_NCPL(foundinenv_run.xml),“dt_count”,and“dt_option”.Thedefaultdt_option is“steps_per_day”.
4. CICE5timestepissetbythecouplingintervalvariableICE_NCPLfoundinenv_run.xml.NotethatICE_NCPL=ATM_NCL.
CESM2Tutorial:BasicModifications:MoreExercises
Exercise.3: HybridstartafullycoupledforPre-Industrialconditions.Usefilesfromspecifieddirectoryforyourreferencecase.Changeyourorbitalparameterstouseconditionfromthe1600ADandchangethephysicstimestepintheatmosphereandlandto1200seconds(defaultis1800).(Note:thisisanexerciseanddoesnotrepresentanyhistoricalperiod).Run5days(default).
1. ./create_newcase --case~/cases/b.day2.3--resf19_g17--compset B1850
2.cd~/cases/b.day2.3
3. ./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=b.day2.hybridstart,RUN_REFDATE=0002-01-01,ATM_NCPL=72(WhyisATM_NCPL=72,dothemath).
./xmlchange –-subgroup case.run JOB_QUEUE=R1578615ß tutorialonly
./xmlchange –-subgroup case.st_archive JOB_QUEUE=R1578615./xmlchange JOB_WALLCLOCK_TIME=2:00:00
4../case.setup
5.Placeacopyofthespecifiedrestartfilesfromyourbday2.1shorttermarchivespacetoyourbday2.2rundirectory.(Thesearefileswecreatedforyoutopracticeahybridstart).
cp /glade/scratch/shields/archive/b.day2.hybridstart/rest/0002-01-01-00000/*(space)/glade/scratch/$LOGNAME/b.day2.3/run/. Continuednextpage
CESM2Tutorial:BasicModifications:MoreExercises
Exercise.3:Continued:
6. ./preview_namelists(Whatisthedifferencebetweenthecamandclm initialfilesinthisExerciseversusthebranchfilesinExercise2?Hint:Checkncdata andcam_branch_file inatm_in andfinidat andnrevsn inlnd_in).
7.Edituser_nl_cpl,aftercomments,addline:orb_iyear=1600(Hint,checkdrv_in).UpdateREADME.case
8. Optional:./preview_namelists
9./glade/p/cesm/tutorial/compile_node.cshcase.buildexit
10. ./case.submit
11. Checklogsfiles.Thecouplerlogfileshouldconfirmyourorbitalchanges.
CESM2Tutorial:BasicModifications:MoreExercises
Exercise.4:ClonecasefromExercise.3.Insteadofspecifyingorbitalyear,assignindividualparameters(eccentricity=0,obliquity=23.,andprecession=0.)IncludenewmodificationtouseadifferentshortwaveabsorptionparameterizationinPOPcalled“jerlov”.(Thedefaultsw absorptionparameterizationisgeography-specificandcalled“chlorophyll”.“Jerlov”istypicallyusedforpaleoclimate simulationswherethegeographyisdifferentfrompresentday).TurnofftheUrbanparamterization inCLM.Run5days(default).
1../create_clone --case~/cases/b.day2.4--clone~/cases/b.day2.32.Edituser_nl_cpl andchangethefollowing:
a.Removeorb_iyearb.Addorb_mode =‘fixed_parameters’c.Addorb_eccen =0.d.Addorb_mvelp =0.e.Addorb_obliq =23.
3. ./xmlchange –-subgroup case.run JOB_QUEUE=R1578615ß tutorialonly./xmlchange –-subgroup case.st_archive JOB_QUEUE=R1578615./xmlchange JOB_WALLCLOCK_TIME=2:00:00
Continuednextpage
CESM2Tutorial:BasicModifications:MoreExercises
Exercise.4:continued
4.Edituser_nl_pop andadd:sw_absorption_type ='jerlov‘5.Edituser_nl_clm andadd:urban_hac =‘OFF’6.UpdateyourREADME.case filetodocumentyourchanges.7../case.setup8.cp /glade/scratch/shields/archive/b.day2.hybridstart/rest/0002-01-01-00000/*(space)/glade/scratch/$LOGNAME/b.day2.4/run/9../preview_namelists
Becauseyouclonedthiscaseyoualreadyhadyouruser_nl_<model>fileinyourcasecasedirectory,butyouhavechangedthemandthereforeneedtoinvokepreview_namelist toupdateyourCaseDocs.10.Logontocomputenode,then,.case.build, thenexitcomputenode.11../case.submit12.Ifyouwant,youcanstarttolookatthehistoryoutput.Onlytheocn willhavedailyoutputtoview,thedefaultismonthlyformostmodelcomponents.(Usencview).Tousencview,youwillneedtotype“moduleloadncview”onyourcommandline.Whereistheshorttermhistoryoutputlocated?Gobacktoearlierexercisestoexploremonthlyhistoryfiles.13.Compareb.day2.4ocn historydatatob.day2.3data.(Usencdiff).Tousencdiff,youwillneedtotype“moduleloadnco”onyourcommandline.
CESM2Tutorial:BasicModifications:MoreExercises
Exercise:Onyourown…
ContinueExercise.4(restart)butreducethesnowalbedoes intheicemodelbyhalf.(Thisisdoneinuser_nl_cice).Youdonotneedtorecompile.Usetherestartfilesthatarealreadyintherundirectory andrun5moredays.
Knowwhatyouarechanging.Lookupinformationonnamelist variablesinthedocumentation.https://ncar.github.io/CICE/doc/build/html/users_guide/ice_nml_var.html?highlight=snow%20albedo
BesuretoupdateyourREADME.case filetokeeptrackofyourchanges.Themodelwillrunregardlessofwhetherornotyourremembertoincludeallofyourchanges.Checkyourresolvednamelist files($RUNDIR/<model>_infiles)tomakesureallchangesareincluded.Ifyoulike,resubmitandcontinuetherunfor1moremonth,experimentwithothernamelist variableschanges,andcomparehistoryfiles.
CESM2Tutorial:BasicModifications:BottomLine
Whatuser-modifiedfilesareactuallyusedatruntime?./case.setup (or./preview_namelists) $RUNDIR/atm_in
$RUNDIR/lnd_in$RUNDIR/pop_in$RUNDIR/ice_in$RUNDIR/drv_in
BottomLine:Usermodificationsshouldbeimplementedintheenv_run.xmlortheuser_nl_<model>files.
Whatfilesarefordocumentationpurposes?Buildconf/*.input_data_list,software_environment.txtCaseDocs,CaseStatus,LockedFiles,README.case
Note:Buildconf/*confdirectoriesarecreatedaftercase.setup.TheuserdoesNOTneedtotouchthesefiles.
CESM2Tutorial:BasicModifications:env_batch.xml
Tofindyourtotalwallclock timeafterrunning,eitherchecktimingfileoryourstandardoutputfile(i.e,b.day2.run.onnnnnnn) inyourcasedirectory.
env_batch.xml is where you can change the CESM2 default values related to job batch submissions.
After the tutorial when you are running at your home institution, you may want to change the default queues, wallclock time, or control the project number after you have set up a case.
Wallclock time: <entry id="JOB_WALLCLOCK_TIME" value="12:00:00">note: use subgroup <group id="case.run">
Job queue: <entry id="JOB_QUEUE" value="regular">
Project number: <entry id="PROJECT" value="UESM0005">
CESM2Tutorial:BasicModifications:LogFiles
LogFiles:
Duringmodelexecution:Aftermodelcompletion:
atm.log.yyddmm-nnnnnn.gzlnd.log.yyddmm-nnnnnn.gzocn.log.yyddmm-nnnnnn.gzice.log.yyddmm-nnnnnn.gzcpl.log.yyddmm-nnnnnn.gzrof.log.yyddmm-nnnnnn.gzcesm.log.yyddmm-nnnnnn.gz
Model runtimestandardoutput
$RUNDIR/*$LOGDIR/*
Files aregzipped aftermodelcompletion.Restore bytypinggunzip <logfile>.
yyddmm =year,month,daynnnnnn =time idstamp
CESM2Tutorial:BasicModifications:OtherTips
CHECK yourresolvednamelists!• Beforeyousubmityourjob,itisalwaysgoodtodoublecheckyour
$RUNDIR/<model>_innamelist files.Thesearethefilesthemodelwillactuallyuseatruntimeandarebasedonyourenv_run.xmlanduser_nl_<model>files.
• Verifythatthemodelisusingwhatyouthinkitisusing!
DOCUMENT everythingyoudo!• Apapertrailofyourproceduresandthoughtsisgoodscientificpractice.
TheREADME.case fileistheperfectplacetowritenotes.Youwillthankyourselfmonths(years)later,whenyouaretryingtofigureoutwhatyoudidoh-so-longago!
CESM2Tutorial:BasicModifications:PostRunTips
Checklogs• Checkyourlogfilestomakesuretherearenohiddenproblemsandtoverifythemodelis
runningsmoothlyandasyouexpect.Thelogfilesmayalsohelpyouverifyyourmodificationswereincludedinyourrun.
Checkoutput• Checkyourhistoryfiles.Itisagoodideatorunasmalltestsampleofyourexperiment
beforelaunchingyourfullproductionrun.Forexample,ifyouwanttoruna500yearcontrolwithvariousmodifications,firstrun10years.Checkthehistoryoutputfilesandverifythemodelisrunningasyoudesignedbeforecontinuingwiththefull500years.Itisalwaysbesttofinderrorsearly,ratherthanlater,intherun.
Checktimings• Checkyourtimings.Aftermodelcompletion,atimingsubdirectorywillbeplacedinyour
scriptsdirectory.Checkthetimingsafterseveraljobcompletionstoverifythatthemodelisrunningefficientlyandasexpected.DoublecheckyourtimingswiththeCESMdefaulttimingsforyourspecificmodelresolutionandmachine.DefaulttimingsforCESM2canbefoundat:http://www.cesm.ucar.edu/models/cesm2.0/timing/index.html
CESM2Tutorial:BasicModifications:HELP!
FindingHelp…
1. Documentation:http://www.cesm.ucar.edu/models/cesm2.0/
2. DiscussCESM: http://bb.cgd.ucar.edu
CESM2Tutorial:BasicModifications
HaveFun!!!