I am new to this model, so sorry if I am asking something obvious.

I am trying to write history files, and I got this error when creating the first file:

ERROR in def_his/avg: Cannot create netCDF file: ./output/GOM1km_his.0000/.nc

WRT_HIS ERROR: Cannot synchronize/close history netCDF file.

The filename of the history output seems to be wrong. This error only happens when I set NRPFHIS to 1. The model runs OK with other NRPFHIS value (at least for 2 or -1). I attached my file here.

Could anybody help me with this? Thank you!

btw, is there any way to turn off average output in .in file? Or is can only be turned off at compiling?

Average output can be turned off by undefining the AVERAGES preprocessor option in cppdefs.h. For that you will need to recompile and run.

Regarding NRPFHIS, I have faced this problem before, but I usually save 2 outputs in 1 file (or 3, depending on the problem). So I prescribe NRPFHIS as either 2 or 3 and it works for me. For eg, if you set NWRT to 1000 and NRPFHIS to 2, it will save the outputs at the 1000th and 2000th timestep in a single file, 3000th and 4000th timestep into the next file, and so on.