49
CESM1.2 Tutorial: Basic Modifica7ons Susan Bates Material from: Chris4ne A. Shields August 9, 2016

CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1.2Tutorial:BasicModifica7ons

SusanBatesMaterialfrom:Chris4neA.Shields

August9,2016

Page 2: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Review

1.  WewillusetheCESMcodelocatedlocallyonyellowstone,noneedtocheckoutordownloadanyinputdata.

2.Wewillrunwithresolu4onT31_gx3v7.3.  Defaultscriptswillautoma7callybeconfiguredforyouusingthecode/script

baseprepareduniquelyforthistutorial.

4.  Pleaselogintoyourassignedyellowstone(orcaldera/geyser)nodeanddoNOTcompileunlessyouhaveacompilecard.Tomakethetutorialrunsmoothlyforall,weneedtocontrolanddistributeallworkevenlyacrossyellowstone.

TutorialCodeandscriptbase:

/glade/p/cesm/tutorial/cesm1_2_2.tutorial

Page 3: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

Thistutorialcontainsstepbystepinstruc7onsapplicabletothecurrentrelease(cesm1.2)only.

Forolderreleases,pleaseseepasttutorials.Forinforma7onournextrelease,pleaseaHendtoJimEdwardspresenta7onWednesdayat1:05pm:“CESM2:Whattoexpect”

Page 4: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

create_newcase requires 4 arguments

create_newcase –case case01 –res T31_g37 -compset B_1850_CN -mach yellowstone

case01 yellowstone B_1850_CN T31_gx3v7

What is the casename ?

Which resolution?

Which model configuration ? Which set of components ?

Which machine are you running on?

CESM1Tutorial:BasicModifica7ons:Review:Crea7nganewcase

courtesy: c.hannay

Page 5: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

Grid naming convention Each model resolution can be specified by its alias, short name and long name. Example of equivalent alias, short name and long name: -  alias: T31_g37 (atm/lnd_ocn/ice) -  short name: T31_gx3v7 -  long name = a%T31_l%T31_oi%gx3v7_r%r05_m%gx3v7_g%null_w%null

atm lnd ocn/ice river lnd mask

lnd-ice wave

Compset naming convention Each model compset can be specified by its alias, short name and long name. Example of equivalent alias, short name and long name: -  alias: B1850CN -  short name: B_1850_CN -  long name = 1850_CAM4_CLM40%CN_CICE_POP2_RTM_SGLC_SWAV

Time Period Model Physics submode “S”=stub/inactive

courtesy: c.hannay

Page 6: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Review:Crea7nganewcase

EXERCISE.0:Logintoyourassignednode.(Haveyoucopiedthegeyser.csh/caldera.cshscripttoyourhomedirectory)?Createandconfigureanout-of-the-boxsetofscriptscalled“b.day2.0”onyellowstoneusingT31_gx3v7andcompsetB_1850_CN.Buildandrunthemodel.

Explana4onofsteps:1.  Changedirectories,(“cd”)totutorialcodebasescriptsdirectory.2.  Viewcompsetandgridchoices.(hint:use–listop4on)3.  Createini4alscripts.(Wewillusethesame“cases”subdirectoryasday1).4.  “cd”toyourcasedir.5.  Invokecesm_setup.6.  Buildthemodel.7.  Submita5-daytest.8.  “cd”toyourrun4medirectoryandexplore

Page 7: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Review:Crea7nganewcase

EXERCISE.0:Createandconfigureanout-of-the-boxsetofscriptscalled“b.day2.0”onyellowstoneusingT31_gx3v7andcompsetB_1850_CN.Buildthemodel.

1. cd/glade/p/cesm/tutorial/cesm1_2_2.tutorial/scripts2. ./create_newcase–listcompsets(and–listgrids)3. ./create_newcase-case~/cases/b.day2.0-resT31_gx3v7-mach

yellowstone-compsetB_1850_CN4.cd~/cases/b.day2.05../cesm_setup6.  ./b.day2.0.build7../b.day2.0.submit8.cd/glade/scratch/$LOGNAME/b.day2.09.Aberthejobcompletes,explorethe“4ming”subdirectoriesinbothyour

scratchspaceandinyourcasedirectory.Explorethe“logs”subdirectoryinyourcasedirectory.

Page 8: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Review:QueuesandJobs

1.  Submidngjobs:Type$CASE.submiti.e.b.day2.0.submit

2.  Checkingjobs:a.Typebjobsorb.Typebjobs-ualltoseeeveryone’sjobs,or

