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 828)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#829 Done Updated few files arango
#828 Done Matlab Scripts to Compute Coupling Melding Coefficents arango
#827 Done IMPORTANT: ESM Run Sequence from Configuration File 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 828)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#829 Done Updated few files arango
Description

This is a minor update to the following files:

  • read_phypar.F: Reports ROMS I/O variables metadata file to standard output.
    Output/Input Files:
    
      ...
      ROMS I/O variables Metadata File:  ../Data/varinfo.dat
    
  • build_roms.bash: Add MVAPICH2 to which_MPI macro variable.
     export        USE_MPIF90=on            # compile with mpif90 script
    #export         which_MPI=mpich         # compile with MPICH library
    #export         which_MPI=mpich2        # compile with MPICH2 library
    #export         which_MPI=mvapich2      # compile with MVAPICH2 library
     export         which_MPI=openmpi       # compile with OpenMPI library
    
  • build_roms.sh: Add MVAPICH2 to which_MPI macro variable.
     setenv USE_MPIF90          on          # compile with mpif90 script
    #setenv which_MPI           mpich       # compile with MPICH library
    #setenv which_MPI           mpich2      # compile with MPICH2 library
    #setenv which_MPI           mvapich2    # compile with MVAPICH2 library
     setenv which_MPI           openmpi     # compile with OpenMPI library
    
  • Corrected information spellings in ESMF RunSequence configuration files: coamps_explicit.runconfig, coamps_implicit.runconfig, wrf_explicit.runconfig, and wrf_implicit.runconfig.
#828 Done Matlab Scripts to Compute Coupling Melding Coefficents arango
Description
  • The Melding coefficients are used to combine fields from DATA and ESM components. The weight factors are read from the input NetCDF specified in the WeightsFile(atmos) keyword of coupling_esmf.in The user has full control of how the merging is done. It is recommended to provide a gradual transition between the two components.

Recall that the DATA component supplies needed data to a particular ESM component. For example, it may export data to the atmosphere model at locations not covered by the other ESM components because of smaller grid coverage. If the atmosphere and ocean model grids are incongruent, the atmosphere component needs to import sea surface temperature (SST) on those grid points not covered by the ocean component. Thus, the weighting coefficients are used to merge the SST data:

        SST_atm(:,:) = Cesm(:,:) * SST_esm(:,:) + Cdat(:,:) * SST_dat(:,:)
where
        Cesm(:,:) + Cdat(:,:) = 1.

In coupling_esmf.in, we now have:

! Weighted coefficients for the merging of DATA component fields with the same
! field from other ESM components. Melding coefficients are positive and MUST
! add to unity. They are read from an input NetCDF file ('WeightsFile'). The
! user needs to specify the NetCDF variable names for the weights for the DATA
! ('VnameDATA') and ESM ('VnameESM') components. Currently, the weight values
! are only needed by the atmosphere component.

WeightsFile(atmos) == meld_weights_atm.nc
  VnameDATA(atmos) =  data_weight
   VnameESM(atmos) =  ocean_weight

We no longer use the WeightDAT and WeightESM constant parameters from previous versions.

  • Several functions to compute melding weights between DATA and ROMS coupling components for exporting fields to the atmosphere component.
    • c_weithts.m: Creates a new weight factor NetCDF file for melding DATA and OCEAN components during ESMF coupling.
    • coamps_weights.m: Computes and writes the COAMPS melding weights to combine fields from DATA and ROMS components after ESMF regridding to the atmosphere grid.
    • smooth_weights.m: Computes smooth melding weights to combine fields from DATA and OCEAN components. The merging factors change gradually in an area next to the OCEAN grid open boundary.
    • wrf_weights.m: Computes and writes the WRF melding weights to combine fields from DATA and ROMS components after ESMF regridding to the atmosphere grid.

