Opened 2 years ago

Closed 2 years ago

#793 closed upgrade (Fixed)

VERY IMPORTANT: Corrected several minor bugs

Reported by: arango Owned by:
Priority: major Milestone: Release ROMS/TOMS 3.7
Component: Nonlinear Version: 3.7
Keywords: Cc:


Several minor bugs were corrected:

  • nesting.F: improved the random issues associated with the linear interpolation weights in put_refine2d and put_refine3d:
    !  Set linear time interpolation weights. Fractional seconds are
    !  rounded to the nearest milliseconds integer towards zero in the
    !  time interpolation weights.
          SecScale=1000.0_dp              ! seconds to milliseconds
    Notice that the scaling from seconds to milliseconds does not affect the values of the weighting coefficients Wold and Wnew. They still range between 0 and 1 since we multiple and divide by SecScale. Many thanks to Takumu Iwamoto for bringing this to my attention.
  • metrics.F: Similar random issues are found when checking the grid refinement timestep when using the mod(dt(dg), dt(rg)):
    !  Check refined grid time-step.  The time-step size for refined grids
    !  needs to be an exact mode multiple of its coarser donor grid.  In
    !  principle, it can be a "RefineScale" factor smaller.  However, other
    !  integer smaller or larger factor is allowed such that:
    !    MOD(dt(dg)*SecScale, dt(rg)*SecScale) = 0   dg:  donor  coarse grid
    !                                                rg:  receiver fine grid
    !  Notice that SecScale is used to avoid roundoff when the timestep
    !  between donor and receiver grids are small and less than one.
            SecScale=1000.0_dp              ! seconds to milliseconds
            DO ig=1,Ngrids
              IF (RefinedGrid(ig).and.(RefineScale(ig).gt.0)) THEN
                IF (MOD(dt(dg)*SecScale,dt(ig)*SecScale).ne.0.0_dp) THEN
                  IF (DOMAIN(ng)%SouthWest_Test(tile)) THEN
                    IF (Master) THEN
                      WRITE (stdout,100) ig, dt(ig), dg, dt(dg),            &
         &                               MOD(dt(dg),dt(ig))
    The conditional MOD(dt(dg)*SecScale?, dt(rg)*SecScale?) must be zero to not trigger an error. Again, many thanks to Takumu Iwamoto for reporting this problem.
  • dateclock.F: Corrected typo in routine datenum when computing its values in seconds:
    !  Fractional date number (units=second).
          DateNumber(2)=REAL(MyDay,dp)*86400.0_dp+                          &
         &              REAL(MyHour,dp)*3600.0_dp+                          &
         &              REAL(MyMinutes,dp)*60.0_dp+                         &
         &              MySeconds
    We needed a factor of 3600 instead of 360. Many thanks to Rafael Soutelino for reporting this bug.
  • rpcg_lanczos.F: Corrected a parallel bug before calling cg_write_rpcg, which writes several parameters (Jf, Jdata, Jmod, Jopt, Jb, Jobs, Jact, preducv, preducy) that are only known by the master node. We need to broadcast their values to other nodes:
         CALL mp_bcastf (ng, model, Jf)
         CALL mp_bcastf (ng, model, Jdata)
         CALL mp_bcastf (ng, model, Jmod)
         CALL mp_bcastf (ng, model, Jopt)
         CALL mp_bcastf (ng, model, Jobs)
         CALL mp_bcastf (ng, model, Jact)
         CALL mp_bcastf (ng, model, preducv)
         CALL mp_bcastf (ng, model, preducy)
    since all the nodes participate in the writing. Many thanks to Andy Moore for bringing this to my attention.
  • mod_scalars.F: Added value for Jerlov water type 7:
            real(r8), dimension(9) :: lmd_mu1 =                             &
         &            (/ 0.35_r8, 0.6_r8,  1.0_r8,  1.5_r8, 1.4_r8,         
         &               0.42_r8, 0.37_r8, 0.33_r8, 0.00468592_r8 /)
    instead of a zero value. Many thnaks to Pierre St-Laurent for bringing this to my attention.
  • fennel.h: Added masing for wetting and drying. Many thanks to John Wilkin for reporting this issue.
  • mod_kinds.F: Included cppdef.h to have access to defined C-preprocessing options. Many thanks to Aaron Tsang for reporting this problem.
  • ana_psource.h: Improved condtional:
          IF (iic(ng).eq.ntstart(ng).or.(iic(ng).eq.0)) THEN
    so we can have anlitical initial conditions since iic(ng)=0. Many thanks to Jamie Pringle for reporting it.

Also, I updated set_ngfld.F, set_2dfld.F, set_3dfld.F, set_ngfldr.F, set_2dfldr.F, set_3dfldr.F for the correct double precision operations when SINGLE_PRECISION is activated. Recall that double precision is need for few variables fo guarantee accuracy.

Change History (1)

comment:1 Changed 2 years ago by arango

  • Resolution set to Fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.