3.Killingjobs:a.FindyourJOBIDabertypingbjobsb.Typebkill<JOBID>

Yellowstone

Page 9: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Review:README

Inyourcasedirectory,inaddi4ontoyourscripts,youwillfindautoma4callygenerateddocumenta4onfiles.

1.   README.science_support:refersyoutotheon-line

documenta4on.2.   README.casefile:detailedinforma4ononyourcompsetand

grid,includingwhetheryourconfigura4onhassciencesupport.

SCIENCE_SUPPORT:NO

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.

Page 10: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

1.  Thecreate_cloneu4litycreatesanEXACTcopyofapreviouslycreatedcase.

2.  Thecreate_cloneu4lityisveryhandywhentheuserwishestorunaslightlymodifiedversionofapreviousexperiment.

a.Invokecreate_clonetocreateanexactcopyofanoldcasebytypingthefollowingonthecommandline:

create_clone-case<newcase>-clone<casetoclone>

b.Implementdesiredmodifica4onsbeforebuildingandrunning.(Wewilllearnnumerouswaytomodifythescriptsduringthispresenta4on).

c.EditandDOCUMENTchangesinREADME.case

CESM1Tutorial:BasicModifica7ons:Review:create_clone

Page 11: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

EditandDOCUMENTchangesinREADME.case.

OtherwiseyourREADME.casefilewilllookexactlylikeyouroriginalcaseanditwillbemuchhardertobacktrackyourmethodswhentroubleshoo4ng.

CAVEATSforCREATE_CLONE:youneedtouse….1)samemodeltag2)samemachine3)samecompset4)sameresolu7on5)samerun-type(slide20)

CESM1Tutorial:BasicModifica7ons:Review:create_clone

Page 12: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Pre“cesm-setup”files-rwxr-xr-x1shieldsncar15789Jun717:33archive_metadata.shdrwxr-xr-x2shieldsncar16384Jun2516:11Buildconf-rw-r--r--1shieldsncar162Jun2516:11CaseStatus-rwxr-xr-x1shieldsncar14495Jun717:33cesm_setup-rwxr-xr-x1shieldsncar837Jun717:33check_case-rwxr-xr-x1shieldsncar10126Jun717:33check_input_data-rwxr-xr-x1shieldsncar3672Jun717:33create_produc4on_test-rw-r--r--1shieldsncar10841Jun2516:11env_build.xml-rw-r--r--1shieldsncar4441Jun2516:11env_case.xml-rw-r--r--1shieldsncar6992Jun2516:11env_mach_pes.xml-rwxr-xr-x1shieldsncar2678Jun2516:11env_mach_specific-rw-r--r--1shieldsncar23069Jun2516:11env_run.xmldrwxr-xr-x2shieldsncar16384Jun2516:11LockedFiles-rwxr-xr-x1shieldsncar2127Jun2516:11preview_namelists-rw-r--r--1shieldsncar1630Jun2516:11README.case-rw-r--r--1shieldsncar380Jun2516:11README.science_supportdrwxr-xr-x11shieldsncar16384Jun2516:11SourceMods-rwxr-xr-x1shieldsncar13233Jun2516:11b.day2.1.build-rwxr-xr-x1shieldsncar1048Jun2516:11b.day2.1.clean_build-rwxrwxr-x1shieldsncar947Jun2516:11b.day2.1.l_archive-rwxr-xr-x1shieldsncar608Jun2516:11b.day2.1.submitdrwxr-xr-x3shieldsncar16384Jun2516:11Tools-rwxr-xr-x1shieldsncar12569Jun717:33xmlchange-rwxr-xr-x1shieldsncar10503Jun717:33xmlquery

ENV Files Tools Case Scripts Documentation Buildconf scripts (do not modify) SourceMods (day 4 of tutorial)

Page 13: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

drwxr-xr-x2shieldsncar16384Jun2516:18CaseDocs-rw-r--r--1shieldsncar9Jun2516:18hosaile-rw-r--r--1shieldsncar949Jun2516:18Macros-rwxr-xr-x1shieldsncar10287Jun2516:18b.day0.1.run

-rw-r--r--1shieldsncar115Jun2516:18user_nl_cam -rw-r--r--1shieldsncar367Jun2516:18user_nl_cice -rw-r--r--1shieldsncar1257Jun2516:18user_nl_clm -rw-r--r--1shieldsncar2284Jun2516:18user_nl_cpl -rw-r--r--1shieldsncar2949Jun2516:18user_nl_pop2 -rw-r--r--1shieldsncar573Jun2516:18user_nl_rtm

