#!/usr/bin/env bash
set -u -o pipefail

folders=(
	"atm"
	"cpl"
	"glc"
	"ice"
	"lnd"
	"ocn"
	"rof"
	"cdeps"
	"share"
	"restart"
	"noresm-only"
)

for item in "${folders[@]}"; do
	echo "Processing $item"
	fout="not-noresm-${item}.txt"
	if [[ "$item" == "noresm-only" ]]; then
		fout="not-noresm-only.txt"
	fi
	find ./${item} -type f -not -group noresm -printf "%u %p\n" | sort > ${fout}
done

