# roms.in

**Notice:** In SVN revision 933 (January 26, 2019), all "roms_*\.in" files were renamed to roms_*.in and all ocean* ROMS executables were renamed to roms* in order to facilitate and clarify model coupling efforts. More information can be found in the ROMS repository Trac ticket #794.

File roms.in is the ROMS standard input file to any model run. This file sets the application spatial dimensions and many of the parameters that are not specified at compile time, including parallel tile decomposition, timestepping, physical coefficients and constants, vertical coordinate set-up, logical switches and flags to control the frequency of output, the names of input and output NetCDF files, and additional input scripts names for data assimilation, stations, floats trajectories, ecosystem models, and sediment model.

This standard input ASCII file is organized in several sections as shown below, with links to more detailed explanation where required.

**Notice:** A detailed information about ROMS input script file syntax can be found here.

**Notice:** A default roms.in input script is provided in the **User/External** subdirectory. Also there are several standard input scripts in the **ROMS/External** subdirectory which are used in the distributed test cases. They are usually named roms_app.in where app is the lowercase of the test case cpp option.

## Contents

- 1 Configuration Parameters
- 2 Tracer Advection Schemes
- 3 Lateral Open Boundary Conditions Parameters
- 4 Timestepping and Iterations Parameters
- 5 Output Frequency Parameters
- 6 Physical and Numerical Parameters
- 7 Vertical Coordinates Parameters
- 8 Adjoint Sensitivity Parameters
- 9 Stochastic Optimals Parameters
- 10 History Output Variables Switches
- 11 Quicksave Output Variables Switches
- 12 Time-averaged Output Variables Switches
- 13 Time-averaged Diagnostic Output Variables Switches
- 14 Generic User Parameters
- 15 NetCDF-4/HDF5 Compression Parameters
- 16 Input NetCDF Files
- 17 Output NetCDF Files
- 18 Additional Input Scripts

## Configuration Parameters

- Application title. This string will be saved in the output NetCDF files. TITLE = Wind-Driven Upwelling/Downwelling over a Periodic Channel

- C-preprocessing Flag to define the specific configuration.MyAppCPP = UPWELLINGThough this is set by ROMS_APPLICATION in the makefile or build Script, ROMS is also compiled with
**-D$(ROMS_APPLICATION)**, which allows the use of#ifdef UPWELLINGfor instance. The net result of both-D$(ROMS_APPLICATION)=UPWELLING -DUPWELLINGis that**ROMS_APPLICATION**becomes**1**in the source code. ROMS therefore needs to be told the application name here as well in order to report it to the output file.

- Input variable information file name. This file needs to be processed first so all information arrays can be initialized properly. Notice that we need an absolute or relative path for input metadata file varinfo.dat. There are many posts in the ROMS Forum of new users that fail to specify the correct location of this file. Expert users usually have the own modified copy of this file for a particular application.VARNAME = ROMS/External/varinfo.dat

**NOTE:**Starting with**revision 460**file names can be up to 256 characters long. Previously only 80 characters were allowed.

- Number of nested grids.Ngrids = 1

- Number of grid nesting layers. This parameter is used to allow refinement and composite grid combinations.NestLayers = 1

- Number of grids in each nesting layer, [1:NestLayers] values are expected.GridsInLayer = 1

- Grid dimension parameters. These are used to dynamically allocate all model state variables upon execution.Lm == 41 ! Number of I-direction INTERIOR RHO-points

Mm == 80 ! Number of J-direction INTERIOR RHO-points

N == 16 ! Number of vertical levels

Nbed = 0 ! Number of sediment bed layers

NAT = 2 ! Number of active tracers (usually, 2)

NPT = 0 ! Number of inactive passive tracers

NCS = 0 ! Number of cohesive (mud) sediment tracers

NNS = 0 ! Number of non-cohesive (sand) sediment tracers

- Domain decomposition parameters for serial, distributed-memory or shared-memory configurations used to determine tile horizontal range indices (Istr,Iend) and (Jstr,Jend), [1:Ngrids] values are expected.

## Tracer Advection Schemes

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.

It is more advantageous to set the horizontal and vertical advection schemes for each tracer with switches instead of a single CPP flag for all of them. Positive-definite and monotonic algorithms (i.e., MPDATA and HSIMT) are appropriate and useful for positive fields like salinity, inert, biological, and sediment tracers. However, since the temperature has a dynamic range with negative and positive values in the ocean, other advection schemes are more appropriate.

Currently, the following tracer advection schemes are available and are activated using the associated Keyword:

- 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 with TVD limiter (horizontal/vertical)

MPDATA recursive flux corrected MPDATA (horizontal/vertical)

SPLINES parabolic splines reconstruction (only vertical)

SU3 split third-order upstream (horizontal/vertical)

U3 3rd-order upstresm-bias (only horizontal)

The user has the option of specifying the full Keyword or the first two letters, regardless if using uppercase or lowercase.

If using either HSIMT (Wu and Zhu, 2010) or MPDATA (Smolarkiewicz and Margolin, 1998) options, the user needs to set the same scheme for both horizontal and vertical advection to preserve monotonicity.

- Horizontal and vertical advection for each active (temperature and salinity) and inert tracer, [1:NAT+NPT,Ngrids] values are expected.Hadvection == U3 \ ! temperature

U3 \ ! salinity

HSIMT \ ! dye_01, inert(1)

HSIMT ! dy2_02, inert(2)

Vadvection == C4 \ ! temperature

C4 \ ! salinity

HSIMT \ ! dye_01, inert(1)

HSIMT ! dy2_02, inert(2)

- Horizontal and vertical advection for each active (temperature and salinity) and inert tracer for adjoint-based algorithms can have different horizontal schemes, [1:NAT+NPT,Ngrids] values are expected.ad_Hadvection == U3 \ ! temperature

U3 \ ! salinity

HSIMT \ ! dye_01, inert(1)

HSIMT ! dy2_02, inert(2)

ad_Vadvection == C4 \ ! temperature

C4 \ ! salinity