CESM1Tutorial:BasicModifica7ons:Post“cesm-setup”files

ENV Files Tools Case Scripts Documentation Buildconf scripts (do not modify) SourceMods (day 4 of tutorial) Namelist modifications

All case modifications are applied in env_run.xml or user_nl_<model>

Page 14: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Edi7ngMethods/Tools

Whenmodifyingfiles,theuserisfreetouseher/hiseditorofchoice,i.e. vi emacs

Whenmodifying“xml”files,theusermayalsousethetool,xmlchange.1.  Forhelp,typexmlchange-help2.   Example:Singlevariablemodifica7on,original(long)method:

Youwanttomanuallyresubmitanini4alcasethatpreviouslyhadaRESUBMITvalueof0,(i.e.youdidnotini4allyresubmittherun).

Editenv_run.xmlviathexmlchangetool,type./xmlchange-fileenv_run.xml-idCONTINUE_RUN-valTRUE

Page 15: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Edi7ngMethods/Tools

Forhelp,typexmlchange-help

3.   Example:Mul7ple(orlist)variablemodifica7onmethod:*:

Youmaywanttochangemorethanoneitemata4me,ortousethisabbreviated“list”methodforasinglemodifica4on.Tomanuallyresubmitthemodel,plustellthescriptstoautoma4callydothistwicemore…

a.Editenv_run.xmlviathexmlchangetool,type

./xmlchangeCONTINUE_RUN=TRUE,RESUBMIT=2*Noteformostcomponentnamelistvariables,thesinglemodifica4onmethodis

necessary.(moreonthislater).

Page 16: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Run7mevariables:env_run.xml

Run4mevariablescanbechangedinenv_run.xmlatanypointduringtherunandcontrolthemechanicsoftherun,i.elength,resubmits,andarchiving.

Commonvariablestochangeinclude

1.RESUBMITàsetsthenumberof4mestoresubmittherun

2.STOP_OPTIONàsetstherunlength4meintervaltype,i.e.nmonths,ndays,nyearsoraspecificdate

3.STOP_Nàsetsthenumberofintervals(setbySTOP_OPTION)torunthemodelduringthespecifiedwallclock4me.Wallclock4meissetinyour*.runfileandisameasureoftheactual4me.

