﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
469	IMPORTANT: Corrected parallel bug in ini_fields.F and friends	arango	arango	" * In src:ticket:178, Kate reported a shared-memory and serial with partition parallel bug in '''ini_fields.F''' when computing the vertically-integrated velocities ('''ubar''', '''vbar''').  We needed to have the computation of '''Hz''' via '''set_depth''' in a different parallel region.  In that ticket, I introduced a new routine '''ini_zeta''' which initialize '''Zt_avg1''' to the initial conditions for '''zeta'''.  The values of '''Zt_avg1''' (time-averaged/filtered '''zeta''') are the ones that actually used in '''set_depth.F'''.  Well, all of this is fine but I forgot to move the call to '''set_depth''' from '''ini_fields.F'''.  It is embarrassing... This needs to be done in a different parallel region in '''main3d.F''':
{{{
!
!  Initialize free-surface and compute initial level thicknesses and
!  depths.
!
!$OMP PARALLEL DO PRIVATE(thread,subs,tile) SHARED(ng,numthreads)
        DO thread=0,numthreads-1
          subs=NtileX(ng)*NtileE(ng)/numthreads
          DO tile=subs*thread,subs*(thread+1)-1,+1
            CALL ini_zeta (ng, TILE, iNLM)
            CALL set_depth (ng, TILE)
          END DO
        END DO
!$OMP END PARALLEL DO
!
!  Initialize other state variables.
!
!$OMP PARALLEL DO PRIVATE(thread,subs,tile) SHARED(ng,numthreads)
        DO thread=0,numthreads-1
          subs=NtileX(ng)*NtileE(ng)/numthreads
          DO tile=subs*(thread+1)-1,subs*thread,-1
            CALL ini_fields (ng, TILE, iNLM)
          END DO
        END DO
!$OMP END PARALLEL DO
}}}

 * The stratigraphic contributions to the bathymetry ('''h''') are  moved to '''ini_zeta''' since they are needed in '''set_depth''' when '''SEDIMENT''' and '''SED_MORPH''' are activated.

 * The routine '''ini_fields.F''' was cleaned and reorganized.  This included the TLM, RPM, and ADM versions.

 * Corrected a distributed-memory I/O bug in periodic application for the radiation stress variables '''Sxx_bar''', '''Sxy_bar''', '''Syy_bar''', '''Sxx''', '''Sxy''', '''Syy''', '''Szx''', and '''Szy'''.  These are all ouput variables and not used in ROMS kernel. A '''mp_exchange2''' and '''mp_exchange3''' is needed for these variables.

 * '''By the way''', the only way to apply periodic boundary conditions in a ROMS distributed-memory (MPI) application with more that one partition in the periodic direction is by a call to any of the '''mp_exchange''' routines since the array elements to be exchanged reside in a different node.

 * Re-organized routine '''radiation_stress.F''' to include new file '''nearshore_mellor05.h'''.  It turns out the there are various formulations for radiation stresses in the literature. The formulation of Mellor (2005) has some fundamental problems which were addressed in Mellor (2008) reformulation. In the future, we plan to have other formulations available in ROMS.  This is a very active topic in the literature nowadays. '''Be aware''' that the formulation currently distributed in ROMS is the one described by Mellor (2005) which has been replaced in Mellor (2008).  This new formulation is still under testing and not available. John Warner is working on other formulations nowadays.

 * To facilitate future developments, the option '''NEARSHORE_MELLOR''' is renamed to '''NEARSHORE_MELLOR05'''.

 * The driver routine '''radiation_stress.F''' will be renamed in the future to a more generic name since it will include other types of wave forcing.

 * Corrected '''negative zero''' problem in '''extract_sta.F'''. Starting F95 zero values can be signed (-0 or +0) following the IEEE 754 floating point standard. This can be advantageous in some computations but not here when '''Ascl''' is negative and '''Apos''' is zero.  This will produce different output files when comparing serial and distributed-memory applications (1x1 and any other tile partition combination are different). Since comparing serial and parallel output is essential for tracking parallel partition bugs, '''positive zero''' is enforced.      "	bug	closed	major	Release ROMS/TOMS 3.4	Nonlinear	3.4	Fixed		
