BISMG:SarahS/jules

Check out JULES version 4.2 from the met office shared repository
svn co --username sarahshannon https://code.metoffice.gov.uk/svn/jules/main/trunk/.

svn mkdir https://code.metoffice.gov.uk/svn/jules/main/branches/dev/sarahshannon

svn copy https://code.metoffice.gov.uk/svn/jules/main/trunk/ https://code.metoffice.gov.uk/svn/jules/main/branches/dev/sarahshannon/simple-smb

Check out code from here
svn co --username sarah-shannon https://puma.nerc.ac.uk/svn/JULES_svn/JULES/trunk jules_trunk

Check out examples: svn co --username sarah-shannon https://puma.nerc.ac.uk/svn/JULES_svn/JULES-DOC/trunk jules-doc

svn co --username sarah-shannon https://puma.nerc.ac.uk/svn/JULES_svn/JULES/branches/dev/sarah-shannon/simple-smb simple-smb

Check out my documentation

svn co --username sarah-shannon https://puma.nerc.ac.uk/svn/JULES_svn/JULES-DOC/branches/dev/sarah-shannon/simple-smb jules-doc

Installation guide for JULES-vn4 on dartagnan with fcm make (gfortran and netcdf4)
The current version of fcm make on dartagnan does not work with the gfortran compiler so you have to use Steph's updated fcm. Also use Steph's gfortran and netCDF libraries because the default stuff on dartagnan does not work (it's too old) Add these lines to your .bashrc

export PATH=/data/ggslc/perl5/site/bin:/data/ggslc/perl5/bin:$PATH

export MANPATH=/data/ggslc/perl5/site/man:/data/ggslc/perl5/man:$MANPATH

export PATH=/data/ggslc/opt/fcm-2014-04/sbin/:/data/ggslc/opt/fcm-2014-04/bin/:$PATH

export BISICLES_HOME=/data/ggslc/opt/BISICLES

ggslcopt

Run this bash script in the JULES head directory !/bin/bash

export JULES_COMPILER=gfortran

export JULES_BUILD=debug

export JULES_NETCDF=actual

export JULES_NETCDF_PATH=/data/ggslc/opt/BISICLES/netcdf/serial/

fcm make -v -f etc/fcm-make/make.cfg

Add extra netCDF library flags in etc/fcm-make/make.cfg at line 97 $ldflags = -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -L/data/ggslc/opt/BISICLES/hdf5/serial/lib Note that the order of these flags are important

Installation guide for JULES-vn4 on bluecrystalp3 with fcm make in parallel (gfortran and netcdf4)
I installed fcm make, hdf5 and c and fortran netcdf libraries in parallel. See notes on main page

Run this bash script

export JULES_COMPILER=gfortran

export JULES_NETCDF=actual

export JULES_NETCDF_PATH=/panfs/panasas01/geog/ggsrs/pnetcdf

export JULES_PARALLEL=mpi

fcm make -v -f etc/fcm-make/make.cfg

Link to hdf5 parallel libraries in make.cfg

$ldflags = -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -L/panfs/panasas01/geog/ggsrs/phdf5-build/lib

Installation jules-v3.2.1 on dartagnan with FCM make & intel
Permanently add the fcm make module using, module initadd fcm/2.3.1

Run this shell script

!/bin/bash

export JULES_CFG_COMP=intel

export JULES_CFG_BLD=debug

export JULES_CFG_NCDF=/home/paleo/ggsrs/jules/jules-trunk/config.cfg # Path to netCDF include and libs export FCM_DEBUG=true

fcm make -f etc/fcm-make/make-local.cfg <br /

where config.cfg contains

$fflags = $fflags -I/opt/local/CentOS-64/netcdf/4.0/intel_fc_10.1/include

$ldflags = $ldflags -L/opt/local/CentOS-64/netcdf/4.0/intel_fc_10.1/lib -lnetcdf -lnetcdff

Running point-loobos example

 * This example runs point at latitude = 52.168, longitude = 5.744

Running gridded example (see WFD in training manual)

 * Remember to ulimit -s unlimited
 * Example ran in /example/WFD/expt004/
 * Run with jules_fast.exe. Note jules_debug.exe results in a seg fault at seek_all_to_current_datetime in init.F90

General Issues ...
''
 * Running point_loobos example in debug mode fails !. Why ? This is the simplist example
 * Stripes in output when running for land & ocean points - - Fixed by creating mini netCDF input files for the Alps and using this as the model grid.
 * Can't seem to output snow level data when multi layer snow scheme is switched on - Fixed by setting l_aggregate=T
 * When setting up model to run with daily data, set timestep_len to be small or model become numerically unstable. This results in surface temp tstar_gb ~ 3130oK. I have used timestep_len=21600 sec (i.e. 6hrs)''- fixed by setting model time step to 3600 or Andy Wiltshire uses 1800.

Changes to get Andy Wiltshire's code to run on dartagnan (r1444_sub_ice)

 * In Makefile remove the f from the line netcdff

ifeq ($(CDFDUMMY),false)

$(LIB_PRE)netcdff

endif


 * pp files provided are machine dependant. Compile code with flag -convert big_endian in the Makfile.comp.intel i.e. FF_DBG=-g -C -CB -traceback -check noarg_temp_created -convert big_endian

59_glacier_elev_tiles_n192.pp --> 59 maps of elevation, 1-9 have no elevation, 10-59 have elevation in the file

50_glacier_tiles_n192.nc --> 59 maps of fraction of surface types

ajkkga.da60c10.JULES.soil.pp --> 1 map of soil parameters for several variables


 * Uncomment out some of the stash codes in init_drive.F90 so that they match the input pp climate files provided by AW
 * In init_opts.F90 at line 102 change WRITE(char,'(II)') i to WRITE(char,'(I2)') i. because the number of ice levels is > 10


 * Code does not calculate surface mass balance. Create a new subroutine to calculate smb called tile_smb. Put subroutine into ICE directory remember to modify Makefile in ICE directory to include the new subroutine
 * call tile_smb from control.F90
 * save smb variable to offline_diag. Note this is only used for offline JULES. Put here temporarily as it is following what Andy did but may need to change this in the future
 * I have put smb in the offline_diag list but should this be in a better place? Watch out that variables in offline_diag are not deallocated!
 * Put smb variable with AW's other ice variables in allocate_arrays.F90
 * SMB = snowfallT (snowfall_tile_diag) - melt_tile - ei_tile.


 * Therefore smb(i,n) = snowfall_tile_diag - melt_tile(i,n) - ei_tile(i,n)
 * Add smb to the output in output_mod.F90 and init_out_varlist.F90
 * OK crossed checked that smb output = snowfallT - eiT - snowMeltT. Difference is -4e-10 -> 2e-10 :)
 * Conversion of snow to ice (firn_flux is zero). This is because in snowpack.F90 firn_flux is set to zero and not calculated. Uncomment out this line firn_flux(i)=MIN(sice(i,n)/timestep,0.1*dz_ice(1)*ice_rho/timestep)
 * Test what happens when the temperature is increased by 10 deg by changing update_mod.F90 line 336