STOP_OPTIONandSTOP_Ncontrolthelengthoftherunpercomputerjobsubmission.Atypicalsimula4oniscomprisedofmanyjobsubmissions.(Youcanonlystayinthecomputerqueueforaspecified4me.Thisqueue4melimitisobenshorterthanthedesiredsimula4onlength.

Page 17: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Run7mevariables:env_run.xml

1.RESUBMITàsetsthenumberof4mestoresubmittherun2.STOP_OPTIONànmonths,ndays,nyearsoraspecificdate3.STOP_Nàsetsthenumberofintervals(setbySTOP_OPTION)torun

Ques4on:ThespecialtutorialversionofT31_gx3v7CESMonyellowstone(runsonmul4plenodes)simulates~44modelyearsperwallclockday.

Maximumwallclockrequestsis12hours.

Ifyouwanttorun100years,whatvaluesshouldbesetforSTOP_OPTION,STOP_N,andRESUBMIT?

Page 18: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Run7mevariablesenv_run.xml

Ques4on:Ifyouwanttorun100years,whatvaluesshouldbesetforSTOP_OPTION,STOP_N,andRESUBMIT?Answer:Assume2jobssubmissionsperday,(212-hrjobs).Modelruns44yrs/day,so44/2=22modelyearsperjobsubmission.Ifwerounddownto20modelyrs/submissiontogiveourselvesabufferandhave

evennumbers….

STOP_OPTION=nyears,STOP_N=20,RESUBMIT=4Ini7alrunof20yrs+(4resubmits*20yearsperjob)=100years

Page 19: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Run7mevariablesenv_run.xml

env_run.xmlcon4nued…morecommonrun4mevariablestochangeinclude

4.CONTINUE_RUNàifTRUE,impliesaCONTINUErun.Note:ifRESUBMITis>0anditisanini4alrun(i.e.CONTINUE_RUN=FALSE),

CONTINUE_RUNwillautoma4callyupdatetoTRUEuponcomple4onofini4alrun.

5.INFO_DBUGàsetslevelofstdout(standardout)printstatements.Ifdebugging,ahighervaluemaybeset.

6.DOUT_Sàturnsonshort-termarchiving.DOUT_SisTRUEbydefault.

7.HIST_OPTIONàcouplerhistoryfilespecifica4on.Note:Allothermodelcomponentsspecifyhistoryfileinforma4onwithinthemodelcomponentnamelists!(Moreonnamelistsinafewslides).

Takesome4metoreviewallotherenv_run.xmlsedngs….

Page 20: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Run-typevariables:env_run.xml

Run-typevariablesdefinetypeofrun(startup,hybrid)andphysicalcontrols(namelistparameters).Samplevariablesspecifiedinthisfileinclude:

1.RUN_TYPEàstartup,hybrid,branch2.RUN_REFCASEàifbranch/hybrid,casenameyouarestar4ngfrom3.RUN_REFDATEàif““,datestampofreferencecaseyouarestar4ngfrom4.   GET_REFCASEàdefault=TRUE;automa4callyretrievesrefcaserestartdata;

assumesrefcaseisonHPSS

5.CCSM_CO2_PPMàCO2valuetobepropagatedtoCAMandCLM

6.CAM_NAMELIST_OPTSàCAMnamelistop4onsthatdifferfromdefaultvalues7.CLM_NAMELIST_OPTSàCLMnamelistop4onsthatdifferfromdefaultvalues8.CICE_NAMELIST_OPTSàCICEnamelistop4onsthatdifferfromdefaultvalues9.RTM_NAMELIST_OPTSàRTMnamelistop4onsthatdifferfromdefaultvalues

Page 21: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Run-typevariablesenv_run.xml

CESMhasfour“types”ofruns:

STARTUP: Allmodelcomponentsareini4alizedfrombasicdefaultini4al condi4ons.

HYBRID: -Theatmosphereandlandareini4alizedfromini4alcondi4on filesgeneratedbyauser-specifiedCESMsimula4on.

-Theoceanandiceareini4alizedfromrestartfilesgeneratedbya user-specifiedCESMsimula4on.

-Ini4alcondi4onsandrestartfilesusethesamereferencecase andreferencedate.

BRANCH: Allmodelcomponentsareini4alizedfromrestartfilesgenerated byauser-specifiedCESMsimula4on.

CONTINUE: Con4nua4onrunsforallruntypes.

DefaultT31_gx3v7casesusingcompsetB_1850_CN(INCLUDINGOURTUTORIAL)areHYBRIDrunsthatareini7alizedfromtheCESM1T31x31850Control.

Page 22: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Run-typevariables:BranchvsHybrid

Branchandhybridrunsareusefulifyouhaveanexperimentwhichonlyslightlydiffersfromyourcontrol,butyouwanttomakeaslightmodifica4on,addhistoryoutput,orstartyoursimula4onfromaCESMspun-upini4alstate.

YourdefaulttutorialexercisesstartasahybridrunfromtheCCSM4T31_gx3v7control1850simula4on.

Useahybridrun:formostapplica4onswhereyoudoNOTneedbitforbitrestart.YouCANspecifyanewstartdateforyourmodelrun.Usebranchrun:onlyforapplica4onswhichrequireexactrestart.YouCANNOTspecifyanewstartdateforyourmodelrun.Itwillbeassignedbythereferencecase(RUN_REFDATE).

Page 23: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

Namelistvariablescanbechangedusing:env_run.xmloruser_nl_<model>(e.g.user_nl_cam,user_nl_pop2,etc)

CAM,CLM,CICE,RTMnamelistvariablescanbechangedusingbothmethods.POP,CPLcanbeonlychangedusingtheuser_nl_<model>method.Foracompletelistofnamelists,pleaseseetheon-linedocumenta4onforeach

componentmodel.hxp://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/modelnl/modelnl.html

CESM1Tutorial:BasicModifica7ons:Namelistvariables

Page 24: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:env_run.xml

EXERCISE.1:Createanewfullycoupled(withCN)hybridcasefrom1850condi4ons,butdoubletheCO2valuesandturnontheicerunoffintheRTMmodel.Increasetheamountofstandardoutproducedbythemodelandchangethedefaultloca4onforthelogfilestoadirectoryon/glade/scratch.Run2months.

1.  fromscriptsdirectory,createyourcasescripts:./create_newcase-case~/cases/b.day2.1-resT31_gx3v7-machyellowstone-compsetB_1850_CN

2. fromcasedirectory,changeyourrun4mevariables:./xmlchangeINFO_DBUG=2,STOP_N=2,STOP_OPTION=nmonths

3. vi(oremacs)env_run.xmltochangeLOGDIRto/glade/scratch/$CCSMUSER/logs/$CASE,or

./xmlchange-fileenv_run.xml-idLOGDIR-val‘/glade/scratch/$CCSMUSER/logs/$CASE‘(notethatsinglequotespreventevalua4onofenvironmentvariables)

Con4nuednextpage

Page 25: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:env_run.xml

EXERCISE.1con7nued:

4.  Makeyourphysicsnamelistchanges:a.Usethelistmethod:./xmlchangeCCSM_CO2_PPMV=569.4b.Usetheoriginalmethod:./xmlchange-fileenv_run.xml-idRTM_NAMELIST_OPTS-valice_runoff=.true.

5.  ./cesm_setup

6.  ManuallyupdateyourREADME.casefiletodocumentyourchanges

7../b.day2.1.build

8. Reviewb.day2.1.run:a)#BSUB–PUESM0004yourprojectnumber

