wiki:TracQuery

Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, which can be used to display tickets that meet specified criteria.

To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.

Filters

When you first go to the query page, the default filter will display tickets relevant to you:

  • If logged in then all open tickets, it will display open tickets assigned to you.
  • If not logged in but you have specified a name or email address in the preferences, then it will display all open tickets where your email (or name if email not defined) is in the CC list.
  • If not logged in and no name/email is defined in the preferences, then all open issues are displayed.

Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the dropdown lists at the bottom corners of the filters box; 'And' conditions on the left, 'Or' conditions on the right. Filters with either a text box or a dropdown menu of options can be added multiple times to perform an Or on the criteria.

You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.

After you have edited your filters, click the Update button to refresh your results.

Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.

You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria , the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.

The query results can be refreshed and cleared of these status indicators by clicking the Update button again.

Saving Queries

Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.

Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.

Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.

You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.

[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]

Which is displayed as:

Active tickets against 1.0

This uses a very simple query language to specify the criteria, see Query Language.

Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:

[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]

Which is displayed as:

Assigned tickets by owner

Customizing the table format

You can also customize the columns displayed in the table format (format=table) by using col=<field>. You can specify multiple fields and what order they are displayed in by placing pipes (|) between the columns:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Results (1 - 3 of 840)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#841 Fixed Corrected bug in contact.m arango
#840 Done IMPORTANT: Updated ROMS test repository arango
#839 Done VERY IMPORTANT: Tracer Advection Revisited arango
1 2 3 4 5 6 7 8 9 10 11

Full rows

In table format you can also have full rows by using rows=<field>:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 840)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#841 Fixed Corrected bug in contact.m arango
Description

The local function refine_coordinates in contact.m has the wrong interpolant:

%--------------------------------------------------------------------------
% Interpolate other grid variables.
%--------------------------------------------------------------------------

if (spherical)
  if (~isempty(G(dg).x_rho) && ~isempty(G(dg).y_rho))

    FCr.Values = G(dg).angle(:);    R.angle = FCr(XrF, YrF); 
    FCr.Values = G(dg).f(:);        R.f     = FCr(XrF, YrF); 
    FCr.Values = G(dg).h(:);        R.h     = FCr(XrF, YrF); 

  elseif (~isempty(G(dg).lon_rho) && ~isempty(G(dg).lat_rho))

    FSr.Values = G(dg).angle(:);    R.angle = FSr(XrF, YrF); 
    FSr.Values = G(dg).f(:);        R.f     = FSr(XrF, YrF); 
    FSr.Values = G(dg).h(:);        R.h     = FSr(XrF, YrF); 
  
  end

else

  FCr.Values = G(dg).angle(:);      R.angle = FCr(XrF, YrF); 
  FCr.Values = G(dg).f(:);          R.f     = FCr(XrF, YrF); 
  FCr.Values = G(dg).h(:);          R.h     = FCr(XrF, YrF); 

end

We needed to use FSr functional for the middle conditional. Many thanks to Daijiro Kobashi for reporting this bug.

