anchor.diff:          h0_out = latt_save ! revert to previous saved lattice
         end if
       end do
  -    if (change_flag == 0 .and. (.not. (present(skip_enth_calc).and.skip_enth_calc)) ) then 
  -      ! calc new enth
  -      enth_out = enthalpy( s, h0_out, V, pressure, cutoff, n_call_enthalpy=n_call_enth ) 
  +    if (change_flag == 0 .and. (.not. (present(skip_ener_calc).and.skip_ener_calc)) ) then 
  +      ! calc new ener
  +      ener_out = energy( s, h0_out, V, cutoff, n_call_energy=n_call_ener ) 
       end if
   
     end subroutine roam_latticeshape_shear
  
positive.code:     real(dp), intent(in) :: V                       ! volume
      real(dp), intent(in)       :: latt_step         ! step length - element of (0.0,1.0)
      real(dp), intent(in) :: min_height              ! minimum cell height (see paper)
      real(dp), intent(in) :: pressure                ! pressure defined in units of eps/(sigma**3)
      real(dp), intent(in) :: cutoff                  ! radial cutoff of potential, defined in units of sigma
      integer , intent(inout) :: change_flag          ! flags whether the minimum cell height condition was met.
                                                      ! 0 : YES 
                                                      ! 1 : NO 
                                                      ! enth_out has ONLY been calculated if change_flag=0
  
      real(dp), intent(out)   :: enth_out             ! enthalpy of trial h0
      real(dp), intent(inout) :: n_call_enth          ! tally of enthalpy calls.
      logical, optional, intent(in) :: skip_enth_calc ! if .true. do not perform enthalpy calculation
  
      real(dp) :: rand_nm, rnd1, rnd2
      real(dp), dimension(6) :: rnd_matrix
      real(dp), dimension(3,3) :: latt_save
      integer  :: i,i2, chosen_lv, roam_count, vs(2)
  
      h0_out = h0_in 
  
      call random_number(rnd_matrix)
  
      change_flag = 1 ! default value indicating that the move was not successful
      latt_save = h0_out ! save
      do roam_count = 1,3
        ! choose random lattice vector to roam
        i2=(roam_count-1)*2
        rand_nm = rnd_matrix(i2 + 1)
        chosen_lv = (rand_nm*3) + 1 ! from 1 to 3
        if (chosen_lv==1) then
          vs = (/ 2, 3 /)
  
negative.code:     real(dp), dimension(3,3), intent(in) :: h0  ! normalised cell matrix
      real(dp), intent(in)       :: vol_step      ! step length
      real(dp), intent(in) :: v_max               ! maximum allowed volume. "V_0" in the paper.
      real(dp), intent(in) :: cutoff              ! radial cutoff of potential, defined in units of sigma
      real(dp), intent(in) :: univar_rnd2(2)      ! an array of 2 iid univariate random numbers 
                                                  ! on (0,1)
      integer , intent(inout) :: change_flag      ! flags whether the trial move was accepted, 
                                                  ! according to the V**(1/3) distribution
                                                  ! 0 : YES 
                                                  ! 1 : NO 
                                                  ! ener_out has ONLY been calculated if change_flag=0
      real(dp), intent(out)   :: ener_out         ! energy of trial V
      real(dp), intent(inout) :: n_call_ener      ! tally of energy calls.
      logical, intent(in) :: flat_v_prior         ! if .true. do not perform MC accept/reject for 
                                                  ! prob(B) ~ V**N
      logical, optional, intent(in) :: skip_ener_calc ! if .true. do not perform energy calculation
  
      real(dp) :: trial_volume, a_0, a_1, p
      integer  :: N
      real(dp), parameter :: v_min = 0.0d0
  
      V_out = V_in
      N = size(s)/3
  