b)#BSUB–qsmallrequestedqueueNotethisisfortutorialpurposesONLY.

9../b.day2.1.submitReview logfiles to familiarizeyourselfwithstandardout.Start lookingatyourhistoryfiles.CheckyourCaseDocs/*_infiles.Wereyournamelistchangesapplied?

Page 26: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Ex1:ExampleREADME.case

.

Page 27: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:HOMEWORK

Beforeyouleavefortheday:Resubmitandcon7nuetorunExercise1for36moremonths.Thiswillrun

overnightintheyellowstonequeues.YourdatawillbeusedforthePrac4calSessiontomorrowonDiagnoshcsandOutput.Assumingyourb.day2.1exerciseransuccessfullyinclass….Inenv_run.xml: 1. SetCONTINUE_RUNto“TRUE” 2.KeepSTOP_OPTIONsetto“nmonths” 3.  SetSTOP_Nto“36” 4.  SetINFO_DBUGto15.  Commentout“#BSUB–UCESM_WS”lineinyourrunscript(b.day2.1.run).

(shouldlooklike“##BSUB-UCESM_WS”)Trytogetasmanyexercisesinthispresenta7oncompletedinclassBEFOREyougobackandsetupthiscon7nuerun.Note:Thereservednodesareforday-4meuseonly.Overnightjobscaneitherberunintheworkshopqueueorregularqueue.

Page 28: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

• Not all changes can be made in env_run.xml.

• user_nl_<model> files appear in the case directory after ./cesm_setup has been invoked), i.e.

user_nl_cam atmosphere

user_nl_clm land

user_nl_cice ice

user_nl_pop2 ocean

user_nl_cpl coupler (driver) user_nl_rtm river transport

CESM1Tutorial:BasicModifica7ons:Namelistvariables/tool:user_nl_<model>

CESM1Tutorial:BasicModifica7ons:Namelistvariables:user_nl_<model>

Page 29: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Namelisttool:preview_namelist

• Insert namelist syntax for desired variable change into the appropriate file. To find the proper syntax and see all default namelist values, use preview_namelist to create the resolved namelists the model will use at runtime in your run directory (i.e. /glade/scratch/<user>/<case>/run/ ). Note that cesm_setup automatically runs preview_namelist so if you have already run ./cesm_setup, you don’t need to do this again.

• In your case directory, type ./preview_namelists

• cd to your run directory and view *_in files:

user_nl_cam modifies atm_in user_nl_clm modifies lnd_in user_nl_cice modifies ice_in user_nl_pop2 modifies pop2_in user_nl_cpl modifies drv_in user_nl_rtm modifies rof_in

• Default namelist can also be reviewed in your CaseDocs subdirectory (found in your case directory after cesm_setup has been invoked).

Page 30: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Namelisttool:preview_namelist

Example: Decrease timestep in the ocean model by increasing dt_count from 12 steps per day to 23 steps per day. 1.  Edit (vi or emacs) user_nl_pop2 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 = 23

3.  Invoke preview_namelists again to verify change in your run directory and update

the documentation pop2_in file in CaseDocs.

http://www.cesm.ucar.edu/models/cesm1.2/pop2/doc/faq/#nml_general_change_dt

Page 31: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Exercise2

EXERCISE.2:BRANCHfromtheend(ofthesecondmonth)inExercise.1(nottheendofthehomework).TurnofficerunoffintheRTM(runoff)model,quadrupleCO2anddoublemethane.Run1month.Restartfor1month.Checkyourresolvednamelistsinyourrundirectory.

1../create_newcase-case~/cases/b.day2.2-resT31_gx3v7-machyellowstone-compsetB_1850_CN

2.cd~/cases/b.day2.2

3../xmlchangeRUN_TYPE=branch,RUN_REFCASE=b.day2.1,RUN_REFDATE=0001-03-01,GET_REFCASE=FALSE,STOP_OPTION=nmonths,STOP_N=1,RESUBMIT=1,CCSM_CO2_PPMV=1138.8(nospacesbetweenarguments).

WhydoweneedtosetGET_REFCASE=FALSE?

Con4nuednextpage

Page 32: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:Exercise2

EXERCISE.2:con7nued

4../xmlchange-fileenv_run.xml-idCAM_NAMELIST_OPTS-valch4vmr=1583.2e-95.  ./xmlchange-fileenv_run.xml-idRTM_NAMELIST_OPTS-valice_runoff=.false.

Whydoweusethesingle./xmlchangemethodhere?

6.  ./cesm_setup

7.  Copyyourrestartfilesfromyourbday2.1shorttermarchivespacetoyourbday2.2$RUNDIR:

cp/glade/scratch/<user>/archive/b.day2.1/rest/0001-03-01-00000/*/glade/scratch/<user>/b.day2.2/run/.