#840 Done IMPORTANT: Updated ROMS test repository arango
Description
  • The test repository was updated to include all the changes due to the tracer advection scheme src:ticket:839 that it now specified in ROMS standard input (roms.in) file. All the tracer advection CPP options were removed from the header file (application.h). However, the obsolete CPP options are still available in the build scripts so that one may run an older version of ROMS. For example, in build_roms.sh for the upwelling test case, we have:
    # The tracer advection is specified in the standard input file, but the
    # CPP options can be specified here for older versions for backward
    # compatibility.
    
    #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DTS_U3HADVECTION -DTS_C4VADVECTION"
    #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DTS_MPDATA"
    
  • Corrected edit_multifile.F for the case FWD2HIS when using a single-file trajectory for the W4D-PSAS forecast sensitivity driver:
    !
    !  Save FWD information into the HIS structure so it can be used to
    !  process the NLM background trajectory by the ADM and TLM kernels.
    !  If multi-file, FWD(ng)%head and FWD(ng)%base is overwritten to
    !  default values. The initialized values in "load_s1d" are incorrect
    !  because the specified input filenames are already split.
    !
              CASE ('FWD2HIS')
                Nfiles=FWD(ng)%Nfiles
                IF (Nfiles.gt.1) THEN
                  ...
                ELSE
                  HIS(ng)%ncid=FWD(ng)%ncid
                  HIS(ng)%files(1)=TRIM(FWD(ng)%files(1))
                  HIS(ng)%name=TRIM(HIS(ng)%files(1))
                  Istring=INDEX(HIS(ng)%name,'_outer',BACK=.FALSE.)
                  IF (Istring.gt.0) THEN     ! outer loop prefix
                    lstr=Istring-1
                    HIS(ng)%head=TRIM(ADJUSTL(HIS(ng)%name(1:lstr)))
                    HIS(ng)%base=TRIM(ADJUSTL(HIS(ng)%name(1:lstr)))
                  END IF
                END IF
    
    Many thanks to Andy More Patrick Drake for bringing this issue to my attention.
  • Removed NL_BULK_FLUXES conditional during the initialization of the BLK structure in read_phypar.F. We have instead:
    #ifdef BULK_FLUXES
    !
    !  Allocate and initialize BLK I/O structure with the same values as
    !  HIS.
    !
          DO ng=1,Ngrids
            OutFiles=HIS(ng)%Nfiles
            allocate ( BLK(ng)%Nrec(OutFiles) )
            allocate ( BLK(ng)%time_min(OutFiles) )
            allocate ( BLK(ng)%time_max(OutFiles) )
            allocate ( BLK(ng)%Vid(NV) )
            allocate ( BLK(ng)%Tid(MT) )
            allocate ( BLK(ng)%files(OutFiles) )
            BLK(ng)%Nfiles=OutFiles
            BLK(ng)%Fcount=1
            BLK(ng)%Rindex=0
            BLK(ng)%ncid=-1
            BLK(ng)%Vid(1:NV)=-1
            BLK(ng)%Tid(1:MT)=-1
            BLK(ng)%Nrec=0
            BLK(ng)%time_min=0.0_dp
            BLK(ng)%time_max=0.0_dp
            BLK(ng)%label='BLK - nonlinear model bulk fluxes'
          END DO
    #endif
    
#839 Done VERY IMPORTANT: Tracer Advection Revisited arango
Description

All the tracer advection CPP options were removed and replaced with logical switches to facilitate applying a desired horizontal and vertical scheme to each tracer. One may have a particular scheme for temperature and a different for salinity, inert, biological, or sediment tracer. It is usually desirable to have a positive-definite or monotonic algorithm for salinity and passive tracers.

  • WARNING: ROMS standard input files for physics, biology, and sediment were modified to include the tracer advection switches. In roms.in we have:
    ! Set horizontal and vertical advection schemes for active and inert
    ! tracers. A different advection scheme is allowed for each tracer.
    ! For example, a positive-definite (monotonic) algorithm can be activated
    ! for salinity and inert tracers, while a different one is set for
    ! temperature. [1:NAT+NPT,Ngrids] values are expected.
    !
    !   Keyword    Advection Algorithm
    !
    !   A4         4th-order Akima (horizontal/vertical)
    !   C2         2nd-order centered differences (horizontal/vertical)
    !   C4         4th-order centered differences (horizontal/vertical)
    !   HSIMT      3th-order HSIMT-TVD (horizontal/vertical)
    !   MPDATA     recursive flux corrected MPDATA (horizontal/vertical)
    !   SPLINES    parabolic splines (only vertical)
    !   SU3        split third-order upstream (horizontal/vertical)
    !   U3         3rd-order upstream-biased (only horizontal)
    !
    ! The user has the option of specifying the full Keyword or the first
    ! two letters, regardless if using uppercase or lowercase. If nested
    ! grids, specify values for each grid (see glossary below).
    
       Hadvection == U3       \                     ! temperature
                     MPDATA                         ! salinity
    
       Vadvection == C4       \                     ! temperature
                     MPDATA                         ! salinity
    
    ! Adjoint-based algorithms can have different horizontal and schemes
    ! for active and inert tracers.
    
    ad_Hadvection == U3       \                     ! temperature
                     U3                             ! salinity
    
    ad_Vadvection == C4       \                     ! temperature
                     C4                             ! salinity
    

Notice that similar switches are defined for the adjoint-based algorithms.

For the Fennel biological model, we specify the tracer advection switches in bio_fennel.in :

