Writing history files - **** Vs. 0001

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
jmcgovern
Posts: 3
Joined: Wed Apr 11, 2018 2:31 pm

Writing history files - **** Vs. 0001

#1 Unread post by jmcgovern »

Hi All,

When I set up my run to write out data hourly to history files, with a new file to cover every 24 hours, I get one file ocean_his_****.nc on the server, which keeps on getting overwritten, so I end up with only 1 file. When I copy it from the server, it shows up as ocean_his_____.nc.

I have scoured the forum and manual but there is no reference to this type of problem, that I can see.

Thanks,
Joe

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Writing history files - **** Vs. 0001

#2 Unread post by kate »

This string is written to in output.F, in code like:

Code: Select all

              WRITE (HIS(ng)%name,10) TRIM(HIS(ng)%base), ifile
#ifdef LONG_NUMS
  10          FORMAT (a,'_',i5.5,'.nc')
#else
  10          FORMAT (a,'_',i4.4,'.nc')
#endif
            END IF
where:

Code: Select all

           ifile=(iic(ng)-1)/ndefHIS(ng)+1
What you have done is overflow the integers that fit within four characters. You can do this by having a DSTART such that your first file wants to be number 560924 or by having over 9999 output files. I ran into the latter problem in some applications and added the LONG_NUM option.

jmcgovern
Posts: 3
Joined: Wed Apr 11, 2018 2:31 pm

Re: Writing history files - **** Vs. 0001

#3 Unread post by jmcgovern »

Thanks Kate, that has sorted the problem!

Post Reply