8../b.day2.2.build

9../b.day2.2.submit

10.Reviewqueuesandlogfiles.Howfastdoesthefirstmonthrun?Wasthesecondmonthresubmixed?

Page 33: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:env_run.xmlvs.user_nl_<model>

Whatmethodisbestfornamelistchanges?env_run.xml:•  Run_typespecifica4on(startup,hybrid,branch,con4nue)•  Run4mevariables(stop_op4on,resubmits,etc.)•  NamelistchangesforCAM,CLM,CICE,RTMbeforecesm_setupisinvoked

user_nl_<model>:•  Swappingoutadefaultinputdatasetforahome-growndataset•  NamelistchangesforPOPorCPL•  Namelistchangesappliedtoclonedscripts.

Page 34: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:env_run.xmlvs.user_nl_<model>

Atrun4me,thescriptswillautoma4callyre-populateyourresolvednamelists

basedonenv_runandtheuser_nl_<model>files,however,itisalwaysgoodtodocumentandcheckyourchangesBEFORErun4me.

Alwayscheckyourresolved*_infiles(rundirectory,i.e./glade/scratch)tomakesureyourchangeshavebeenapplied.

Page 35: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:TimeStepChanges

WhereandWhentoChangeTimeSteps

Whenthemodelcrashesduetolarge,temporaryinstabili4es,onemethodtoovercometheproblemistochangethe4mestep.

Thisistypicallydoneineithertheatmosphereoroceancomponents.

CAM/CLM:ATM_NCPLinenv_run.xml.

POP:dt_countinPOPnamelist.Editandchangetheuser_nl_popfile.

Page 36: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:TimeStepChanges

1.ATM_NCPLinenv_run.xmlspecifiesthenumberofcouplingintervalsperdaybetweentheatmosphere/landandthecoupledsystem.BasedonATM_NCPL,thescriptswillautoma4callycomputethe4mestepfortheatmosphereandland(DTIME)andpopulatethenamelistfilesaccordingly.

2.   CLM7mestep=CAM4mestep;thisisautoma4callysetwiththeCAM4mestepviaATM_NCPL.Youcannotsetthisseparately.

3.   RTM7mestep,4mestepisexplicitlydefinedandisnotrela4vetotheCLM4mestep.(DefaultRTM4mestepis3hours).

Page 37: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:MoreExercises

Exercise.3:Createnewcase,hybridstart,fullycoupledforPre-Industrialcondi4ons(withCN).Quadruplethespecifiedmethanetracegasvalueintheatmosphere,butdecreasethesolarconstantby0.1%,andsettheorbitalparametersto1600.(Note:thisisanexerciseanddoesnotrepresentanyhistoricalperiod).Run5days(default).Resubmitforanother5days.WhathappenstoCONTINUE_RUNinenv_run.xmlabercomple4onoftheini4al5dayrun(assumingyousetRESUBMIT=1)?

1../create_newcase-case~/cases/b.day2.3-resT31_gx3v7-machyellowstone-compsetB_1850_CN

