If you want to change the 4-digit ID of your experiment you have to do it in the name of the initial conditions (ICM* files), in the namelist (namelistfc or fort.4) and/or in the script which handles your job (oifs_run.sh) AND in the initial conditions itself.

Set new experiment id with grib_set

This short shell script below makes this latter one: modifies the experiment ID in the GRIB files using the grib_set command:

#!/bin/bash -l

cd /scratch/<your_troifs>/tc-karl/h7cc
newid=${1?}
echo ${newid}
key="experimentVersionNumber"

for file in *INI*; do
echo ${file}
id=$(grib_get -p $key -w count=1 $file) 
echo ${id}
newgrb=${file/$id/$newid}
echo "Changing expid from '$id' to '$newid' for $file writing to new file $newgrb."
grib_set -f -s ${key}="$newid" -w ${key}="$id" $file $newgrb
done

Set new experiment id with the exptid command

Use the exptid command (available here: /home/ectrain/<your_troifs>/perm/oifs43r3/bin) to set the new experiment id to 'hecc':

troifs0@cca-login3:> exptid -n hecc ICM*h7cc*
Changing expid from 'h7cc' to 'hecc' for ICMCLh7ccINIT and writing to new file ICMCLheccINIT.
Changing expid from 'h7cc' to 'hecc' for ICMGGh7ccINIT and writing to new file ICMGGheccINIT.
Changing expid from 'h7cc' to 'hecc' for ICMGGh7ccINIUA and writing to new file ICMGGheccINIUA.
Changing expid from 'h7cc' to 'hecc' for ICMSHh7ccINIT and writing to new file ICMSHheccINIT.

Verify the command worked by checking the experimentVersionNumber in the new files:

troifs0@cca-login3:> exptid *hecc*
In file ICMCLheccINIT, values of key experimentVersionNumber are:
hecc
In file ICMGGheccINIT, values of key experimentVersionNumber are:
0001
hecc
In file ICMGGheccINIUA, values of key experimentVersionNumber are:
hecc
In file ICMSHheccINIT, values of key experimentVersionNumber are:
hecc