anchor.diff:                               call stop_all('read_ccmc_in', 'Uninitialised secondary reference determinant.') 
                            end if
                            if (ccmc_in%secondary_refs(i)%ex_level == -1 .or. ccmc_in%secondary_refs(i)%ex_level == sys%nel) then
  -                             call stop_all('read_ccmc_in', 'Uninitialised second reference excitation level.')
  +                             call stop_all('read_ccmc_in', 'Uninitialised secondary reference excitation level.')
                            end if
  +                         secondary_ref_keys(i) = 'secondary_ref'//string
                   end do
               end if
  -            call warn_unused_args(lua_state, keys, ccmc_table)
  +            keys_concat = [keys,secondary_ref_keys(i)]
  +            
  +            call warn_unused_args(lua_state, keys_concat, ccmc_table)
   
               call aot_table_close(lua_state, ccmc_table)
   
  
positive.code:                                                                 'density_matrices', 'density_matrix_file', 'even_selection', &
                                                                  'multiref', 'n_secondary_ref']
          character(10) :: string
  
          if (aot_exists(lua_state, opts, 'ccmc')) then
  
  
negative.code:         !        full space if present.
          !    ref_table_name (optional): name of table holding reference info.  Default: reference.
          ! Out:
          !    ref: reference_t object containing the input options describing the
          !        reference.  Note that ex_level is set to the number of electrons
          !        if not provided (incl. if the reference table is not present in
          !        opts) and sys is present and -1 otherwise.
  