noresm:settingupcamonlinuxpc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
noresm:settingupcamonlinuxpc [2015-06-08 13:40:34]
alfg [Including cam-oslo code]
noresm:settingupcamonlinuxpc [2022-05-31 09:29:32] (current)
Line 51: Line 51:
   * export CXXFLAGS=-O0   * export CXXFLAGS=-O0
  
-The netcdf c-library complains about a non-successful compilation because it can not find Doxyfile. This is not important.+The netcdf c-library complains about a non-successful compilation because it can not find Doxyfile. This is not important. The compilation needs also the following env-variables: CPPFLAGS=-I${dir}/include, LDFLAGS=-L${dir}/lib, where "dir" is directory you use for the "configure" scripts
  
 3) Get the netcdf source code (including the c-headers) from  3) Get the netcdf source code (including the c-headers) from 
Line 59: Line 59:
 c) make install c) make install
  
-4) Get fortran netcdf api (http://www.unidata.ucar.edu/downloads/netcdf/netcdf-fortran/index.jsp) and follow+4) Get fortran netcdf api (http://www.unidata.ucar.edu/downloads/netcdf/index.jsp) and follow
 http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html
  
Line 81: Line 81:
   * export CSMDATA=/path/to/cam/input/data   * export CSMDATA=/path/to/cam/input/data
  
-This command compiles CAM (not including any CAM-Oslo code) on my machine+This command configures CAM (not including any CAM-Oslo code) on my machine. It creates a Makefile used later for compilation.
  
 <file> <file>
Line 87: Line 87:
 </file> </file>
  
-As long as $camcfg is defined, you can execute this from any directory..+**As long as $camcfg is defined, you can execute this from any directory..**
  
-Then you need the following commands+Then you need the following commands **executed from the same directory as you executed "configure"**
 <file> <file>
 $camcfg/build-namelist -test -config config_cache.xml $camcfg/build-namelist -test -config config_cache.xml
Line 112: Line 112:
 <file> <file>
 ./cam ./cam
 +</file>
 +
 +
 +NOTE: In CAM5.5 (upcoming versions) this same procedure is supposed to work with the following command (NOT VERIFIED): 
 +<file>
 +$camcfg/configure -fc gfortran -fc_type gnu -debug -nospmd -nosmp -dyn fv -res 10x15 -ice sice -phys cam5
 </file> </file>
  
Line 123: Line 129:
 </file> </file>
  
-For older versions you would need 
-<file> 
- $camcfg/configure -dyn fv -debug -hgrid 10x15 -fc gfortran -nospmd -nosmp -test -fc_type gnu -chem trop_mam_oslo -cam_oslo_pc true 
-</file> 
  
 There are additional input needed for the CAM-Oslo code. They are available in the same input-directory as the normal CESM-input files. There are additional input needed for the CAM-Oslo code. They are available in the same input-directory as the normal CESM-input files.
Line 144: Line 146:
  
 gdb has problems with printing info about allocatable arrays. Allocatable arrays have to be displayed as "*((real_8 *)my_array + N)@M" where N is number of elements beyond first element and M is number of elements to show. (See bottom of this page (and links therein) http://stackoverflow.com/questions/11786958/how-to-print-fortran-arrays-in-gdb)  gdb has problems with printing info about allocatable arrays. Allocatable arrays have to be displayed as "*((real_8 *)my_array + N)@M" where N is number of elements beyond first element and M is number of elements to show. (See bottom of this page (and links therein) http://stackoverflow.com/questions/11786958/how-to-print-fortran-arrays-in-gdb) 
 +
 +It is sometimes useful to let the compiler tell you about additional errors. Assuming you use gfortran on your PC: See https://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html for additional options. For example if you want to check just about everything, add "-fcheck=all" to the "FC_FLAGS" in the gfortran section. (Note: Running configure again re-generates the Makefile)
  
  
  • noresm/settingupcamonlinuxpc.1433770834.txt.gz
  • Last modified: 2022-05-31 09:23:24
  • (external edit)