Many thanks to John Wilkin for his help in coding the generic Matlab script smooth_weights.m to compute the varying weight factors at each grid cell of the atmosphere grid.

  • The coamps_weights.m is used to compute the melding weight factors for COAMPS 15km resolution grid that combines SST from the DATA (HyCOM) and ROMS components in the Indian Ocean coupled application.

http://www.myroms.org/trac/coamps_15km_weights.png

Here, N=200 is the number of convolutions used to smooth the transition between DATA and ROMS components.

  • The wrf_weights.m is used to compute the melding weight factors for WRF 6km resolution grid that combines SST from the DATA (HyCOM) and ROMS components in a U.S. East Coast application to study Hurricanes Irene and Sandy.

http://www.myroms.org/trac/wrf_6km_weights.png

  • The c_weights.m creates a simple NetCDF file containing both the rigid and smooth weights for the DATA and OCEAN components.
    netcdf wrf6km_meld_weights {
    dimensions:
            lon = 319 ;
            lat = 279 ;
    variables:
            double lon(lat, lon) ;
                    lon:long_name = "longitude" ;
                    lon:standard_name = "longitude" ;
                    lon:units = "degrees_east" ;
            double lat(lat, lon) ;
                    lat:long_name = "latitude" ;
                    lat:standard_name = "latitude" ;
                    lat:units = "degrees_north" ;
            double mask(lat, lon) ;
                    mask:long_name = "land-sea mask" ;
                    mask:flag_values = 0., 1. ;
                    mask:flag_meanings = "land sea" ;
                    mask:coordinates = "lon lat" ;
            double data_weight_rigid(lat, lon) ;
                    data_weight_rigid:long_name = "DATA component rigid melding weights" ;
                    data_weight_rigid:valid_min = 0. ;
                    data_weight_rigid:valid_max = 1. ;
                    data_weight_rigid:coordinates = "lon lat" ;
            double ocean_weight_rigid(lat, lon) ;
                    ocean_weight_rigid:long_name = "OCEAN component rigid melding weights" ;
                    ocean_weight_rigid:valid_min = 0. ;
                    ocean_weight_rigid:valid_max = 1. ;
                    ocean_weight_rigid:coordinates = "lon lat" ;
            double data_weight_smooth(lat, lon) ;
                    data_weight_smooth:long_name = "DATA component smooth melding weights" ;
                    data_weight_smooth:valid_min = 0. ;
                    data_weight_smooth:valid_max = 1. ;
                    data_weight_smooth:coordinates = "lon lat" ;
            double ocean_weight_smooth(lat, lon) ;
                    ocean_weight_smooth:long_name = "OCEAN component smooth melding weights" ;
                    ocean_weight_smooth:valid_min = 0. ;
                    ocean_weight_smooth:valid_max = 1. ;
                    ocean_weight_smooth:coordinates = "lon lat" ;
    
    // global attributes:
                    :Conventions = "CF-1.0" ;
                    :title = "WRF coupling import field melding weights between `DATA and ROMS components" ;
                    :wrf_grid = "/s1/arango/ocean/repository/Projects/irene/Data/WRF/6km/irene_wrf_inp_d01.nc" ;
                    :roms_grid = "/s1/arango/ocean/repository/Projects/om/grid_doppio_JJA_v12n.nc" ;
                    :convolutions = "150" ;
                    :history = "Weights file created using Matlab script /Users/arango/ocean/repository/matlab/coupling/wrf_weights.m 24-Oct-2019 21:39:02" ;
    
  • Added and updated several Matlab scripts.
#827 Done IMPORTANT: ESM Run Sequence from Configuration File arango
Description
  • The ESM run sequence is now set, by default, from a new input configuration file (Keyword: CONFname) in the coupling standard input script (coupling_esmf.in). It is a more elegant option than the hundreds, if not thousands, lines of code in module esmf_esm.F. It will facilitate complex RunSequence execution with more than one-time loop (time slots) and an increased number of coupled components. The NUOPC layer generates the RunSequence automatically. It can be changed without recompiling. It also facilitates updates to newer versions of the ESMF/NUOPC library.
  • Examples of RunSequence templates are provided for coupling ROMS to either COAMPS or WRF explicitly or semi-implicitly:
    • ESM/coamps_explicit.runconfig
    • ESM/coamps_implicit.runconfig
    • ESM/wrf_explicit.runconfig
    • ESM/wrf_implicit.runconfig

For the DATA-WRF-ROMS semi-implicit coupling with a single time loop (denoted by the at symbol @), we have:

#
# svn $Id$
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Copyright (c) 2002-2019 The ROMS/TOMS Group                           :::
#   Licensed under a MIT/X style license                                :::
#   See License_ROMS.txt                                                :::
#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
#                                                                       :::
# DATA-WRF-ROMS semi-implicit ESMF coupling:                            :::
#                                                                       :::
# This ESMF configuration file includes the Run Sequence to couple      :::
# DATA, WRF, and ROMS components. All the components interact with      :::
# the same coupling time step. The connector from ROMS to WRF is        :::
# explicit, whereas the connector from WRF to ROMS is semi-implicit.    :::
# Usually, the timestep of the atmosphere kernel is smaller than that   :::
# for the ocean. Therefore, WRF export files are time-averaged over     :::
# the coupling interval, which is the same as the ROMS timestep. It     :::
# is semi-implicit because ROMS right-hand-side terms are forced with   :::
# n+1/2 WRF fields because of the time-averaging.                       :::
#                                                                       :::
# The time-averaging is activated with WRF_TIMEAVG in the ROMS build    :::
# script. The WRF "namelist.input" needs to include the parameters      :::
# for the RAMS averaged diagnostics in the &time_control section.       :::
# The User needs to check that the single coupling interval specified   :::
# here is the same as for the ROMS coupling standard input script       :::
# (keyword TimeStep).                                                   :::
#                                                                       :::
# It is not necessary to specify options to the connectors here for     :::
# the "remapMethod" since it is specified in the input coupling         :::
# metada file (keyword CPLname) for each exchanged field.               :::
#                                                                       :::
# The component label is specific to how is known in the ESMF driver.   :::
# It is set in subroutine allocate_esmf_esm, variable MODELS(:)%name.   :::
#                                                                       :::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# Hurricane Irene Application

runSeq::
  @60                        # 1 min coupling time step, single time loop
    DATA -> WRF_01           # DATA to WRF connector
    DATA
    ROMS_01 -> WRF_01        # ROMS to WRF connector
    WRF_01
    WRF_01 -> ROMS_01        # WRF to ROMS connector
    ROMS_01
  @
::

As you can see, the syntax is straightforward and implies thousands of line of code that we can avoid. See NUOPC_refdoc_*.doc for details about the synthax. The User needs to make sure that the coupling time step in seconds (@60) has the same value of TimeStep specified in coupling_esmf.in:

! Set ESM coupling driver clock. If not re-starting, set StartTime and
! RestartTime to the same values.  Set coupling time interval (TimeStep)
! to the largest value for the field exchange between activated ESM
! components. Check glossary below for more information.
!
!                     YYYY MM DD hh mm ss

     ReferenceTime =  2006 01 01 00 00 00   ! Simulation reference time
         StartTime =  2011 08 27 00 00 00   ! Simulation start time
       RestartTime =  2011 08 27 00 00 00   ! Simulation restart time
          StopTime =  2011 08 29 00 00 00   ! Simulation stop time
          TimeStep =  0000 00 00 00 01 00   ! Coupler driver interval (60 sec ROMS DT)

Here, ROMS DT=60 and larger than the one for WRF. Therefore, the exchange of fields between DATA, WRF, and ROMS components is done every 60 seconds. The execution will stop if both values are not the same.

  • A new C-preprocessing option NO_ESMF_CONFIG to preserve the hundreds of line of coding in esmf_esm.F. Such code and option will be removed in the future.
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 2 years ago Last modified on Jun 20, 2017 2:27:28 PM