2.cd~/cases/b.day2.33../xmlchangeRESUBMIT=14../xmlchange-fileenv_run.xml-idCAM_NAMELIST_OPTS

-valsolar_const=1359.53,ch4vmr=3166.40e-95../cesm_setup

Con4nuednextpage

Page 38: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:MoreExercises

Exercise.3:Con7nued:6.  Edituser_nl_cpl,abercomments,addline:orb_iyear=16007.  UpdateREADME.case8.  Op4onal:./preview_namelists9../b.day2.3.build

Checkyour$RUNDIRandreviewyournamelistchangesinatm_inanddrv_in

10.Reviewb.day2.3.run: Notequeue(small)andprojectnumber(UESM0004)arefortutorial

purposesONLY.Normally,youwillrunwithyourownprojectnumberintheregularqueue.

11. ./b.day2.3.submit

Aberthejobcompletes,gototheshorttermarchivespaceandexplore.

Page 39: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:MoreExercises

Exercise.4:ClonecasefromExercise.3.Includeallmodifica4onsfromExercise.3exceptinsteadofspecifyingorbitalyear,assignindividualparameters(eccentricity=0,obliquity=23.,andprecession=0.)Includenewmodifica4ontouseadifferentshortwaveabsorp4onparameteriza4oninPOPcalled“jerlov”.(Thedefaultswabsorp4onparameteriza4onisgeography-specificandcalled“chlorophyll”.“Jerlov”istypicallyusedforpaleoclimatesimula4onswherethegeographyisdifferentfrompresentday).TurnofftheUrbanparamteriza4oninCLM.Run5days(default).

1../create_clone-case~/cases/b.day2.4-clone~/cases/b.day2.32.Cleanupstderrandstdoutthatdon’tbelongtoyournewcase.3.Edituser_nl_cplandchangethefollowing:

a.Removeorb_iyearb.Addorb_mode=‘fixed_parameters’

c.Addorb_eccen=0.d.Addorb_mvelp=0.e.Addorb_obliq=23.

Con4nuednextpage

Page 40: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:MoreExercises

Exercise.4:con4nued

4.Edituser_nl_pop2andadd:sw_absorphon_type='jerlov‘

5.  Edituser_nl_clmandadd:urban_hac=‘OFF’

6.  Notethatinenv_run.xml,create_clonehasautoma4callysetCONTINUE_RUNbacktoFALSE,thisisanini4alrun.

7.UpdateyourREADME.casefile.Documentyourchanges

8../cesm_setupBecauseyouclonedthiscaseyoualreadyhadyouruser_nl_<model>fileinyourcase

casedirectory,butyouhavechangedthemandthereforeneedtoinvokecesm_setuporpreview_namelisttoupdateyourCaseDocs,createtheresolvednamelistsinyourrundirectory,andcreateyourrunscript.

Con4nuednextpage

Page 41: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:MoreExercises

Exercise.4:con4nued9../b.day2.4.build

10../b.day2.4.submit

11. Gooveralllogfilesand4mingfiles.Ifyouwant,youcanstarttolookatthehistoryoutput.Onlytheatm/ocnwillhavedailyoutputtoview.(ncview).Whereistheshorttermhistoryoutputlocated?Tousencview,youwillneedtotype“moduleloadncview”onyourcommandline.

12.Compareb.day2.4historydatatob.day2.3historydata.(ncdiff).Tousencdiff,youwillneedtotype“moduleloadnco”onyourcommandline.

13.Op7onal:ResubmitExercise.3andExercise.4for1monthtoobtainmonthlyhistoryfilesforallmodelcomponents.Whatwillyouneedtochange?

Page 42: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:MoreExercisesExercise.5:Onyourown…Doa“startup”run.Changetheatm/lnd4mestepto900seconds.(Defaultvalueis1800secondswithATM_NCPL=48).Run1month.Besureall4mestepsarecompa4ble.BesuretoupdateyourREADME.casefiletokeeptrackofyourchanges.Reviewlogstoverify4mestepchanges.

Exercise.6:Onyourown…BranchstartusingExercise.5restartfiles.IncludeallExercise5modifica4ons.ReducethesnowalbedoesoverseaiceinCICEbyhalf.Run1month.