HSIMT \ ! dye_01, inert(1)

HSIMT ! dy2_02, inert(2)

## Lateral Open Boundary Conditions Parameters

- The lateral boundary conditions are now specified with logical switches instead of CPP flags to allow nested grid configurations. Their values are loaded into the structured array:where
**1:4**are the numbered boundary edges,**nLBCvar**are the number LBC state variables, and Ngrids is the number of nested grids. For example, to apply gradient boundary conditions for free-surface we use:LBC(iwest, isFsur, ng) % gradientThe lateral boundary conditions are entered with a keyword. A value is expected for each boundary segment per nested grid for each state variable. Each tracer variable requires [1:4,1:NAT+NPT,Ngrids] values. [1:4,1:Ngrids] values are expected for other variables. The boundary order is:

LBC(ieast, ... , ng) % gradient

LBC(isouth, ... , ng) % gradient

LBC(inorth, ... , ng) % gradient**1**=west,**2**=south,**3**=east, and**4**=north. That is, anticlockwise starting at the western boundary.

The keyword is case insensitive and usually has three characters. However, it is possible to have compound keywords, if applicable. For example, the keyword**RadNud**implies radiation boundary condition with nudging. This combination is usually used in active/passive radiation conditions.! Keyword Lateral Boundary Condition Type

!

! Cha Chapman

! Cla Clamped

! Clo Closed

! Fla Flather _____N_____ j=Mm

! Gra Gradient | 4 |

! Nes Nested | |

! Nud Nudging 1 W E 3

! Per Periodic | |

! Rad Radiation |_____S_____|

! Red Reduced Physics 2 j=1

! i=1 i=Lm

! W S E N

! e o a o

! s u s r

! t t t t

! h h

!

! 1 2 3 4

LBC(isFsur) == Per Clo Per Clo ! free-surface

LBC(isUbar) == Per Clo Per Clo ! 2D U-momentum

LBC(isVbar) == Per Clo Per Clo ! 2D V-momentum

LBC(isUvel) == Per Clo Per Clo ! 3D U-momentum

LBC(isVvel) == Per Clo Per Clo ! 3D V-momentum

LBC(isMtke) == Per Clo Per Clo ! mixing TKE

LBC(isTvar) == Per Clo Per Clo \ ! temperature

Per Clo Per Clo ! salinity

- Adjoint-based algorithms can have different lateral boundary conditions keywords.ad_LBC(isFsur) == Per Clo Per Clo ! free-surface

ad_LBC(isUbar) == Per Clo Per Clo ! 2D U-momentum

ad_LBC(isVbar) == Per Clo Per Clo ! 2D U-momentum

ad_LBC(isUvel) == Per Clo Per Clo ! 3D U-momentum

ad_LBC(isVvel) == Per Clo Per Clo ! 3D V-momentum

ad_LBC(isMtke) == Per Clo Per Clo ! mixing TKE

ad_LBC(isTvar) == Per Clo Per Clo \ ! temperature

Per Clo Per Clo ! salinity

- Lateral open boundary edge volume conservation switch for nonlinear model and adjoint-based algorithm. This is usually activated with radiation boundary conditions to enforce global mass conservation. Notice that these switches should not be activated if tidal forcing, [1:Ngrids] values are expected.VolCons(west) == F ! western boundary

VolCons(east) == F ! eastern boundary

VolCons(south) == F ! southern boundary

VolCons(north) == F ! northern boundary

ad_VolCons(west) == F ! western boundary

ad_VolCons(east) == F ! eastern boundary

ad_VolCons(south) == F ! southern boundary

ad_VolCons(north) == F ! northern boundary

## Timestepping and Iterations Parameters

- Timestepping parameters.

- Total number of timesteps for computing observations impacts interval during the analysis (NTIMES_ANA) or forecast (NTIMES_FCT) cycle.

- Model iteration loops parameters.ERstr = 1 ! Starting perturbation or iteration

ERend = 1 ! Ending perturbation or iteration

Nouter = 1 ! Maximum number of 4DVar outer loop iterations

Ninner = 1 ! Maximum number of 4DVar inner loop iterations

Nintervals = 1 ! Number of stochastic optimals interval divisions

- Number of eigenvalues (NEV) and eigenvectors (NCV) to compute for the Lanczos/Arnoldi problem in the Generalized Stability Theory (GST) analysis. NCV must be greater than NEV.
**Notice:**At present, there is no*apriori*analysis to guide the selection of NCV relative to NEV. The only formal requirement is that NCV > NEV. However in optimal perturbations, it is recommended to have NCV ≥ 2*NEV. In Finite Time Eigenmodes (FTE) and Adjoint Finite Time Eigenmodes (AFTE) the requirement is to have NCV ≥ 2*NEV+1. The efficiency of calculations depends critically on the combination of NEV and NCV. If NEV is large (greater than 10 say), you can use NCV=2*NEV+1 but for NEV small (less than 6) it will be inefficient to use NCV=2*NEV+1. In complicated applications, you can start with NEV=2 and NCV=10. Otherwise, it will iterate for very long time.

## Output Frequency Parameters

- Flags controlling the frequency of output.NRREC = 0 ! Model restart flag

LcycleRST == T ! Switch to recycle restart time records

NRST == 288 ! Number of timesteps between writing restart records

NSTA == 1 ! Number of timesteps between stations records

NFLT == 1 ! Number of timesteps between floats records

NINFO == 1 ! Number of timesteps between printing information diagnostics

- Output history, average, diagnostic files parameters.LDEFOUT == T ! File creation/append switch

NHIS == 72 ! Number of timesteps between writing history records

NDEFHIS == 0 ! Number of timesteps between creation of new history file

NQCK == 0 ! Number of timesteps between writing quicksave records

NDEFQCK == 0 ! Number of timesteps between creation of new quicksave file

NTSAVG == 1 ! Starting averages timestep

NAVG == 72 ! Number of timesteps between writing averages records

NDEFAVG == 0 ! Number of timesteps between creation of new averages file

NTSDIA == 1 ! Starting diagnostics timestep

