Custom Query (964 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (667 - 669 of 964)

Ticket Owner Reporter Resolution Summary
#628 arango arango Done Matlab scripts to process sponges and nudging inverse time scales
Description

Two new Matlab scripts were added to process sponges and nudging inverse time scales. See src:ticket:627 for detailed documentation.

  • grid/add_sponge.m: Adds enhanced viscosity and diffusion scaling variables (visc_factor and diff_factor) to an existing ROMS Grid NetCDF file. These scales are used in an application to set sponge areas with larger horizontal mixing coefficients for the damping of high frequency noise coming from open boundary conditions or nesting. In ROMS, these scales are used as follows:
       visc2_r(i,j) = visc2_r(i,j) * visc_factor(i,j)
       visc4_r(i,j) = visc4_r(i,j) * visc_factor(i,j)
    
       diff2(i,j,itrc) = diff2(i,j,itrc) * diff_factor(i,j)
       diff4(i,j,itrc) = diff4(i,j,itrc) * diff_factor(i,j)
    
    where the variables visc_factor and diff_factor are defined at RHO-points. Usually, sponges are linearly tapered over several grid points adjacent to the open boundaries. Its positive values linearly increases from the inner to outer edges of the sponge. At the interior of the grid we can values of zero (no mixing) or one (regular mixing).

NOTICE that it is more advantageous to specify these scaling factors in the ROMS Grid that coding it inside ROMS. We can plot and adjust their values in an easy way in Matlab.

  • initial/d_nudgcoef.m: This a user modifiable script that can be used to prepare ROMS nudging inverse time scales NetCDF file. It sets-up all the necessary parameters and variables. Users can use this as a prototype for their application.

Nudging to climatology can be used in ROMS for various purposes:

. Improve the behavior of open boundary conditions.

. Used in conjunction with sponges.

. Minimize numerical diapycnal mixing of tracers over steep bathymetry (improve T-S properties in deep water masses). For example, we can nudge to T-S climatology is areas deeper than 1500 m.

The inverse nudging coefficients have units of 1/time. The default input units in ROMS is 1/day but 1/second is also possible. The routine get_nudgcoef.F will check the units attribute to compute the conversion factor for 1/second. Users need to be sure the units variable attribute is consistent with the written data.

The variable names for the nudging coefficients is as follows:

    M2_NudgeCoef       for 2D momentum
    M3_NudgeCoef       for 3D momentum
    temp_NudgeCoef     for potential temperature
    salt_NudgeCoef     for salinity
    ...
    NO3_NudgeCoef      for nitrate
    ...
    tracer_NudgeCoef   for any generic tracer

They are all defined at RHO-points. If the nudging coefficients for a specific tracer are available in the NetCDF, ROMS will read that NetCDF variable. If NOT and the generic coefficients tracer_NudgeCoef are available, ROMS will process those values instead.

Notice that the input switch LnudgeTCLM(itrc,ng) in ROMS input script ocean.in will control which trace to nudge in the desired grid.

Currently, the nudging coefficients are time invariant in ROMS. The same scales are used for the entire simulation.

#629 arango arango Fixed Corrected typo when reporting biology parameters
Description

Corrected typo when reporting the LtracerCLM and LnudgeTCLM logical switches in ecosim_inp.h, fennel_inp.h, nemuro_inp.h, npzd_Franks_inp.h, npzd_Powell_inp.h, and npzd_iron_inp.h. An IF-statement was not terminated correctly. We need to have instead:

            DO itrc=1,NBT
              i=idbio(itrc)
              IF (LtracerCLM(i,ng)) THEN
                WRITE (out,110) LtracerCLM(i,ng), 'LtracerCLM', i,      &
     &              'Turning ON  processing of climatology tracer ', i, &
     &              TRIM(Vname(1,idTvar(i)))
              ELSE
                WRITE (out,110) LtracerCLM(i,ng), 'LtracerCLM', i,      &
     &              'Turning OFF processing of climatology tracer ', i, &
     &              TRIM(Vname(1,idTvar(i)))
              END IF
            END DO
            DO itrc=1,NBT
              i=idbio(itrc)
              IF (LnudgeTCLM(i,ng)) THEN
                WRITE (out,110) LnudgeTCLM(i,ng), 'LnudgeTCLM', i,      &
     &              'Turning ON  nudging of climatology tracer ', i,    &
     &              TRIM(Vname(1,idTvar(i)))
              ELSE
                WRITE (out,110) LnudgeTCLM(i,ng), 'LnudgeTCLM', i,      &
     &              'Turning OFF nudging of climatology tracer ', i,    &
     &              TRIM(Vname(1,idTvar(i)))
              END IF
            END DO
#630 arango arango Fixed IMPORTANT: Corrected shared-memory bug
Description

A shared-memory bug was corrected for variables ntstart(ng), ntfirst(ng), and ntend(ng). Because of nesting, these variables were declared as THREADPRIVATE. However, this introduced a parallel bug when calling get_state to read initial conditions or restart fields. The routine get_state is only executed by the master thread. As a consequence, the above variables are only initialized in the master thread and their values are unknown to other shared-memory threads. Similar problem occurs for the time(ng) variable.

The solution is to remove the THREADPRIVATE clause for such variables and initialize them by master thread as follows:

!$OMP MASTER
        ntstart(ng)=INT((time(ng)-dstart*day2sec)/dt(ng))+1
        ntend(ng)=ntimes(ng)
        ntfirst(ng)=ntstart(ng)
!$OMP END MASTER
!$OMP BARRIER

and introduce a new scalar variable io_time to update the value of time(ng) for the other shared-memory threads after initialization or restart:

#ifdef INI_FILE
!
!  Read in initial conditions from initial NetCDF file.
!
      DO ng=1,Ngrids
!$OMP MASTER
        CALL get_state (ng, iNLM, 1, INI(ng)%name,                      &
     &                  IniRec(ng), Tindex(ng))
!$OMP END MASTER
# ifdef DISTRIBUTE
        CALL mp_bcasti (ng, iNLM, exit_flag)
# endif
!$OMP BARRIER
        IF (exit_flag.ne.NoError) RETURN
        time(ng)=io_time                     ! needed for shared-memory
      END DO
#else
!
!  If restart, read in initial conditions restart NetCDF file.
!
      DO ng=1,Ngrids
        IF (nrrec(ng).ne.0) THEN
!$OMP MASTER
          CALL get_state (ng, 0, 1, INI(ng)%name,                      &
     &                    IniRec(ng), Tindex(ng))
!$OMP END MASTER
# ifdef DISTRIBUTE
          CALL mp_bcasti (ng, iNLM, exit_flag)
# endif
!$OMP BARRIER
          IF (exit_flag.ne.NoError) RETURN
          time(ng)=io_time                   ! needed for shared-memory
        END IF
      END DO
#endif

Many thanks to Mark Hadfield for bringing this to my attention. This was also reported by Mitsuhiro Kawase.

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.