Knowwhatyouarechanging.Lookupinforma4ononnamelistvariablesinthedocumenta4on.(hxp://www.cesm.ucar.edu/models/cesm1.2/cice/doc/index.html).BesuretoupdateyourREADME.casefiletokeeptrackofyourchanges.Themodelwillrunregardlessofwhetherornotyourremembertoincludeallofyourchanges.Checkyourresolved/processednamelistfiles($RUNDIR/<model>_infiles)tomakesureallchangesareincluded.Ifyoulike,resubmitandcon4nuetherunfor1moremonth.

Page 43: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:BoHomLine

Whatuser-modifiedfilesareactuallyusedatrun7me?./cesm_setup(or./preview_namelists) $RUNDIR/atm_in

$RUNDIR/lnd_in $RUNDIR/pop2_in $RUNDIR/ice_in $RUNDIR/drv_in

BoHomLine:Usermodifica7onsshouldbeimplementedintheenv_run.xmlortheuser_nl_<model>files.

Whatfilesarefordocumenta7onpurposes?Buildconf/*.input_data_listCaseDocs,CaseStatus,LockedFiles,README.*

Note:Buildconf/*confdirectoriesarecreatedabercesm_setup.TheuserdoesNOTneedtotouchthesefiles.

Page 44: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:RunScripts

Reviewrunscript:b.day2.x.runCommonBSUBcommandtochange:

#BSUB-qsmallqueuetype*#BSUB-ocesm.stdout.%J machinestandardout#BSUB-ecesm.stderr.%J machinestandarderror#BSUB–Jb.day2.x jobname#BSUB-W2:00 wallclock4merequested#BSUB-PUESM0004 projectnumber

Note:Maximumallowablewallclock4meperjobsubmissionvariesfrommachinetomachineandqueuetoqueue.Yellowstone(NCAR’sIBM)regularqueueis12hours.Submissionsreques4ngunderanhourtypicallyhaveshorterwait4mesinthequeue.

Page 45: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:LogFiles

LogFiles:Duringmodelexecu4on: Abermodelcomple4on: 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

Modelrun7mestandardoutput$RUNDIR/*$LOGDIR/*Filesaregzippedabermodelcomple4on.Restorebytypinggunzip<logfile>.yyddmm=year,month,daynnnnnn=4meidstamp

Page 46: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:OtherTips

CHECKyourresolvednamelists!•  Beforeyousubmityourjob,itisalwaysgoodtodoublecheckyour

$RUNDIR/<model>_innamelistfiles.Thesearethefilesthemodelwillactuallyuseatrun4meandarebasedonyourenv_run.xmlanduser_nl_<model>files.

•  Verifythatthemodelisusingwhatyouthinkitisusing!

DOCUMENTeverythingyoudo!•  Apapertrailofyourproceduresandthoughtsisgoodscien4ficprac4ce.

TheREADME.casefileistheperfectplacetowritenotes.Youwillthankyourselfmonths(years)later,whenyouaretryingtofigureoutwhatyoudidoh-so-longago!

Page 47: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:PostRunTips

Checklogs•  Checkyourlogfilestomakesuretherearenohiddenproblemsandtoverifythemodelis

runningsmoothlyandasyouexpect.Thelogfilesmayalsohelpyouverifyyourmodifica4onswereincludedinyourrun.

Checkoutput•  Checkyourhistoryfiles.Itisagoodideatorunasmalltestsampleofyourexperiment

beforelaunchingyourfullproduc4onrun.Forexample,ifyouwanttoruna500yearcontrolwithvariousmodifica4ons,firstrun10years.Checkthehistoryoutputfilesandverifythemodelisrunningasyoudesignedbeforecon4nuingwiththefull500years.Itisalwaysbesttofinderrorsearly,ratherthanlater,intherun.

Check7mings•  Checkyour4mings.Abermodelcomple4on,a4mingsubdirectorywillbeplacedinyour

scriptsdirectory.Checkthe4mingsaberseveraljobcomple4onstoverifythatthemodelisrunningefficientlyandasexpected.Doublecheckyour4mingswiththeCESMdefault4mingsforyourspecificmodelresolu4onandmachine.Default4mingsforCESM1.2canbefoundat:hxp://www.cesm.ucar.edu/models/cesm1.2/4ming/

Page 48: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons:HELP!

FindingHelp…1. Documenta4on:hxp://www.cesm.ucar.edu/models/cesm1.2/

2. DiscussCESM:hxp://bb.cgd.ucar.edu

Page 49: CESM1.2 Tutorial: Basic Modifica7ons · 2016-08-04 · CESM1 Tutorial: Basic Modifica7ons: Review 1. We will use the CESM code located locally on yellowstone, no need to checkout

CESM1Tutorial:BasicModifica7ons

HaveFun!!!