NDIA == 72 ! Number of timesteps between writing diagnostics records

NDEFDIA == 0 ! Number of timesteps between creation of new diagnostics file

- Output tangent linear and adjoint models parameters.LcycleTLM == F ! Switch to recycle TLM time records

NTLM == 72 ! Number of timesteps writing between TLM records

NDEFTLM == 0 ! Number of timesteps between creation of new TLM file

LcycleADJ == F ! Switch to recycle ADM time records

NADJ == 72 ! Number of timesteps between writing ADM records

NDEFADJ == 0 ! Number of timesteps between creation of new ADM file

NSFF == 72 ! Number of timesteps between 4DVAR adjustment of

! surface forcing fluxes

NOBC == 72 ! Number of timesteps between 4DVAR adjustment of

! open boundary fields

- Output check pointing GST restart parameters.LmultiGST = F ! one eigenvector per history file

LrstGST = F ! GST restart switch

MaxIterGST = 500 ! maximum number of iterations

NGST = 10 ! check pointing interval

## Physical and Numerical Parameters

- Relative accuracy of the Ritz values computed in the GST analysis.Ritz_tol = 1.0d-15

- Harmonic/biharmonic horizontal diffusion of all active and passive (dye) tracers for the nonlinear model and adjoint-based algorithms: [1:NAT+NPT,Ngrids] values are expected. Diffusion coefficients for biology and sediment tracers are set in their respective input scripts.

