1 Cam5 Catalyst Adaptor {#Cam5Adaptor}
4 We provide a ParaView Catalyst Adaptor for CAM5 simulation
5 with Finite Volume (fv) or Spectral Element (se) dynamic modules.
6 We tested our code with cesm1_2_2.
10 * catalyst_add_and_coprocess.F90: included in one of the simulation
11 files as it needs to call functions from the simulation
13 * fv_create_data.cxx, se_create_data.cxx: initializes and stores the VTK grid.
14 * Grid.cxx, Grid.h: manages the VTK grid.
15 * fv_coprocess.py, se_coprocess.py: ParaView pipeline.
16 * cesm1_2_2.patch: patch to Cam5 sources
20 * <http://www.cesm.ucar.edu/models/cesm1.2/cam/docs/ug5_3/ug.html>
21 * <http://www.cesm.ucar.edu/cgi-bin/eaton/namelist/nldef2html-cam5_3>
22 * <http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide/book1.html>
23 * <http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/modelnl/env_run.html>
24 * <http://www.cesm.ucar.edu/models/pio/decomp.html>
25 * <http://www.cesm.ucar.edu/models/pio/_c_a_mexample.html>
26 * For information about the SE grid see <https://www.earthsystemcog.org/projects/dcmip-2012/cam-se>.
28 To build CAM5 and the Catalyst adaptor:
30 1. Download ParaView source code and
31 download CESM (Community Earth System Model) source code using instructions in:
33 <http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide/book1.html>
35 2. Modify `configure-cam.sh`, `gen-cam.sh`, `build-namelist.sh` in
36 `~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/`
37 such that `CAM_ROOT` points to the location for `cesm1_2_2` sources.
38 By default the scripts assume that `cesm1_2_2` is stored in `~/src/cesm_1_2_2`.
40 3. Set `PARAVIEW_BUILD_CATALYST_ADAPTORS` to `On` and build ParaView.
42 Patch `cesm1_2_2` sources to call the Catalyst Adaptor:
44 cd ~/src/cesm1_2_2/models/atm/cam
45 patch < ~/build/ParaView/CoProcessing/Adaptors/CamAdaptor/cesm1_2_2.patch
47 By default, Cam5 Adaptor saves the simulation data. See `fv_coprocess.py` and `se_coprocess.py`
48 for the ParaView pipeline that is executed. To execute a different script you can modify those files
49 or modify `src/cpl_mct/atm_comp_mct.F90` to point to your scripts.
56 Edit the configuration script by uncommenting the configuration
57 you want or creating a different configuration. Parameters for
58 finite volume and spectral element with different grid sizes are
59 available. Run the configuration script.
61 ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/configure-cam.sh
63 Note you have to configure the number of MPI processors and use the same
64 number when you run the simulation.
70 5. Create a run directory for the simulation and create the parameters
71 for the simulation. This is where you set for how long you run the
72 simulation and how often you save data.
76 ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/build-namelist.sh | grep FOUND
77 Namelists (parameters) for the simulation are listed in:
79 <http://www.cesm.ucar.edu/cgi-bin/eaton/namelist/nldef2html-cam5_3>
81 Different configurations need different data files. If any of the required
82 data files are NOT FOUND download them from:
83 <https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata>
84 Don't checkout everything as the datafiles are big!
85 First checkout individual empty directories leading to the file you
89 svn update --depth empty atm
91 svn update --depth empty cam
93 svn update --depth empty inic
95 svn update --depth empty homme
98 Then checkout the file:
100 svn update cami-mam3_0000-01-01_ne30np4_L30_c130424.nc
102 6. Run the simulation:
104 ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/run-cam.sh
106 The data fields generated by the simulation (those stored in the
107 .nc file) are listed in:
109 <http://www.cesm.ucar.edu/models/cesm1.2/cam/docs/ug5_3/hist_flds_fv_cam5.html>
111 You can view the history file `camrun.cam.h0.*.nc` in ParaView
112 using 'NetCDF files generic and CF conventions' reader. You can
113 switch the dimensions viewed to be (lat,lon) or (lev, lat, lon) to
114 get a sphere or a ball.
116 7. Optional: If you want to debug certain pio files in the simulation run:
118 ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/gen-cam.sh d
120 This command copies a list of .F90.in to the corresponding .F90
121 so that gdb works correctly over these files. When you need to rebuild
124 ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/gen-cam.sh g
127 To dump the history file produced by the simulation in text format run
128 ncdump camrun.cam.h0.*.nc > camrun.txt
130 See <http://www.unidata.ucar.edu/software/netcdf/docs/netcdf_utilities_guide.html#ncdump_SYNOPSIS>
131 for more information.