ParaView
/builddir/build/BUILD/ParaView-v5.2.0/CoProcessing/Adaptors/CamAdaptor/README.md
Go to the documentation of this file.
1 Cam5 Catalyst Adaptor {#Cam5Adaptor}
2 =====================
3 
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.
7 
8 Files:
9 
10 * catalyst_add_and_coprocess.F90: included in one of the simulation
11  files as it needs to call functions from the simulation
12  executable.
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
17 
18 Useful documentation:
19 
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>.
27 
28 To build CAM5 and the Catalyst adaptor:
29 
30 1. Download ParaView source code and
31  download CESM (Community Earth System Model) source code using instructions in:
32 
33  <http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide/book1.html>
34 
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`.
39 
40 3. Set `PARAVIEW_BUILD_CATALYST_ADAPTORS` to `On` and build ParaView.
41 
42  Patch `cesm1_2_2` sources to call the Catalyst Adaptor:
43 
44  cd ~/src/cesm1_2_2/models/atm/cam
45  patch < ~/build/ParaView/CoProcessing/Adaptors/CamAdaptor/cesm1_2_2.patch
46 
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.
50 
51 4. Configure Cam5:
52 
53  mkdir ~/build/cam-5.3
54  cd ~/build/cam-5.3
55 
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.
60 
61  ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/configure-cam.sh
62 
63  Note you have to configure the number of MPI processors and use the same
64  number when you run the simulation.
65 
66  Build cam5:
67 
68  make -j10
69 
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.
73 
74  mkdir ~/run/cam-5.3
75  cd ~/run/cam-5.3
76  ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/build-namelist.sh | grep FOUND
77  Namelists (parameters) for the simulation are listed in:
78 
79  <http://www.cesm.ucar.edu/cgi-bin/eaton/namelist/nldef2html-cam5_3>
80 
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
86  are interested in:
87 
88  cd ~/src/cesm-data
89  svn update --depth empty atm
90  cd atm
91  svn update --depth empty cam
92  cd cam
93  svn update --depth empty inic
94  cd inic
95  svn update --depth empty homme
96  cd homme
97 
98  Then checkout the file:
99 
100  svn update cami-mam3_0000-01-01_ne30np4_L30_c130424.nc
101 
102 6. Run the simulation:
103 
104  ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/run-cam.sh
105 
106  The data fields generated by the simulation (those stored in the
107  .nc file) are listed in:
108 
109  <http://www.cesm.ucar.edu/models/cesm1.2/cam/docs/ug5_3/hist_flds_fv_cam5.html>
110 
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.
115 
116 7. Optional: If you want to debug certain pio files in the simulation run:
117 
118  ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/gen-cam.sh d
119 
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
122  run:
123 
124  ~/src/ParaView/CoProcessing/Adaptors/CamAdaptor/gen-cam.sh g
125 
126 
127 To dump the history file produced by the simulation in text format run
128  ncdump camrun.cam.h0.*.nc > camrun.txt
129 
130 See <http://www.unidata.ucar.edu/software/netcdf/docs/netcdf_utilities_guide.html#ncdump_SYNOPSIS>
131 for more information.