Menu
SOCRATES
Summary
April 2015
SOCRATES, Suite Of Community RAdiative Transfer codes based on Edwards and Slingo, has just been released by the UK Met Office.
The current version can be downloaded by contacting James Manners at the Met Office.
Notes
I was able to get the code running by hardwiring some changes into some of the .F90 files to revert the FORTRAN 2003 back to older fortran, so it worked with the compiler and netcdf library options. Theoretically it should be possible to set the options up so that the code compiles and runs with the latest FORTRAN code, but I couldn't figure out what these options are.
Instructions
Below are the steps necessary to follow to get the code running at Reading. I soon hope to have a branch setup so that these changes can be downloaded.
- Extract the code
From the Dropbox link you need to click on download to get the full file to download properly. Check that it's around 20M in size.
  $ ls -lh Socrates.zip
  -rw-r--r-- 1 jp902366 research 20M May 5 16:42 Socrates.zip
  $ unzip Socrates.zip
this creates socrates_1504.tar.xz
  $ unxz socrates_1504.tar.xz
creates socrates_1504.tar
  $ tar -xvf socrates_1504.tar
extracts the files & directories to /socrates_1504/
- Reading Setup
Before compiling, type:
  $ setup studio12
  $ export NAG_KUSARI_FILE=/opt/compilers/NAG/license.dat
as per instructions at
http://www.met.reading.ac.uk/it/UNIX/unix-apps/nag-linux.html
- Change Mk_cmd file
As in point (3), now change the options in the file /make/Mk_cmd. At Reading, these should be: (note that netcdf only has one f here)
#
# Pathnames for compilers and global options for naming files
#
FORTCOMP = f90 -c -O -M./ -M$(INCCDF_PATH)
LINK = f90 -O
LIBLINK = ar rvu
INCCDF_PATH = /opt/graphics/netcdf-studio12/64/include
LIBCDF_PATH = /opt/graphics/netcdf-studio12/64/lib
LIBCDF_NAME = netcdf
LIBSUFFIX = a
.SUFFIXES: $(SUFFIXES) .f90
- Code Changes
The above settings don't allow FORTRAN 2003. So before compiling the code, hardwire the code using the following. These can also be copied from my directory at /export/cloud/aerosol/jp902366/socrates_1504/.
Change the file open_cloud_gen.F90 in /src/radiation_control/
from:
REAL(RealK), PARAMETER :: root_two = SQRT(2.0)
to:
REAL(RealK):: root_two
root_two = SQRT(2.0)
Also change the file solve_band_k_eqv.F90 in /src/radiance_core/
from:
REAL (RealK) :: temp_max = LOG(1.0_RealK/EPSILON(temp_max))
to:
REAL (RealK) :: temp_max
temp_max = LOG(1.0_RealK/EPSILON(temp_max))
- Compile Code
As per instructions in README file in the main socrates directory, point 3, compile with:
$ ./build_code
$ . ./set_rad_env
- Compile Scripts
As per instructions in README point 4, compile scripts with:
  $ cd $RAD_SCRIPT
  $ make
If you have not done this step, then scripts such as Cl_run_cdf will not work.
- Test Code
Check the code works by running the examples (quick_tests) in /examples
Other Notes
I also found it useful, when trouble shooting, to change to the /bin directory, type
  $ make clean
in case any previous incarnations are getting in the way.
claires_notes.txt has a record of all the above steps, and a lot more mess besides.