BISMG:SarahS/jules merge

Notes on merging AW glacier code to current JULES trunk
 * Install tkdiff

1. A copy of the trunk to which changes will be merged to
 * Create 3 directories in the puma repository in my work space to contain

2. Andy Wiltshire's code

3. JULES version 3 from which Andy made his changes

How to sync my branch with the trunk
 * go to the working copy of my branch jules/jules-glacier
 * svn update- ensure there are no differences
 * svn merge https://puma.nerc.ac.uk/svn/JULES_svn/JULES/trunk
 * See if you can build and run a test
 * svn commit -m "Merge latest trunk changes to the jules-glacier branch"

 Check out my code  Check out smb-robin and trunk

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

Use both versions using fcm make

Run test with both versions and compare dump files

Notes on merging


 * Create a point loobos test for jules-glacier and worry about creating suitable netCDF inputs later. Example in /jules-glacier/tests/examples/point_loobos
 * For this example set nice=2. Modify loobos/data initial conditions files and frac data for the additional 2 ice types
 * sf_impl is not called in the new jules but sf_impl2 is called instead. will have to make changes to this instead of sf_impl


 * sf_exch is tricky to merge because there is extra sea-ice stuff in the new jules and some existing variables are derived types in the new jules


 * Get new jules to read in the number of ice tiles. init_model_levels reads the namelist. In old JULES init_opt.F90 reads the .jin
 * What is the purpose of the extract and preprocessor directories? Extract directory is where fcm make checks the svn repository and build the code. Preprocessor has something to do with the UM. Look like there is duplicate code there.
 * In AW /SOURCE/SUBROUTINES/control.F90 can I remove offline_diag variables ?
 * Where do I insert the switch to turn on elevation for ice tiles? Does AW have a switch for elevation tiles or do switches only relate to ice dynamics ? Still not usre about this . I think Ill add my won switch and keep turning it on/off to check backwards compatibility.


 * How to set the number of ice tiles "nice" ? Is there a conflict with sea ice


 * tile_albedo.F90 AW changed the value in the of 10 in this equation to 20. Note 20 is used in the new version of jules

( snowd(l) .gt. 0.) fsnow(l) = snowd(l) / ( snowd(l) + 20.*z0(l) )
 * Change input to read in tile surface heights relative to grid box mean. No need just use existing tile heights stuff
 * In src/control/standaloce/control.F90. ei_tile and melt_tile are already in here so no need to add.


 * SMB = snowfallT (snowfall_tile_diag) - melt_tile (snow + ice) - ei_tile (sublim of snow + ice)

where snowfall_tile_diag = ls_snow_tile(l,n) + con_snow(i,j)

melt_tile, ei_tile and con_snow are already calcualted. Only need to calc ls_snow_tile (downscaled snow??)?


 * Note call to elevate is not in control.F90 in the new JULES.

In old jules CALL elevate is in control.F90 twice and in sf_exch.F90. In new jules it is in subroutine sf_exch_jls.F90 only.

BUGS

 * this bug happens for some regions

forrtl: severe (408): fort: (3): Subscript #1 of the array ES has value -2147483648 which is less than the lower bound of 0

Image             PC                Routine            Line        Source

jules_debug.exe   0000000000D80646  Unknown               Unknown  Unknown

jules_debug.exe   0000000000D7F846  Unknown               Unknown  Unknown

jules_debug.exe   0000000000D3979E  Unknown               Unknown  Unknown

jules_debug.exe   0000000000CEF311  Unknown               Unknown  Unknown

jules_debug.exe   0000000000CEE570  Unknown               Unknown  Unknown

jules_debug.exe   00000000007A87CD  qsat_mix_                 519  qsat_mix_jls.F90

jules_debug.exe   0000000000A75DBC  screen_tq_                287  screen_tq_jls.F90

jules_debug.exe   000000000079799F  sf_impl2_                1340  sf_impl2_jls.F90

jules_debug.exe   00000000004C2DF0  control_                 1033  control.F90

jules_debug.exe   0000000000403750  MAIN__                    107  jules.F90

jules_debug.exe   0000000000403646  Unknown               Unknown  Unknown

libc.so.6         00000031FA61D9C4  Unknown               Unknown  Unknown

jules_debug.exe   00000000004034E9  Unknown               Unknown  Unknown


 * Firn-flux calculation bug happenns for some regions