typo in mod_arrays.F and missing in read_phypar.F?

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
mjfconan
Posts: 20
Joined: Mon Mar 03, 2014 1:57 pm
Location: SKLEC, ECNU, China

typo in mod_arrays.F and missing in read_phypar.F?

#1 Unread post by mjfconan »

(1) mod_arrays.F

Code: Select all

Line 67
     &                         deallocate_seabed,                       &
Line 266
                          CALL allocate_sedbed (ng)
should be

Code: Select all

     &                         deallocate_sedbed,                       &
                         CALL deallocate_sedbed (ng)
(2) read_phypar.F
Block of "#ifdef AVERAGES" from line 4095

Code: Select all

Line 4097
          OutFiles=ntimes(ng)/ndefAVG(ng)
should add the same process as other blocks:

Code: Select all

          OutFiles=ntimes(ng)/ndefAVG(ng)
          
          IF ((nAVG(ng).eq.ndefAVG(ng)).or.                             &
     &        (MOD(ntimes(ng),ndefAVG(ng)).ge.nAVG(ng))) THEN
            OutFiles=Outfiles+1
          END IF

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: typo in mod_arrays.F and missing in read_phypar.F?

#2 Unread post by arango »

Thank you for bringing this to my attention. I agree with the correction to mod_arrays.F. Now, I need to think about the issue with the AVERAGES files and also the DIAGNOSTICS files in read_phypar.F. They are special since the creation of the time-averaged files is delayed due to the time-averaging. I will have to look at this at the debugger and test it.

carlosag
Posts: 24
Joined: Thu Sep 30, 2021 12:08 pm
Location: University of Iceland

Re: typo in mod_arrays.F and missing in read_phypar.F?

#3 Unread post by carlosag »

Thank you. I am brand new in this community and I am still leaning the to do's and the don't, as well as the generalities. The typo in read_phypar.F was accepted or is it still under review?
All best and thank you.

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: typo in mod_arrays.F and missing in read_phypar.F?

#4 Unread post by arango »

Yes, I updated the repository but I rejected the changes to read_phypar.F. As I mentioned above, the suggested change is not needed because the time-averaged NetCDF files activated with AVERAGES and DIAGNOSTICS options are special.

The user Jianfei Ma didn't provide enough information as to why the change was needed. That logic is delicate and I looked in the debugger for issues. The multi-file logic is correct for the delayed I/O. I suspect that the user has inconsistent values for NTIMES, NAVG, and NDEFAVG in the standard input file roms.in. They must be exact integer multiples of each other for the time-averaging to work correctly!

mjfconan
Posts: 20
Joined: Mon Mar 03, 2014 1:57 pm
Location: SKLEC, ECNU, China

Re: typo in mod_arrays.F and missing in read_phypar.F?

#5 Unread post by mjfconan »

Thanks! Sometimes, my NTIMES is not integer multiples of NDEFAVG, which causes the problem. :shock:
Moreover, when I checked the output.F, it says:

Code: Select all

Line 399-402
        IF (((iic(ng).gt.ntstart(ng)).and.                              &
     &       (MOD(iic(ng)-1,nAVG(ng)).eq.0)).or.                        &
     &      ((iic(ng).ge.ntsAVG(ng)).and.(nAVG(ng).eq.1))) THEN
          CALL wrt_avg (ng, tile)
Why dose the 1st condition use ntstart(ng) not ntsAVG(ng)? such as:

Code: Select all

        
        IF ((iic(ng).ge.ntsAVG(ng)).and.                              &
     &       ((MOD(iic(ng)-1,nAVG(ng)).eq.0).or.(nAVG(ng).eq.1))) THEN
          CALL wrt_avg (ng, tile)
The old one seems to write out every AVG field from the first NAVG step, but without a correct ocean_time until ntsAVG step.

Post Reply