! Set horizontal and vertical advection schemes for biological tracers.
! A different advection scheme is allowed for each tracer. For example,
! a positive-definite (monotonic) algorithm can be activated for
! salinity and biological tracers, while a different one is set for
! temperature. [1:NAT+NPT,Ngrids] values are expected.
!
!   Keyword    Advection Algorithm
!
!   A4         4th-order Akima (horizontal/vertical)
!   C2         2nd-order centered differences (horizontal/vertical)
!   C4         4th-order centered differences (horizontal/vertical)
!   HSIMT      3th-order HSIMT-TVD (horizontal/vertical)
!   MPDATA     recursive flux corrected MPDATA (horizontal/vertical)
!   SPLINES    parabolic splines (only vertical)
!   SU3        split third-order upstream (horizontal/vertical)
!   U3         3rd-order upstream-biased (only horizontal)
!
! The user has the option of specifying the full Keyword or the first
! two letters, regardless if using uppercase or lowercase. If nested
! grids, specify values for each grid.

   Hadvection == HSIMT    \                     ! idbio( 1), NO3
                 HSIMT    \                     ! idbio( 2), NH4
                 HSIMT    \                     ! idbio( 3), chlorophyll
                 HSIMT    \                     ! idbio( 4), phytoplankton
                 HSIMT    \                     ! idbio( 5), zooplankton
                 HSIMT    \                     ! idbio( 6), LdetritusN
                 HSIMT    \                     ! idbio( 7), SdetritusN
                 HSIMT    \                     ! idbio( 8), LdetritusC
                 HSIMT    \                     ! idbio( 9), SdetritusC
                 HSIMT    \                     ! idbio(10), TIC
                 HSIMT    \                     ! idbio(11), alkalinity
                 HSIMT                          ! idbio(12), oxygen

   Vadvection == HSIMT    \                     ! idbio( 1), NO3
                 HSIMT    \                     ! idbio( 2), NH4
                 HSIMT    \                     ! idbio( 3), chlorophyll
                 HSIMT    \                     ! idbio( 4), phytoplankton
                 HSIMT    \                     ! idbio( 5), zooplankton
                 HSIMT    \                     ! idbio( 6), LdetritusN
                 HSIMT    \                     ! idbio( 7), SdetritusN
                 HSIMT    \                     ! idbio( 8), LdetritusC
                 HSIMT    \                     ! idbio( 9), SdetritusC
                 HSIMT    \                     ! idbio(10), TIC
                 HSIMT    \                     ! idbio(11), alkalinity
                 HSIMT                          ! idbio(12), oxygen

Alternatively, it advantageous to specify the tracer advection switches in a compact form. For example, in ecosim.in we have:

   Hadvection == HSIMT                          ! idbio(:), compact

   Vadvection == HSIMT                          ! idbio(:), compact

! Adjoint-based algorithms can have different horizontal and schemes
! for active and inert tracers.

ad_Hadvection == U3                             ! idbio(:), compact

ad_Vadvection == C4

That is all EcoSim tracers have the same tracer advection algorithm. A similar strategy can be used for the sediment tracers in sediment.in.

In a nested application, the syntax is as follows:

   Hadvection == A4       \                     ! temperature, Grid 1
                 A4       \                     ! temperature, Grid 2
                 A4       \                     ! temperature, Grid 3
                 HSIMT    \                     ! salinity,    Grid 1
                 HSIMT    \                     ! salinity,    Grid 2
                 HSIMT                          ! salinity,    Grid 3
 
   Vadvection == A4       \                     ! temperature, Grid 1
                 A4       \                     ! temperature, Grid 2
                 A4       \                     ! temperature, Grid 3
                 HSIMT    \                     ! salinity,    Grid 1
                 HSIMT    \                     ! salinity,    Grid 2
                 HSIMT                          ! salinity,    Grid 3

  • A new tracer scheme HSIMT (Wu and Zhu, 2010) that uses a Total Variation Diminishing (TVD) limiter is included. It is adapted from Hui Wu code and implemented in COAWST by Tarandeep Kalra and John Warner. The HSIMT algorithm can be used for salinity and passive tracer to achieve monotonicity. For more information, check the following publication:
        Hui Wu and Jianrong Zhu, 2010: Advection scheme with 3rd          
          high-order spatial interpolation at the middle temporal
          level and its application to saltwater intrusion in 
          Changjiang Estuary, Ocean Modelling 33, 33-51,                  
          doi:10.1016/j.ocemod.2009.12.001
    
    The HSIMT algorithm is inlined into ROMS code in step3d_t.F instead of calling a subroutine inside of DO-loops to avoid computational inefficiency and facilitate the tangent linear and adjoint transformation.

