How should i add new variables to initial condition files

Hi everyone,

Is it possible to add new initial conditions variables by editing the file itself directly? I used python to do it but the following error popped up when i tried to run the model with the new file:

Error opening file at path-name:
netCDF error number -128 processing file “INIT_CONC_1”
NetCDF: Attempt to use feature that was not turned on when netCDF was built.
NetCDF: Attempt to use feature that was not turned on when netCDF was built.
/glade/scratch/hmao/data/icon/ICON_Jun2010_BrOf_US12NE_201002
 *** ERROR ABORT in subroutine gridded_files_se on PE 000
 Open failure for INIT_CONC_1
 PM3EXIT:  date&time specified as 0
 Date&time specified as 0

Even if i directly copied the file using python without adding any new variables the error will also appear. Could anyone help with this?

Best!
Lin

From the I/O API Home Page https://cjcoats.github.io/ioapi/index.html:

The Models-3 I/O API is A programming interface, not a data format !!
I/O API files are not synonymous with “netCDF files” !!
Instead, netCDF is one of four (and a half) distinct lower layers on which the data and metadata structures for I/O API files are currently available; additional lower layers have been incorporated at times in the past, and may very well be incorporated at various times in the future. Attempts to treat the I/O API as “just a data format” have consistently failed in all cases because the persons attempting to do so have not fully understood the I/O API data structures embedded in these files

Trying to do what you suggest is explicitly not supported. Would you try to treat MS Word .doc files as a data format, and attempt to edit them using a hex editor?

Instead, there are many examples of programs you could use as templates, to try to do what you want – e.g., M3Tools program m3combo

Got it! Thanks so much!
Lin