- Harmonic/biharmonic, horizontal viscosity coefficient for the nonlinear model and adjoint-based algorithms: [1:Ngrids values are expected. Only used if the appropriate CPP options are defined.

- Logical switches (
**TRUE**/**FALSE**) to increase/decrease horizontal viscosity and/or diffusivity in specific areas of the application domain (like sponge areas) for the desired application grid.

- Background vertical mixing coefficients for active (NAT) and inert (NPT) tracers for the nonlinear model and basic state scale factor in adjoint-based algorithms: [1:NAT+NPT,Ngrids] values are expected.

- Background vertical mixing coefficient for momentum for the nonlinear model and basic state scale factor in the adjoint-based algorithms: [1:Ngrids] values are expected.

- Upper threshold values to limit vertical mixing coefficients computed from vertical mixing parameterizations. Although this is an engineering fix, the vertical mixing values inferred from ocean observations are rarely higher than this upper limit value.

- Turbulent closures parameters.

- Generic length-scale turbulence closure parameters. These parameters are used when GLS_MIXING is activated.GLS_P == 3.0d0 ! K-epsilon

GLS_M == 1.5d0 ! Turbulent kinetic energy exponent

GLS_N == -1.0d0 ! Turbulent length scale exponent

GLS_Kmin == 7.6d-6 ! Minimum value of specific turbulent energy

GLS_Pmin == 1.0d-12 ! Minimum Value of dissipation**! Closure independent constraint parameters:**

GLS_CMU0 == 0.5477d0 ! Stability coefficient

GLS_C1 == 1.44d0 ! Shear production coefficient

GLS_C2 == 1.92d0 ! Dissipation coefficient

GLS_C3M == -0.4d0 ! Buoyancy production coefficient (minus)

GLS_C3P == 1.0d0 ! Buoyancy production coefficient (plus)

GLS_SIGK == 1.0d0 ! Constant Schmidt number for turbulent

! kinetic energy diffusivity

GLS_SIGP == 1.30d0 ! Constant Schmidt number for turbulent

! generic statistical field, "psi"

- Constants used in surface turbulent kinetic energy flux computation.CHARNOK_ALPHA == 1400.0d0 ! Charnok surface roughness

ZOS_HSIG_ALPHA == 0.5d0 ! Roughness from wave amplitude

SZ_ALPHA == 0.25d0 ! roughness from wave dissipation

CRGBAN_CW == 100.0d0 ! Craig and Banner wave breaking

- Constants used in momentum stress computation.

- Height (m) of atmospheric measurements for Bulk fluxes parameterization.

- Minimum depth for wetting and drying.DCRIT == 0.10d0 ! m

- Jerlov water type used to set vertical depth scale for shortwave radiation absorption.WTYPE == 1

- Deepest and shallowest levels to apply surface momentum stress as a body-force.

- Mean Density and Brunt-Vaisala frequency.

- Timestamp assigned for model initialization, reference time origin for tidal forcing, and model reference time for output NetCDF units attribute.

- Nudging/relaxation time scales, inverse scales will be computed internally, [1:Ngrids] values are expected. These values are used for two purposes.

- When climatology nudging is active throughout the domain because the logical flags LtracerCLM, Lm3CLM, Lm2CLM etc. are TRUE, these values are the default nudging time scales set in Functionals/ana_nudgcoef.h. Since the user can choose to customize ana_nudgcoef.h, or provide 3-D climatology nudging time scales in an external file, these parameters might not be used
- When nudging is applied in the lateral open boundary conditions because the LBC logical flags are set to "RadNud" the values here set the nudging time scale when the Orlanski radiation scheme detects outflow conditions. When the Orlanski scheme detects inflow conditions, the nudging time scale is TNUDG/OBCFAC (see OBCFAC below).

- Factor between passive (outflow) and active (inflow) (in the Orlanksi radiation sense) open boundary condition nudging time scales, [1:Ngrids]. If OBCFAC > 1, nudging on inflow is stronger than on outflow (recommended) because the inflow time scale TNUDG/OBCFAC is less than the outflow timescale TNUDG (see above). The passive/active radiation conditions in ROMS follow the method proposed by Marchesiello et al. (2001): withwhere represents the external boundary data and is the nudging time scale with for outflow, for inflow, and . At outflow, a weak nudging is used to prevent a numerical drift in the solution while avoiding over-specification of the boundary data. During inflow, a strong nudging is applied to avoid data-shock in the solution. The nudging time scales provided above are for the outflow (passive) conditions, , in days. The inflow nudging factor in the above equation is .OBCFAC == 10.0d0 ! nondimensional

- Linear equation of State parameters, [1:Ngrids] values are expected.

- Slipperiness parameter: 1.0 (free slip) or -1.0 (no slip).GAMMA2 = 1.0d0

- Logical switches (
**TRUE**/**FALSE**) to activate horizontal momentum transport point Sources/Sinks (like river runoff) and mass point Sources/Sinks (like volume vertical influx): [1:Ngrids] values are expected. These switches replace obsolete CPP options UV_PSOURCE and Q_PSOURCE, respectively. In nesting, a particular grid may or may not have Sources/Sinks forcing.

- Logical switches (
**TRUE**/**FALSE**) to activate tracers point Sources/Sinks (like river runoff) and to specify which tracer variables to consider: [1:NAT+NPT,Ngrids] values are expected. Other biological and sediment tracer switches are activated in their respective input scripts. This switch replaces obsolete CPP option TS_PSOURCE. In nesting, a particular grid may or may not have tracers Sources/Sinks forcing.LtracerSrc == F F ! temperature, salinity, inert

- Logical switches (
**TRUE**/**FALSE**) to read and process climatology fields.LsshCLM == F ! sea-surface height

Lm2CLM == F ! 2D momentum

Lm3CLM == F ! 3D momentum

LtracerCLM == F F ! temperature, salinity, inert

- Logical switches (
**TRUE**/**FALSE**) to nudge the desired climatology field(s). If not analytical climatology fields, users need to turn ON the logical switches above to process the fields from the climatology NetCDF file that are needed for nudging.LnudgeM2CLM == F ! 2D momentum

LnudgeM3CLM == F ! 3D momentum

LnudgeTCLM == F F ! temperature, salinity, inert

## Vertical Coordinates Parameters

- Set vertical, terrain-following coordinates transformation equation and stretching function (see Vertical S-coordinate for more details).

- S-coordinate surface control parameter, [1:Ngrids] values are expected. The range of optimal values depends on the vertical stretching function.THETA_S == 3.0d0 ! surface stretching parameter

- S-coordinate bottom control parameter, [1:Ngrids] values are expected. The range of optimal values depends on the vertical stretching function.THETA_B == 0.0d0 ! bottom stretching parameter

- Critical depth (hc) in meters (positive) controlling the stretching. It can be interpreted as the width of surface or bottom boundary layer in which higher vertical resolution (levels) is required during stretching.TCLINE == 25.0d0 ! critical depth (m)

## Adjoint Sensitivity Parameters

- Starting (DstrS) and ending (DendS) day for adjoint sensitivity forcing. DstrS must be less or equal to DendS. If both values are zero, their values are reset internally to the full range of the adjoint integration.

- Starting and ending vertical levels of the 3D adjoint state variables whose sensitivity is required.

- Logical switches (
**TRUE**/**FALSE**) to specify the adjoint state variables whose sensitivity is required.Lstate(isFsur) == F ! free-surface

Lstate(isUbar) == F ! 2D U-momentum

Lstate(isVbar) == F ! 2D V-momentum

Lstate(isUvel) == F ! 3D U-momentum

Lstate(isVvel) == F ! 3D V-momentum

Lstate(isWvel) == F ! 3D W-momentum

- Logical switches (
**TRUE**/**FALSE**) to specify the adjoint state tracer variables whose sensitivity is required, [1:NT,1:Ngrids] values are expected.Lstate(isTvar) == F F ! NT tracers

## Stochastic Optimals Parameters

- Logical switches (
**TRUE**/**FALSE**) to specify the state variables required by Forcing Singular Vectors or Stochastic Optimals.Fstate(isFsur) == F ! free-surface

Fstate(isUbar) == F ! 2D U-momentum

Fstate(isVbar) == F ! 2D V-momentum

Fstate(isUvel) == F ! 3D U-momentum

Fstate(isVvel) == F ! 3D V-momentum

Fstate(isTvar) == F F ! NT tracers

Fstate(isUstr) == F ! surface U-stress

Fstate(isVstr) == F ! surface V-stress

Fstate(isTsur) == F F ! NT surface tracers flux

- Stochastic optimals time decorrelation scale (days) assumed for red noise processes.SO_decay == 2.0d0 ! days

- Stochastic Optimals surface forcing standard deviation for dimensionalization.SO_sdev(isFsur) == 1.0d0 ! free-surface

SO_sdev(isUbar) == 1.0d0 ! 2D U-momentum

SO_sdev(isVbar) == 1.0d0 ! 2D V-momentum

SO_sdev(isUvel) == 1.0d0 ! 3D U-momentum

SO_sdev(isVvel) == 1.0d0 ! 3D V-momentum

SO_sdev(isTvar) == 1.0d0 1.0d0 ! NT tracers

SOstate(isUstr) == 1.0d0 ! surface u-stress

SOstate(isVstr) == 1.0d0 ! surface v-stress

SO_sdev(isTsur) == 1.0d0 1.0d0 ! NT surface tracer flux

## History Output Variables Switches

- Logical switches (
**TRUE**/**FALSE**) to activate writing of fields into history output file.Hout(idUvel) == T ! u 3D U-velocity

Hout(idVvel) == T ! v 3D V-velocity

Hout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points

Hout(idv3dN) == F ! v_northward 3D V-northward at RHO-points

Hout(idWvel) == T ! w 3D W-velocity

Hout(idOvel) == T ! omega omega vertical velocity

Hout(idUbar) == T ! ubar 2D U-velocity

Hout(idVbar) == T ! vbar 2D V-velocity

Hout(idu2dE) == F ! ubar_eastward 2D U-eastward at RHO-points

Hout(idv2dN) == F ! vbar_northward 2D V-northward at RHO-points

Hout(idFsur) == T ! zeta free-surface

Hout(idBath) == T ! bath time-dependent bathymetry

Hout(idTvar) == T T ! temp, salt temperature and salinity

Hout(idpthR) == F ! z_rho time-varying depths of RHO-points

Hout(idpthU) == F ! z_u time-varying depths of U-points

Hout(idpthV) == F ! z_v time-varying depths of V-points

Hout(idpthW) == F ! z_w time-varying depths of W-points

Hout(idUsms) == F ! sustr surface U-stress

Hout(idVsms) == F ! svstr surface V-stress

Hout(idUbms) == F ! bustr bottom U-stress

Hout(idVbms) == F ! bvstr bottom V-stress

Hout(idUbrs) == F ! bustrc bottom U-current stress

Hout(idVbrs) == F ! bvstrc bottom V-current stress

Hout(idUbws) == F ! bustrw bottom U-wave stress

Hout(idVbws) == F ! bvstrw bottom V-wave stress

Hout(idUbcs) == F ! bustrcwmax bottom max wave-current U-stress

Hout(idVbcs) == F ! bvstrcwmax bottom max wave-current V-stress

Hout(idUbot) == F ! Ubot bed wave orbital U-velocity

Hout(idVbot) == F ! Vbot bed wave orbital V-velocity

Hout(idUbur) == F ! Ur bottom U-velocity above bed

Hout(idVbvr) == F ! Vr bottom V-velocity above bed

Hout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component

Hout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component

Hout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component

Hout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress

Hout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress

Hout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity

Hout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity

Hout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component

Hout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component

Hout(idW3yy) == F ! Syy 3D radiation stress, Syy component

Hout(idW3zx) == F ! Szx 3D radiation stress, Szx component

Hout(idW3zy) == F ! Szy 3D radiation stress, Szy component

Hout(idU3rs) == F ! u_Rstress 3D U-radiation stress

Hout(idV3rs) == F ! v_Rstress 3D V-radiation stress

Hout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity

Hout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity

Hout(idWamp) == F ! Hwave wave height

Hout(idWlen) == F ! Lwave wave length

Hout(idWdir) == F ! Dwave wave direction

Hout(idWptp) == F ! Pwave_top wave surface period

Hout(idWpbt) == F ! Pwave_bot wave bottom period

Hout(idWorb) == F ! Ub_swan wave bottom orbital velocity

Hout(idWdis) == F ! Wave_dissip wave dissipation

Hout(idPair) == F ! Pair surface air pressure

Hout(idUair) == F ! Uair surface U-wind component

Hout(idVair) == F ! Vair surface V-wind component

Hout(idTsur) == F F ! shflux, ssflux surface net heat and salt flux

Hout(idLhea) == F ! latent latent heat flux

Hout(idShea) == F ! sensible sensible heat flux

Hout(idLrad) == F ! lwrad longwave radiation flux

Hout(idSrad) == F ! swrad shortwave radiation flux

Hout(idEmPf) == F ! EminusP E-P flux

Hout(idevap) == F ! evaporation evaporation rate

Hout(idrain) == F ! rain precipitation rate

Hout(idDano) == F ! rho density anomaly

Hout(idVvis) == F ! AKv vertical viscosity

Hout(idTdif) == F ! AKt vertical T-diffusion

Hout(idSdif) == F ! AKs vertical Salinity diffusion

Hout(idHsbl) == F ! Hsbl depth of surface boundary layer

Hout(idHbbl) == F ! Hbbl depth of bottom boundary layer

Hout(idMtke) == F ! tke turbulent kinetic energy

Hout(idMtls) == F ! gls turbulent length scale

- Logical switches (
**TRUE**/**FALSE**) to activate writing of extra inert passive tracers other than biological and sediment tracers. An inert passive tracer is one that it is only advected and diffused. Other processes are ignored. These tracers include, for example, dyes, pollutants, oil spills, etc. [1:NPT] values are expected. However, these switches can be activated using compact parameter specification.Hout(inert) == T ! dye_01, ... inert passive tracers

## Quicksave Output Variables Switches

- Logical switches (
**TRUE**/**FALSE**) to activate writing of fields into quicksave output file.Qout(idUvel) == F ! u 3D U-velocity

Qout(idVvel) == F ! v 3D V-velocity

Qout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points

Qout(idv3dN) == F ! v_northward 3D V-northward at RHO-points

Qout(idWvel) == F ! w 3D W-velocity

Qout(idOvel) == F ! omega omega vertical velocity

Qout(idUbar) == T ! ubar 2D U-velocity

Qout(idVbar) == T ! vbar 2D V-velocity

Qout(idu2dE) == T ! ubar_eastward 2D U-eastward at RHO-points

Qout(idv2dN) == T ! vbar_northward 2D V-northward at RHO-points

Qout(idFsur) == T ! zeta free-surface

Qout(idBath) == T ! bath time-dependent bathymetry

Qout(idTvar) == F F ! temp, salt temperature and salinity

Qout(idUsur) == T ! u_sur surface U-velocity

Qout(idVsur) == T ! v_sur surface V-velocity

Qout(idUsuE) == T ! u_sur_eastward surface U-eastward velocity

Qout(idVsuN) == T ! v_sur_northward surface V-northward velocity

Qout(idsurT) == T T ! temp_sur, salt_sur surface temperature and salinity

Qout(idpthR) == F ! z_rho time-varying depths of RHO-points

Qout(idpthU) == F ! z_u time-varying depths of U-points

Qout(idpthV) == F ! z_v time-varying depths of V-points

Qout(idpthW) == F ! z_w time-varying depths of W-points

Qout(idUsms) == F ! sustr surface U-stress

Qout(idVsms) == F ! svstr surface V-stress

Qout(idUbms) == F ! bustr bottom U-stress

Qout(idVbms) == F ! bvstr bottom V-stress

Qout(idUbrs) == F ! bustrc bottom U-current stress

Qout(idVbrs) == F ! bvstrc bottom V-current stress

Qout(idUbws) == F ! bustrw bottom U-wave stress

Qout(idVbws) == F ! bvstrw bottom V-wave stress

Qout(idUbcs) == F ! bustrcwmax bottom max wave-current U-stress

Qout(idVbcs) == F ! bvstrcwmax bottom max wave-current V-stress

Qout(idUbot) == F ! Ubot bed wave orbital U-velocity

Qout(idVbot) == F ! Vbot bed wave orbital V-velocity

Qout(idUbur) == F ! Ur bottom U-velocity above bed

Qout(idVbvr) == F ! Vr bottom V-velocity above bed

Qout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component

Qout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component

Qout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component

Qout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress

Qout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress

Qout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity

Qout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity

Qout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component

Qout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component

Qout(idW3yy) == F ! Syy 3D radiation stress, Syy component

Qout(idW3zx) == F ! Szx 3D radiation stress, Szx component

Qout(idW3zy) == F ! Szy 3D radiation stress, Szy component

Qout(idU3rs) == F ! u_Rstress 3D U-radiation stress

Qout(idV3rs) == F ! v_Rstress 3D V-radiation stress

Qout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity

Qout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity

Qout(idWamp) == F ! Hwave wave height

Qout(idWlen) == F ! Lwave wave length

Qout(idWdir) == F ! Dwave wave direction

Qout(idWptp) == F ! Pwave_top wave surface period

Qout(idWpbt) == F ! Pwave_bot wave bottom period

Qout(idWorb) == F ! Ub_swan wave bottom orbital velocity

Qout(idWdis) == F ! Wave_dissip wave dissipation

Qout(idPair) == F ! Pair surface air pressure

Qout(idUair) == F ! Uair surface U-wind component

Qout(idVair) == F ! Vair surface V-wind component

Qout(idTsur) == F F ! shflux, ssflux surface net heat and salt flux

Qout(idLhea) == F ! latent latent heat flux

Qout(idShea) == F ! sensible sensible heat flux

Qout(idLrad) == F ! lwrad longwave radiation flux

Qout(idSrad) == F ! swrad shortwave radiation flux

Qout(idEmPf) == F ! EminusP E-P flux

Qout(idevap) == F ! evaporation evaporation rate

Qout(idrain) == F ! rain precipitation rate

Qout(idDano) == F ! rho density anomaly

Qout(idVvis) == F ! AKv vertical viscosity

Qout(idTdif) == F ! AKt vertical T-diffusion

Qout(idSdif) == F ! AKs vertical Salinity diffusion

Qout(idHsbl) == F ! Hsbl depth of surface boundary layer

Qout(idHbbl) == F ! Hbbl depth of bottom boundary layer

Qout(idMtke) == F ! tke turbulent kinetic energy

Qout(idMtls) == F ! gls turbulent length scale

- Logical switches (
**TRUE**/**FALSE**) to activate writing of extra inert passive tracers other than biological and sediment tracers into the quicksave output file. An inert passive tracer is one that it is only advected and diffused. Other processes are ignored. These tracers include, for example, dyes, pollutants, oil spills, etc. [1:NPT] values are expected. However, these switches can be activated using compact parameter specification.Qout(inert) == F ! dye_01, ... inert passive tracers

Qout(Snert) == F ! dye_01, ... surface inert passive tracers

## Time-averaged Output Variables Switches

- Logical switches (
**TRUE**/**FALSE**) to activate writing of fields into time-averaged output file.Aout(idUvel) == T ! u 3D U-velocityy

Aout(idVvel) == T ! v 3D V-velocity

Aout(idu3dE) == F ! u_eastward 3D U-eastward at RHO-points

Aout(idv3dN) == F ! v_northward 3D V-northward at RHO-points

Aout(idWvel) == T ! w 3D W-velocity

Aout(idOvel) == T ! omega omega vertical velocity

Aout(idUbar) == T ! ubar 2D U-velocity

Aout(idVbar) == T ! vbar 2D V-velocity

Aout(idu2dE) == F ! ubar_eastward 2D U-eastward at RHO-points

Aout(idv2dN) == F ! vbar_northward 2D V-northward at RHO-points

Aout(idFsur) == T ! zeta free-surface

Aout(idTvar) == T T ! temp, salt temperature and salinity

Aout(idUsms) == F ! sustr surface U-stress

Aout(idVsms) == F ! svstr surface V-stress

Aout(idUbms) == F ! bustr bottom U-stress

Aout(idVbms) == F ! bvstr bottom V-stress

Aout(idW2xx) == F ! Sxx_bar 2D radiation stress, Sxx component

Aout(idW2xy) == F ! Sxy_bar 2D radiation stress, Sxy component

Aout(idW2yy) == F ! Syy_bar 2D radiation stress, Syy component

Aout(idU2rs) == F ! Ubar_Rstress 2D radiation U-stress

Aout(idV2rs) == F ! Vbar_Rstress 2D radiation V-stress

Aout(idU2Sd) == F ! ubar_stokes 2D U-Stokes velocity

Aout(idV2Sd) == F ! vbar_stokes 2D V-Stokes velocity

Aout(idW3xx) == F ! Sxx 3D radiation stress, Sxx component

Aout(idW3xy) == F ! Sxy 3D radiation stress, Sxy component

Aout(idW3yy) == F ! Syy 3D radiation stress, Syy component

Aout(idW3zx) == F ! Szx 3D radiation stress, Szx component

Aout(idW3zy) == F ! Szy 3D radiation stress, Szy component

Aout(idU3rs) == F ! u_Rstress 3D U-radiation stress

Aout(idV3rs) == F ! v_Rstress 3D V-radiation stress

Aout(idU3Sd) == F ! u_stokes 3D U-Stokes velocity

Aout(idV3Sd) == F ! v_stokes 3D V-Stokes velocity

Aout(idPair) == F ! Pair surface air pressure

Aout(idUair) == F ! Uair surface U-wind component

Aout(idVair) == F ! Vair surface V-wind component

Aout(idTsur) == F F ! shflux, ssflux surface net heat and salt flux

Aout(idLhea) == F ! latent latent heat flux

Aout(idShea) == F ! sensible sensible heat flux

Aout(idLrad) == F ! lwrad longwave radiation flux

Aout(idSrad) == F ! swrad shortwave radiation flux

Aout(idevap) == F ! evaporation evaporation rate

Aout(idrain) == F ! rain precipitation rate

Aout(idDano) == F ! rho density anomaly

Aout(idVvis) == F ! AKv vertical viscosity

Aout(idTdif) == F ! AKt vertical T-diffusion

Aout(idSdif) == F ! AKs vertical Salinity diffusion

Aout(idHsbl) == F ! Hsbl depth of surface boundary layer

Aout(idHbbl) == F ! Hbbl depth of bottom boundary layer

Aout(id2dRV) == F ! pvorticity_bar 2D relative vorticity

Aout(id3dRV) == F ! pvorticity 3D relative vorticity

Aout(id2dPV) == F ! rvorticity_bar 2D potential vorticity

Aout(id3dPV) == F ! rvorticity 3D potential vorticity

Aout(idu3dD) == F ! u_detided detided 3D U-velocity

Aout(idv3dD) == F ! v_detided detided 3D V-velocity

Aout(idu2dD) == F ! ubar_detided detided 2D U-velocity

Aout(idu3dD) == F ! vbar_detided detided 2D V-velocity

Aout(idFsuD) == F ! zeta_detided detided free-surface

Aout(idTrcD) == F F ! temp_detided, ... detided temperature and salinity

Aout(idHUav) == F ! Huon u-volume flux, Huon

Aout(idHVav) == F ! Hvom v-volume flux, Hvom

Aout(idUUav) == F ! uu quadratic <u*u> term

Aout(idUVav) == F ! uv quadratic <u*v> term

Aout(idVVav) == F ! vv quadratic <v*v> term

Aout(idU2av) == F ! ubar2 quadratic <ubar*ubar> term

Aout(idV2av) == F ! vbar2 quadratic <vbar*vbar> term

Aout(idZZav) == F ! zeta2 quadratic <zeta*zeta> term

Aout(idTTav) == F F ! temp2, ... quadratic <t*t> tracer terms

Aout(idUTav) == F F ! utemp, ... quadratic <u*t> tracer terms

Aout(idVTav) == F F ! vtemp, ... quadratic <v*t> tracer terms

Aout(iHUTav) == F F ! Huontemp, ... tracer volume flux, <Huon*t>

Aout(iHVTav) == F F ! Hvomtemp, ... tracer volume flux, <Hvom*t>

- Logical switches (
**TRUE**/**FALSE**) to activate writing of extra inert passive tracers other than biological and sediment tracers into the time-averaged output file. An inert passive tracer is one that it is only advected and diffused. Other processes are ignored. These tracers include, for example, dyes, pollutants, oil spills, etc. [1:NPT,1:Ngrids] values are expected. However, these switches can be activated using compact parameter specification.Aout(inert) == T ! dye_01, ... inert passive tracers

## Time-averaged Diagnostic Output Variables Switches

- Logical switches (
**TRUE**/**FALSE**) to activate writing time-averaged. 2D momentum (ubar, vbar) diagnostic terms into the diagnostics output file.Dout(M2rate) == T ! ubar_accel, ... acceleration

Dout(M2pgrd) == T ! ubar_prsgrd, ... pressure gradient

Dout(M2fcor) == T ! ubar_cor, ... Coriolis force

Dout(M2hadv) == T ! ubar_hadv, ... horizontal total advection

Dout(M2xadv) == T ! ubar_xadv, ... horizontal XI-advection

Dout(M2yadv) == T ! ubar_yadv, ... horizontal ETA-advection

Dout(M2hrad) == T ! ubar_hrad, ... horizontal total radiation stress

Dout(M2hvis) == T ! ubar_hvisc, ... horizontal total viscosity

Dout(M2xvis) == T ! ubar_xvisc, ... horizontal XI-viscosity

Dout(M2yvis) == T ! ubar_yvisc, ... horizontal ETA-viscosity

Dout(M2sstr) == T ! ubar_sstr, ... surface stress

Dout(M2bstr) == T ! ubar_bstr, ... bottom stress

- Logical switches (
**TRUE**/**FALSE**) to activate writing of time-averaged, 3D momentum (u,v) diagnostic terms into the diagnostics output file.Dout(M3rate) == T ! u_accel, ... acceleration

Dout(M3pgrd) == T ! u_prsgrd, ... pressure gradient

Dout(M3fcor) == T ! u_cor, ... Coriolis force

Dout(M3hadv) == T ! u_hadv, ... horizontal total advection

Dout(M3xadv) == T ! u_xadv, ... horizontal XI-advection

Dout(M3yadv) == T ! u_yadv, ... horizontal ETA-advection

Dout(M3vadv) == T ! u_vadv, ... vertical advection

Dout(M3hrad) == T ! u_hrad, ... horizontal total radiation stress

Dout(M3vrad) == T ! u_vrad, ... vertical radiation stress

Dout(M3hvis) == T ! u_hvisc, ... horizontal total viscosity

Dout(M3xvis) == T ! u_xvisc, ... horizontal XI-viscosity

Dout(M3yvis) == T ! u_yvisc, ... horizontal ETA-viscosity

Dout(M3vvis) == T ! u_vvisc, ... vertical viscosity

- Logical switches (
**TRUE**/**FALSE**) to activate writing of time-averaged, active (temperature and salinity) and passive (inert) tracer diagnostic terms into the diagnostics output file. [1:NAT+NPT,1:Ngrids] values are expected.Dout(iTrate) == T T ! temp_rate, ... time rate of change

Dout(iThadv) == T T ! temp_hadv, ... horizontal total advection

Dout(iTxadv) == T T ! temp_xadv, ... horizontal XI-advection

Dout(iTyadv) == T T ! temp_yadv, ... horizontal ETA-advection

Dout(iTvadv) == T T ! temp_vadv, ... vertical advection

Dout(iThdif) == T T ! temp_hdiff, ... horizontal total diffusion

Dout(iTxdif) == T T ! temp_xdiff, ... horizontal XI-diffusion

Dout(iTydif) == T T ! temp_ydiff, ... horizontal ETA-diffusion

Dout(iTsdif) == T T ! temp_sdiff, ... horizontal S-diffusion

Dout(iTvdif) == T T ! temp_vdiff, ... vertical diffusion

## Generic User Parameters

- NUSER is the number (integer) of user parameters to consider. USER is a vector containing NUSER user parameters (real array).This array is primarily used with the SANITY_CHECK to test the correctness of the tangent linear adjoint models. It contains the model variable and grid point to perturb:! INT(user(1)): tangent state variable to perturbSet tangent and adjoint parameters to the same values if perturbing and reporting the same variable.

! INT(user(2)): adjoint state variable to perturb

! [ isFsur = 1 ] free-surface

! [ isUbar = 2 ] 2D U-momentum

! [ isVbar = 3 ] 2D V-momentum

! [ isUvel = 4 ] 3D U-momentum

! [ isVvel = 5 ] 3D V-momentum

! [ isTvar = 6 ] First tracer (temperature)

! [ ... ] ...

! [ isTvar = ? ] Last tracer

!

! INT(user(3)): I-index of tangent variable to perturb

! INT(user(4)): I-index of adjoint variable to perturb

! INT(user(5)): J-index of tangent variable to perturb

! INT(user(6)): J-index of adjoint variable to perturb

! INT(user(7)): K-index of tangent variable to perturb, if 3D

! INT(user(8)): K-index of adjoint variable to perturb, if 3D

- This parameter could also be used to adjust constants in analytical functions at run time.

## NetCDF-4/HDF5 Compression Parameters

- NetCDF-4/HDF5 compression parameters for output files. This capability is used when both HDF5 and DEFLATE C-preprocessing options are activated. The user needs to compile with the NetCDF-4/HDF5 and MPI libraries. File deflation cannot be used in parallel I/O for writing libraries. File deflation cannot be used in parallel I/O for writing to exactly map the data to the disk location. For more information, check NetCDF official website.NC_SHUFFLE = 1 ! if non-zero, turn on shuffle filter

NC_DEFLATE = 1 ! if non-zero, turn on deflate filter

NC_DLEVEL = 1 ! deflate level [0-9]

## Input NetCDF Files

**NOTE:** Starting with **revision 460** file names can be up to 256 characters long. Previously only 80 characters were allowed.

- Input NetCDF file names, [1:Ngrids] values are expected.GRDNAME == roms_grd.nc ! Grid

ININAME == roms_ini.nc ! NLM initial conditions

ITLNAME == roms_itl.nc ! TLM initial conditions

IRPNAME == roms_irp.nc ! RPM initial conditions

IADNAME == roms_iad.nc ! ADM initial conditions

FWDNAME == roms_fwd.nc ! Forward trajectory

ADSNAME == roms_ads.nc ! Adjoint sensitivity functionals

- Input adjoint forcing NetCDF filenames for computing observations impacts during the analysis-forecast cycle. If the forecast error metric is defined in state-space, then FOInameA and FOInameB should be regular adjoint forcing files just like ADSNAME. If the forecast error metric is defined in observation space (OBS_SPACE is activated) then the forecast is initialized OIFnameA and OIFnameB (specified in s4dvar.in input script) will have the structure of a 4D-Var observation file.

- Input NetCDF filenames for the forecasts initialized from the analysis of the current 4D-Var cycle (FCTnameA) and initialized from the analysis of the previous 4D-Var cycle (FCTnameB).

- Nesting grids connectivity data: contact points information. This NetCDF file is special and complex. It is currently generated using the script
**matlab/grid/contact.m**from the Matlab repository.NGCNAME = roms_ngc.nc

- Input lateral boundary conditions and climatology file names. The
**user**has the option to split input data time records into several NetCDF files (see the File Syntax Notes). If so, use a single line per entry with a vertical bar (|) symbol after each entry, except the last one.

- Input climatology nudging coefficients file name.NUDNAME == roms_nud.nc

- Input Sources/Sinks forcing (like river runoff) file name. This file is separated from the regular forcing files to allow manipulations over nested grids. A particular nesting grid may or may not have Sources/Sinks forcing.SSFNAME == roms_rivers.nc

- Input tidal forcing file name.TIDENAME == roms_tides.nc

- Input forcing NetCDF file name(s). The
**user**has the option to enter several files names for each nested grid. For example, the**user**may have a different files for wind products, heat fluxes, tides, etc. The model will scan the file list and will read the needed data from the first file in the list containing the forcing field. Therefore, the order of the file names is very important. If multiple forcing files per grid, enter first all the file names for grid 1, then grid 2, and so on. It is also possible to split input data time records into several NetCDF files (see the File Syntax Notes). Use a single line per entry with a continuation ( \ ) or vertical bar ( | ) symbol after each entry, except the last one.

## Output NetCDF Files

**NOTE:** Starting with **revision 460** file names can be up to 256 characters long. Previously only 80 characters were allowed.

- Output NetCDF file names, [1:Ngrids] files are expected.DAINAME == roms_dai.nc ! Data assimilation next cycle initial conditions or restart file

GSTNAME == roms_gst.nc ! GST analysis restart

RSTNAME == roms_rst.nc ! Restart

HISNAME == roms_his.nc ! History

QCKNAME == roms_qck.nc ! Quicksave

TLMNAME == roms_tlm.nc ! TLM history

TLFNAME == roms_tlf.nc ! Impulse TLM forcing

ADJNAME == roms_adj.nc ! ADM history

AVGNAME == roms_avg.nc ! Averages

HARNAME == roms_har.nc ! least-squares detiding harmonics

DIANAME == roms_dia.nc ! Diagnostics

STANAME == roms_sta.nc ! Stations

FLTNAME == roms_flt.nc ! Floats

## Additional Input Scripts

**NOTE:** Starting with **revision 460** file names can be up to 256 characters long. Previously only 80 characters were allowed.

- Input ASCII parameter filenames.APARNAM = ROMS/External/s4dvar.in

SPOSNAM = ROMS/External/stations.in

FPOSNAM = ROMS/External/floats.in

BPARNAM = ROMS/External/biology.in

SPARNAM = ROMS/External/sediment.in

USRNAME = ROMS/External/MyFile.dat