It is recommended to use HSIMT or MPDATA for passive tracers since the have a positive-definite dynamical range. The HSIMT is more modern and efficient than the recursive MPDATA algorithm. When using HSIMT or MPDATA, the user needs to specify the same scheme for both horizontal and vertical tracer advection.

  • All the tracer advection algorithms are available at run time. For example, in the step3d_t.F the horizontal advective fluxes are computed as:
             HADV_FLUX : IF (Hadvection(itrc,ng)%CENTERED2) THEN
    
               FX(i,j) = ...
               FE(i,j) = ...
    
             ELSE IF (Hadvection(itrc,ng)%MPDATA) THEN
    
               FX(i,j) = ...
               FE(i,j) = ...
    
             ELSE IF (Hadvection(itrc,ng)%HSIMT) THEN
    
               FX(i,j) = ...
               FE(i,j) = ...
    
             ELSE IF ((Hadvection(itrc,ng)%AKIMA4).or.                     &
        &             (Hadvection(itrc,ng)%CENTERED4).or.                  &
        &             (Hadvection(itrc,ng)%SPLIT_U3).or.                   &
        &             (Hadvection(itrc,ng)%UPSTREAM3)) THEN
    
               FX(i,j) = ...
               FE(i,j) = ...
    
             END IF HADV_FLUX
    
    and for vertical advective flux
              VADV_FLUX : IF (Vadvection(itrc,ng)%SPLINES) THEN
    
                FC(i,k) = ..
    
              ELSE IF (Vadvection(itrc,ng)%AKIMA4) THEN
    
                FC(i,k) = ..
    
              ELSE IF (Vadvection(itrc,ng)%CENTERED2) THEN
    
                FC(i,k) = ..
    
              ELSE IF (Vadvection(itrc,ng)%MPDATA) THEN
    
                FC(i,k) = ..
    
              ELSE IF (Vadvection(itrc,ng)%HSIMT) THEN
    
                FC(i,k) = ..
    
              ELSE IF ((Vadvection(itrc,ng)%CENTERED4).or.                  &
         &             (Vadvection(itrc,ng)%SPLIT_U3)) THEN
    
                FC(i,k) = ..
    
              END IF VADV_FLUX
    

A similar structure is found in pre_step3d.F.

  • The new tracer advection strategy was tested to get identical results regardless of the parallel partitions in distributed-memory (MPI), shared-memory (OpenMP), and serial with tiled partitions. It is only possible in double precision computations. In serial precision with double precision IO, the solution are not identical because of round-off. The user needs to be aware of the computational sensitivity in parallel single-precision applications. The solution differs as a function of the tile partition.
  • The HSIMT and MPDATA algorithms are not implemented in the tangent linear and adjoint codes. MPDATA is very tricky because of the recursive algorithm in the anti-diffusivity correction.
  • The tracer advection switches are reported in the output NetCDF files global attribute NLM_TADV:
                   :NLM_TADV = "\n",
                           "ADVECTION:      HORIZONTAL   VERTICAL     \n",
                           "temp:           Upstream3    Centered4    \n",
                           "salt:           HSIMT        HSIMT        \n",
                           "NO3:            HSIMT        HSIMT        \n",
                           "NH4:            HSIMT        HSIMT        \n",
                           "chlorophyll:    HSIMT        HSIMT        \n",
                           "phytoplankton:  HSIMT        HSIMT        \n",
                           "zooplankton:    HSIMT        HSIMT        \n",
                           "LdetritusN:     HSIMT        HSIMT        \n",
                           "SdetritusN:     HSIMT        HSIMT        \n",
                           "LdetritusC:     HSIMT        HSIMT        \n",
                           "SdetritusC:     HSIMT        HSIMT        \n",
                           "TIC:            HSIMT        HSIMT        \n",
                           "Talk:           HSIMT        HSIMT        \n",
                           "oxyg:           HSIMT        HSIMT" ;
    
  • The old tracer advection CPP options will be ignored in ROMS. Therefore, Users may want to still keep then in the application header file to run with older versions of ROMS.
  • We strongly discourage you from using the parabolic splines vertical advection (SPLINES) scheme in realistic applications! It was intended for use in idealized toy problems. It is still available for historical reasons and backward compatibility.
1 2 3 4 5 6 7 8 9 10 11

Query Language

query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Filters are separated by ampersands (&). Each filter consists of the ticket field name, an operator and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values. To include a literal & or | in a value, escape the character with a backslash (\).

The available operators are:

= the field content exactly matches one of the values
~= the field content contains one or more of the values
^= the field content starts with one of the values
$= the field content ends with one of the values

All of these operators can also be negated:

!= the field content matches none of the values
!~= the field content does not contain any of the values
!^= the field content does not start with any of the values
!$= the field content does not end with any of the values

The date fields created and modified can be constrained by using the = operator and specifying a value containing two dates separated by two dots (..). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be omitted to avoid having to quote the query string.

created=2007-01-01..2008-01-01 query tickets created in 2007
created=lastmonth..thismonth query tickets created during the previous month
modified=1weekago.. query tickets that have been modified in the last week
modified=..30daysago query tickets that have been inactive for the last 30 days

See also: TracTickets, TracReports, TracGuide, TicketQuery

Last modified 3 years ago Last modified on Jun 20, 2017 2:27:28 PM