export CC to c-lime if not already set
added barrier after writing field
added some diagnostic output