Case Build#
After a new case is setup, the tool that builds the new case by compiling the code is case.build
. This tool is located in the $CASEROOT
directory.
Running this script results in the following actions:
Checks and creates final component namelists
Builds individual model component libraries
Builds the final CESM model executable
Figure: Detailed view of the location of case.build
For the current tutorial on derecho, the paths are:
$SRCROOT
=/glade/u/home/$USER/code/my_cesm_code
$CASEROOT
=/glade/u/home/$USER/cases/$CASE
$EXEROOT
=/glade/derecho/scratch/$USER/$CASE/bld
$RUNDIR
=/glade/derecho/scratch/$USER/$CASE/run
Command Syntax#
You should still be in the CASEROOT
directory after running case.setup
cd /glade/u/home/$USER/cases/CASE
Example case.build
command:
qcmd -- ./case.build
NOTE: Do not enter the example above at the command line. You will create your first case in the Exercise at the end of this section.
Click here for example output
Building case in directory /glade/u/home/$USER/cases/b1850.basics
sharedlib_only is False
model_only is False
Generating component namelists as part of build
- Prestaging REFCASE (/glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01) to /glade/derecho/scratch/$USER/b1850.basics/run
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.ocn.restart
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.ice
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.lnd
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.rof
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.atm
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.ocn.tavg.5
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.glc
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.ocn.ovf
Copy rpointer /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/rpointer.drv
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.pop.ro.0301-01-01-00000
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.mosart.r.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cpl.r.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.pop.r.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cam.r.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cice.r.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cam.rs.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.clm2.r.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cam.i.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.cism.r.0301-01-01-00000.nc
Staging file /glade/campaign/cesm/cesmdata/inputdata/cesm2_init/b.e20.B1850.f19_g17.release_cesm2_1_0.020/0301-01-01/b.e20.B1850.f19_g17.release_cesm2_1_0.020.ww3.r.0301-01-01-00000
Creating component namelists
Calling /glade/u/home/$USER/my_cesm_code/components/cam//cime_config/buildnml
...calling cam buildcpp to set build time options
CAM namelist copy: file1 /glade/u/home/$USER/cases/b1850.basics/Buildconf/camconf/atm_in file2 /glade/derecho/scratch/$USER/b1850.basics/run/atm_in
Calling /glade/u/home/$USER/my_cesm_code/components/clm//cime_config/buildnml
Calling /glade/u/home/$USER/my_cesm_code/components/cice//cime_config/buildnml
...buildnml calling cice buildcpp to set build time options
Calling /glade/u/home/$USER/my_cesm_code/components/pop//cime_config/buildnml
... buildnml: calling pop buildcpp to set build time options
given is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2666.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2667.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2668.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2675.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2676.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2677.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2678.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2679.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2680.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2681.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2682.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2683.
when is deprecated at /glade/u/home/$USER/my_cesm_code/components/pop/bld/build-namelist line 2684.
Calling /glade/u/home/$USER/my_cesm_code/components/mosart//cime_config/buildnml
Running /glade/u/home/$USER/my_cesm_code/components/cism//cime_config/buildnml
Calling /glade/u/home/$USER/my_cesm_code/components/ww3//cime_config/buildnml
Calling /glade/u/home/$USER/my_cesm_code/cime/src/components/stub_comps/sesp/cime_config/buildnml
Calling /glade/u/home/$USER/my_cesm_code/cime/src/drivers/mct/cime_config/buildnml
Finished creating component namelists
Building gptl with output to file /glade/derecho/scratch/$USER/b1850.basics/bld/gptl.bldlog.240606-134217
Calling /glade/u/home/$USER/my_cesm_code/cime/src/build_scripts/buildlib.gptl
Component gptl build complete with 2 warnings
Building mct with output to file /glade/derecho/scratch/$USER/b1850.basics/bld/mct.bldlog.240606-134217
Calling /glade/u/home/$USER/my_cesm_code/cime/src/build_scripts/buildlib.mct
Component mct build complete with 55 warnings
Building pio with output to file /glade/derecho/scratch/$USER/b1850.basics/bld/pio.bldlog.240606-134217
Calling /glade/u/home/$USER/my_cesm_code/cime/src/build_scripts/buildlib.pio
Component pio build complete with 28 warnings
Building csm_share with output to file /glade/derecho/scratch/$USER/b1850.basics/bld/csm_share.bldlog.240606-134217
Calling /glade/u/home/$USER/my_cesm_code/cime/src/build_scripts/buildlib.csm_share
Component csm_share build complete with 85 warnings
- Building clm4_5/clm5_0 Library
Building lnd with output to /glade/derecho/scratch/$USER/b1850.basics/bld/lnd.bldlog.240606-134217
Component lnd build complete with 292 warnings
clm built in 109.479993 seconds
Building atm with output to /glade/derecho/scratch/$USER/b1850.basics/bld/atm.bldlog.240606-134217
Building ice with output to /glade/derecho/scratch/$USER/b1850.basics/bld/ice.bldlog.240606-134217
Building ocn with output to /glade/derecho/scratch/$USER/b1850.basics/bld/ocn.bldlog.240606-134217
Building rof with output to /glade/derecho/scratch/$USER/b1850.basics/bld/rof.bldlog.240606-134217
Building glc with output to /glade/derecho/scratch/$USER/b1850.basics/bld/glc.bldlog.240606-134217
Building wav with output to /glade/derecho/scratch/$USER/b1850.basics/bld/wav.bldlog.240606-134217
Building esp with output to /glade/derecho/scratch/$USER/b1850.basics/bld/esp.bldlog.240606-134217
Component esp build complete with 1 warnings
sesp built in 4.413109 seconds
Component wav build complete with 35 warnings
ww built in 33.126202 seconds
Component rof build complete with 14 warnings
mosart built in 33.278138 seconds
Component ice build complete with 74 warnings
cice built in 51.958399 seconds
Component ocn build complete with 207 warnings
pop built in 86.837194 seconds
Component atm build complete with 528 warnings
cam built in 105.142718 seconds
Component glc build complete with 150 warnings
cism built in 133.173952 seconds
Building cesm with output to /glade/derecho/scratch/$USER/b1850.basics/bld/cesm.bldlog.240606-134217
Component cesm exe build complete with 27 warnings
Time spent not building: 130.716460 sec
Time spent building: 389.249592 sec
MODEL BUILD HAS FINISHED SUCCESSFULLY
Notes:
Notice the
./
before any command run in the CASEROOT.On NCAR HPC machines you must call the
case.build
usingqcmd
because it compiles the model on a compute node rather than a login node. This reduces the load on login nodes and prevents a timeout while you are building the model.The output tells you if it was successful at the end:
MODEL BUILD HAS FINISHED SUCCESSFULLY
Tips#
To completely rebuild a case, run
./case.build --clean-all
first before building the model.If you want to make any source code modifications in
SourceMods
, do this before building the model. We will cover SourceMods in a later section.If you want to make any modifications to
env_build.xml
, do this before building the model.If any input data is missing the build will abort but provide a list of missing files. To acquire missing data run
./check_input_data --download
. This will download the required data and put it in theinputdata
directory defined by the XML variableDIN_LOC_ROOT
. After you have done these steps you can re-run thecase.build
script.