Nfiles counter error?

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
backkom
Posts: 35
Joined: Wed Nov 07, 2007 5:03 pm
Location: Ocean University of China

Nfiles counter error?

#1 Unread post by backkom »

Hi all,

I have reported this error before in ROMS_Problem.


I got an abnormal stop of my ROMS application, with error prompt:
247057 OUTPUT - multi-file counter AVG(ng)%load = 3, is greater than Nfiles = 2 dimension
247058 in structure when creating next file: /lustre/home/yaozhigang/Projects/BYS/Out/roms_avg_0003.nc
247059 Incorrect OutFiles logic in 'read_phypar'.

My guess is something goes wrong with the variable Nfiles for average file, which should be 3 for my case ( ntimes = 87120, ndefAVG =37200, nAVG=1860 ).

After checking the codes, it seems that variable Nfiles is determined in Utility/read_PhyPar.F.
3727 ! If multiple output files, edit derived type structure to store the
3728 ! information about all multi-files.
3729 !
3730 DO ng=1,Ngrids
3731 IF ((nHIS(ng).gt.0).and.(ndefHIS(ng).gt.0)) THEN
3732 OutFiles=ntimes(ng)/ndefHIS(ng)
3733 IF (nHIS(ng).eq.ndefHIS(ng)) OutFiles=Outfiles+1 ! because IC
3734 CALL edit_file_struct (ng, OutFiles, HIS)
3735 END IF
3736 IF ((nQCK(ng).gt.0).and.(ndefQCK(ng).gt.0)) THEN
3737 OutFiles=ntimes(ng)/ndefQCK(ng)
3738 IF (nQCK(ng).eq.ndefQCK(ng)) OutFiles=Outfiles+1 ! because IC
3739 CALL edit_file_struct (ng, OutFiles, QCK)
3740 END IF
3741 #ifdef ADJOINT
3742 IF ((nADJ(ng).gt.0).and.(ndefADJ(ng).gt.0)) THEN
3743 OutFiles=ntimes(ng)/ndefADJ(ng)
3744 IF (nADJ(ng).eq.ndefADJ(ng)) OutFiles=Outfiles+1 ! because IC
3745 CALL edit_file_struct (ng, OutFiles, ADM)
3746 END IF
3747 #endif
3748 #ifdef AVERAGES
3749 IF ((nAVG(ng).gt.0).and.(ndefAVG(ng).gt.0)) THEN
3750 OutFiles=ntimes(ng)/ndefAVG(ng)
3751 CALL edit_file_struct (ng, OutFiles, AVG)
3752 AVG(ng)%load=0 ! because delayed creation of NetCDF file
3753 END IF ! due to time-aveeraging
3754 #endif

Another experiment is launched for Upwelling case, and same error happens when setting NTIMES = 1800, NDEFAVG=720., to force a 3-file average output.


So I guess something goes wrong with the Nfiles variable for average files. The model can run successfully if following modification is added.

3748 #ifdef AVERAGES
3749 IF ((nAVG(ng).gt.0).and.(ndefAVG(ng).gt.0)) THEN
3750 OutFiles=ntimes(ng)/ndefAVG(ng)

IF (nAVG(ng).eq.ndefAVG(ng)) OutFiles=Outfiles+1

3751 CALL edit_file_struct (ng, OutFiles, AVG)
3752 AVG(ng)%load=0 ! because delayed creation of NetCDF file
3753 END IF ! due to time-aveeraging
3754 #endif


So this might be a bug?

Best,

Zhigang

Post Reply