diff --git a/IRENE/Coupled_RBL4DVAR/Readme.md b/IRENE/Coupled_RBL4DVAR/Readme.md
index 0c9bff8b..a7d1ab05 100644
--- a/IRENE/Coupled_RBL4DVAR/Readme.md
+++ b/IRENE/Coupled_RBL4DVAR/Readme.md
@@ -155,7 +155,7 @@ They are activated in the build scripts.
links files created by the build script and needed to run **WRF**:
```
alias ltl '/bin/ls -ltHF | grep -v ^l'
- ```
+ ```
### How to Compile ROMS:
- **ROMS** is the driver of the coupling system. In this application, the **WRF** Surface
@@ -168,7 +168,7 @@ They are activated in the build scripts.
The option **bulk_flux = 1** in the **ROMS** build script IS NOT RECOMMENDED FOR THIS
APPLICATION because the **bulk_flux.F** module is not tunned for Hurricane regimes,
and will get the wrong solution
-
+
To compile **ROMS** coupling (nonlinear kernel) and data assimilation kernels, use:
```
build_split.csh -nl -j 10 creates executable romsM_nl
@@ -187,7 +187,7 @@ They are activated in the build scripts.
submit.sh > & log &
```
You can modify **submit.sh** for your appropriate computer environment.
-
+
The **submit.sh** script creates the sub-directory **2011.08.27** and includes all
the required input scripts to run the **coupled/RBL4D-Var** system. The input
scripts are generated from the templates. The **submit.sh** script is quite
diff --git a/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl.tmp b/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl.tmp
index 3d89436f..86d2e961 100644
--- a/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl.tmp
+++ b/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl.tmp
@@ -687,7 +687,7 @@ nDataExport(seaice) == 0 ! number of fields to export
! flag to ESMF_FieldRegridStore.
!
!------------------------------------------------------------------------------
-! Melding weighting coefficients.
+! Melding weighting coefficients.
!------------------------------------------------------------------------------
!
! Melding coefficients used to combine fields from DATA and ESM components.
diff --git a/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl_wmc.tmp b/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl_wmc.tmp
index 3f41e32c..ec29e97b 100644
--- a/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl_wmc.tmp
+++ b/IRENE/Coupled_RBL4DVAR/coupling_esmf_atm_sbl_wmc.tmp
@@ -691,7 +691,7 @@ nDataExport(seaice) == 0 ! number of fields to export
! flag to ESMF_FieldRegridStore.
!
!------------------------------------------------------------------------------
-! Melding weighting coefficients.
+! Melding weighting coefficients.
!------------------------------------------------------------------------------
!
! Melding coefficients used to combine fields from DATA and ESM components.
diff --git a/IRENE/Coupled_RBL4DVAR/coupling_esmf_bulk_flux.tmp b/IRENE/Coupled_RBL4DVAR/coupling_esmf_bulk_flux.tmp
index e0abe72f..83824777 100644
--- a/IRENE/Coupled_RBL4DVAR/coupling_esmf_bulk_flux.tmp
+++ b/IRENE/Coupled_RBL4DVAR/coupling_esmf_bulk_flux.tmp
@@ -680,7 +680,7 @@ nDataExport(seaice) == 0 ! number of fields to export
! flag to ESMF_FieldRegridStore.
!
!------------------------------------------------------------------------------
-! Melding weighting coefficients.
+! Melding weighting coefficients.
!------------------------------------------------------------------------------
!
! Melding coefficients used to combine fields from DATA and ESM components.
diff --git a/IRENE/Coupled_RBL4DVAR/irene.h b/IRENE/Coupled_RBL4DVAR/irene.h
index dfb4a81f..353ec80a 100644
--- a/IRENE/Coupled_RBL4DVAR/irene.h
+++ b/IRENE/Coupled_RBL4DVAR/irene.h
@@ -32,7 +32,7 @@
#define CHARNOK
#define ATM_PRESS
-
+
/* Basic numerics options */
diff --git a/IRENE/Coupled_RBL4DVAR/namelist.input.tmp b/IRENE/Coupled_RBL4DVAR/namelist.input.tmp
index a7225f17..c0de0bcb 100644
--- a/IRENE/Coupled_RBL4DVAR/namelist.input.tmp
+++ b/IRENE/Coupled_RBL4DVAR/namelist.input.tmp
@@ -22,8 +22,8 @@
input_from_file = .true., .false., .false.,
force_use_old_data = .false.,
input_inname = "MyInpName"
- bdy_inname = "MyBryName"
- history_outname = "MyHisName"
+ bdy_inname = "MyBryName"
+ history_outname = "MyHisName"
history_interval = 60, 60, 60, ! minutes
frames_per_outfile = 1000, 1000, 1000,
restart = .false.,
diff --git a/IRENE/Coupled_RBL4DVAR/roms_da_irene.tmp b/IRENE/Coupled_RBL4DVAR/roms_da_irene.tmp
index 5b7991b1..6d858d8d 100644
--- a/IRENE/Coupled_RBL4DVAR/roms_da_irene.tmp
+++ b/IRENE/Coupled_RBL4DVAR/roms_da_irene.tmp
@@ -1139,7 +1139,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/Coupled_RBL4DVAR/roms_nl_irene.tmp b/IRENE/Coupled_RBL4DVAR/roms_nl_irene.tmp
index 4a9aa5e5..79f10a14 100644
--- a/IRENE/Coupled_RBL4DVAR/roms_nl_irene.tmp
+++ b/IRENE/Coupled_RBL4DVAR/roms_nl_irene.tmp
@@ -1139,7 +1139,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/Coupled_RBL4DVAR/s4dvar.in b/IRENE/Coupled_RBL4DVAR/s4dvar.in
index 9c9473d4..0a67d03c 100644
--- a/IRENE/Coupled_RBL4DVAR/s4dvar.in
+++ b/IRENE/Coupled_RBL4DVAR/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = F ! 3D momentum (u, v)
tl_Tdiff == 50.0d0 50.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/IRENE/Coupled_RBL4DVAR/submit.sh b/IRENE/Coupled_RBL4DVAR/submit.sh
index cbe33558..012be623 100755
--- a/IRENE/Coupled_RBL4DVAR/submit.sh
+++ b/IRENE/Coupled_RBL4DVAR/submit.sh
@@ -450,7 +450,7 @@ while [ "$(bc <<< "$SDAY <= $L_DN")" == "1" ]; do
done
end=() # WRF end simulation time
- i=0 # integer vector
+ i=0 # integer vector
for element in ${StopTime// / }; do # (YYYY MM DD hh mm ss)
end[$i]=${element}
((i=$i+1))
diff --git a/IRENE/Coupling/data_wrf_roms/Readme.md b/IRENE/Coupling/data_wrf_roms/Readme.md
index a9c39c3a..bf6e68cf 100644
--- a/IRENE/Coupling/data_wrf_roms/Readme.md
+++ b/IRENE/Coupling/data_wrf_roms/Readme.md
@@ -5,7 +5,7 @@
This directory includes various files to run the **DATA-WRF-ROMS**
coupling system for Hurricane Irene using the **ESMF/NUOPC** library. It
uses our Coupled Forecast Framework (**CFF**) configuration for the
-US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
+US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
only run for 42 hours as Hurricane Irene approached the Outer Banks
of North Carolina on August 27, 2011.
@@ -26,7 +26,7 @@ diagnostics.
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.
+from **WRF** to **ROMS** is semi-implicit.
It uses **ROMS**'s native, **NUOPC**-based coupling system. For more information,
visit **WikiROMS**:
@@ -143,7 +143,7 @@ They are activated in the build scripts.
links files created by the build script and needed to run **WRF**:
```
alias ltl '/bin/ls -ltHF | grep -v ^l'
- ```
+ ```
### How to Compile ROMS:
- **ROMS** is the driver of the coupling system. In this application, the **WRF** Surface
@@ -156,7 +156,7 @@ They are activated in the build scripts.
The option **bulk_flux = 1** in the **ROMS** build script IS NOT RECOMMENDED FOR THIS
APPLICATION because the **bulk_flux.F** module is not tunned for Hurricane regimes,
and will get the wrong solution
-
+
To compile **ROMS**, use:
```
build_roms.csh -j 10
@@ -167,7 +167,7 @@ They are activated in the build scripts.
submit.sh > & log &
```
You can modify **submit.sh** for your appropriate computer environment.
-
+
### The output Files:
- Standard Output Files:
@@ -180,7 +180,7 @@ They are activated in the build scripts.
```
- **ROMS** NetCDF Files:
-
+
```
irene_avg.nc 6-hour averages
irene_his.nc hourly history
diff --git a/IRENE/Coupling/data_wrf_roms/cbuild_roms.csh b/IRENE/Coupling/data_wrf_roms/cbuild_roms.csh
index f91672f5..4a126f0f 100755
--- a/IRENE/Coupling/data_wrf_roms/cbuild_roms.csh
+++ b/IRENE/Coupling/data_wrf_roms/cbuild_roms.csh
@@ -378,10 +378,10 @@ if ( $dprint == 0 ) then
echo ""
cd src
git checkout $branch_name
-
+
# If we are using the COMPILERS from the ROMS source code
# overide the value set above
-
+
if ( ${COMPILERS} =~ ${MY_ROMS_SRC}* ) then
setenv COMPILERS ${MY_PROJECT_DIR}/src/Compilers
endif
diff --git a/IRENE/Coupling/data_wrf_roms/cbuild_roms.sh b/IRENE/Coupling/data_wrf_roms/cbuild_roms.sh
index aca2b2b8..3053f901 100755
--- a/IRENE/Coupling/data_wrf_roms/cbuild_roms.sh
+++ b/IRENE/Coupling/data_wrf_roms/cbuild_roms.sh
@@ -367,7 +367,7 @@ if [ $dprint -eq 0 ]; then
# If we are using the COMPILERS from the ROMS source code
# overide the value set above
-
+
if [[ ${COMPILERS} == ${MY_ROMS_SRC}* ]]; then
export COMPILERS=${MY_PROJECT_DIR}/src/Compilers
fi
diff --git a/IRENE/Coupling/data_wrf_roms/irene.h b/IRENE/Coupling/data_wrf_roms/irene.h
index dfb4a81f..353ec80a 100644
--- a/IRENE/Coupling/data_wrf_roms/irene.h
+++ b/IRENE/Coupling/data_wrf_roms/irene.h
@@ -32,7 +32,7 @@
#define CHARNOK
#define ATM_PRESS
-
+
/* Basic numerics options */
diff --git a/IRENE/Coupling/data_wrf_roms/roms_irene.in b/IRENE/Coupling/data_wrf_roms/roms_irene.in
index 0b3fe3ed..a5ba1163 100644
--- a/IRENE/Coupling/data_wrf_roms/roms_irene.in
+++ b/IRENE/Coupling/data_wrf_roms/roms_irene.in
@@ -1140,7 +1140,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/Coupling/data_wrf_roms/submit.sh b/IRENE/Coupling/data_wrf_roms/submit.sh
index 82391cfe..0604465e 100755
--- a/IRENE/Coupling/data_wrf_roms/submit.sh
+++ b/IRENE/Coupling/data_wrf_roms/submit.sh
@@ -56,7 +56,7 @@ fi
##---------------------------------------------------------------------
if [ ${BATCH} -eq 1 ]; then
- ${SRUN} ${ROMS_EXE} ${ESMFinp} > log.wrf 2>&1
+ ${SRUN} ${ROMS_EXE} ${ESMFinp} > log.wrf 2>&1
else
${MPIrun} ${nPETs} ${ROMS_EXE} ${ESMFinp} > log.wrf 2>&1
fi
diff --git a/IRENE/Coupling/data_wrf_roms_wmc/Readme.md b/IRENE/Coupling/data_wrf_roms_wmc/Readme.md
index 12ca4c85..3976e701 100644
--- a/IRENE/Coupling/data_wrf_roms_wmc/Readme.md
+++ b/IRENE/Coupling/data_wrf_roms_wmc/Readme.md
@@ -7,12 +7,12 @@ coupling system for Hurricane Irene using the **ESMF/NUOPC** library. It
uses our Coupled Forecast Framework (**CFF**) configuration for the
US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is only
run for 42 hours as Hurricane Irene approached the Outer Banks
-of North Carolina on August 27, 2011.
+of North Carolina on August 27, 2011.
This test is a variant of the one available in [data_wrf_roms](../data_wrf_roms)
since **ROMS** and **DATA** export surface ocean currents to compute the
effective surface wind forcing by subtracting surface ocean currents from
-**WRF** surface wind.
+**WRF** surface wind.
@@ -30,7 +30,7 @@ activating the **RAMS**-averaged diagnostics.
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.
+from **WRF** to **ROMS** is semi-implicit.
It uses **ROMS**'s native, **NUOPC**-based coupling system. For more information,
visit **WikiROMS**:
@@ -41,7 +41,7 @@ https://www.myroms.org/wiki/Model_Coupling_ESMF
As shown by Renault _et al._ (2016), the feedback from surface ocean currents to
the atmosphere is an eddy-killing effect stabilizing the Gulf Stream separation
-at Cape Hatteras in **WRF-ROMS** fully coupled applications. The result is
+at Cape Hatteras in **WRF-ROMS** fully coupled applications. The result is
around 0.3 N/m2 weaker surface wind stress in the core of the Gulf Stream. Since
**ROMS** doesn't cover all the ocean points in the **WRF** grid, a **DATA**
component is used to supply those values from the 3-hour **HyCOM** dataset.
@@ -120,7 +120,7 @@ They are activated in the build scripts.
coupling_esmf_wrf.yaml Coupling fields exchange YAML metadata
irene.h ROMS header file
namelist.input WRF standard input script
- plot_debug.m Matlab plotting driver for debugging (for DebugLevel=3)
+ plot_debug.m Matlab plotting driver for debugging (for DebugLevel=3)
plot_esmf.m Matlab plotting script for field maps (for DebugLevel=3)
rbl4dvar.in ROMS observation input script
roms_irene.in ROMS standard input script
@@ -129,7 +129,7 @@ They are activated in the build scripts.
```
- To download **WRF** latest forked repository, you may use:
--
+-
```
git clone https://github.com/myroms/WRF
```
@@ -183,7 +183,7 @@ They are activated in the build scripts.
links files created by the build script and needed to run **WRF**:
```
alias ltl '/bin/ls -ltHF | grep -v ^l'
- ```
+ ```
### How to Compile ROMS:
- **ROMS** is the driver of the coupling system. In this application, the **WRF** Surface
@@ -196,7 +196,7 @@ They are activated in the build scripts.
The option **bulk_flux = 1** in the **ROMS** build script IS NOT RECOMMENDED FOR THIS
APPLICATION because the **bulk_flux.F** module is not tunned for Hurricane regimes,
and will get the wrong solution
-
+
To compile **ROMS**, use:
```
build_roms.csh -j 10
@@ -207,7 +207,7 @@ They are activated in the build scripts.
submit.sh > & log &
```
You can modify **submit.sh** for your appropriate computer environment.
-
+
### Debugging:
The **ROMS** native coupling framework allows writing the selected exchange fields in
@@ -265,7 +265,7 @@ exporting surface ocean currents. An example of the figures generated and shown
```
- **ROMS** NetCDF Files:
-
+
```
irene_avg.nc 6-hour averages
irene_his.nc hourly history
diff --git a/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.csh b/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.csh
index 0a396aa6..9bbf1dbf 100755
--- a/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.csh
+++ b/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.csh
@@ -380,10 +380,10 @@ if ( $dprint == 0 ) then
echo ""
cd src
git checkout $branch_name
-
+
# If we are using the COMPILERS from the ROMS source code
# overide the value set above
-
+
if ( ${COMPILERS} =~ ${MY_ROMS_SRC}* ) then
setenv COMPILERS ${MY_PROJECT_DIR}/src/Compilers
endif
diff --git a/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.sh b/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.sh
index f4162cd9..5fcaf200 100755
--- a/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.sh
+++ b/IRENE/Coupling/data_wrf_roms_wmc/cbuild_roms.sh
@@ -369,7 +369,7 @@ if [ $dprint -eq 0 ]; then
# If we are using the COMPILERS from the ROMS source code
# overide the value set above
-
+
if [[ ${COMPILERS} == ${MY_ROMS_SRC}* ]]; then
export COMPILERS=${MY_PROJECT_DIR}/src/Compilers
fi
diff --git a/IRENE/Coupling/data_wrf_roms_wmc/irene.h b/IRENE/Coupling/data_wrf_roms_wmc/irene.h
index dfb4a81f..353ec80a 100644
--- a/IRENE/Coupling/data_wrf_roms_wmc/irene.h
+++ b/IRENE/Coupling/data_wrf_roms_wmc/irene.h
@@ -32,7 +32,7 @@
#define CHARNOK
#define ATM_PRESS
-
+
/* Basic numerics options */
diff --git a/IRENE/Coupling/data_wrf_roms_wmc/roms_irene.in b/IRENE/Coupling/data_wrf_roms_wmc/roms_irene.in
index cc18bfd9..99cce819 100644
--- a/IRENE/Coupling/data_wrf_roms_wmc/roms_irene.in
+++ b/IRENE/Coupling/data_wrf_roms_wmc/roms_irene.in
@@ -1140,7 +1140,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/Coupling/data_wrf_roms_wmc/submit.sh b/IRENE/Coupling/data_wrf_roms_wmc/submit.sh
index a5efe53e..03bf6c47 100755
--- a/IRENE/Coupling/data_wrf_roms_wmc/submit.sh
+++ b/IRENE/Coupling/data_wrf_roms_wmc/submit.sh
@@ -56,7 +56,7 @@ fi
##---------------------------------------------------------------------
if [ ${BATCH} -eq 1 ]; then
- ${SRUN} ${ROMS_EXE} ${ESMFinp} > log.wrf 2>&1
+ ${SRUN} ${ROMS_EXE} ${ESMFinp} > log.wrf 2>&1
else
${MPIrun} ${nPETs} ${ROMS_EXE} ${ESMFinp} > log.wrf 2>&1
fi
diff --git a/IRENE/Coupling/mesh_esmf/Readme.md b/IRENE/Coupling/mesh_esmf/Readme.md
index 53dd5f00..53f293dc 100644
--- a/IRENE/Coupling/mesh_esmf/Readme.md
+++ b/IRENE/Coupling/mesh_esmf/Readme.md
@@ -23,7 +23,7 @@ structured and unstructured grids.
The **mesh** NetCDF files are created for you:
- **DATA** component: **ECMWF-ERA5** dataset
-
+
- **era5_IRENE_ESMFmesh.nc**
- **DATA** component: **NCEP-NARR** dataset
@@ -38,9 +38,9 @@ The **mesh** NetCDF files are created for you:
- **Tair_narr_IRENE_ESMFmesh.nc**
- **Uwind_narr_IRENE_ESMFmesh.nc**
- **Vwind_narr_IRENE_ESMFmesh.nc**
-
+
- **ROMS** component:
-
+
- **irene_roms_grid_rho_ESMFmesh.nc**
### How to Run:
diff --git a/IRENE/Coupling/roms_data/Readme.md b/IRENE/Coupling/roms_data/Readme.md
index 6fdf3880..f64ae4a8 100644
--- a/IRENE/Coupling/roms_data/Readme.md
+++ b/IRENE/Coupling/roms_data/Readme.md
@@ -5,7 +5,7 @@
This directory includes various files to run the **DATA-ROMS**
coupling for Hurricane Irene using the **ESMF/NUOPC** library. It
uses our Coupled Forecast Framework (**CFF**) configuration for the
-US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
+US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
only run for 42 hours as Hurricane Irene approached the Outer Banks
of North Carolina on August 27, 2011.
@@ -94,7 +94,7 @@ They are activated in the build scripts.
roms_irene.in ROMS standard input script
data_explicit.runconfig ESMF coupling Run Sequence
```
-
+
### How to Compile ROMS:
- **ROMS** is the driver of the coupling system.
diff --git a/IRENE/Coupling/roms_data/cbuild_roms.csh b/IRENE/Coupling/roms_data/cbuild_roms.csh
index 3f53fdaf..85e43e60 100755
--- a/IRENE/Coupling/roms_data/cbuild_roms.csh
+++ b/IRENE/Coupling/roms_data/cbuild_roms.csh
@@ -380,10 +380,10 @@ if ( $dprint == 0 ) then
echo ""
cd src
git checkout $branch_name
-
+
# If we are using the COMPILERS from the ROMS source code
# overide the value set above
-
+
if ( ${COMPILERS} =~ ${MY_ROMS_SRC}* ) then
setenv COMPILERS ${MY_PROJECT_DIR}/src/Compilers
endif
diff --git a/IRENE/Coupling/roms_data/cbuild_roms.sh b/IRENE/Coupling/roms_data/cbuild_roms.sh
index 52e9d32b..a1076bf8 100755
--- a/IRENE/Coupling/roms_data/cbuild_roms.sh
+++ b/IRENE/Coupling/roms_data/cbuild_roms.sh
@@ -369,7 +369,7 @@ if [ $dprint -eq 0 ]; then
# If we are using the COMPILERS from the ROMS source code
# overide the value set above
-
+
if [[ ${COMPILERS} == ${MY_ROMS_SRC}* ]]; then
export COMPILERS=${MY_PROJECT_DIR}/src/Compilers
fi
diff --git a/IRENE/Coupling/roms_data/irene.h b/IRENE/Coupling/roms_data/irene.h
index dfb4a81f..353ec80a 100644
--- a/IRENE/Coupling/roms_data/irene.h
+++ b/IRENE/Coupling/roms_data/irene.h
@@ -32,7 +32,7 @@
#define CHARNOK
#define ATM_PRESS
-
+
/* Basic numerics options */
diff --git a/IRENE/Coupling/roms_data/roms_irene.in b/IRENE/Coupling/roms_data/roms_irene.in
index 0c3e30ad..c8e8cdd4 100644
--- a/IRENE/Coupling/roms_data/roms_irene.in
+++ b/IRENE/Coupling/roms_data/roms_irene.in
@@ -1140,7 +1140,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/Coupling/roms_data_cdeps/Readme.md b/IRENE/Coupling/roms_data_cdeps/Readme.md
index e8ee210b..fb2ae539 100644
--- a/IRENE/Coupling/roms_data_cdeps/Readme.md
+++ b/IRENE/Coupling/roms_data_cdeps/Readme.md
@@ -3,10 +3,10 @@
## Hurricane Irene: CDEPS Coupling Connectors
This directory includes various files to run the **DATA-ROMS** coupling for Hurricane Irene
-using **CDEPS** **NUOPC**-based connectors. The **DATA** component is replacing the
+using **CDEPS** **NUOPC**-based connectors. The **DATA** component is replacing the
Atmosphere Model, using datasets from **NCEP-NARR** or **ECMWF-ERA5** products. It
uses our Coupled Forecast Framework (**CFF**) configuration for the
-US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
+US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
only run for 42 hours as Hurricane Irene approached the Outer Banks
of North Carolina on August 27, 2011.
diff --git a/IRENE/Coupling/roms_data_cdeps/clean.sh b/IRENE/Coupling/roms_data_cdeps/clean.sh
index 6871b046..4c629680 100755
--- a/IRENE/Coupling/roms_data_cdeps/clean.sh
+++ b/IRENE/Coupling/roms_data_cdeps/clean.sh
@@ -6,5 +6,5 @@ rm -f ESMF_LogFile PET* log out err
rm -f ufs.cpld.*
rm -f rpointer.*
rm -f *.vtk
-rm -f weightmatrix_*.nc diagnostic_*.nc
+rm -f weightmatrix_*.nc diagnostic_*.nc
rm -f *_premesh.nc
diff --git a/IRENE/Coupling/roms_data_cdeps/irene.h b/IRENE/Coupling/roms_data_cdeps/irene.h
index a1944fda..b969cae9 100644
--- a/IRENE/Coupling/roms_data_cdeps/irene.h
+++ b/IRENE/Coupling/roms_data_cdeps/irene.h
@@ -32,7 +32,7 @@
#define CHARNOK
#define ATM_PRESS
-
+
/* Basic numerics options */
#define UV_U3HADVECTION
diff --git a/IRENE/Coupling/roms_data_cdeps/job_setup.sh b/IRENE/Coupling/roms_data_cdeps/job_setup.sh
index b12779a5..11fe3e7a 100755
--- a/IRENE/Coupling/roms_data_cdeps/job_setup.sh
+++ b/IRENE/Coupling/roms_data_cdeps/job_setup.sh
@@ -132,7 +132,7 @@ fi
echo
echo " Generating '${ROMS_Inp}' from template '${TemplDir}/${ROMS_InpTmpl}'"
-
+
cp -f ${TemplDir}/${ROMS_InpTmpl} ${ROMS_Inp}
perl -p0777 -i -e "s|MyNtileI|${nPETsX}|g" ${ROMS_Inp}
diff --git a/IRENE/Coupling/roms_data_cdeps/roms_irene.in b/IRENE/Coupling/roms_data_cdeps/roms_irene.in
index 1e996372..2a854027 100644
--- a/IRENE/Coupling/roms_data_cdeps/roms_irene.in
+++ b/IRENE/Coupling/roms_data_cdeps/roms_irene.in
@@ -1140,7 +1140,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/Coupling/roms_data_cmeps/Readme.md b/IRENE/Coupling/roms_data_cmeps/Readme.md
index 99e5fac9..ddae72c0 100644
--- a/IRENE/Coupling/roms_data_cmeps/Readme.md
+++ b/IRENE/Coupling/roms_data_cmeps/Readme.md
@@ -3,16 +3,16 @@
## Hurricane Irene: CMEPS Coupling Connectors
This directory includes various files to run the **DATA-ROMS** coupling for Hurricane Irene
-using **CMEPS** **NUOPC**-based mediator. The **DATA** component is replacing the
+using **CMEPS** **NUOPC**-based mediator. The **DATA** component is replacing the
Atmosphere Model, using datasets from **NCEP-NARR** or **ECMWF-ERA5** products. It
uses our Coupled Forecast Framework (**CFF**) configuration for the
-US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
+US East Coast **`CFF-EC7`** (**ROMS** 7km grid), and the simulation is
only run for 42 hours as Hurricane Irene approached the Outer Banks
of North Carolina on August 27, 2011.
-For more information about the Community Mediator for Earth Prediction Systems
+For more information about the Community Mediator for Earth Prediction Systems
(**CMEPS**), visit:
https://escomp.github.io/CMEPS/versions/master/html/index.html
@@ -114,7 +114,7 @@ For example, it uses Perl to replace the value of **`MyIRENEdir`** in the templa
rbl4dvar.in.tmpl ROMS observation input template
roms_irene.in.tmpl ROMS standard input template
```
-
+
### How to Compile and Run UFS Coupling System:
- Clone **UFS-coastal** repository:
diff --git a/IRENE/Coupling/roms_data_cmeps/clean.sh b/IRENE/Coupling/roms_data_cmeps/clean.sh
index 6871b046..4c629680 100755
--- a/IRENE/Coupling/roms_data_cmeps/clean.sh
+++ b/IRENE/Coupling/roms_data_cmeps/clean.sh
@@ -6,5 +6,5 @@ rm -f ESMF_LogFile PET* log out err
rm -f ufs.cpld.*
rm -f rpointer.*
rm -f *.vtk
-rm -f weightmatrix_*.nc diagnostic_*.nc
+rm -f weightmatrix_*.nc diagnostic_*.nc
rm -f *_premesh.nc
diff --git a/IRENE/Coupling/roms_data_cmeps/irene.h b/IRENE/Coupling/roms_data_cmeps/irene.h
index a1944fda..b969cae9 100644
--- a/IRENE/Coupling/roms_data_cmeps/irene.h
+++ b/IRENE/Coupling/roms_data_cmeps/irene.h
@@ -32,7 +32,7 @@
#define CHARNOK
#define ATM_PRESS
-
+
/* Basic numerics options */
#define UV_U3HADVECTION
diff --git a/IRENE/Coupling/roms_data_cmeps/job_setup.sh b/IRENE/Coupling/roms_data_cmeps/job_setup.sh
index b12779a5..11fe3e7a 100755
--- a/IRENE/Coupling/roms_data_cmeps/job_setup.sh
+++ b/IRENE/Coupling/roms_data_cmeps/job_setup.sh
@@ -132,7 +132,7 @@ fi
echo
echo " Generating '${ROMS_Inp}' from template '${TemplDir}/${ROMS_InpTmpl}'"
-
+
cp -f ${TemplDir}/${ROMS_InpTmpl} ${ROMS_Inp}
perl -p0777 -i -e "s|MyNtileI|${nPETsX}|g" ${ROMS_Inp}
diff --git a/IRENE/Coupling/roms_data_cmeps/roms_irene.in b/IRENE/Coupling/roms_data_cmeps/roms_irene.in
index 1e996372..2a854027 100644
--- a/IRENE/Coupling/roms_data_cmeps/roms_irene.in
+++ b/IRENE/Coupling/roms_data_cmeps/roms_irene.in
@@ -1140,7 +1140,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/Data/HyCOM/hycom_mab_sst.m b/IRENE/Data/HyCOM/hycom_mab_sst.m
index 822a4b5b..ea53fc86 100644
--- a/IRENE/Data/HyCOM/hycom_mab_sst.m
+++ b/IRENE/Data/HyCOM/hycom_mab_sst.m
@@ -22,7 +22,7 @@
Nrec = length(nc_read(InpName, 'MT'));
lon = nc_read(InpName, 'Longitude');
-lon = lon(i1:i2, j1:j2) - 360;
+lon = lon(i1:i2, j1:j2) - 360;
nc_write(OutName, 'Longitude', lon);
lat = nc_read(InpName, 'Latitude');
@@ -41,7 +41,7 @@
nc_write(OutName, 'MT', F, rec);
F = nc_read(InpName, 'Date', rec);
- nc_write(OutName, 'Date', F, rec);
+ nc_write(OutName, 'Date', F, rec);
F = nc_read(InpName, 'temperature', rec, NaN);
F = F(i1:i2, j1:j2);
diff --git a/IRENE/Data/HyCOM/hycom_mab_uv.m b/IRENE/Data/HyCOM/hycom_mab_uv.m
index 383d2d3b..5b68f2b8 100644
--- a/IRENE/Data/HyCOM/hycom_mab_uv.m
+++ b/IRENE/Data/HyCOM/hycom_mab_uv.m
@@ -48,7 +48,7 @@
Date = str2num(datestr(datenum(epoch+time),'yyyymmdd'))+dfrac;
disp(['Processing Date: ', dstr]);
-
+
Usur = nc_read(fname, 'water_u', 1, NaN);
Vsur = nc_read(fname, 'water_v', 1, NaN);
@@ -56,7 +56,7 @@
if (~isempty(Uind))
Uwind(Uind)=1.0E+30;
end
-
+
Vind = find(isnan(Vsur));
if (~isempty(Vind))
Vwind(Vind)=1.0E+30;
diff --git a/IRENE/Forward/irene.h b/IRENE/Forward/irene.h
index 537995f4..5b5300af 100644
--- a/IRENE/Forward/irene.h
+++ b/IRENE/Forward/irene.h
@@ -30,7 +30,7 @@
#define CHARNOK
#define ATM_PRESS
-
+
/* Basic numerics options */
diff --git a/IRENE/Forward/roms_irene.in b/IRENE/Forward/roms_irene.in
index c0af1201..5fc2b0ca 100644
--- a/IRENE/Forward/roms_irene.in
+++ b/IRENE/Forward/roms_irene.in
@@ -1139,7 +1139,7 @@ PIO_I2C_Preq = 65 ! Maximum pending I2C requests
! Input tidal forcing file name.
- TIDENAME == ../Data/ROMS/irene_roms_tides.nc
+ TIDENAME == ../Data/ROMS/irene_roms_tides.nc
! Input forcing NetCDF file name(s).
!
diff --git a/IRENE/plotting/plot_roms.m b/IRENE/plotting/plot_roms.m
index ee7b0b23..c150be4e 100644
--- a/IRENE/plotting/plot_roms.m
+++ b/IRENE/plotting/plot_roms.m
@@ -13,9 +13,9 @@ function plot_roms (varargin)
% Dir Run sub-directory (string, OPTIONAL)
% default: '' or [] for current directory
%
-% wrtPNG Flag to save figure(s) as a PNG file (logical, OPTIONAL)
+% wrtPNG Flag to save figure(s) as a PNG file (logical, OPTIONAL)
%
-
+
% git $Id$
%=========================================================================%
% Copyright (c) 2002-2024 The ROMS/TOMS Group %
@@ -92,7 +92,7 @@ function plot_roms (varargin)
iv = 3; % vector I-sampling
jv = 3; % vector J-sampling
vcolor = 'k'; % vector overlay color
-vscale = 2; % vector scale
+vscale = 2; % vector scale
density = 1.5; % streamlines density
dx = 0.1; % streamlines monotonic longitude spacing
@@ -140,7 +140,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(sst(:))), ...
' Max = ', num2str(max(sst(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_sst_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -160,7 +160,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(sss(:))), ...
' Max = ', num2str(max(sss(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_sss_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -180,7 +180,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(Pair(:))), ...
' Max = ', num2str(max(Pair(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_pair_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -200,7 +200,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(swrad(:))), ...
' Max = ', num2str(max(swrad(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_swrad_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -220,7 +220,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(lwrad(:))), ...
' Max = ', num2str(max(lwrad(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_lwrad_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -240,7 +240,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(latent(:))), ...
' Max = ', num2str(max(latent(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_lhf_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -261,7 +261,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(sensible(:))), ...
' Max = ', num2str(max(sensible(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_shf_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -281,7 +281,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(shflux(:))), ...
' Max = ', num2str(max(shflux(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_shflux_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -301,7 +301,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(ssflux(:))), ...
' Max = ', num2str(max(ssflux(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_ssflux_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -321,7 +321,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(EminusP(:))), ...
' Max = ', num2str(max(EminusP(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_EminusP_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -344,7 +344,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_wstress_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
@@ -368,7 +368,7 @@ function plot_roms (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('roms_irene_wstrvec_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 1882x1700+218+50', ...
diff --git a/IRENE/plotting/plot_wrf.m b/IRENE/plotting/plot_wrf.m
index 7fd5fbd3..392b0bd9 100644
--- a/IRENE/plotting/plot_wrf.m
+++ b/IRENE/plotting/plot_wrf.m
@@ -13,9 +13,9 @@ function plot_wrf (varargin)
% Dir Run sub-directory (string, OPTIONAL)
% default: '' or [] for current directory
%
-% wrtPNG Flag to save figures as a PNG file (logical, OPTIONAL)
+% wrtPNG Flag to save figures as a PNG file (logical, OPTIONAL)
%
-
+
% git $Id$
%=========================================================================%
% Copyright (c) 2002-2024 The ROMS/TOMS Group %
@@ -119,7 +119,7 @@ function plot_wrf (varargin)
f = sst-273.15;
m_pcolor(lon, lat, f);
shading interp; colorbar; caxis([0 35]);
-cmocean('inferno',256);
+cmocean('inferno',256);
m_gshhs_i('color','k');
m_plot(XboxW,YboxW,'linewidth',2,'color','k');
title('WRF: Surface Land/Ocean Temperature (Celsius)');
@@ -127,7 +127,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_tsur_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -147,7 +147,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(gsw(:))), ...
' Max = ', num2str(max(gsw(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_gsw_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -159,7 +159,7 @@ function plot_wrf (varargin)
hold on;
m_pcolor(lon, lat, sw);
shading interp; colorbar; caxis([0 800]);
-colormap(cmap('R2'));
+colormap(cmap('R2'));
m_gshhs_i('color','k');
m_plot(XboxW,YboxW,'linewidth',2,'color','k');
title('WRF: SWDOWN - Downward Shortwave Radiation Flux (W/m^2)');
@@ -167,7 +167,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(sw(:))), ...
' Max = ', num2str(max(sw(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_swdown_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -179,7 +179,7 @@ function plot_wrf (varargin)
hold on;
m_pcolor(lon, lat, swd);
shading interp; colorbar; caxis([0 800]);
-colormap(cmap('R2'));
+colormap(cmap('R2'));
m_gshhs_i('color','k');
m_plot(XboxW,YboxW,'linewidth',2,'color','k');
title('WRF: SWDNB - Downwelling Shortwave Radiation Flux (W/m^2)');
@@ -187,7 +187,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(swd(:))), ...
' Max = ', num2str(max(swd(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_swdn_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -199,7 +199,7 @@ function plot_wrf (varargin)
hold on;
m_pcolor(lon, lat, swu);
shading interp; colorbar; caxis([0 200]);
-colormap(cmap('R2'));
+colormap(cmap('R2'));
m_gshhs_i('color','k');
m_plot(XboxW,YboxW,'linewidth',2,'color','k');
title('WRF: SWUPB - Upwelling Shortwave Radiation Flux (W/m^2)');
@@ -207,7 +207,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(swu(:))), ...
' Max = ', num2str(max(swu(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_swup_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -228,7 +228,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_swperc_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -249,7 +249,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(swnet1(:))), ...
' Max = ', num2str(max(swnet1(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_swflx_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -269,7 +269,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(glw(:))), ...
' Max = ', num2str(max(glw(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_irflx_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -281,7 +281,7 @@ function plot_wrf (varargin)
hold on;
m_pcolor(lon, lat, glw);
shading interp; colorbar; caxis([300 500]);
-colormap(cmap('R2'));
+colormap(cmap('R2'));
m_gshhs_i('color','k');
m_plot(XboxW,YboxW,'linewidth',2,'color','k');
title('WRF: GLW - Downward Longwave Radiation Flux (W/m^2)');
@@ -289,7 +289,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(glw(:))), ...
' Max = ', num2str(max(glw(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_glw_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -309,7 +309,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(lwd(:))), ...
' Max = ', num2str(max(lwd(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_lwdn_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -329,7 +329,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(lwu(:))), ...
' Max = ', num2str(max(lwu(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_lwup_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -350,7 +350,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_lwup-irflx_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -372,7 +372,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_lwflx_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -393,7 +393,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_lwdn-lwup_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -415,7 +415,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(f(:))), ...
' Max = ', num2str(max(f(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_glw-lwdn_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -435,7 +435,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(hfx(:))), ...
' Max = ', num2str(max(hfx(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_shflx_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -455,7 +455,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(lhf(:))), ...
' Max = ', num2str(max(lhf(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_lhflx_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
@@ -475,7 +475,7 @@ function plot_wrf (varargin)
['Min = ', num2str(min(heat(:))), ...
' Max = ', num2str(max(heat(:)))]}, ...
'FontSize',12,'FontWeight','bold');
-if (wrtPNG)
+if (wrtPNG)
png_file=strcat('wrf_irene_nhflx_',num2str(rec, '%3.3i'),'.png');
print(png_file, '-dpng', '-r300');
unix(['/opt/local/bin/convert -verbose -crop 2045x1605+131+104', ...
diff --git a/WC13/ARRAY_MODES/Readme.md b/WC13/ARRAY_MODES/Readme.md
index 599f558e..4052b828 100644
--- a/WC13/ARRAY_MODES/Readme.md
+++ b/WC13/ARRAY_MODES/Readme.md
@@ -91,7 +91,7 @@ You need to take the following steps:
balance relationships (*i.e.*, **T-S** empirical formulas,
hydrostatic balance, and geostrophic balance) with other
state variables (Weaver *et al.*, 2005).
-
+
- These standard deviations have already been created for you:
```
../Data/wc13_std_i.nc initial conditions
@@ -112,7 +112,7 @@ You need to take the following steps:
(2D state variables) or volume (3D state variables), and
then by convolving with the squared-root adjoint and tangent
linear diffusion operators.
-
+
- The **randomization method** is cheaper and an approximation.
The normalization coefficients are computed using the approach
of Fisher and Courtier (1995). The coefficients are initialized
@@ -121,7 +121,7 @@ You need to take the following steps:
they are scaled by the inverse squared root of the cell area
(2D state variable) or volume (3D state variable) and convolved
with the squared-root adjoint and tangent diffusion operators
- over a specified number of iterations, **Nrandom**.
+ over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script
**s4dvar.in** (see input script for details):
@@ -134,14 +134,14 @@ You need to take the following steps:
CnormM(isFsur) = T ! Model, 2D variable at RHO-points
CnormM(isUbar) = T ! Model, 2D variable at U-points
- CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
CnormM(isUvel) = T ! Model, 3D variable at U-points
CnormM(isVvel) = T ! Model, 3D variable at V-points
CnormM(isTvar) = T T ! Model, NT tracers
CnormI(isFsur) = T ! IC, 2D variable at RHO-points
CnormI(isUbar) = T ! IC, 2D variable at U-points
- CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
CnormI(isUvel) = T ! IC, 3D variable at U-points
CnormI(isVvel) = T ! IC, 3D variable at V-points
CnormI(isTvar) = T T ! IC, NT tracers
@@ -183,7 +183,7 @@ You need to take the following steps:
```
In **RBL4D-Var** (observation space minimization, dual formulation), the Lanczos
vectors are stored in output **4D-Var** NetCDF file **wc13_mod.nc**.
-
+
- Customize your preferred **build** script and provide the
appropriate values for:
@@ -243,7 +243,7 @@ You need to take the following steps:
determined by the parameter **Nvct**. The array modes are referenced
in reverse order, so choosing **Nvct=Ninner-1** is the significant array
mode. Note that **Nvct** must be assigned a numeric value
- (i.e. **Nvct=10** for the **RBL4D-Var** tutorial).
+ (i.e. **Nvct=10** for the **RBL4D-Var** tutorial).
- Execute the configuration **job_array_modes.csh** `BEFORE` running
the model. It copies the required files and creates **r4dvar.in**
@@ -267,9 +267,9 @@ You need to take the following steps:
```
- Analyze the results using the plotting scripts (Matlab or
**ROMS** plotting package) provided in the **../plotting** directory:
-
+
- **plot_array_modes.m**: plots chosen stabilized representer matrix array modes.
-
+
- **plot_array_modes_spectrum.m**: Plots array modes eigenvalues spectrum.
- **ccnt_array_modes_[*].in**: plots chosen stabilized representer
@@ -285,7 +285,7 @@ You need to take the following steps:
- Moore, A.M., H.G. Arango, C.A. Edwards, **2017**: Reduced-Rank
Array Modes of the California Current Observing System,
- *J. Geophys. Res. Ocean*, **122**,
+ *J. Geophys. Res. Ocean*, **122**,
https://doi.org/10.1002/2017JC013172.
- Moore, A.M., H.G. Arango, G. Broquet, B.S. Powell, A.T. Weaver,
@@ -299,7 +299,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/ARRAY_MODES/s4dvar.in b/WC13/ARRAY_MODES/s4dvar.in
index 2845c90a..29bab6be 100644
--- a/WC13/ARRAY_MODES/s4dvar.in
+++ b/WC13/ARRAY_MODES/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/Data/adsen_37N_transport.m b/WC13/Data/adsen_37N_transport.m
index a57879f7..3bcaa849 100644
--- a/WC13/Data/adsen_37N_transport.m
+++ b/WC13/Data/adsen_37N_transport.m
@@ -20,7 +20,7 @@
Eradius=6371315.0;
lonr=nc_read(gname,'lon_rho'); lonr=lonr';
-latr=nc_read(gname,'lat_rho'); latr=latr';
+latr=nc_read(gname,'lat_rho'); latr=latr';
lonv=nc_read(gname,'lon_v'); lonv=lonv';
latv=nc_read(gname,'lat_v'); latv=latv';
lonu=nc_read(gname,'lon_u'); lonu=lonu';
@@ -42,15 +42,15 @@
nHIS=nc_read(Inp,'nHIS');
ntimes=nc_read(Inp,'ntimes');
facdt1=nHIS/ntimes;
-
+
clear f;
-v='v';
+v='v';
f=nc_read(Inp,v);
-
+
clear varr;
varr=zeros(size(f));
-
-
+
+
for it=1:size(f,4),
if it==1 | it==size(f,4),
@@ -58,22 +58,22 @@
else,
facdt=facdt1;
end,
-
+
clear z_w;
[z_w]=depths(Inp,gname,5,0);
-
+
nlevt=size(f,3);
-
+
clear Hz;
for k=1:nlevt
Hz(:,:,k)=z_w(:,:,k+1)-z_w(:,:,k);
end
-
+
clear z_v;
[z_v]=depths(Inp,gname,4,0);
-
+
clear df;
-
+
for k=1:nlevt,
for i=section,
if z_v(i,jlat,k) > depth
@@ -83,18 +83,18 @@
end,
end,
end,
-
+
end,
% Create adjoint sensitivy NetCDF file.
Out='wc13_ads.nc';
unix('ncgen -b adsen.cdl');
-
+
% Write out information variables.
v='spherical'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
-
+
v='Vtransform'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
v='Vstretching'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
v='theta_s'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
@@ -107,7 +107,7 @@
v='Cs_w'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
v='h'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
-
+
v='lon_rho'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
v='lat_rho'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
v='lon_u'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
@@ -121,11 +121,11 @@
v='mask_rho'; f=nc_read(Inp,v); s=nc_write(Out,'scope_rho',f);
v='mask_u'; f=nc_read(Inp,v); s=nc_write(Out,'scope_u',f);
v='mask_v'; f=nc_read(Inp,v); s=nc_write(Out,'scope_v',f);
-
+
% Write out zero state variables.
v='ocean_time'; f=nc_read(Inp,v); s=nc_write(Out,v,f);
-
+
v='zeta'; f=nc_read(Inp,v); s=nc_write(Out,v,zeros(size(f)));
v='ubar'; f=nc_read(Inp,v); s=nc_write(Out,v,zeros(size(f)));
v='vbar'; f=nc_read(Inp,v); s=nc_write(Out,v,zeros(size(f)));
@@ -133,10 +133,10 @@
v='v'; f=nc_read(Inp,v); s=nc_write(Out,v,zeros(size(f)));
v='temp'; f=nc_read(Inp,v); s=nc_write(Out,v,zeros(size(f)));
v='salt'; f=nc_read(Inp,v); s=nc_write(Out,v,zeros(size(f)));
-
+
% Over-write v-momentum sensitivity functional for the California
% Current System: sensitivity of meridional transport along 37N
% for the upper 500 m.
s=nc_write(Out,'v',varr);
-
+
diff --git a/WC13/Data/adsen_37N_transport_fcst.m b/WC13/Data/adsen_37N_transport_fcst.m
index 75fbb48e..5aae9f36 100644
--- a/WC13/Data/adsen_37N_transport_fcst.m
+++ b/WC13/Data/adsen_37N_transport_fcst.m
@@ -56,7 +56,7 @@
Eradius=6371315.0;
lonr=nc_read(Gname,'lon_rho'); lonr=lonr';
-latr=nc_read(Gname,'lat_rho'); latr=latr';
+latr=nc_read(Gname,'lat_rho'); latr=latr';
lonv=nc_read(Gname,'lon_v'); lonv=lonv';
latv=nc_read(Gname,'lat_v'); latv=latv';
lonu=nc_read(Gname,'lon_u'); lonu=lonu';
@@ -79,36 +79,36 @@
ntimes=nc_read(InpA,'ntimes');
%facdt1=nHIS/ntimes;
facdt1=1/nAVG;
-
+
clear f;
-v='v';
+v='v';
fA =nc_read(InpA,v);
fB =nc_read(InpB,v);
fVA=nc_read(InpVA,v);
-
+
clear varr;
varr=zeros(size(fA));
-
-
+
+
for it=(size(fA,4)-nAVG):size(fA,4),
facdt=facdt1;
-
+
clear z_w;
[z_w]=depths(InpA,Gname,5,0);
-
+
nlevt=size(fA,3);
-
+
clear Hz;
for k=1:nlevt
Hz(:,:,k)=z_w(:,:,k+1)-z_w(:,:,k);
end
-
+
clear z_v;
[z_v]=depths(InpA,Gname,4,0);
-
+
clear df;
-
+
for k=1:nlevt,
for i=section,
if z_v(i,jlat,k) > depth
@@ -118,7 +118,7 @@
end
end
end
-
+
end
% Compute dJA and dJB.
@@ -160,7 +160,7 @@
end
% Write out zero state variables.
-
+
for var = Vstate
v = char(var);
f = nc_read (InpA, v);
@@ -216,4 +216,4 @@
% for the upper 500 m.
s=nc_write(Out,'v',varrB);
-
+
diff --git a/WC13/I4DVAR/Readme.md b/WC13/I4DVAR/Readme.md
index 8033b679..b140b390 100644
--- a/WC13/I4DVAR/Readme.md
+++ b/WC13/I4DVAR/Readme.md
@@ -106,7 +106,7 @@ You need to take the following steps:
(2D state variables) or volume (3D state variables), and
then by convolving with the squared-root adjoint and tangent
linear diffusion operators.
-
+
- The **randomization method** is cheaper and an approximation.
The normalization coefficients are computed using the approach
of Fisher and Courtier (1995). The coefficients are initialized
@@ -115,7 +115,7 @@ You need to take the following steps:
they are scaled by the inverse squared root of the cell area
(2D state variable) or volume (3D state variable) and convolved
with the squared-root adjoint and tangent diffusion operators
- over a specified number of iterations, **Nrandom**.
+ over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script
**s4dvar.in**:
@@ -128,14 +128,14 @@ You need to take the following steps:
CnormM(isFsur) = T ! Model, 2D variable at RHO-points
CnormM(isUbar) = T ! Model, 2D variable at U-points
- CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
CnormM(isUvel) = T ! Model, 3D variable at U-points
CnormM(isVvel) = T ! Model, 3D variable at V-points
CnormM(isTvar) = T T ! Model, NT tracers
CnormI(isFsur) = T ! IC, 2D variable at RHO-points
CnormI(isUbar) = T ! IC, 2D variable at U-points
- CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
CnormI(isUvel) = T ! IC, 3D variable at U-points
CnormI(isVvel) = T ! IC, 3D variable at V-points
CnormI(isTvar) = T T ! IC, NT tracers
@@ -194,7 +194,7 @@ You need to take the following steps:
For this to work, however, any **#undef** directives **must** be
avoided in the header file **wc13.h** since it has precedence
during C-preprocessing.
-
+
- You **must** use any of the **build** scripts to compile.
- Customize the **ROMS** input script **roms_wc13.in** and specify
@@ -235,7 +235,7 @@ You need to take the following steps:
mpirun -np 8 romsM roms_wc13_2hours.in > & log &
```
-
+
Notice that the nonlinear trajectory can be written either
daily (**NHIS=48** if using **roms_wc13_daily.in**) or every
two hours (**NHIS=4** if using **roms_wc13_2hours.in**). It is
@@ -248,7 +248,7 @@ You need to take the following steps:
The two set-ups are provided to make the user aware of the
validity of the tangent linear approximation in highly
nonlinear circulations. The differences will be noticeable
- when computing observation impacts and observation sensitivities.
+ when computing observation impacts and observation sensitivities.
- We recommend creating a new subdirectories **EX1** (Tutorial Exercise 1)
and **EX2** (Tutorial Exercise 2) to save the solution in it for
@@ -289,7 +289,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/I4DVAR/roms_wc13_2hours.in b/WC13/I4DVAR/roms_wc13_2hours.in
index e7393baa..06a82e17 100644
--- a/WC13/I4DVAR/roms_wc13_2hours.in
+++ b/WC13/I4DVAR/roms_wc13_2hours.in
@@ -284,7 +284,7 @@ ad_VolCons(north) == F ! northern boundary
! Output tangent linear and adjoint models parameters.
- LcycleTLM == F
+ LcycleTLM == F
NTLM == 48 ! daily
NDEFTLM == 0
LcycleADJ == T
diff --git a/WC13/I4DVAR/roms_wc13_daily.in b/WC13/I4DVAR/roms_wc13_daily.in
index 045247a5..715b80c5 100644
--- a/WC13/I4DVAR/roms_wc13_daily.in
+++ b/WC13/I4DVAR/roms_wc13_daily.in
@@ -284,7 +284,7 @@ ad_VolCons(north) == F ! northern boundary
! Output tangent linear and adjoint models parameters.
- LcycleTLM == F
+ LcycleTLM == F
NTLM == 48 ! daily
NDEFTLM == 0
LcycleADJ == T
diff --git a/WC13/I4DVAR/s4dvar.in b/WC13/I4DVAR/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/I4DVAR/s4dvar.in
+++ b/WC13/I4DVAR/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/I4DVAR_analysis_impact/Readme.md b/WC13/I4DVAR_analysis_impact/Readme.md
index 9295752d..4df55adc 100644
--- a/WC13/I4DVAR_analysis_impact/Readme.md
+++ b/WC13/I4DVAR_analysis_impact/Readme.md
@@ -131,7 +131,7 @@ Current System, 1/3 degree resolution, application (**WC13**).
(2D state variables) or volume (3D state variables), and
then by convolving with the squared-root adjoint and tangent
linear diffusion operators.
-
+
- The **randomization method** is cheaper and an approximation.
The normalization coefficients are computed using the approach
of Fisher and Courtier (1995). The coefficients are initialized
@@ -140,7 +140,7 @@ Current System, 1/3 degree resolution, application (**WC13**).
they are scaled by the inverse squared root of the cell area
(2D state variable) or volume (3D state variable) and convolved
with the squared-root adjoint and tangent diffusion operators
- over a specified number of iterations, **Nrandom**.
+ over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script
**s4dvar.in** (see input script for details):
@@ -153,14 +153,14 @@ Current System, 1/3 degree resolution, application (**WC13**).
CnormM(isFsur) = T ! Model, 2D variable at RHO-points
CnormM(isUbar) = T ! Model, 2D variable at U-points
- CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
CnormM(isUvel) = T ! Model, 3D variable at U-points
CnormM(isVvel) = T ! Model, 3D variable at V-points
CnormM(isTvar) = T T ! Model, NT tracers
CnormI(isFsur) = T ! IC, 2D variable at RHO-points
CnormI(isUbar) = T ! IC, 2D variable at U-points
- CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
CnormI(isUvel) = T ! IC, 3D variable at U-points
CnormI(isVvel) = T ! IC, 3D variable at V-points
CnormI(isTvar) = T T ! IC, NT tracers
@@ -241,7 +241,7 @@ Current System, 1/3 degree resolution, application (**WC13**).
For this to work, however, any **#undef** directives **must** be
avoided in the header file **wc13.h** since it has precedence
during C-preprocessing.
-
+
- You **must** use any of the **build** scripts to compile.
- Customize the **ROMS** input script **roms_wc13.in** and specify
@@ -316,7 +316,7 @@ Current System, 1/3 degree resolution, application (**WC13**).
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/I4DVAR_analysis_impact/roms_wc13_2hours.in b/WC13/I4DVAR_analysis_impact/roms_wc13_2hours.in
index 88f72fab..c830c4d3 100644
--- a/WC13/I4DVAR_analysis_impact/roms_wc13_2hours.in
+++ b/WC13/I4DVAR_analysis_impact/roms_wc13_2hours.in
@@ -283,7 +283,7 @@ ad_VolCons(north) == F ! northern boundary
! Output tangent linear and adjoint models parameters.
- LcycleTLM == F
+ LcycleTLM == F
NTLM == 48 ! daily
NDEFTLM == 0
LcycleADJ == T
diff --git a/WC13/I4DVAR_analysis_impact/roms_wc13_daily.in b/WC13/I4DVAR_analysis_impact/roms_wc13_daily.in
index 5f2a9d08..8a5d2154 100644
--- a/WC13/I4DVAR_analysis_impact/roms_wc13_daily.in
+++ b/WC13/I4DVAR_analysis_impact/roms_wc13_daily.in
@@ -283,7 +283,7 @@ ad_VolCons(north) == F ! northern boundary
! Output tangent linear and adjoint models parameters.
- LcycleTLM == F
+ LcycleTLM == F
NTLM == 48 ! daily
NDEFTLM == 0
LcycleADJ == T
diff --git a/WC13/I4DVAR_analysis_impact/s4dvar.in b/WC13/I4DVAR_analysis_impact/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/I4DVAR_analysis_impact/s4dvar.in
+++ b/WC13/I4DVAR_analysis_impact/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/I4DVAR_split/s4dvar.in b/WC13/I4DVAR_split/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/I4DVAR_split/s4dvar.in
+++ b/WC13/I4DVAR_split/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/I4DVAR_split/submit_split_i4dvar.sh b/WC13/I4DVAR_split/submit_split_i4dvar.sh
index c8320412..b06ce638 100755
--- a/WC13/I4DVAR_split/submit_split_i4dvar.sh
+++ b/WC13/I4DVAR_split/submit_split_i4dvar.sh
@@ -181,7 +181,7 @@ My4DVarScript() {
HereDir=${PWD} # current directory
- DataDir="../../Data" # data directory
+ DataDir="../../Data" # data directory
ObsDir=${DataDir} # observations directory
@@ -193,7 +193,7 @@ My4DVarScript() {
if [ ${BATCH} -eq 1 ]; then
SRUN="srun --mpi=pmi2" # SLURM workload manager
- else
+ else
MPIrun="mpirunI -np" # Basic MPI workload manager
fi
@@ -465,7 +465,7 @@ while [ $SDAY -le $L_DN ]; do
## Start 4D-Var outer loops :::::::::::::::::::::::::::::::::::::::::::
while [ $OuterLoop -lt $MyNouter ]; do
-
+
OuterLoop=$(( $OuterLoop + 1 ))
## Run 4D-Var 'background' phase ......................................
@@ -493,7 +493,7 @@ while [ $SDAY -le $L_DN ]; do
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Outer = ${OuterLoop}" \
" Phase = ${Phase4DVAR}"
@@ -526,7 +526,7 @@ while [ $SDAY -le $L_DN ]; do
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Outer = ${OuterLoop}" \
" Phase = ${Phase4DVAR}"
@@ -558,7 +558,7 @@ while [ $SDAY -le $L_DN ]; do
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Outer = ${OuterLoop}" \
" Phase = ${Phase4DVAR}"
@@ -597,7 +597,7 @@ while [ $SDAY -le $L_DN ]; do
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Phase = ${Phase4DVAR}"
echo "Check ${RunDir}/log.roms for details ..."
diff --git a/WC13/Normalization/Readme.md b/WC13/Normalization/Readme.md
index f8ae8e96..945e1764 100644
--- a/WC13/Normalization/Readme.md
+++ b/WC13/Normalization/Readme.md
@@ -83,7 +83,7 @@ a uniform distribution (drawn from a normal distribution with zero
mean and unit variance). Then, they are scaled by the inverse
squared-root of the cell area (2D state variable) or volume (3D state
variable) and convolved with the squared-root adjoint and tangent
-diffusion operators over a specified number of iterations, **Nrandom**.
+diffusion operators over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script **s4dvar.in**:
```
@@ -95,7 +95,7 @@ Check the following parameters in the **4D-Var** input script **s4dvar.in**:
CnormI(isFsur) = T ! 2D variable at RHO-points
CnormI(isUbar) = T ! 2D variable at U-points
- CnormI(isVbar) = T ! 2D variable at V-points
+ CnormI(isVbar) = T ! 2D variable at V-points
CnormI(isUvel) = T ! 3D variable at U-points
CnormI(isVvel) = T ! 3D variable at V-points
CnormI(isTvar) = T T ! NT tracers
@@ -272,7 +272,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/Normalization/s4dvar.in b/WC13/Normalization/s4dvar.in
index 629d2d37..562504bf 100644
--- a/WC13/Normalization/s4dvar.in
+++ b/WC13/Normalization/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR/Readme.md b/WC13/RBL4DVAR/Readme.md
index 228e51ff..4be46fa1 100644
--- a/WC13/RBL4DVAR/Readme.md
+++ b/WC13/RBL4DVAR/Readme.md
@@ -114,7 +114,7 @@ You need to take the following steps:
(2D state variables) or volume (3D state variables), and
then by convolving with the squared-root adjoint and tangent
linear diffusion operators.
-
+
- The **randomization method** is cheaper and an approximation.
The normalization coefficients are computed using the approach
of Fisher and Courtier (1995). The coefficients are initialized
@@ -123,7 +123,7 @@ You need to take the following steps:
they are scaled by the inverse squared root of the cell area
(2D state variable) or volume (3D state variable) and convolved
with the squared-root adjoint and tangent diffusion operators
- over a specified number of iterations, **Nrandom**.
+ over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script
**s4dvar.in**:
@@ -136,14 +136,14 @@ You need to take the following steps:
CnormM(isFsur) = T ! Model, 2D variable at RHO-points
CnormM(isUbar) = T ! Model, 2D variable at U-points
- CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
CnormM(isUvel) = T ! Model, 3D variable at U-points
CnormM(isVvel) = T ! Model, 3D variable at V-points
CnormM(isTvar) = T T ! Model, NT tracers
CnormI(isFsur) = T ! IC, 2D variable at RHO-points
CnormI(isUbar) = T ! IC, 2D variable at U-points
- CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
CnormI(isUvel) = T ! IC, 3D variable at U-points
CnormI(isVvel) = T ! IC, 3D variable at V-points
CnormI(isTvar) = T T ! IC, NT tracers
@@ -210,7 +210,7 @@ You need to take the following steps:
For this to work, however, any **#undef** directives **must** be
avoided in the header file **wc13.h** since it has precedence
during C-preprocessing.
-
+
- You **must** use any of the **build** scripts to compile.
- Customize the **ROMS** input script **roms_wc13.in** and specify
@@ -251,7 +251,7 @@ You need to take the following steps:
mpirun -np 8 romsM roms_wc13_2hours.in > & log &
```
-
+
Notice that the nonlinear trajectory can be written either
daily (**NHIS=48** if using **roms_wc13_daily.in**) or every
two hours (**NHIS=4** if using **roms_wc13_2hours.in**). It is
@@ -335,7 +335,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR/VERIFYING_ANALYSIS/Readme.md b/WC13/RBL4DVAR/VERIFYING_ANALYSIS/Readme.md
index 16a07685..7d832062 100644
--- a/WC13/RBL4DVAR/VERIFYING_ANALYSIS/Readme.md
+++ b/WC13/RBL4DVAR/VERIFYING_ANALYSIS/Readme.md
@@ -120,7 +120,7 @@ You need to take the following steps:
(2D state variables) or volume (3D state variables), and
then by convolving with the squared-root adjoint and tangent
linear diffusion operators.
-
+
- The **randomization method** is cheaper and an approximation.
The normalization coefficients are computed using the approach
of Fisher and Courtier (1995). The coefficients are initialized
@@ -129,7 +129,7 @@ You need to take the following steps:
they are scaled by the inverse squared root of the cell area
(2D state variable) or volume (3D state variable) and convolved
with the squared-root adjoint and tangent diffusion operators
- over a specified number of iterations, **Nrandom**.
+ over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script
**s4dvar.in**:
@@ -142,14 +142,14 @@ You need to take the following steps:
CnormM(isFsur) = T ! Model, 2D variable at RHO-points
CnormM(isUbar) = T ! Model, 2D variable at U-points
- CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
CnormM(isUvel) = T ! Model, 3D variable at U-points
CnormM(isVvel) = T ! Model, 3D variable at V-points
CnormM(isTvar) = T T ! Model, NT tracers
CnormI(isFsur) = T ! IC, 2D variable at RHO-points
CnormI(isUbar) = T ! IC, 2D variable at U-points
- CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
CnormI(isUvel) = T ! IC, 3D variable at U-points
CnormI(isVvel) = T ! IC, 3D variable at V-points
CnormI(isTvar) = T T ! IC, NT tracers
@@ -297,7 +297,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR/VERIFYING_ANALYSIS/s4dvar.in b/WC13/RBL4DVAR/VERIFYING_ANALYSIS/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR/VERIFYING_ANALYSIS/s4dvar.in
+++ b/WC13/RBL4DVAR/VERIFYING_ANALYSIS/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR/roms_wc13_2hours.in b/WC13/RBL4DVAR/roms_wc13_2hours.in
index b30e55d1..3c082aca 100644
--- a/WC13/RBL4DVAR/roms_wc13_2hours.in
+++ b/WC13/RBL4DVAR/roms_wc13_2hours.in
@@ -1001,12 +1001,12 @@ Dout(iTvdif) == T T ! temp_vdiff, ... vertical diffusion
! [3] parallel read and serial write of NetCDF4/HDF5
! [4] parallel read and write of NETCDF4/HDF5
- PIO_METHOD = 2
+ PIO_METHOD = 1
! PIO library MPI processes set-up:
PIO_IOTASKS = 1 ! number of I/O tasks to define
- PIO_STRIDE = 1 ! stride in the MPI-ran between I/O tasks
+ PIO_STRIDE = 1 ! stride in the MPI-rank between I/O tasks
PIO_BASE = 0 ! offset for the first I/O task
PIO_AGGREG = 1 ! number of MPI-aggregators to use
diff --git a/WC13/RBL4DVAR/s4dvar.in b/WC13/RBL4DVAR/s4dvar.in
index 6e5b84bb..331eae44 100644
--- a/WC13/RBL4DVAR/s4dvar.in
+++ b/WC13/RBL4DVAR/s4dvar.in
@@ -165,6 +165,16 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +336,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +344,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +721,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +925,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_IAU/Readme.md b/WC13/RBL4DVAR_IAU/Readme.md
new file mode 100644
index 00000000..a8f3fb20
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/Readme.md
@@ -0,0 +1,344 @@
+
+
+## 4D-Var Incremental Analysis Update Test
+
+**Technical Description**: [roms PR #38](https://github.com/myroms/roms/pull/38)
+
+**Information**: www.myroms.org/wiki/4DVar_Tutorial_Introduction
+
+**Results**: www.myroms.org/wiki/RBL4DVAR_Tutorial
+
+This directory includes various files to run the strong/weak
+constraint, dual form of 4-Dimensional Variational data (**4D-Var**)
+assimilation based on the Restricted B-preconditioned Lanczos
+(**RBL4D-Var**) algorithm in the California Current System, 1/3
+degree resolution, application (**WC13**). It activates the Incremental
+Analysis Update (IAU) to suppress the generation of inertia-gravity waves
+during the assimilation window due to initialization shocks.
+
+### Important CPP Options:
+```
+ RBL4DVAR RBL4D-Var driver (observation space)
+ ANA_SPONGE Analytical enhanced viscosity/diffusion sponge
+ BGQC Background quality control of observations
+ RPCG Restricted B-preconditioned Lanczos minimization
+ WC13 Application CPP option
+```
+
+### Input NetCDF Files:
+```
+ Grid File: ../Data/wc13_grd.nc
+ Nonlinear Initial File: wc13_ini.nc
+ Forcing File 01: ../Data/coamps_wc13_lwrad_down.nc
+ Forcing File 02: ../Data/coamps_wc13_Pair.nc
+ Forcing File 03: ../Data/coamps_wc13_Qair.nc
+ Forcing File 04: ../Data/coamps_wc13_rain.nc
+ Forcing File 05: ../Data/coamps_wc13_swrad.nc
+ Forcing File 06: ../Data/coamps_wc13_Tair.nc
+ Forcing File 07: ../Data/coamps_wc13_wind.nc
+ Boundary File: ../Data/wc13_ecco_bry.nc
+
+ Initial Conditions STD File: ../Data/wc13_std_i.nc
+ Model STD File: ../Data/wc13_std_m.nc
+ Boundary Conditions STD File: ../Data/wc13_std_b.nc
+ Surface Forcing STD File: ../Data/wc13_std_f.nc
+ Initial Conditions Norm File: ../Data/wc13_nrm_i.nc
+ Model Norm File: ../Data/wc13_nrm_m.nc
+ Boundary Conditions Norm File: ../Data/wc13_nrm_b.nc
+ Surface Forcing Norm File: ../Data/wc13_nrm_f.nc
+ Observations File: wc13_obs.nc
+```
+### Configuration and Input Scripts:
+```
+ build_roms.csh ROMS GNU make compiling and linking CSH script
+ build_roms.sh ROMS GNU make compiling and linking BASH script
+ cbuild_roms.csh ROMS CMake compiling and linking CSH script
+ cbuild_roms.sh ROMS CMake compiling and linking BASH script
+ job_rbl4dvar.csh job configuration script
+ roms_wc13_20040103.in ROMS standard input script for WC13, NHIS=4,
+ two-hours forward trajectory snapshots
+ s4dvar.in 4D-Var standard input script template
+ wc13.h WC13 header with CPP options
+```
+
+### How to Run this Application:
+
+You need to take the following steps:
+
+- We must run the model application for a long time
+ to compute meaningful circulation statistics,
+ like mean and standard deviations for all prognostic state
+ variables (**zeta**, **u**, **v**, **T**, and **S**). The standard deviations
+ are written to NetCDF files and are read by the **4D-Var**
+ algorithm to convert modeled error correlations to error
+ covariances. The error covariance matrix, **D**, is large
+ and unknown. It is modeled as the solution of a
+ diffusion equation, as shown by Weaver and Courtier (2001).
+
+ - In this application, we need standard deviations for
+ initial conditions, surface forcing (**ADJUST_WSTRESS** and
+ **ADJUST_STFLUX**), and open boundary conditions (**ADJUST_BOUNDARY**).
+ The standard deviations for the initial and open boundary
+ conditions are in terms of the unbalanced error covariance
+ (**K Du KT**) since the balanced operator is activated
+ (**BALANCE_OPERATOR** and **ZETA_ELLIPTIC**).
+
+ - The balance operator imposes a multivariate constraint on
+ the error covariance such that the unobserved variable
+ information is extracted from observed data by establishing
+ balance relationships (*i.e.*, **T-S** empirical formulas,
+ hydrostatic balance, and geostrophic balance) with other
+ state variables (Weaver *et al.*, 2005).
+
+ - These standard deviations have already been created for you:
+ ```
+ ../Data/wc13_std_i.nc initial conditions
+ ../Data/wc13_std_m.nc model error (if weak constraint)
+ ../Data/wc13_std_b.nc open boundary conditions
+ ../Data/wc13_std_f.nc surface forcing (wind stress and net heat flux)
+ ```
+- Since we are modeling the error covariance matrix, **D**, we
+ need to compute the normalization coefficients to ensure
+ that the diagonal elements of the associated correlation
+ matrix **C** are equal to unity. There are two methods to compute
+ normalization coefficients: **exact** and
+ **randomization** (an approximation).
+
+ - The **exact method** is very expensive on large grids. The
+ normalization coefficients are computed by perturbing each
+ model grid cell with a delta function scaled by the area
+ (2D state variables) or volume (3D state variables), and
+ then by convolving with the squared-root adjoint and tangent
+ linear diffusion operators.
+
+ - The **randomization method** is cheaper and an approximation.
+ The normalization coefficients are computed using the approach
+ of Fisher and Courtier (1995). The coefficients are initialized
+ with random numbers having a uniform distribution (drawn from a
+ normal distribution with zero mean and unit variance). Then,
+ they are scaled by the inverse squared root of the cell area
+ (2D state variable) or volume (3D state variable) and convolved
+ with the squared-root adjoint and tangent diffusion operators
+ over a specified number of iterations, **Nrandom**.
+
+ Check the following parameters in the **4D-Var** input script
+ **s4dvar.in**:
+ ```
+ Nmethod == 0 ! normalization method
+ Nrandom == 5000 ! randomization iterations
+
+ LdefNRM == F F F F ! Create a new normalization files
+ LwrtNRM == F F F F ! Compute and write normalization
+
+ CnormM(isFsur) = T ! Model, 2D variable at RHO-points
+ CnormM(isUbar) = T ! Model, 2D variable at U-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isUvel) = T ! Model, 3D variable at U-points
+ CnormM(isVvel) = T ! Model, 3D variable at V-points
+ CnormM(isTvar) = T T ! Model, NT tracers
+
+ CnormI(isFsur) = T ! IC, 2D variable at RHO-points
+ CnormI(isUbar) = T ! IC, 2D variable at U-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isUvel) = T ! IC, 3D variable at U-points
+ CnormI(isVvel) = T ! IC, 3D variable at V-points
+ CnormI(isTvar) = T T ! IC, NT tracers
+
+ CnormB(isFsur) = T ! OBC, 2D variable at RHO-points
+ CnormB(isUbar) = T ! OBC, 2D variable at U-points
+ CnormB(isVbar) = T ! OBC, 2D variable at V-points
+ CnormB(isUvel) = T ! OBC, 3D variable at U-points
+ CnormB(isVvel) = T ! OBC, 3D variable at V-points
+ CnormB(isTvar) = T T ! OBC, NT tracers
+
+ CnormF(isUstr) = T ! Surface Forcing, U-momentum stress
+ CnormF(isVstr) = T ! Surface Forcing, V-momentum stress
+ CnormF(isTsur) = T T ! Surface Forcing, NT tracers fluxes
+ ```
+ These normalization coefficients have already been computed for you
+ (see **`../Normalization`**) using the **exact method** since this
+ application has a small grid (**54x53x30**):
+ ```
+ ../Data/wc13_nrm_i.nc initial conditions
+ ../Data/wc13_nrm_m.nc model error (if weak constraint)
+ ../Data/wc13_nrm_b.nc open boundary conditions
+ ../Data/wc13_nrm_f.nc surface forcing (wind stress and net heat flux)
+ ```
+ Notice that the switches **LdefNRM** and **LwrtNRM** are all **.FALSE.**
+ (**F**) since we already computed these coefficients.
+
+ The normalization coefficients need to be computed only once
+ for a particular application provided that the grid, land/sea
+ masking (if any), and decorrelation scales (**HdecayI**, **VdecayI**,
+ **HdecayB**, **VdecayV**, and **HdecayF**) remain the same. Notice that
+ large spatial changes in the normalization coefficient
+ structure are observed near the open boundaries and land/sea
+ masking regions.
+
+- Customize your preferred **build** script and provide the
+ appropriate values for:
+
+ - Root directory, **MY_ROOT_DIR**
+ - **ROMS** source code path, **MY_ROMS_SRC**
+ - Fortran compiler, **FORT**
+ - MPI flags, **USE_MPI** and **USE_MPIF90**
+ - Path of **MPI**, **NetCDF**, and **ARPACK** libraries according to
+ the compiler. Notice that you need to provide the
+ correct locations of these libraries for your computer.
+ If you want to ignore this section, comment (turn off) the
+ assignment for the macro **USE_MY_LIBS**.
+
+- Notice that the most important CPP options for this application
+ are specified in the **build** script instead of the header file
+ **wc13.h** allows flexibility with different CPP options:
+ ```
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRBL4DVAR"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DANA_SPONGE"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DMINRES"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRPCG"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DTIME_CONV"
+
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DBGQC"
+
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DPOSTERIOR_EOFS"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DPOSTERIOR_ERROR_I"
+ ```
+ For this to work, however, any **#undef** directives **must** be
+ avoided in the header file **wc13.h** since it has precedence
+ during C-preprocessing.
+
+- You **must** use any of the **build** scripts to compile.
+
+- Customize the **ROMS** input script **roms_wc13.in** and specify
+ the appropriate values for the distributed-memory tile partition.
+ It is set by default to:
+ ```
+ NtileI == 2 ! I-direction partition
+ NtileJ == 4 ! J-direction partition
+ ```
+ Notice that the adjoint-based algorithms can only be run
+ in parallel using **MPI**. This is because of the way that the
+ adjoint model is constructed.
+
+- Customize the configuration script **job_rbl4dvar.csh** and provide
+ the appropriate place for the **substitute** Perl script:
+ ```
+ set SUBSTITUTE=${ROMS_ROOT}/ROMS/Bin/substitute
+ ```
+ This Perl script is distributed with **ROMS**, and it is found in the
+ **ROMS/Bin** sub-directory. Alternatively, you can define
+ **ROMS_ROOT** environmental variable in your login script. For example, I have:
+ ```
+ setenv ROMS_ROOT ${HOME}/ocean/repository/git/roms
+ ```
+
+- Execute the configuration **job_rbl4dvar.csh** `BEFORE` running
+ the model. It copies the required files and creates **i4dvar.in**
+ input script from template **s4dvar.in**. This has to be done
+ EVERY TIME that you run this application. We need a clean and
+ fresh copy of the initial conditions and observation files
+ since they are modified by **ROMS** during execution.
+
+- Run **ROMS** with data assimilation:
+ ```
+ mpirun -np 8 romsM roms_wc13_daily.in > & log &
+
+ or
+
+ mpirun -np 8 romsM roms_wc13_2hours.in > & log &
+ ```
+
+ Notice that the nonlinear trajectory can be written either
+ daily (**NHIS=48** if using **roms_wc13_daily.in**) or every
+ two hours (**NHIS=4** if using **roms_wc13_2hours.in**). It is
+ the basic state trajectory used to linearize the tangent linear
+ and adjoint models.
+
+ It turns out that the daily sampling is over the
+ limit where the tangent linear approximation is valid. The
+ results are much better when using the two-hour snapshots.
+ The two set-ups are provided to make the user aware of the
+ validity of the tangent linear approximation in highly
+ nonlinear circulations. The differences will be noticeable
+ when computing observation impacts and observation sensitivities.
+
+- We recommend creating new subdirectories **EX3_CONGRAD**,
+ **EXE_MINRES**, and **EX3_RPCG** (Tutorial Exercise **3** using
+ default, **MINRES**, and **RPCG** algorithms) to save the solution
+ in it for analysis and plotting to avoid overwriting output
+ files when activating different CPP options and parameters.
+ For example:
+ ```
+ mkdir EX3_RPCG
+ mv Build_roms rbl4dvar.in *.nc log EX3_RPCG
+ cp -p romsM roms_wc13.in EX3_RPCG
+ ```
+ Check Exercise **3** instructions for more details.
+
+- Analyze the results using the plotting scripts (Matlab or
+ **ROMS** plotting package) provided in the **`../plotting`** directory:
+
+ - **`plot_rbl4dvar_cost.m`**: plots **RBL4D-Var** cost function.
+
+ - **`plot_rbl4dvar_increments.m`**: plots **RBL4D-Var** increments to
+ initial conditions.
+
+ - **`plot_eof_eigenvalues.m`**: plots the eigenvalues for each EOF
+ of the analysis error covariance
+ matrix and the randomized trace
+ estimates
+ (User needs to edit **Inp** file).
+
+ - **`plot_posterior_EOF_fields.m`**: plots selected **RBL4D-Var** analysis
+ error covariance matrix EOF
+ (User needs to edit **Inpa** file).
+
+ - **`plot_prior_posterior_errors.m`**: plots the difference between the
+ prior and posterior error
+ covariance deviations
+ (User needs to edit **Inpa** file).
+
+ - **`ccnt_rbl4dvar_increments.in`**: plots **RBL4D-Var** initial conditions
+ increments contours at **z=-100m**.
+
+ - **`csec_rbl4dvar_increments.in`**: plots **RBL4D-Var** initial conditions
+ increments cross-sections along **37N**.
+
+ - **`ccnt_posterior_EOF_fields.in`**: plots selected **RBL4D-Var** analysis
+ error covariance matrix EOF
+ contours at **z=-100m**
+ (User needs to change **R4DVAR**
+ directory to **RBL4DVAR**).
+
+ - **`csec_posterior_EOF_fields.in`** plots selected **RBL4D-Var** analysis
+ error covariance matrix EOF
+ cross-sections along **37N**
+ (User needs to change **R4DVAR**
+ directory to **RBL4DVAR**).
+
+ ---
+
+### References:
+
+- Moore, A.M., H.G. Arango, G. Broquet, B.S. Powell, A.T. Weaver,
+ and J. Zavala-Garay, **2011**: The Regional Ocean Modeling System
+ (ROMS) 4-dimensional variational data assimilation systems,
+ Part I - System overview and formulation, *Prog. Oceanogr.*,
+ **91**, 34-49, https://doi.org/10.1016/j.pocean.2011.05.004.
+
+- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
+ B. Powell, D. Foley, J.D. Doyle, D. Costa, and P. Robinson,
+ **2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
+ variational data assimilations systems, Part II - Performance
+ and application to the California Current System, *Prog.
+ Oceanogr.*, **91**, 50-73,
+ https://doi.org/10.1016/j.pocean.2011.05.003.
+
+- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
+ B. Powell, D. Foley, J.D. Doyle, D. Costa, and P. Robinson,
+ **2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
+ variational data assimilations systems, Part III - Observation
+ impact and observation sensitivity in the California Current
+ System, *Prog. Oceanogr.*, **91**, 74-94,
+ https://doi.org/10.1016/j.pocean.2011.05.005.
+
diff --git a/WC13/RBL4DVAR_IAU/build_roms.csh b/WC13/RBL4DVAR_IAU/build_roms.csh
new file mode 100755
index 00000000..c2ff4514
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/build_roms.csh
@@ -0,0 +1,429 @@
+#!/bin/csh -f
+#
+# git $Id$
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+# Copyright (c) 2002-2024 The ROMS/TOMS Group :::
+# Licensed under a MIT/X style license :::
+# See License_ROMS.md :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
+# :::
+# ROMS Compiling CSH Script :::
+# :::
+# Script to compile an user application where the application-specific :::
+# files are kept separate from the ROMS source code. :::
+# :::
+# Q: How/why does this script work? :::
+# :::
+# A: The ROMS makefile configures user-defined options with a set of :::
+# flags such as ROMS_APPLICATION. Browse the makefile to see these. :::
+# If an option in the makefile uses the syntax ?= in setting the :::
+# default, this means that make will check whether an environment :::
+# variable by that name is set in the shell that calls make. If so :::
+# the environment variable value overrides the default (and the :::
+# user need not maintain separate makefiles, or frequently edit :::
+# the makefile, to run separate applications). :::
+# :::
+# Usage: :::
+# :::
+# ./build_roms.csh [options] :::
+# :::
+# Options: :::
+# :::
+# -j [N] Compile in parallel using N CPUs :::
+# omit argument for all available CPUs :::
+# :::
+# -b Compile a specific ROMS GitHub branch :::
+# :::
+# build_roms.csh -j 5 -b feature/kernel :::
+# :::
+# -p macro Prints any Makefile macro value. For example, :::
+# :::
+# build_roms.csh -p FFLAGS :::
+# :::
+# -noclean Do not clean already compiled objects :::
+# :::
+# Notice that sometimes the parallel compilation fail to find MPI :::
+# include file "mpif.h". :::
+# :::
+# The branch option -b is only possible for ROMS source code from :::
+# https://github.com/myroms. Such versions are under development :::
+# and targeted to advanced users, superusers, and beta testers. :::
+# Regular and novice users must use the default 'develop' branch. :::
+# :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+setenv which_MPI openmpi # default, overwritten below
+
+set parallel = 0
+set clean = 1
+set dprint = 0
+set branch = 0
+
+set command = "build_roms.csh $argv[*]"
+
+set separator = `perl -e "print '<>' x 50;"`
+
+setenv MY_CPP_FLAGS ''
+
+while ( ($#argv) > 0 )
+ switch ($1)
+ case "-noclean"
+ shift
+ set clean = 0
+ breaksw
+
+ case "-p"
+ shift
+ set clean = 0
+ set dprint = 1
+ set debug = "print-$1"
+ shift
+ breaksw
+
+ case "-j"
+ shift
+ set parallel = 1
+ if (`echo $1 | grep '^[0-9]\+$'` != "" ) then
+ set NCPUS = "-j $1"
+ shift
+ else
+ set NCPUS = "-j"
+ endif
+ breaksw
+
+ case "-b"
+ shift
+ set branch = 1
+ set branch_name = `echo $1 | grep -v '^-'`
+ if ( "$branch_name" == "" ) then
+ echo "Please enter a branch name."
+ exit 1
+ endif
+ shift
+ breaksw
+
+ case "-*":
+ echo ""
+ echo "${separator}"
+ echo "$0 : Unknown option [ $1 ]"
+ echo ""
+ echo "Available Options:"
+ echo ""
+ echo "-j [N] Compile in parallel using N CPUs"
+ echo " omit argument for all avaliable CPUs"
+ echo ""
+ echo "-b branch_name Compile specific ROMS GitHub branch name"
+ echo " For example: build_roms.csh -b feature/kernel"
+ echo ""
+ echo "-p macro Prints any Makefile macro value"
+ echo " For example: build_roms.csh -p FFLAGS"
+ echo ""
+ echo "-noclean Do not clean already compiled objects"
+ echo "${separator}"
+ echo ""
+ exit 1
+ breaksw
+
+ endsw
+end
+
+# Set the CPP option defining the particular application. This will
+# determine the name of the ".h" header file with the application
+# CPP definitions.
+
+setenv ROMS_APPLICATION WC13
+
+# Set a local environmental variable to define the path to the directories
+# where the ROMS source code is located (MY_ROOT_DIR), and this project's
+# configuration and files are kept (MY_PROJECT_DIR). Notice that if the
+# User sets the ROMS_ROOT_DIR environment variable in their computer logging
+# script describing the location from where the ROMS source code was cloned
+# or downloaded, it uses that value.
+
+if ($?ROMS_ROOT_DIR) then
+ setenv MY_ROOT_DIR ${ROMS_ROOT_DIR}
+else
+ setenv MY_ROOT_DIR ${HOME}/ocean/repository/git
+endif
+
+setenv MY_PROJECT_DIR ${PWD}
+
+# The path to the user's local current ROMS source code.
+#
+# If downloading ROMS locally, this would be the user's Working Copy Path.
+# One advantage of maintaining your source code copy is that when working
+# simultaneously on multiple machines (e.g., a local workstation, a local
+# cluster, and a remote supercomputer), you can update with the latest ROMS
+# release and always get an up-to-date customized source on each machine.
+# This script allows for differing paths to the code and inputs on other
+# computers.
+
+ setenv MY_ROMS_SRC ${MY_ROOT_DIR}/roms
+
+# Set path of the directory containing makefile configuration (*.mk) files.
+# The user has the option to specify a customized version of these files
+# in a different directory than the one distributed with the source code,
+# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep these
+# configurations files up-to-date.
+
+ setenv COMPILERS ${MY_ROMS_SRC}/Compilers
+#setenv COMPILERS ${HOME}/Compilers/ROMS
+
+#--------------------------------------------------------------------------
+# Set tunable CPP options.
+#--------------------------------------------------------------------------
+#
+# Sometimes it is desirable to activate one or more CPP options to run
+# different variants of the same application without modifying its header
+# file. If this is the case, specify each options here using the -D syntax.
+# Notice also that you need to use shell's quoting syntax to enclose the
+# definition. Both single or double quotes work. For example,
+#
+# setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DAVERAGES"
+# setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DDEBUGGING"
+#
+# can be used to write time-averaged fields. Notice that you can have as
+# many definitions as you want by appending values.
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRBL4DVAR"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DANA_SPONGE"
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DROMS_STDOUT"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DINITIALIZE_AUTOMATIC"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCHECKSUM"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DMINRES"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRPCG"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DTIME_CONV"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DBGQC"
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_BOUNDARY"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_STFLUX"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_WSTRESS"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DSTD_MODEL"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCOMPUTE_MLD"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCOLLECT_ALLREDUCE"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DREDUCE_ALLGATHER"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DDEBUGGING"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DPOSITIVE_ZERO"
+
+#--------------------------------------------------------------------------
+# Compiler options.
+#--------------------------------------------------------------------------
+#
+# Other user defined environmental variables. See the ROMS makefile for
+# details on other options the user might want to set here. Be sure to
+# leave the switches meant to be off set to an empty string or commented
+# out. Any string value (including off) will evaluate to TRUE in
+# conditional if-statements.
+
+ setenv USE_MPI on # distributed-memory parallelism
+ setenv USE_MPIF90 on # compile with mpif90 script
+#setenv which_MPI intel # compile with mpiifort library
+#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
+
+#setenv USE_OpenMP on # shared-memory parallelism
+
+ setenv FORT ifort
+#setenv FORT gfortran
+#setenv FORT pgi
+
+#setenv USE_DEBUG on # use Fortran debugging flags
+ setenv USE_LARGE on # activate 64-bit compilation
+
+#--------------------------------------------------------------------------
+# Building the ROMS executable using the shared library is not recommended
+# because it requires keeping track of the matching libROMS.{so|dylib}
+# which is located in the Build_roms or Build_romsG directory and will be
+# lost and/or replaced with each new build. The option to build the shared
+# version of libROMS was introduced for use in model coupling systems.
+#--------------------------------------------------------------------------
+
+#setenv SHARED on # build libROMS.{so|dylib}
+ setenv STATIC on # build libROMS.a
+
+ setenv EXEC on # build roms{G|M|O|S} executable
+
+# ROMS I/O choices and combinations. A more complete description of the
+# available options can be found in the wiki (https://myroms.org/wiki/IO).
+# Most users will want to enable at least USE_NETCDF4 because that will
+# instruct the ROMS build system to use nf-config to determine the
+# necessary libraries and paths to link into the ROMS executable.
+
+ setenv USE_NETCDF4 on # compile with NetCDF-4 library
+#setenv USE_PARALLEL_IO on # Parallel I/O with NetCDF-4/HDF5
+#setenv USE_PIO on # Parallel I/O with PIO library
+#setenv USE_SCORPIO on # Parallel I/O with SCORPIO library
+
+# If any of the coupling component use the HDF5 Fortran API for primary
+# I/O, we need to compile the main driver with the HDF5 library.
+
+#setenv USE_HDF5 on # compile with HDF5 library
+
+#--------------------------------------------------------------------------
+# If coupling Earth Systems Models (ESM), set the location of the ESM
+# component libraries and modules.
+#--------------------------------------------------------------------------
+
+source ${MY_ROMS_SRC}/ESM/esm_libs.csh ${MY_ROMS_SRC}/ESM/esm_libs.csh
+
+#--------------------------------------------------------------------------
+# If applicable, use my specified library paths.
+#--------------------------------------------------------------------------
+
+ setenv USE_MY_LIBS no # use system default library paths
+#setenv USE_MY_LIBS yes # use my customized library paths
+
+set MY_PATHS = ${COMPILERS}/my_build_paths.csh
+
+if ($USE_MY_LIBS == 'yes') then
+ source ${MY_PATHS} ${MY_PATHS}
+endif
+
+#--------------------------------------------------------------------------
+# The rest of this script sets the path to the users header file and
+# analytical source files, if any. See the templates in User/Functionals.
+#--------------------------------------------------------------------------
+#
+# If applicable, use the MY_ANALYTICAL_DIR directory to place your
+# customized biology model header file (like fennel.h, nemuro.h, ecosim.h,
+# etc).
+
+ setenv MY_HEADER_DIR ${MY_PROJECT_DIR}
+
+ setenv MY_ANALYTICAL_DIR `dirname ${PWD}`/Functionals
+
+# Put the binary to execute in the following directory.
+
+ setenv BINDIR ${MY_PROJECT_DIR}
+
+ echo ""
+ echo "${separator}"
+
+# Stop if activating both MPI and OpenMP at the same time.
+
+if ( ${?USE_MPI} & ${?USE_OpenMP} ) then
+ echo ""
+ echo "You cannot activate USE_MPI and USE_OpenMP at the same time!"
+ exit 1
+endif
+
+# Put the f90 files in a project specific Build directory to avoid conflict
+# with other projects.
+
+if ($?USE_DEBUG) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_romsG
+else
+ if ($?USE_OpenMP) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_romsO
+ else if ($?USE_MPI) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_romsM
+ else
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_roms
+ endif
+endif
+
+# For backward compatibility, set deprecated SCRATCH_DIR to compile
+# older released versions of ROMS.
+
+setenv SCRATCH_DIR ${BUILD_DIR}
+
+# If necessary, create ROMS build directory.
+
+if ( ! -d $BUILD_DIR ) then
+ echo ""
+ echo "Creating ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ mkdir $BUILD_DIR
+endif
+
+# Go to the users source directory to compile. The options set above will
+# pick up the application-specific code from the appropriate place.
+
+if ( $branch == 1 ) then
+
+ # Check out requested branch from ROMS GitHub.
+
+ if ( ! -d ${MY_PROJECT_DIR}/src ) then
+ echo ""
+ echo "Downloading ROMS source code from GitHub: https://www.github.com/myroms"
+ echo ""
+ git clone https://www.github.com/myroms/roms.git src
+ endif
+ echo ""
+ echo "Checking out ROMS GitHub branch: $branch_name"
+ echo ""
+ cd src
+ git checkout $branch_name
+
+ # If we are using the COMPILERS from the ROMS source code
+ # overide the value set above
+
+ if ( ${COMPILERS} =~ ${MY_ROMS_SRC}* ) then
+ setenv COMPILERS ${MY_PROJECT_DIR}/src/Compilers
+ endif
+ setenv MY_ROMS_SRC ${MY_PROJECT_DIR}/src
+
+else
+ echo ""
+ echo "Using ROMS source code from: ${MY_ROMS_SRC}"
+ echo ""
+ cd ${MY_ROMS_SRC}
+endif
+
+#--------------------------------------------------------------------------
+# Compile.
+#--------------------------------------------------------------------------
+
+# Remove build directory.
+
+if ( $clean == 1 ) then
+ echo ""
+ echo "Cleaning ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ make clean
+endif
+
+# Compile (the binary will go to BINDIR set above).
+
+if ( $dprint == 1 ) then
+ make $debug
+else
+ echo ""
+ echo "Compiling ROMS source code:"
+ echo ""
+ if ( $parallel == 1 ) then
+ make $NCPUS
+ else
+ make
+ endif
+
+ set HEADER = `echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+
+ echo ""
+ echo "${separator}"
+ echo "GNU Build script command: ${command}"
+ echo "ROMS source directory: ${MY_ROMS_SRC}"
+ echo "ROMS header file: ${MY_HEADER_DIR}/${HEADER}"
+ echo "ROMS build directory: ${BUILD_DIR}"
+ if ( $branch == 1 ) then
+ echo "ROMS downloaded from: https://github.com/myroms/roms.git"
+ echo "ROMS compiled branch: $branch_name"
+ endif
+ echo "ROMS Application: ${ROMS_APPLICATION}"
+ set FFLAGS = `make print-FFLAGS | cut -d " " -f 3-`
+ echo "Fortran compiler: ${FORT}"
+ echo "Fortran flags: ${FFLAGS}"
+ if ($?MY_CPP_FLAGS) then
+ echo "Added CPP Options: ${MY_CPP_FLAGS}"
+ endif
+ echo "${separator}"
+ echo ""
+endif
diff --git a/WC13/RBL4DVAR_IAU/build_roms.sh b/WC13/RBL4DVAR_IAU/build_roms.sh
new file mode 100755
index 00000000..8d54421d
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/build_roms.sh
@@ -0,0 +1,427 @@
+#!/bin/bash
+#
+# git $Id$
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+# Copyright (c) 2002-2024 The ROMS/TOMS Group :::
+# Licensed under a MIT/X style license :::
+# See License_ROMS.md :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
+# :::
+# ROMS Compiling BASH Script :::
+# :::
+# Script to compile an user application where the application-specific :::
+# files are kept separate from the ROMS source code. :::
+# :::
+# Q: How/why does this script work? :::
+# :::
+# A: The ROMS makefile configures user-defined options with a set of :::
+# flags such as ROMS_APPLICATION. Browse the makefile to see these. :::
+# If an option in the makefile uses the syntax ?= in setting the :::
+# default, this means that make will check whether an environment :::
+# variable by that name is set in the shell that calls make. If so :::
+# the environment variable value overrides the default (and the :::
+# user need not maintain separate makefiles, or frequently edit :::
+# the makefile, to run separate applications). :::
+# :::
+# Usage: :::
+# :::
+# ./build_roms.sh [options] :::
+# :::
+# Options: :::
+# :::
+# -j [N] Compile in parallel using N CPUs :::
+# omit argument for all available CPUs :::
+# :::
+# -b Compile a specific ROMS GitHub branch :::
+# :::
+# build_roms.sh -j 5 -b feature/kernel :::
+# :::
+# -p macro Prints any Makefile macro value. For example, :::
+# :::
+# build_roms.sh -p FFLAGS :::
+# :::
+# -noclean Do not clean already compiled objects :::
+# :::
+# Notice that sometimes the parallel compilation fail to find MPI :::
+# include file "mpif.h". :::
+# :::
+# The branch option -b is only possible for ROMS source code from :::
+# https://github.com/myroms. Such versions are under development :::
+# and targeted to advanced users, superusers, and beta testers. :::
+# Regular and novice users must use the default 'develop' branch. :::
+# :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+export which_MPI=openmpi # default, overwritten below
+
+parallel=0
+clean=1
+dprint=0
+branch=0
+
+command="build_roms.sh $@"
+
+separator=`perl -e "print '<>' x 50;"`
+
+export MY_CPP_FLAGS=
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ -j )
+ shift
+ parallel=1
+ test=`echo $1 | grep '^[0-9]\+$'`
+ if [ "$test" != "" ]; then
+ NCPUS="-j $1"
+ shift
+ else
+ NCPUS="-j"
+ fi
+ ;;
+
+ -p )
+ shift
+ clean=0
+ dprint=1
+ debug="print-$1"
+ shift
+ ;;
+
+ -noclean )
+ shift
+ clean=0
+ ;;
+
+ -b )
+ shift
+ branch=1
+ branch_name=`echo $1 | grep -v '^-'`
+ if [ "$branch_name" == "" ]; then
+ echo "Please enter a ROMS GitHub branch name."
+ exit 1
+ fi
+ shift
+ ;;
+
+ * )
+ echo ""
+ echo "${separator}"
+ echo "$0 : Unknown option [ $1 ]"
+ echo ""
+ echo "Available Options:"
+ echo ""
+ echo "-j [N] Compile in parallel using N CPUs"
+ echo " omit argument for all avaliable CPUs"
+ echo ""
+ echo "-b branch_name Compile specific ROMS GitHub branch name"
+ echo " For example: build_roms.sh -b feature/kernel"
+ echo ""
+ echo "-p macro Prints any Makefile macro value"
+ echo " For example: build_roms.sh -p FFLAGS"
+ echo ""
+ echo "-noclean Do not clean already compiled objects"
+ echo "${separator}"
+ echo ""
+ exit 1
+ ;;
+ esac
+done
+
+# Set the CPP option defining the particular application. This will
+# determine the name of the ".h" header file with the application
+# CPP definitions.
+
+export ROMS_APPLICATION=WC13
+
+# Set a local environmental variable to define the path to the directories
+# where the ROMS source code is located (MY_ROOT_DIR), and this project's
+# configuration and files are kept (MY_PROJECT_DIR). Notice that if the
+# User sets the ROMS_ROOT_DIR environment variable in their computer logging
+# script describing the location from where the ROMS source code was cloned
+# or downloaded, it uses that value.
+
+if [ -n "${ROMS_ROOT_DIR:+1}" ]; then
+ export MY_ROOT_DIR=${ROMS_ROOT_DIR}
+else
+ export MY_ROOT_DIR=${HOME}/ocean/repository/git
+fi
+
+export MY_PROJECT_DIR=${PWD}
+
+# The path to the user's local current ROMS source code.
+#
+# If downloading ROMS locally, this would be the user's Working Copy Path.
+# One advantage of maintaining your source code copy is that when working
+# simultaneously on multiple machines (e.g., a local workstation, a local
+# cluster, and a remote supercomputer), you can update with the latest ROMS
+# release and always get an up-to-date customized source on each machine.
+# This script allows for differing paths to the code and inputs on other
+# computers.
+
+ export MY_ROMS_SRC=${MY_ROOT_DIR}/roms
+
+# Set path of the directory containing makefile configuration (*.mk) files.
+# The user has the option to specify a customized version of these files
+# in a different directory than the one distributed with the source code,
+# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep these
+# configurations files up-to-date.
+
+ export COMPILERS=${MY_ROMS_SRC}/Compilers
+#export COMPILERS=${HOME}/Compilers/ROMS
+
+#--------------------------------------------------------------------------
+# Set tunable CPP options.
+#--------------------------------------------------------------------------
+#
+# Sometimes it is desirable to activate one or more CPP options to run
+# different variants of the same application without modifying its header
+# file. If this is the case, specify each options here using the -D syntax.
+# Notice also that you need to use shell's quoting syntax to enclose the
+# definition. Both single or double quotes work. For example,
+#
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DAVERAGES"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DDEBUGGING"
+#
+# can be used to write time-averaged fields. Notice that you can have as
+# many definitions as you want by appending values.
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DRBL4DVAR"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DANA_SPONGE"
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DROMS_STDOUT"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DINITIALIZE_AUTOMATIC"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCHECKSUM"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DMINRES"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DRPCG"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DTIME_CONV"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DBGQC"
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_BOUNDARY"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_STFLUX"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_WSTRESS"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCOLLECT_ALLREDUCE"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DREDUCE_ALLGATHER"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DDEBUGGING"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DPOSITIVE_ZERO"
+
+#--------------------------------------------------------------------------
+# Compiler options.
+#--------------------------------------------------------------------------
+#
+# Other user defined environmental variables. See the ROMS makefile for
+# details on other options the user might want to set here. Be sure to
+# leave the switches meant to be off set to an empty string or commented
+# out. Any string value (including off) will evaluate to TRUE in
+# conditional if-statements.
+
+ export USE_MPI=on # distributed-memory parallelism
+ export USE_MPIF90=on # compile with mpif90 script
+#export which_MPI=intel # compile with mpiifort library
+#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
+
+#export USE_OpenMP=on # shared-memory parallelism
+
+ export FORT=ifort
+#export FORT=gfortran
+#export FORT=pgi
+
+#export USE_DEBUG=on # use Fortran debugging flags
+ export USE_LARGE=on # activate 64-bit compilation
+
+#--------------------------------------------------------------------------
+# Building the ROMS executable using the shared library is not recommended
+# because it requires keeping track of the matching libROMS.{so|dylib}
+# which is located in the Build_roms or Build_romsG directory and will be
+# lost and/or replaced with each new build. The option to build the shared
+# version of libROMS was introduced for use in model coupling systems.
+#--------------------------------------------------------------------------
+
+#export SHARED=on # build libROMS.{so|dylib}
+ export STATIC=on # build libROMS.a
+
+ export EXEC=on # build roms{G|M|O|S} executable
+
+# ROMS I/O choices and combinations. A more complete description of the
+# available options can be found in the wiki (https://myroms.org/wiki/IO).
+# Most users will want to enable at least USE_NETCDF4 because that will
+# instruct the ROMS build system to use nf-config to determine the
+# necessary libraries and paths to link into the ROMS executable.
+
+ export USE_NETCDF4=on # compile with NetCDF-4 library
+#export USE_PARALLEL_IO=on # Parallel I/O with NetCDF-4/HDF5
+#export USE_PIO=on # Parallel I/O with PIO library
+#export USE_SCORPIO=on # Parallel I/O with SCORPIO library
+
+# If any of the coupling component use the HDF5 Fortran API for primary
+# I/O, we need to compile the main driver with the HDF5 library.
+
+#export USE_HDF5=on # compile with HDF5 library
+
+#--------------------------------------------------------------------------
+# If coupling Earth System Models (ESM), set the location of the ESM
+# component libraries and modules.
+#--------------------------------------------------------------------------
+
+source ${MY_ROMS_SRC}/ESM/esm_libs.sh ${MY_ROMS_SRC}/ESM/esm_libs.sh
+
+#--------------------------------------------------------------------------
+# If applicable, use my specified library paths.
+#--------------------------------------------------------------------------
+
+ export USE_MY_LIBS=no # use system default library paths
+#export USE_MY_LIBS=yes # use my customized library paths
+
+MY_PATHS=${COMPILERS}/my_build_paths.sh
+
+if [ "${USE_MY_LIBS}" == "yes" ]; then
+ source ${MY_PATHS} ${MY_PATHS}
+fi
+
+#--------------------------------------------------------------------------
+# The rest of this script sets the path to the users header file and
+# analytical source files, if any. See the templates in User/Functionals.
+#--------------------------------------------------------------------------
+#
+# If applicable, use the MY_ANALYTICAL_DIR directory to place your
+# customized biology model header file (like fennel.h, nemuro.h, ecosim.h,
+# etc).
+
+ export MY_HEADER_DIR=${MY_PROJECT_DIR}
+
+ export MY_ANALYTICAL_DIR=`dirname ${PWD}`/Functionals
+
+# Put the binary to execute in the following directory.
+
+ export BINDIR=${MY_PROJECT_DIR}
+
+ echo ""
+ echo "${separator}"
+
+# Stop if activating both MPI and OpenMP at the same time.
+
+if [ -n "${USE_MPI:+1}" ] && [ -n "${USE_OpenMP:+1}" ]; then
+ echo ""
+ echo "You cannot activate USE_MPI and USE_OpenMP at the same time!"
+ exit 1
+fi
+
+# Put the f90 files in a project specific Build directory to avoid conflict
+# with other projects.
+
+if [ -n "${USE_DEBUG:+1}" ]; then
+ export BUILD_DIR=${MY_PROJECT_DIR}/Build_romsG
+else
+ if [ -n "${USE_OpenMP:+1}" ]; then
+ export BUILD_DIR=${MY_PROJECT_DIR}/Build_romsO
+ elif [ -n "${USE_MPI:+1}" ]; then
+ export BUILD_DIR=${MY_PROJECT_DIR}/Build_romsM
+ else
+ export BUILD_DIR=${MY_PROJECT_DIR}/Build_roms
+ fi
+fi
+
+# For backward compatibility, set deprecated SCRATCH_DIR to compile
+# older released versions of ROMS.
+
+export SCRATCH_DIR=${BUILD_DIR}
+
+# If necessary, create ROMS build directory.
+
+if [ ! -d ${BUILD_DIR} ]; then
+ echo ""
+ echo "Creating ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ mkdir $BUILD_DIR
+fi
+
+# Go to the users source directory to compile. The options set above will
+# pick up the application-specific code from the appropriate place.
+
+if [ $branch -eq 1 ]; then
+
+ # Check out requested branch from ROMS GitHub.
+
+ if [ ! -d ${MY_PROJECT_DIR}/src ]; then
+ echo ""
+ echo "Downloading ROMS source code from GitHub: https://www.github.com/myroms"
+ echo ""
+ git clone https://www.github.com/myroms/roms.git src
+ fi
+ echo ""
+ echo "Checking out ROMS GitHub branch: $branch_name"
+ echo ""
+ cd src
+ git checkout $branch_name
+
+ # If we are using the COMPILERS from the ROMS source code
+ # overide the value set above
+
+ if [[ ${COMPILERS} == ${MY_ROMS_SRC}* ]]; then
+ export COMPILERS=${MY_PROJECT_DIR}/src/Compilers
+ fi
+ export MY_ROMS_SRC=${MY_PROJECT_DIR}/src
+
+else
+ echo ""
+ echo "Using ROMS source code from: ${MY_ROMS_SRC}"
+ echo ""
+ cd ${MY_ROMS_SRC}
+fi
+
+#--------------------------------------------------------------------------
+# Compile.
+#--------------------------------------------------------------------------
+
+# Remove build directory.
+
+if [ $clean -eq 1 ]; then
+ echo ""
+ echo "Cleaning ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ make clean
+fi
+
+# Compile (the binary will go to BINDIR set above).
+
+if [ $dprint -eq 1 ]; then
+ make $debug
+else
+ echo ""
+ echo "Compiling ROMS source code:"
+ echo ""
+ if [ $parallel -eq 1 ]; then
+ make $NCPUS
+ else
+ make
+ fi
+
+ HEADER=`echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+
+ echo ""
+ echo "${separator}"
+ echo "GNU Build script command: ${command}"
+ echo "ROMS source directory: ${MY_ROMS_SRC}"
+ echo "ROMS header file: ${MY_HEADER_DIR}/${HEADER}"
+ echo "ROMS build directory: ${BUILD_DIR}"
+ if [ $branch -eq 1 ]; then
+ echo "ROMS downloaded from: https://github.com/myroms/roms.git"
+ echo "ROMS compiled branch: $branch_name"
+ fi
+ echo "ROMS Application: ${ROMS_APPLICATION}"
+ FFLAGS=`make print-FFLAGS | cut -d " " -f 3-`
+ echo "Fortran compiler: ${FORT}"
+ echo "Fortran flags: ${FFLAGS}"
+ if [ -n "${MY_CPP_FLAGS:+1}" ]; then
+ echo "Added CPP Options: ${MY_CPP_FLAGS}"
+ fi
+ echo "${separator}"
+ echo ""
+fi
diff --git a/WC13/RBL4DVAR_IAU/cbuild_roms.csh b/WC13/RBL4DVAR_IAU/cbuild_roms.csh
new file mode 100755
index 00000000..59542c2f
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/cbuild_roms.csh
@@ -0,0 +1,657 @@
+#!/bin/csh -ef
+#
+# git $Id$
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+# Copyright (c) 2002-2024 The ROMS/TOMS Group :::
+# Licensed under a MIT/X style license :::
+# See License_ROMS.md :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
+# :::
+# ROMS CMake Compiling CSH Script :::
+# :::
+# Script to compile an user application where the application-specific :::
+# files are kept separate from the ROMS source code. :::
+# :::
+# Q: How/why does this script work? :::
+# :::
+# A: The ROMS makefile configures user-defined options with a set of :::
+# flags such as ROMS_APPLICATION. Browse the makefile to see these. :::
+# If an option in the makefile uses the syntax ?= in setting the :::
+# default, this means that make will check whether an environment :::
+# variable by that name is set in the shell that calls make. If so :::
+# the environment variable value overrides the default (and the :::
+# user need not maintain separate makefiles, or frequently edit :::
+# the makefile, to run separate applications). :::
+# :::
+# Usage: :::
+# :::
+# ./cbuild_roms.csh [options] :::
+# :::
+# Options: :::
+# :::
+# -j [N] Compile in parallel using N CPUs :::
+# omit argument for all available CPUs :::
+# :::
+# -b Compile a specific ROMS GitHub branch :::
+# :::
+# cbuild_roms.csh -j 5 -b feature/kernel :::
+# :::
+# -p macro Prints any Makefile macro value. For example, :::
+# :::
+# cbuild_roms.csh -p MY_CPP_FLAGS :::
+# :::
+# -noclean Do not clean already compiled objects :::
+# :::
+# -v Compile in verbose mode (VERBOSE=1) :::
+# :::
+# The branch option -b is only possible for ROMS source code from :::
+# https://github.com/myroms. Such versions are under development :::
+# and targeted to advanced users, superusers, and beta testers. :::
+# Regular and novice users must use the default 'develop' branch. :::
+# :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+setenv which_MPI openmpi # default, overwritten below
+
+set parallel = 0
+set clean = 1
+set dprint = 0
+set Verbose = 0
+set branch = 0
+
+set command = "cbuild_roms.csh $argv[*]"
+
+set separator = `perl -e "print '<>' x 50;"`
+
+setenv MY_CPP_FLAGS ''
+
+while ( ($#argv) > 0 )
+ switch ($1)
+ case "-j"
+ shift
+ set parallel = 1
+ if (`echo $1 | grep '^[0-9]\+$'` != "" ) then
+ set NCPUS = "-j $1"
+ shift
+ else
+ set NCPUS = "-j"
+ endif
+ breaksw
+
+ case "-p"
+ shift
+ set clean = 0
+ set dprint = 1
+ set debug = "$1"
+ shift
+ breaksw
+
+ case "-v"
+ shift
+ set Verbose = 1
+ breaksw
+
+ case "-noclean"
+ shift
+ set clean = 0
+ breaksw
+
+ case "-b"
+ shift
+ set branch = 1
+ set branch_name = `echo $1 | grep -v '^-'`
+ if ( "$branch_name" == "" ) then
+ echo "Please enter a branch name."
+ exit 1
+ endif
+ shift
+ breaksw
+
+ case "-*":
+ echo ""
+ echo "${separator}"
+ echo "$0 : Unknown option [ $1 ]"
+ echo ""
+ echo "Available Options:"
+ echo ""
+ echo "-j [N] Compile in parallel using N CPUs"
+ echo " omit argument for all avaliable CPUs"
+ echo ""
+ echo "-b branch_name Compile specific ROMS GitHub branch name"
+ echo " For example: cbuild_roms.csh -b feature/kernel"
+ echo ""
+ echo "-p macro Prints any Makefile macro value"
+ echo " For example: cbuild_roms.csh -p FFLAGS"
+ echo ""
+ echo "-noclean Do not clean already compiled objects"
+ echo ""
+ echo "-v Compile in verbose mode"
+ echo "${separator}"
+ echo ""
+ exit 1
+ breaksw
+
+ endsw
+end
+
+# Set the CPP option defining the particular application. This will
+# determine the name of the ".h" header file with the application
+# CPP definitions. REQUIRED
+
+ setenv ROMS_APPLICATION WC13
+
+# Set a local environmental variable to define the path to the directories
+# where the ROMS source code is located (MY_ROOT_DIR), and this project's
+# configuration and files are kept (MY_PROJECT_DIR). Notice that if the
+# User sets the ROMS_ROOT_DIR environment variable in their computer logging
+# script describing the location from where the ROMS source code was cloned
+# or downloaded, it uses that value.
+
+if ( $?ROMS_ROOT_DIR ) then
+ if ( "${ROMS_ROOT_DIR}" != "" ) then
+ setenv MY_ROOT_DIR ${ROMS_ROOT_DIR}
+ else
+ setenv MY_ROOT_DIR ${HOME}/ocean/repository/git
+ endif
+endif
+
+setenv MY_PROJECT_DIR ${PWD}
+
+# The path to the user's local current ROMS source code.
+#
+# If downloading ROMS locally, this would be the user's Working Copy Path.
+# One advantage of maintaining your source code copy is that when working
+# simultaneously on multiple machines (e.g., a local workstation, a local
+# cluster, and a remote supercomputer), you can update with the latest ROMS
+# release and always get an up-to-date customized source on each machine.
+# This script allows for differing paths to the code and inputs on other
+# computers.
+
+ setenv MY_ROMS_SRC ${MY_ROOT_DIR}/roms
+
+# Which type(s) of libraries would you like?
+#
+# NOTE: If you choose both and also choose to build the ROMS executable,
+# it will be linked to the static version of the library.
+#
+# Valid options are SHARED, STATIC, and BOTH.
+
+ setenv LIBTYPE STATIC
+
+# Do you want to build the ROMS executable?
+#
+# Valid values are: ON (build the executable) and OFF (do NOT build the
+# executable). If you comment this out the executable WILL be built.
+
+ setenv ROMS_EXECUTABLE ON
+
+# Set path of the directory containing "my_build_paths.csh".
+#
+# The user has the option to specify a customized version of this file
+# in a different directory than the one distributed with the source code,
+# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep this
+# configurations files up-to-date.
+
+ setenv COMPILERS ${MY_ROMS_SRC}/Compilers
+#setenv COMPILERS ${HOME}/Compilers/ROMS
+
+#--------------------------------------------------------------------------
+# Set tunable CPP options.
+#--------------------------------------------------------------------------
+#
+# Sometimes it is desirable to activate one or more CPP options to run
+# different variants of the same application without modifying its header
+# file. If this is the case, specify each option here.
+#
+# Notice also that you need to use shell's quoting syntax to enclose the
+# definition.
+#
+# setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DAVERAGES"
+# setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DDEBUGGING"
+#
+# can be used to write time-averaged fields. Notice that you can have as
+# many definitions as you want by appending values.
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRBL4DVAR"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DANA_SPONGE"
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DROMS_STDOUT"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DINITIALIZE_AUTOMATIC"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCHECKSUM"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DMINRES"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRPCG"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DTIME_CONV"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DBGQC"
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_BOUNDARY"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_STFLUX"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_WSTRESS"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DSTD_MODEL"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCOMPUTE_MLD"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCOLLECT_ALLREDUCE"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DREDUCE_ALLGATHER"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DDEBUGGING"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DPOSITIVE_ZERO"
+
+#--------------------------------------------------------------------------
+# Compilation options.
+#--------------------------------------------------------------------------
+
+ setenv USE_MPI on # distributed-memory
+ setenv USE_MPIF90 on # compile with mpif90 script
+#setenv which_MPI intel # compile with mpiifort library
+#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
+
+ setenv FORT ifort
+#setenv FORT gfortran
+#setenv FORT pgi
+
+#setenv USE_DEBUG on # use Fortran debugging flags
+
+# ROMS I/O choices and combinations. A more complete description of the
+# available options can be found in the wiki (https://myroms.org/wiki/IO).
+# Most users will want to enable at least USE_NETCDF4 because that will
+# instruct the ROMS build system to use nf-config to determine the
+# necessary libraries and paths to link into the ROMS executable.
+
+ setenv USE_NETCDF4 on # compile with NetCDF4 library
+#setenv USE_PARALLEL_IO on # Parallel I/O with NetCDF-4/HDF5
+#setenv USE_PIO on # Parallel I/O with PIO library
+#setenv USE_SCORPIO on # Parallel I/O with SCORPIO library
+
+# If any of the coupling component use the HDF5 Fortran API for primary
+# I/O, we need to compile the main driver with the HDF5 library.
+
+#setenv USE_HDF5 on # compile with HDF5 library
+
+#--------------------------------------------------------------------------
+# If coupling Earth Systems Models (ESM), set the location of the ESM
+# component libraries and modules.
+#--------------------------------------------------------------------------
+
+source ${MY_ROMS_SRC}/ESM/esm_libs.csh ${MY_ROMS_SRC}/ESM/esm_libs.csh
+
+#--------------------------------------------------------------------------
+# If applicable, use my specified library paths.
+#--------------------------------------------------------------------------
+
+ setenv USE_MY_LIBS no # use system default library paths
+#setenv USE_MY_LIBS yes # use my customized library paths
+
+set MY_PATHS = ${COMPILERS}/my_build_paths.csh
+
+if ($USE_MY_LIBS == 'yes') then
+ source ${MY_PATHS} ${MY_PATHS}
+endif
+
+# Set location of the application header file.
+
+ setenv MY_HEADER_DIR ${MY_PROJECT_DIR}
+
+# If you have custom analytical functions to include, enter the path here.
+
+ setenv MY_ANALYTICAL_DIR `dirname ${PWD}`/Functionals
+
+ echo ""
+ echo "${separator}"
+
+# Put the CMake files in a project specific Build directory to avoid conflict
+# with other projects.
+
+if ( $?USE_DEBUG ) then
+ if ( "${USE_DEBUG}" == "on" ) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/CBuild_romsG
+ else if ( $?USE_MPI ) then
+ if ( "${USE_MPI}" == "on" ) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/CBuild_romsM
+ else
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/CBuild_roms
+ endif
+ else
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/CBuild_roms
+ endif
+else if ($?USE_MPI) then
+ if ( "${USE_MPI}" == "on" ) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/CBuild_romsM
+ else
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/CBuild_roms
+ endif
+else
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/CBuild_roms
+endif
+
+# For backward compatibility, set deprecated SCRATCH_DIR to compile
+# older released versions of ROMS.
+
+setenv SCRATCH_DIR ${BUILD_DIR}
+
+# If necessary, create ROMS build directory.
+
+if ( $dprint == 0 ) then
+ if ( -d ${BUILD_DIR} ) then
+ if ( $clean == 1 ) then
+ echo ""
+ echo "Removing ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ rm -rf ${BUILD_DIR}
+ echo ""
+ echo "Creating ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ mkdir ${BUILD_DIR}
+ endif
+ else
+ if ( $clean == 1 ) then
+ mkdir ${BUILD_DIR}
+ cd ${BUILD_DIR}
+ else
+ echo ""
+ echo "Option -noclean activated when the ROMS build directory didn't exist"
+ echo "Creating ROMS build directory and disabling -noclean"
+ echo ""
+ set clean = 1
+ mkdir ${BUILD_DIR}
+ cd ${BUILD_DIR}
+ endif
+ endif
+
+ # If requested, check out requested branch from ROMS GitHub
+
+ if ( $branch == 1 ) then
+ if ( ! -d ${MY_PROJECT_DIR}/src ) then
+ echo ""
+ echo "Downloading ROMS source code from GitHub: https://www.github.com/myroms"
+ echo ""
+ git clone https://www.github.com/myroms/roms.git src
+ endif
+ echo ""
+ echo "Checking out ROMS GitHub branch: $branch_name"
+ echo ""
+ cd src
+ git checkout $branch_name
+
+ # If we are using the COMPILERS from the ROMS source code
+ # overide the value set above
+
+ if ( ${COMPILERS} =~ ${MY_ROMS_SRC}* ) then
+ setenv COMPILERS ${MY_PROJECT_DIR}/src/Compilers
+ endif
+ setenv MY_ROMS_SRC ${MY_PROJECT_DIR}/src
+
+ else
+ echo ""
+ echo "Using ROMS source code from: ${MY_ROMS_SRC}"
+ echo ""
+ cd ${MY_ROMS_SRC}
+ endif
+endif
+
+#--------------------------------------------------------------------------
+# Add environmental variables constructed in 'makefile' to MY_CPP_FLAGS
+# so can be passed to ROMS.
+#--------------------------------------------------------------------------
+
+set ANALYTICAL_DIR = "ANALYTICAL_DIR='${MY_ANALYTICAL_DIR}'"
+set HEADER = `echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+set HEADER_DIR = "HEADER_DIR='${MY_HEADER_DIR}'"
+set ROOT_DIR = "ROOT_DIR='${MY_ROMS_SRC}'"
+
+set mycppflags = "${MY_CPP_FLAGS}"
+
+setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -D${ANALYTICAL_DIR}"
+setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -D${HEADER_DIR}"
+setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -D${ROOT_DIR}"
+
+cd ${BUILD_DIR}
+
+#--------------------------------------------------------------------------
+# Configure.
+#--------------------------------------------------------------------------
+
+# Construct the cmake command.
+
+if ( $?LIBTYPE ) then
+ set ltype="-DLIBTYPE=${LIBTYPE}"
+else
+ set ltype=""
+endif
+
+if ( $?FORT ) then
+ if ( "${FORT}" == "ifort" ) then
+ set compiler="-DCMAKE_Fortran_COMPILER=ifort"
+ else if ( "${FORT}" == "gfortran" ) then
+ set compiler="-DCMAKE_Fortran_COMPILER=gfortran"
+ else
+ set compiler=""
+ endif
+endif
+
+if ( $?MY_CPP_FLAGS ) then
+ set tmp=`echo ${MY_CPP_FLAGS} | sed 's/^ *-D//' | sed 's/ *-D/;/g'`
+ set extra_flags="-DMY_CPP_FLAGS=${tmp}"
+else
+ set extra_flags=""
+endif
+
+if ( $?PARPACK_LIBDIR ) then
+ set parpack_ldir="-DPARPACK_LIBDIR=${PARPACK_LIBDIR}"
+else
+ set parpack_ldir=""
+endif
+
+if ( $?ARPACK_LIBDIR ) then
+ set arpack_ldir="-DARPACK_LIBDIR=${ARPACK_LIBDIR}"
+else
+ set arpack_ldir=""
+endif
+
+if ( $?PIO_LIBDIR && $?PIO_INCDIR ) then
+ set pio_ldir="-DPIO_LIBDIR=${PIO_LIBDIR}"
+ set pio_idir="-DPIO_INCDIR=${PIO_INCDIR}"
+ if ( $?PNETCDF_LIBDIR && $?PNETCDF_INCDIR ) then
+ set pnetcdf_ldir="-DPNETCDF_LIBDIR=${PNETCDF_LIBDIR}"
+ set pnetcdf_idir="-DPNETCDF_INCDIR=${PNETCDF_INCDIR}"
+ else
+ set pnetcdf_ldir=""
+ set pnetcdf_idir=""
+ endif
+else
+ set pio_ldir=""
+ set pio_idir=""
+ set pnetcdf_ldir=""
+ set pnetcdf_idir=""
+endif
+
+# The nested ifs are required to avoid breaking the script, as tcsh
+# apparently does not short-circuit if when the first truth is found
+
+if ( $?USE_MPI ) then
+ if ( "${USE_MPI}" == "on" ) then
+ set mpi="-DMPI=ON"
+ else
+ set mpi=""
+ endif
+else
+ set mpi=""
+endif
+
+if ( $?USE_MPIF90 ) then
+ if ( "${USE_MPIF90}" == "on" ) then
+ set comm="-DCOMM=${which_MPI}"
+ else
+ set comm=""
+ endif
+else
+ set comm=""
+endif
+
+if ( $?ROMS_EXECUTABLE ) then
+ if ( "${ROMS_EXECUTABLE}" == "ON" ) then
+ set roms_exec="-DROMS_EXECUTABLE=ON"
+ else
+ set roms_exec="-DROMS_EXECUTABLE=OFF"
+ endif
+else
+ set roms_exec=""
+endif
+
+if ( $?USE_DEBUG ) then
+ if ( "${USE_DEBUG}" == "on" ) then
+ set dbg="-DCMAKE_BUILD_TYPE=Debug"
+ else
+ set dbg="-DCMAKE_BUILD_TYPE=Release"
+ endif
+else
+ set dbg="-DCMAKE_BUILD_TYPE=Release"
+endif
+
+#--------------------------------------------------------------------------
+# Run the chosen build command.
+#--------------------------------------------------------------------------
+
+set my_hdir="-DMY_HEADER_DIR=${MY_HEADER_DIR}"
+
+if ( $dprint == 0 ) then
+ if ( $clean == 1 ) then
+ echo ""
+ echo "Configuring CMake for ROMS application:"
+ echo ""
+ cmake -DROMS_APP=${ROMS_APPLICATION} \
+ ${my_hdir} \
+ ${ltype} \
+ ${compiler} \
+ ${extra_flags} \
+ ${parpack_ldir} \
+ ${arpack_ldir} \
+ ${pio_ldir} \
+ ${pio_idir} \
+ ${pnetcdf_ldir} \
+ ${pnetcdf_idir} \
+ ${mpi} \
+ ${comm} \
+ ${roms_exec} \
+ ${dbg} \
+ ${MY_ROMS_SRC}
+ endif
+endif
+
+#--------------------------------------------------------------------------
+# Compile.
+#--------------------------------------------------------------------------
+
+if ( $dprint == 1 ) then
+ set val = `eval echo \$${debug}`
+ echo "${debug}:$val"
+else
+
+ echo ""
+ echo "Compiling ROMS source code:"
+ echo ""
+
+ if ( $parallel == 1 ) then
+ if ( $Verbose == 1 ) then
+ make VERBOSE=1 $NCPUS
+ else
+ make $NCPUS
+ endif
+ else
+ if ( $Verbose == 1 ) then
+ make VERBOSE=1
+ else
+ make
+ endif
+ endif
+ make install
+
+ set HEADER = `echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+
+ echo ""
+ echo "${separator}"
+ echo "CMake Build script command: ${command}"
+ echo "ROMS source directory: ${MY_ROMS_SRC}"
+ echo "ROMS build directory: ${BUILD_DIR}"
+ if ( $branch == 1 ) then
+ echo "ROMS downloaded from: https://github.com/myroms/roms.git"
+ echo "ROMS compiled branch: $branch_name"
+ endif
+ echo "ROMS Application: ${ROMS_APPLICATION}"
+ echo "ROMS header file: ${MY_HEADER_DIR}/${HEADER}"
+ set FFLAGS = `cat fortran_flags`
+ echo "Fortran compiler: ${FORT}"
+ echo "Fortran flags: ${FFLAGS}"
+ if ($?mycppflags) then
+ echo "Added CPP Options: ${mycppflags}"
+ endif
+ echo "${separator}"
+ echo ""
+endif
+
+cd ${MY_PROJECT_DIR}
+
+# If ROMS_EXECUTABLE is set to OFF remove the symlink from
+# previous build if present.
+
+if ( $?ROMS_EXECUTABLE ) then
+ if ( "${ROMS_EXECUTABLE}" == "OFF" ) then
+ if ( $?USE_DEBUG ) then
+ if ( "${USE_DEBUG}" == "on" ) then
+ if { test -L romsG } then
+ rm -f romsG
+ endif
+ endif
+ else if ( $?USE_MPI ) then
+ if ( "${USE_MPI}" == "on" ) then
+ if { test -L romsM } then
+ rm -f romsM
+ endif
+ endif
+ else
+ if { test -L romsS } then
+ rm -f romsS
+ endif
+ endif
+ endif
+endif
+
+# Copy executable to project directory. This should work even
+# if ROMS was linked to the shared library (libROMS.{so|dylib})
+# because CMAKE_BUILD_WITH_INSTALL_RPATH is set to FALSE so that
+# RPATH/RUNPATH are set correctly for both the build tree and
+# installed locations of the ROMS executable.
+
+if ( $dprint == 0 ) then
+ if ( ! $?ROMS_EXECUTABLE ) then
+ if ( $?USE_DEBUG ) then
+ if ( "${USE_DEBUG}" == "on" ) then
+ cp -pfv ${BUILD_DIR}/romsG .
+ endif
+ else if ( $?USE_MPI ) then
+ if ( "${USE_MPI}" == "on" ) then
+ cp -pfv ${BUILD_DIR}/romsM .
+ endif
+ else
+ cp -pfv ${BUILD_DIR}/romsS .
+ endif
+ else
+ if ( "${ROMS_EXECUTABLE}" == "ON" ) then
+ if ( $?USE_DEBUG ) then
+ if ( "${USE_DEBUG}" == "on" ) then
+ cp -pfv ${BUILD_DIR}/romsG .
+ endif
+ else if ( $?USE_MPI ) then
+ if ( "${USE_MPI}" == "on" ) then
+ cp -pfv ${BUILD_DIR}/romsM .
+ endif
+ else
+ cp -pfv ${BUILD_DIR}/romsS .
+ endif
+ endif
+ endif
+endif
diff --git a/WC13/RBL4DVAR_IAU/cbuild_roms.sh b/WC13/RBL4DVAR_IAU/cbuild_roms.sh
new file mode 100755
index 00000000..63454be4
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/cbuild_roms.sh
@@ -0,0 +1,610 @@
+#!/bin/bash
+#
+# git $Id$
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+# Copyright (c) 2002-2024 The ROMS/TOMS Group :::
+# Licensed under a MIT/X style license :::
+# See License_ROMS.md :::
+#:::::::::::::::::::::::::::::::::::::::::::::::::::::: David Robertson :::
+# :::
+# ROMS CMake Compiling BASH Script :::
+# :::
+# Script to configure and compile a user application where the :::
+# application-specific files are kept separate from the ROMS :::
+# source code. :::
+# :::
+# Q: How/why does this script work? :::
+# :::
+# A: The ROMS makefile configures user-defined options with a set of :::
+# flags such as ROMS_APPLICATION. Browse the makefile to see these. :::
+# If an option in the makefile uses the syntax ?= in setting the :::
+# default, this means that make will check whether an environment :::
+# variable by that name is set in the shell that calls make. If so :::
+# the environment variable value overrides the default (and the :::
+# user need not maintain separate makefiles, or frequently edit :::
+# the makefile, to run separate applications). :::
+# :::
+# Usage: :::
+# :::
+# ./cbuild_roms.sh [options] :::
+# :::
+# Options: :::
+# :::
+# -j [N] Compile in parallel using N CPUs :::
+# omit argument for all available CPUs :::
+# :::
+# -b Compile a specific ROMS GitHub branch :::
+# :::
+# cbuild_roms.sh -j 5 -b feature/kernel :::
+# :::
+# -p macro Prints any Makefile macro value. For example, :::
+# :::
+# cbuild_roms.sh -p MY_CPP_FLAGS :::
+# :::
+# -noclean Do not clean already compiled objects :::
+# :::
+# -v Compile in verbose mode (VERBOSE=1) :::
+# :::
+# The branch option -b is only possible for ROMS source code from :::
+# https://github.com/myroms. Such versions are under development :::
+# and targeted to advanced users, superusers, and beta testers. :::
+# Regular and novice users must use the default 'develop' branch. :::
+# :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+export which_MPI=openmpi # default, overwritten below
+
+parallel=0
+clean=1
+dprint=0
+Verbose=0
+branch=0
+
+command="cbuild_roms.sh $@"
+
+separator=`perl -e "print '<>' x 50;"`
+
+export MY_CPP_FLAGS=
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ -j )
+ shift
+ parallel=1
+ test=`echo $1 | grep '^[0-9]\+$'`
+ if [ "$test" != "" ]; then
+ NCPUS="-j $1"
+ shift
+ else
+ NCPUS="-j"
+ fi
+ ;;
+
+ -p )
+ shift
+ clean=0
+ dprint=1
+ debug="$1"
+ shift
+ ;;
+
+ -v )
+ shift
+ Verbose=1
+ ;;
+
+ -noclean )
+ shift
+ clean=0
+ ;;
+
+ -b )
+ shift
+ branch=1
+ branch_name=`echo $1 | grep -v '^-'`
+ if [ "$branch_name" == "" ]; then
+ echo "Please enter a ROMS GitHub branch name."
+ exit 1
+ fi
+ shift
+ ;;
+
+ * )
+ echo ""
+ echo "${separator}"
+ echo "$0 : Unknown option [ $1 ]"
+ echo ""
+ echo "Available Options:"
+ echo ""
+ echo "-j [N] Compile in parallel using N CPUs"
+ echo " omit argument for all avaliable CPUs"
+ echo ""
+ echo "-b branch_name Compile specific ROMS GitHub branch name"
+ echo " For example: cbuild_roms.sh -b feature/kernel"
+ echo ""
+ echo "-p macro Prints any Makefile macro value"
+ echo " For example: cbuild_roms.sh -p FFLAGS"
+ echo ""
+ echo "-noclean Do not clean already compiled objects"
+ echo ""
+ echo "-v Compile in verbose mode"
+ echo "${separator}"
+ echo ""
+ exit 1
+ ;;
+ esac
+done
+
+# Set the CPP option defining the particular application. This will
+# determine the name of the ".h" header file with the application
+# CPP definitions. REQUIRED
+
+export ROMS_APPLICATION=WC13
+
+# Set a local environmental variable to define the path to the directories
+# where the ROMS source code is located (MY_ROOT_DIR), and this project's
+# configuration and files are kept (MY_PROJECT_DIR). Notice that if the
+# User sets the ROMS_ROOT_DIR environment variable in their computer logging
+# script describing the location from where the ROMS source code was cloned
+# or downloaded, it uses that value.
+
+if [ -n "${ROMS_ROOT_DIR:+1}" ]; then
+ export MY_ROOT_DIR=${ROMS_ROOT_DIR}
+else
+ export MY_ROOT_DIR=${HOME}/ocean/repository/git
+fi
+
+export MY_PROJECT_DIR=${PWD}
+
+# The path to the user's local current ROMS source code.
+#
+# If downloading ROMS locally, this would be the user's Working Copy Path.
+# One advantage of maintaining your source code copy is that when working
+# simultaneously on multiple machines (e.g., a local workstation, a local
+# cluster, and a remote supercomputer), you can update with the latest ROMS
+# release and always get an up-to-date customized source on each machine.
+# This script allows for differing paths to the code and inputs on other
+# computers.
+
+ export MY_ROMS_SRC=${MY_ROOT_DIR}/roms
+
+# Which type(s) of libraries would you like?
+#
+# NOTE: If you choose both and also choose to build the ROMS executable,
+# it will be linked to the shared version of the library.
+#
+# Valid options are SHARED, STATIC, and BOTH.
+
+ export LIBTYPE=STATIC
+
+# Do you want to build the ROMS executable?
+#
+# Valid values are: ON (build the executable) and OFF (do NOT build the
+# executable). If you comment this out the executable WILL be built.
+
+ export ROMS_EXECUTABLE=ON
+
+# Set path of the directory containing "my_build_paths.sh".
+#
+# The user has the option to specify a customized version of this file
+# in a different directory than the one distributed with the source code,
+# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep these
+# configurations files up-to-date.
+
+ export COMPILERS=${MY_ROMS_SRC}/Compilers
+#export COMPILERS=${HOME}/Compilers/ROMS
+
+#--------------------------------------------------------------------------
+# Set tunable CPP options.
+#--------------------------------------------------------------------------
+#
+# Sometimes it is desirable to activate one or more CPP options to run
+# different variants of the same application without modifying its header
+# file. If this is the case, specify each option here.
+#
+# Notice also that you need to use shell's quoting syntax to enclose the
+# definition.
+#
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DAVERAGES"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DDEBUGGING"
+#
+# can be used to write time-averaged fields. Notice that you can have as
+# many definitions as you want by appending values.
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DRBL4DVAR"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DOLD_DRIVER"
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DANA_SPONGE"
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DROMS_STDOUT"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DINITIALIZE_AUTOMATIC"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCHECKSUM"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCHECKSUM_NG"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DMINRES"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DRPCG"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DTIME_CONV"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DBGQC"
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_BOUNDARY"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_STFLUX"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_WSTRESS"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCOLLECT_ALLREDUCE"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DREDUCE_ALLGATHER"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DDEBUGGING"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DPOSITIVE_ZERO"
+
+#--------------------------------------------------------------------------
+# Compilation options.
+#--------------------------------------------------------------------------
+
+ export USE_MPI=on # distributed-memory parallelism
+ export USE_MPIF90=on # compile with mpif90 script
+#export which_MPI=intel # compile with mpiifort library
+#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
+
+ export FORT=ifort
+#export FORT=gfortran
+#export FORT=pgi
+
+#export USE_DEBUG=on # use Fortran debugging flags
+
+# ROMS I/O choices and combinations. A more complete description of the
+# available options can be found in the wiki (https://myroms.org/wiki/IO).
+# Most users will want to enable at least USE_NETCDF4 because that will
+# instruct the ROMS build system to use nf-config to determine the
+# necessary libraries and paths to link into the ROMS executable.
+
+ export USE_NETCDF4=on # compile with NetCDF-4 library
+#export USE_PARALLEL_IO=on # Parallel I/O with NetCDF-4/HDF5
+#export USE_PIO=on # Parallel I/O with PIO library
+#export USE_SCORPIO=on # Parallel I/O with SCORPIO library
+
+# If any of the coupling component use the HDF5 Fortran API for primary
+# I/O, we need to compile the main driver with the HDF5 library.
+
+#export USE_HDF5=on # compile with HDF5 library
+
+#--------------------------------------------------------------------------
+# If coupling Earth System Models (ESM), set the location of the ESM
+# component libraries and modules.
+#--------------------------------------------------------------------------
+
+source ${MY_ROMS_SRC}/ESM/esm_libs.sh ${MY_ROMS_SRC}/ESM/esm_libs.sh
+
+#--------------------------------------------------------------------------
+# If applicable, use my specified library paths.
+#--------------------------------------------------------------------------
+
+ export USE_MY_LIBS=no # use system default library paths
+#export USE_MY_LIBS=yes # use my customized library paths
+
+MY_PATHS=${COMPILERS}/my_build_paths.sh
+
+if [ "${USE_MY_LIBS}" = "yes" ]; then
+ source ${MY_PATHS} ${MY_PATHS}
+fi
+
+# Set location of the application header file.
+
+ export MY_HEADER_DIR=${MY_PROJECT_DIR}
+
+# If you have custom analytical functions to include, enter the path here.
+
+ export MY_ANALYTICAL_DIR=`dirname ${PWD}`/Functionals
+
+ echo ""
+ echo "${separator}"
+
+# Put the CMake files in a project specific Build directory to avoid conflict
+# with other projects.
+
+if [ "${USE_DEBUG:-x}" = "on" ]; then
+ export BUILD_DIR=${MY_PROJECT_DIR}/CBuild_romsG
+else
+ if [ "${USE_MPI:-x}" = "on" ]; then
+ export BUILD_DIR=${MY_PROJECT_DIR}/CBuild_romsM
+ else
+ export BUILD_DIR=${MY_PROJECT_DIR}/CBuild_roms
+ fi
+fi
+
+# For backward compatibility, set deprecated SCRATCH_DIR to compile
+# older released versions of ROMS.
+
+export SCRATCH_DIR=${BUILD_DIR}
+
+# If necessary, create ROMS build directory.
+
+if [ $dprint -eq 0 ]; then
+ if [ -d ${BUILD_DIR} ]; then
+ if [ $clean -eq 1 ]; then
+ echo ""
+ echo "Removing ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ rm -rf ${BUILD_DIR}
+ echo ""
+ echo "Creating ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ mkdir ${BUILD_DIR}
+ fi
+ else
+ if [ $clean -eq 1 ]; then
+ mkdir ${BUILD_DIR}
+ cd ${BUILD_DIR}
+ else
+ echo ""
+ echo "Option -noclean activated when the ROMS build directory did not exist"
+ echo "Creating ROMS build directory and disabling -noclean"
+ echo ""
+ clean=1
+ mkdir ${BUILD_DIR}
+ cd ${BUILD_DIR}
+ fi
+ fi
+
+ # If requested, check out requested branch from ROMS GitHub
+
+ if [ $branch -eq 1 ]; then
+ if [ ! -d ${MY_PROJECT_DIR}/src ]; then
+ echo ""
+ echo "Downloading ROMS source code from GitHub: https://www.github.com/myroms"
+ echo ""
+ git clone https://www.github.com/myroms/roms.git src
+ fi
+ echo ""
+ echo "Checking out ROMS GitHub branch: $branch_name"
+ echo ""
+ cd src
+ git checkout $branch_name
+
+ # If we are using the COMPILERS from the ROMS source code
+ # overide the value set above
+
+ if [[ ${COMPILERS} == ${MY_ROMS_SRC}* ]]; then
+ export COMPILERS=${MY_PROJECT_DIR}/src/Compilers
+ fi
+ export MY_ROMS_SRC=${MY_PROJECT_DIR}/src
+
+ else
+ echo ""
+ echo "Using ROMS source code from: ${MY_ROMS_SRC}"
+ echo ""
+ cd ${MY_ROMS_SRC}
+ fi
+fi
+
+#--------------------------------------------------------------------------
+# Add environmental variables constructed in 'makefile' to MY_CPP_FLAGS
+# so can be passed to ROMS.
+#--------------------------------------------------------------------------
+
+ANALYTICAL_DIR="ANALYTICAL_DIR='${MY_ANALYTICAL_DIR}'"
+HEADER=`echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+HEADER_DIR="HEADER_DIR='${MY_HEADER_DIR}'"
+ROOT_DIR="ROOT_DIR='${MY_ROMS_SRC}'"
+
+mycppflags="${MY_CPP_FLAGS}"
+
+export MY_CPP_FLAGS="${MY_CPP_FLAGS} -D${ANALYTICAL_DIR}"
+export MY_CPP_FLAGS="${MY_CPP_FLAGS} -D${HEADER_DIR}"
+export MY_CPP_FLAGS="${MY_CPP_FLAGS} -D${ROOT_DIR}"
+
+cd ${BUILD_DIR}
+
+#--------------------------------------------------------------------------
+# Configure.
+#--------------------------------------------------------------------------
+
+# Construct the "cmake" command.
+
+if [ ! -z "${LIBTYPE}" ]; then
+ ltype="-DLIBTYPE=${LIBTYPE}"
+else
+ ltype=""
+fi
+
+if [ ! -z "${FORT}" ]; then
+ if [ ${FORT} == "ifort" ]; then
+ compiler="-DCMAKE_Fortran_COMPILER=ifort"
+ elif [ ${FORT} == "gfortran" ]; then
+ compiler="-DCMAKE_Fortran_COMPILER=gfortran"
+ else
+ compiler=""
+ fi
+fi
+
+if [ ! -z "${MY_CPP_FLAGS}" ]; then
+ tmp=`echo ${MY_CPP_FLAGS} | sed 's/^ *-D//' | sed 's/ *-D/;/g'`
+ extra_flags="-DMY_CPP_FLAGS=${tmp}"
+else
+ extra_flags=""
+fi
+
+if [ ! -z "${PARPACK_LIBDIR}" ]; then
+ parpack_ldir="-DPARPACK_LIBDIR=${PARPACK_LIBDIR}"
+else
+ parpack_ldir=""
+fi
+
+if [ ! -z "${ARPACK_LIBDIR}" ]; then
+ arpack_ldir="-DARPACK_LIBDIR=${ARPACK_LIBDIR}"
+else
+ arpack_ldir=""
+fi
+
+if [ ! -z "${USE_SCORPIO}" ]; then
+ if [[ ! -z "${PIO_LIBDIR}" && ! -z "${PIO_INCDIR}" ]]; then
+ pio_ldir="-DPIO_LIBDIR=${PIO_LIBDIR}"
+ pio_idir="-DPIO_INCDIR=${PIO_INCDIR}"
+ if [[ ! -z "${PNETCDF_LIBDIR}" && ! -z "${PNETCDF_INCDIR}" ]]; then
+ pnetcdf_ldir="-DPNETCDF_LIBDIR=${PNETCDF_LIBDIR}"
+ pnetcdf_idir="-DPNETCDF_INCDIR=${PNETCDF_INCDIR}"
+ else
+ pnetcdf_ldir=""
+ pnetcdf_idir=""
+ fi
+ else
+ pio_ldir=""
+ pio_idir=""
+ pnetcdf_ldir=""
+ pnetcdf_idir=""
+ fi
+fi
+
+if [[ ! -z "${USE_MPI}" && "${USE_MPI}" == "on" ]]; then
+ mpi="-DMPI=ON"
+else
+ mpi=""
+fi
+
+if [[ ! -z "${USE_MPIF90}" && "${USE_MPIF90}" == "on" ]]; then
+ comm="-DCOMM=${which_MPI}"
+else
+ comm=""
+fi
+
+if [ ! -z "${ROMS_EXECUTABLE}" ]; then
+ if [[ "${ROMS_EXECUTABLE}" == "ON" ]]; then
+ roms_exec="-DROMS_EXECUTABLE=ON"
+ else
+ roms_exec="-DROMS_EXECUTABLE=OFF"
+ fi
+else
+ roms_exec=""
+fi
+
+if [[ ! -z "${USE_DEBUG}" && "${USE_DEBUG}" == "on" ]]; then
+ dbg="-DCMAKE_BUILD_TYPE=Debug"
+else
+ dbg="-DCMAKE_BUILD_TYPE=Release"
+fi
+
+#--------------------------------------------------------------------------
+# Run the chosen build command.
+#--------------------------------------------------------------------------
+
+my_hdir="-DMY_HEADER_DIR=${MY_HEADER_DIR}"
+
+if [[ $dprint -eq 0 && $clean -eq 1 ]]; then
+ echo ""
+ echo "Configuring CMake for ROMS application:"
+ echo ""
+ cmake -DROMS_APP=${ROMS_APPLICATION} \
+ ${my_hdir} \
+ ${ltype} \
+ ${compiler} \
+ ${extra_flags} \
+ ${parpack_ldir} \
+ ${arpack_ldir} \
+ ${pio_ldir} \
+ ${pio_idir} \
+ ${pnetcdf_ldir} \
+ ${pnetcdf_idir} \
+ ${mpi} \
+ ${comm} \
+ ${roms_exec} \
+ ${dbg} \
+ ${MY_ROMS_SRC}
+fi
+
+if [ $? -ne 0 ]; then
+ echo "cmake did not complete successfully"
+ exit 1
+fi
+
+#--------------------------------------------------------------------------
+# Compile.
+#--------------------------------------------------------------------------
+
+if [ $dprint -eq 1 ]; then
+ echo $debug:"${!debug}"
+else
+
+ echo ""
+ echo "Compiling ROMS source code:"
+ echo ""
+
+ if [ $parallel -eq 1 ]; then
+ if [ $Verbose -eq 1 ]; then
+ make VERBOSE=1 $NCPUS
+ else
+ make $NCPUS
+ fi
+ else
+ if [ $Verbose -eq 1 ]; then
+ make VERBOSE=1
+ else
+ make
+ fi
+ fi
+ make install
+
+ HEADER=`echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+
+ echo ""
+ echo "${separator}"
+ echo "CMake Build script command: ${command}"
+ echo "ROMS source directory: ${MY_ROMS_SRC}"
+ echo "ROMS build directory: ${BUILD_DIR}"
+ if [ $branch -eq 1 ]; then
+ echo "ROMS downloaded from: https://github.com/myroms/roms.git"
+ echo "ROMS compiled branch: $branch_name"
+ fi
+ echo "ROMS Application: ${ROMS_APPLICATION}"
+ echo "ROMS header file: ${MY_HEADER_DIR}/${HEADER}"
+ FFLAGS=`cat fortran_flags`
+ echo "Fortran compiler: ${FORT}"
+ echo "Fortran flags: ${FFLAGS}"
+ if [ -n "${mycppflags:+1}" ]; then
+ echo "Added CPP Options: ${mycppflags}"
+ fi
+ echo "${separator}"
+ echo ""
+fi
+
+cd ${MY_PROJECT_DIR}
+
+# If ROMS_EXECUTABLE is set to OFF remove the symlink from
+# previous builds if present.
+
+if [[ ! -z "${ROMS_EXECUTABLE}" && "${ROMS_EXECUTABLE}" == "OFF" ]]; then
+ if [[ ! -z "${USE_DEBUG}" && "${USE_DEBUG}" == "on" ]]; then
+ if [ -L romsG ]; then
+ rm -f romsG
+ fi
+ elif [[ ! -z "${USE_MPI}" && "${USE_MPI}" == "on" ]]; then
+ if [ -L romsM ]; then
+ rm -f romsM
+ fi
+ else
+ if [ -L romsS ]; then
+ rm -f romsS
+ fi
+ fi
+fi
+
+# Copy executable to project directory. This should work even
+# if ROMS was linked to the shared library (libROMS.{so|dylib})
+# because CMAKE_BUILD_WITH_INSTALL_RPATH is set to FALSE so that
+# RPATH/RUNPATH are set correctly for both the build tree and
+# installed locations of the ROMS executable.
+
+if [[ -z "${ROMS_EXECUTABLE}" || "${ROMS_EXECUTABLE}" == "ON" ]]; then
+ if [ $dprint -eq 0 ]; then
+ if [[ ! -z "${USE_DEBUG}" && "${USE_DEBUG}" == "on" ]]; then
+ cp -pfv ${BUILD_DIR}/romsG .
+ elif [[ ! -z "${USE_MPI}" && "${USE_MPI}" == "on" ]]; then
+ cp -pfv ${BUILD_DIR}/romsM .
+ else
+ cp -pfv ${BUILD_DIR}/romsS .
+ fi
+ fi
+fi
diff --git a/WC13/RBL4DVAR_IAU/job_rbl4dvar.csh b/WC13/RBL4DVAR_IAU/job_rbl4dvar.csh
new file mode 100755
index 00000000..379447f0
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/job_rbl4dvar.csh
@@ -0,0 +1,103 @@
+#!/bin/csh -f
+#
+# git $Id$
+#######################################################################
+# Copyright (c) 2002-2024 The ROMS/TOMS Group #
+# Licensed under a MIT/X style license #
+# See License_ROMS.md #
+#######################################################################
+# #
+# Strong/Weak constraint RBL4D-Var job CSH script: #
+# #
+# This script NEEDS to be run before any run: #
+# #
+# (1) It copies a new clean nonlinear model initial conditions #
+# file. The nonlinear model is initialized from the #
+# background or reference state. #
+# (2) Specify model, initial conditions, boundary conditions, and #
+# surface forcing error convariance input standard deviations #
+# files. #
+# (3) Specify model, initial conditions, boundary conditions, and #
+# surface forcing error convariance input/output normalization #
+# factors files. #
+# (4) Copy a clean copy of the observations NetCDF file. #
+# (5) Create 4D-Var input script "rbl4dvar.in" from template and #
+# specify the error covariance standard deviation, error #
+# covariance normalization factors, and observation files to #
+# be used. #
+# #
+#######################################################################
+
+ echo ' '
+ echo 'Strong/Weak Constraint RBL4D-Var Configuration:'
+ echo ' '
+
+# Set path definition to one directory up in the tree.
+
+ set Dir=`dirname ${PWD}`
+
+# Set string manipulations perl script.
+
+ set SUBSTITUTE=${ROMS_ROOT}/ROMS/Bin/substitute
+
+# Set NetCDF file suffix.
+
+ set Fsuffix="_20040103"
+
+# Copy nonlinear model initial conditions file.
+
+cp -vp ${Dir}/Data/wc13_roms_ini${Fsuffix}.nc wc13_roms_ini${Fsuffix}.nc
+
+# Set model, initial conditions, boundary conditions and surface
+# forcing error covariance standard deviations files.
+
+ set STDnameM=../Data/wc13_std_m.nc
+ set STDnameI=../Data/wc13_std_i.nc
+ set STDnameB=../Data/wc13_std_b.nc
+ set STDnameF=../Data/wc13_std_f.nc
+
+# Set output file for standard deviation computed/modeled from background
+# (prior) state.
+
+ set STDnameC=wc13_std_computed.nc
+
+# Set model, initial conditions, boundary conditions and surface
+# forcing error covariance normalization factors files.
+
+ set NRMnameM=../Data/wc13_nrm_m.nc
+ set NRMnameI=../Data/wc13_nrm_i.nc
+ set NRMnameB=../Data/wc13_nrm_b.nc
+ set NRMnameF=../Data/wc13_nrm_f.nc
+
+# Set observations file.
+
+ set OBSname=wc13_obs${Fsuffix}.nc
+
+# Get a clean copy of the observation file. This is really
+# important since this file is modified.
+
+ cp -vp ${Dir}/Data/${OBSname} .
+
+# Modify 4D-Var template input script and specify above files.
+
+ set RBL4DVAR=rbl4dvar.in
+ if (-e $RBL4DVAR) then
+ /bin/rm $RBL4DVAR
+ endif
+ cp -v s4dvar.in $RBL4DVAR
+
+ $SUBSTITUTE $RBL4DVAR roms_std_m.nc $STDnameM
+ $SUBSTITUTE $RBL4DVAR roms_std_i.nc $STDnameI
+ $SUBSTITUTE $RBL4DVAR roms_std_b.nc $STDnameB
+ $SUBSTITUTE $RBL4DVAR roms_std_f.nc $STDnameF
+ $SUBSTITUTE $RBL4DVAR roms_std_c.nc $STDnameC
+ $SUBSTITUTE $RBL4DVAR roms_nrm_m.nc $NRMnameM
+ $SUBSTITUTE $RBL4DVAR roms_nrm_i.nc $NRMnameI
+ $SUBSTITUTE $RBL4DVAR roms_nrm_b.nc $NRMnameB
+ $SUBSTITUTE $RBL4DVAR roms_nrm_f.nc $NRMnameF
+ $SUBSTITUTE $RBL4DVAR roms_obs.nc $OBSname
+ $SUBSTITUTE $RBL4DVAR roms_hss.nc wc13_hss${Fsuffix}.nc
+ $SUBSTITUTE $RBL4DVAR roms_lcz.nc wc13_lcz${Fsuffix}.nc
+ $SUBSTITUTE $RBL4DVAR roms_lze.nc wc13_lze${Fsuffix}.nc
+ $SUBSTITUTE $RBL4DVAR roms_mod.nc wc13_mod${Fsuffix}.nc
+ $SUBSTITUTE $RBL4DVAR roms_err.nc wc13_err${Fsuffix}.nc
diff --git a/WC13/RBL4DVAR_IAU/roms_wc13_20040103.in b/WC13/RBL4DVAR_IAU/roms_wc13_20040103.in
new file mode 100644
index 00000000..a50b913d
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/roms_wc13_20040103.in
@@ -0,0 +1,3511 @@
+!
+! ROMS/TOMS Standard Input parameters.
+!
+! git $Id$
+!========================================================= Hernan G. Arango ===
+! Copyright (c) 2002-2024 The ROMS/TOMS Group !
+! Licensed under a MIT/X style license !
+! See License_ROMS.md !
+!==============================================================================
+! !
+! Input parameters can be entered in ANY order, provided that the parameter !
+! KEYWORD (usually, upper case) is typed correctly followed by "=" or "==" !
+! symbols. Any comment lines are allowed and must begin with an exclamation !
+! mark (!) in column one. Comments may appear to the right of a parameter !
+! specification to improve documentation. Comments are ignored during !
+! reading. Blank lines are also allowed and ignored. Continuation lines in !
+! a parameter specification are allowed if preceded by a backslash (\). In !
+! some instances, more than one value is required for a parameter. If fewer !
+! values are provided, the last value is assigned for the entire parameter !
+! array. The multiplication symbol (*), without blank spaces in between, !
+! is allowed for a parameter specification. For example, in two grids nested !
+! application: !
+! !
+! AKT_BAK == 2*1.0d-6 2*5.0d-6 ! m2/s !
+! !
+! indicates that the first two entries of array AKT_BAK, in fortran column- !
+! major order, will have the same value of "1.0d-6" for grid 1, whereas the !
+! next two entries will have the same value of "5.0d-6" for grid 2. !
+! !
+! In multiple levels of nesting or multiple connected domains step-ups, !
+! "Ngrids" entries are expected for some of these parameters. In such case, !
+! the order of the entries for a parameter is critical. It must follow the !
+! same order (1:Ngrids) as in the state variable declaration. The USER may !
+! follow the above guidelines for specifying his/her values. These parameters !
+! are marked by "==" plural symbol after the KEYWORD. !
+! !
+! Multiple NetCDF files are allowed for input field(s). It is useful when !
+! splitting input data (climatology, boundary, forcing) time records into !
+! several files (say monthly, annual, etc.). In this case, each multiple !
+! filename entry lines need to end with the vertical bar (|) symbol. For !
+! example: !
+! !
+! NFFILES == 6 ! number of forcing files !
+! !
+! FRCNAME == my_lwrad_year1.nc | !
+! my_lwrad_year2.nc \ !
+! my_swrad_year1.nc | !
+! my_swrad_year2.nc \ !
+! my_winds_year1.nc | !
+! my_winds_year2.nc \ !
+! my_Pair_year1.nc | !
+! my_Pair_year2.nc \ !
+! my_Qair_year1.nc | !
+! my_Qair_year2.nc \ !
+! my_Tair_year1.nc | !
+! my_Tair_year2.nc !
+! !
+! Notice that NFFILES is 6 and not 12. There are 6 uniquely different fields !
+! in the file list, we DO NOT count file entries followed by the vertical !
+! bar symbol. This is because multiple file entries are processed in ROMS !
+! with derived type structures. !
+! !
+!==============================================================================
+!
+! Application title.
+
+ TITLE = California Current System, 1/3 degree resolution
+
+! C-preprocessing Flag.
+
+ MyAppCPP = WC13
+
+! Input variable information file name. This file needs to be processed
+! first so all information arrays can be initialized properly.
+
+ VARNAME = ~/ocean/repository/git/roms_test/External/varinfo.yaml
+
+! 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].
+
+GridsInLayer = 1
+
+! Grid dimension parameters. See notes below in the Glossary for how to set
+! these parameters correctly.
+
+ Lm == 54 ! Number of I-direction INTERIOR RHO-points
+ Mm == 53 ! Number of J-direction INTERIOR RHO-points
+ N == 30 ! 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].
+
+ NtileI == 3 ! I-direction partition
+ NtileJ == 4 ! J-direction partition
+
+! 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
+ U3 ! salinity
+
+ Vadvection == C4 \ ! temperature
+ C4 ! 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
+
+! Set lateral boundary conditions keyword. Notice that 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. Otherwise,
+! [1:4,1:Ngrids] values are expected for other variables. The boundary
+! order is: 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_implicit (free-surface)
+! Che Chapman_explicit (free-surface)
+! Cla Clamped
+! Clo Closed
+! Fla Flather (2D momentum) _____N_____ j=Mm
+! Gra Gradient | 4 |
+! Nes Nested (refinement) | |
+! Nud Nudging 1 W E 3
+! Per Periodic | |
+! Rad Radiation |_____S_____|
+! Red Reduced Physics (2D momentum) 2 j=1
+! Shc Shchepetkin (2D momentum) 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) == Cha Cha Clo Cha ! free-surface
+ LBC(isUbar) == Fla Fla Clo Fla ! 2D U-momentum
+ LBC(isVbar) == Fla Fla Clo Fla ! 2D V-momentum
+ LBC(isUvel) == Cla Cla Clo Cla ! 3D U-momentum
+ LBC(isVvel) == Cla Cla Clo Cla ! 3D V-momentum
+ LBC(isMtke) == Gra Gra Clo Gra ! mixing TKE
+
+ LBC(isTvar) == Cla Cla Clo Cla \ ! temperature
+ Cla Cla Clo Cla ! salinity
+
+! Waves Effect on Currents lateral boundary conditions.
+
+ LBC(isU2Sd) == Gra Gra Clo Gra ! 2D U-Stokes
+ LBC(isV2Sd) == Gra Gra Clo Gra ! 2D V-Stokes
+ LBC(isU3Sd) == Gra Gra Clo Gra ! 3D U-Stokes
+ LBC(isV3Sd) == Gra Gra Clo Gra ! 3D V-Stokes
+
+! Adjoint-based algorithms can have different lateral boundary
+! conditions keywords.
+
+ad_LBC(isFsur) == Cha Cha Clo Cha ! free-surface
+ad_LBC(isUbar) == Fla Fla Clo Fla ! 2D U-momentum
+ad_LBC(isVbar) == Fla Fla Clo Fla ! 2D V-momentum
+ad_LBC(isUvel) == Cla Cla Clo Cla ! 3D U-momentum
+ad_LBC(isVvel) == Cla Cla Clo Cla ! 3D V-momentum
+ad_LBC(isMtke) == Gra Gra Clo Gra ! mixing TKE
+
+ad_LBC(isTvar) == Cla Cla Clo Cla \ ! temperature
+ Cla Cla Clo Cla ! salinity
+
+! Set lateral open boundary edge volume conservation switch for
+! nonlinear model and adjoint-based algorithms. Usually activated
+! with radiation boundary conditions to enforce global mass
+! conservation, except if tidal forcing is enabled. [1:Ngrids].
+
+ 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
+
+! Time-Stepping parameters.
+
+ NTIMES == 192
+ DT == 1800.0d0
+ NDTFAST == 72
+
+! Number of timesteps for computing observation impacts during the
+! analysis-forecast cycle.
+
+ NTIMES_ANA == 192 ! analysis interval
+ NTIMES_FCT == 192 ! forecast interval
+
+! Model iteration loops parameters.
+
+ ERstr = 1
+ ERend = 1
+ Nouter = 1
+! Nouter = 2
+! Ninner = 25 ! CONGRAD and MINRES cases
+ Ninner = 26 ! RPCG case
+ Nsaddle = 1
+ Nintervals = 1
+
+! 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 (see documentation below).
+
+ NEV = 2 ! Number of eigenvalues
+ NCV = 10 ! Number of eigenvectors
+
+! Input/Output parameters.
+
+ NRREC == 0
+ LcycleRST == T
+ NRST == 192
+ NSTA == 1
+ NFLT == 1
+ NINFO == 1
+
+! Output history, quicksave, average, and diagnostic files parameters.
+
+ LDEFOUT == T
+ NHIS == 4 ! every 2-hours
+! NHIS == 48 ! daily
+ NDEFHIS == 0
+ NXTR == 4 ! every 2-hours
+ NDEFXTR == 0
+ NQCK == 4
+ NDEFQCK == 0
+ NTSAVG == 1
+ NAVG == 12
+ NDEFAVG == 0
+ NTSDIA == 1
+ NDIA == 12
+ NDEFDIA == 0
+
+! Output tangent linear and adjoint models parameters.
+
+ LcycleTLM == F
+ NTLM == 48 ! daily
+ NDEFTLM == 0
+ LcycleADJ == T
+ NADJ == 192 ! Strong constraint
+! NADJ == 48 ! Weak constraint (daily)
+ NDEFADJ == 0
+ NSFF == 48 ! daily
+ NOBC == 48 ! daily
+
+! GST output and check pointing restart parameters.
+
+ LmultiGST = F ! one eigenvector per file
+ LrstGST = F ! GST restart switch
+ MaxIterGST = 500 ! maximum number of iterations
+ NGST = 10 ! check pointing interval
+
+! Relative accuracy of the Ritz values computed in the GST analysis.
+
+ Ritz_tol = 1.0d-15
+
+! Harmonic/biharmonic horizontal diffusion of tracer for nonlinear model
+! and adjoint-based algorithms: [1:NAT+NPT,Ngrids].
+
+ TNU2 == 4.0d0 4.0d0 ! m2/s
+ TNU4 == 0.0d0 0.0d0 ! m4/s
+
+ ad_TNU2 == 4.0d0 4.0d0 ! m2/s
+ ad_TNU4 == 0.0d0 0.0d0 ! m4/s
+
+! Harmonic/biharmonic, horizontal viscosity coefficient for nonlinear model
+! and adjoint-based algorithms: [Ngrids].
+
+ VISC2 == 4.0d0 ! m2/s
+ VISC4 == 0.0d0 ! m4/s
+
+ ad_VISC2 == 4.0d0 ! m2/s
+ ad_VISC4 == 0.0d0 ! m4/s
+
+! 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.
+
+ LuvSponge == T ! horizontal momentum
+LtracerSponge == T T ! temperature, salinity, inert
+
+! Vertical mixing coefficients for tracers in nonlinear model and
+! basic state scale factor in adjoint-based algorithms: [1:NAT+NPT,Ngrids]
+
+ AKT_BAK == 1.0d-5 1.0d-5 ! m2/s
+
+ ad_AKT_fac == 1.0d0 1.0d0 ! nondimensional
+
+! Vertical mixing coefficient for momentum for nonlinear model and
+! basic state scale factor in adjoint-based algorithms: [Ngrids].
+
+ AKV_BAK == 1.0d-5 ! m2/s
+
+ ad_AKV_fac == 1.0d0 ! nondimensional
+
+! 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.
+
+ AKT_LIMIT == 1.0d-3 1.0d-3 ! m2/s
+
+ AKV_LIMIT == 1.0d-3 ! m2/s
+
+! Turbulent closure parameters.
+
+ AKK_BAK == 5.0d-6 ! m2/s
+ AKP_BAK == 5.0d-6 ! m2/s
+ TKENU2 == 0.0d0 ! m2/s
+ TKENU4 == 0.0d0 ! m4/s
+
+! Generic length-scale turbulence closure parameters.
+
+ GLS_P == -1.0d0 ! K-omega
+ GLS_M == 0.5d0
+ GLS_N == -1.0d0
+ GLS_Kmin == 7.6d-6
+ GLS_Pmin == 1.0d-12
+
+ GLS_CMU0 == 0.5477d0
+ GLS_C1 == 0.555d0
+ GLS_C2 == 0.833d0
+ GLS_C3M == -0.6d0
+ GLS_C3P == 1.0d0
+ GLS_SIGK == 2.0d0
+ GLS_SIGP == 2.0d0
+
+! Constants used in surface turbulent kinetic energy flux computation.
+
+ CHARNOK_ALPHA == 1400.0d0 ! Charnock 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
+
+! Waves Effect on Current wave dissipation action scale:
+!
+! [0.0] All wave dissipation goes to breaking and none to roller
+! [1.0] All wave dissipation goes to roller and none to breaking
+
+ WEC_ALPHA == 0.0d0
+
+! Constants used in momentum stress computation.
+
+ RDRG == 3.0d-04 ! m/s
+ RDRG2 == 2.5d-03 ! nondimensional
+ Zob == 0.02d0 ! m
+ Zos == 0.02d0 ! m
+
+! Height (m) of atmospheric measurements for Bulk fluxes parameterization.
+
+ BLK_ZQ == 10.0d0 ! air humidity
+ BLK_ZT == 2.0d0 ! air temperature
+ BLK_ZW == 10.0d0 ! winds
+
+! Minimum depth for wetting and drying.
+
+ DCRIT == 0.10d0 ! m
+
+! Various parameters.
+
+ WTYPE == 1
+ LEVSFRC == 30
+ LEVBFRC == 1
+
+! Set vertical, terrain-following coordinates transformation equation and
+! stretching function (see below for details), [1:Ngrids].
+
+ Vtransform == 1 ! transformation equation
+ Vstretching == 1 ! stretching function
+
+! Vertical S-coordinates parameters (see below for details), [1:Ngrids].
+
+ THETA_S == 5.0d0 ! surface stretching parameter
+ THETA_B == 0.4d0 ! bottom stretching parameter
+ TCLINE == 10.0d0 ! critical depth (m)
+
+! Mean Density and Brunt-Vaisala frequency.
+
+ RHO0 = 1025.0d0 ! kg/m3
+ BVF_BAK = 1.0d-5 ! 1/s2
+
+! If tide generating forces, set switch (T/F) to apply a 18.6-year lunar
+! nodal correction to equilibrium tide constituents.
+
+ Lnodal = T
+
+! Time-stamp assigned for model initialization, reference time
+! origin for tidal forcing, and model reference time for output
+! NetCDF units attribute.
+
+ DSTART = 13008.0d0 ! days
+ TIDE_START = 0.0d0 ! days
+ TIME_REF = -2.0d0 ! yyyymmdd.dd
+
+! Nudging/relaxation time scales, inverse scales will be computed
+! internally, [1:Ngrids].
+
+ TNUDG == 360.0d0 360.0d0 ! days
+ ZNUDG == 360.0d0 ! days
+ M2NUDG == 360.0d0 ! days
+ M3NUDG == 360.0d0 ! days
+
+! Factor between passive (outflow) and active (inflow) open boundary
+! conditions, [1:Ngrids]. If OBCFAC > 1, nudging on inflow is stronger
+! than on outflow (recommended).
+
+ OBCFAC == 360.0d0 ! nondimensional
+
+! Linear equation of State parameters:
+
+ R0 == 1028.0d0 ! kg/m3
+ T0 == 5.0d0 ! Celsius
+ S0 == 35.0d0 ! nondimensional
+ TCOEF == 1.0d-4 ! 1/Celsius
+ SCOEF == 7.6d-4 ! nondimensional
+
+! 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 transport) and mass point
+! Sources/Sinks (like volume vertical influx), [1:Ngrids].
+
+ LuvSrc == F ! horizontal momentum transport
+ LwSrc == F ! volume vertical influx
+
+! 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]. See glossary below for details.
+
+ LtracerSrc == F F ! temperature, salinity, inert
+
+! Logical switches (TRUE/FALSE) to read and process climatology fields.
+! See glossary below for details.
+
+ 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. See glossary below for details.
+
+ LnudgeM2CLM == F ! 2D momentum
+ LnudgeM3CLM == F ! 3D momentum
+
+ LnudgeTCLM == F F ! temperature, salinity, inert
+
+! 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.
+
+ DstrS == 0.0d0 ! starting day
+ DendS == 0.0d0 ! ending day
+
+! Starting and ending vertical levels of the 3D adjoint state variables
+! whose sensitivity is required.
+
+ KstrS == 1 ! starting level
+ KendS == 30 ! ending level
+
+! 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
+
+Lstate(isTvar) == F F ! NT tracers
+
+! Logical switches (TRUE/FALSE) to specify the state variables for
+! which Forcing Singular Vectors or Stochastic Optimals is required.
+
+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
+
+SO_sdev(isUstr) == 1.0d0 ! surface U-stress
+SO_sdev(isVstr) == 1.0d0 ! surface V-stress
+SO_sdev(isTsur) == 1.0d0 1.0d0 ! NT surface tracers flux
+
+! 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(idOvil) == F ! omega_implicit omega implicit 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) == F ! 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) == T ! sustr surface U-stress
+Hout(idVsms) == T ! 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(idUVwc) == F ! bstrcwmax bottom max wave-current stress magnitude
+
+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(idWztw) == F ! zetaw WEC_VF quasi-static sea level adjustment
+Hout(idWqsp) == F ! qsp WEC_VF quasi-static pressure adjustment
+Hout(idWbeh) == F ! bernoulli_head WEC_VF Bernoulli head adjustment
+
+Hout(idU2rs) == F ! ubar_wec_stress WEC 2D U-stress
+Hout(idV2rs) == F ! vbar_wec_stress WEC 2D V-stress
+Hout(idU3rs) == F ! u_wec_stress WEC 3D U-stress
+Hout(idV3rs) == F ! v_wec_stress WEC 3D V-stress
+
+Hout(idU2Sd) == F ! ubar_stokes 2D Stokes U-velocity
+Hout(idV2Sd) == F ! vbar_stokes 2D Stokes V-velocity
+Hout(idU3Sd) == F ! u_stokes 3D Stokes U-velocity
+Hout(idV3Sd) == F ! v_stokes 3D Stokes V-velocity
+Hout(idW3St) == F ! w_stokes 3D Stokes W-velocity
+Hout(idW3Sd) == F ! omega_stokes 3D Stokes omega-velocity
+
+Hout(idWamp) == F ! Hwave wave significat height
+Hout(idWlen) == F ! Lwave wave mean wavelength
+Hout(idWlep) == F ! Lwavep wave peak wavelength
+Hout(idWdir) == F ! Dwave wave mean direction
+Hout(idWdip) == F ! Dwavep wave peak direction
+Hout(idWptp) == F ! Pwave_top wave surface period
+Hout(idWpbt) == F ! Pwave_bot wave bottom period
+Hout(idWorb) == F ! Uwave_rms wave bottom orbital velocity
+Hout(idWbrk) == F ! Wave_break wave breaking (percent)
+Hout(idUwav) == F ! uWave wave depth-averaged U-velocity
+Hout(idVwav) == F ! vWave wave depth-averaged V-velocity
+Hout(idWdif) == F ! Dissip_fric wave dissipation from bottom friction
+Hout(idWdib) == F ! Dissip_break wave dissipation from breaking
+Hout(idWdiw) == F ! Dissip_wcap wave dissipation from whitecapping
+Hout(idWdis) == F ! Dissip_roller wave roller dissipation
+Hout(idWrol) == F ! roller_action wave roller action density
+
+Hout(idPair) == T ! Pair surface air pressure
+Hout(idTair) == T ! Tair surface air temperature
+Hout(idUair) == T ! Uwind surface U-wind
+Hout(idVair) == T ! Vwind surface V-wind
+Hout(idUaiE) == F ! Uwind_eastward surface Eastward U-wind
+Hout(idVaiN) == F ! Vwind_northward surface Northward V-wind
+
+Hout(idTsur) == T T ! shflux, ssflux surface net heat and salt flux
+Hout(idLhea) == T ! latent latent heat flux
+Hout(idShea) == T ! sensible sensible heat flux
+Hout(idLrad) == T ! lwrad longwave radiation flux
+Hout(idSrad) == T ! swrad shortwave radiation flux
+Hout(idEmPf) == T ! EminusP E-P flux
+Hout(idevap) == T ! evaporation evaporation rate
+Hout(idrain) == T ! rain precipitation rate
+
+Hout(idDano) == F ! rho density anomaly
+Hout(idVvis) == T ! AKv vertical viscosity
+Hout(idTdif) == T ! AKt vertical T-diffusion
+Hout(idSdif) == T ! 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 into the HISTORY
+! 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. NPT values are expected. However, these
+! switches can be activated using compact parameter specification.
+
+ Hout(inert) == T ! dye_01, ... inert passive tracers
+
+! 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) == F ! ubar 2D U-velocity
+Qout(idVbar) == F ! vbar 2D V-velocity
+Qout(idu2dE) == F ! ubar_eastward 2D U-eastward at RHO-points
+Qout(idv2dN) == F ! vbar_northward 2D V-northward at RHO-points
+Qout(idFsur) == T ! zeta free-surface
+Qout(idBath) == F ! 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) == T ! sustr surface U-stress
+Qout(idVsms) == T ! 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(idUVwc) == F ! bstrcwmax bottom max wave-current stress magnitude
+
+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(idWztw) == F ! zetaw WEC_VF quasi-static sea level adjustment
+Qout(idWqsp) == F ! qsp WEC_VF quasi-static pressure adjustment
+Qout(idWbeh) == F ! bernoulli_head WEC_VF Bernoulli head adjustment
+
+Qout(idU2rs) == F ! ubar_wec_stress WEC 2D U-stress
+Qout(idV2rs) == F ! vbar_wec_stress WEC 2D V-stress
+Qout(idU3rs) == F ! u_wec_stress WEC 3D U-stress
+Qout(idV3rs) == F ! v_wec_stress WEC 3D V-stress
+
+Qout(idU2Sd) == F ! ubar_stokes 2D Stokes U-velocity
+Qout(idV2Sd) == F ! vbar_stokes 2D Stokes V-velocity
+Qout(idU3Sd) == F ! u_stokes 3D Stokes U-velocity
+Qout(idV3Sd) == F ! v_stokes 3D Stokes V-velocity
+Qout(idW3St) == F ! w_stokes 3D Stokes W-velocity
+Qout(idW3Sd) == F ! omega_stokes 3D Stokes omega-velocity
+
+Qout(idWamp) == F ! Hwave wave significant height
+Qout(idWlen) == F ! Lwave wave mean wavelength
+Qout(idWlep) == F ! Lwavep wave peak wavelength
+Qout(idWdir) == F ! Dwave wave mean direction
+Qout(idWdip) == F ! Dwavep wave peak direction
+Qout(idWptp) == F ! Pwave_top wave surface period
+Qout(idWpbt) == F ! Pwave_bot wave bottom period
+Qout(idWorb) == F ! Uwave_rms wave bottom orbital velocity
+Qout(idWbrk) == F ! Wave_break wave breaking (percent)
+Qout(idUwav) == F ! uWave wave depth-averaged U-velocity
+Qout(idVwav) == F ! vWave wave depth-averaged V-velocity
+Qout(idWdif) == F ! Dissip_fric wave dissipation from bottom friction
+Qout(idWdib) == F ! Dissip_break wave dissipation from breaking
+Qout(idWdiw) == F ! Dissip_wcap wave dissipation from whitecapping
+Qout(idWdis) == F ! Dissip_roller wave roller dissipation
+Qout(idWrol) == F ! roller_action wave roller action density
+
+Qout(idPair) == T ! Pair surface air pressure
+Qout(idTair) == T ! Tair surface air temperature
+Qout(idUair) == T ! Uair surface U-wind
+Qout(idVair) == T ! Vair surface V-wind
+Qout(idUaiE) == F ! Uwind_eastward surface Eastward U-wind
+Qout(idVaiN) == F ! Vwind_northward surface Northward V-wind
+
+Qout(idTsur) == T T ! shflux, ssflux surface net heat and salt flux
+Qout(idLhea) == T ! latent latent heat flux
+Qout(idShea) == T ! sensible sensible heat flux
+Qout(idLrad) == T ! lwrad longwave radiation flux
+Qout(idSrad) == T ! swrad shortwave radiation flux
+Qout(idEmPf) == T ! EminusP E-P flux
+Qout(idevap) == T ! evaporation evaporation rate
+Qout(idrain) == T ! 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. 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_sur, ... surface inert passive tracers
+
+! Logical switches (TRUE/FALSE) to activate writing of time-averaged
+! fields into AVERAGE output file.
+
+Aout(idUvel) == T ! u 3D U-velocity
+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) == F ! 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(idBath) == F ! bath time-dependent bathymetry
+
+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(idUbrs) == F ! bustrc bottom U-current stress
+Aout(idVbrs) == F ! bvstrc bottom V-current stress
+Aout(idUbws) == F ! bustrw bottom U-wave stress
+Aout(idVbws) == F ! bvstrw bottom V-wave stress
+Aout(idUbcs) == F ! bustrcwmax bottom max wave-current U-stress
+Aout(idVbcs) == F ! bvstrcwmax bottom max wave-current V-stress
+Aout(idUVwc) == F ! bstrcwmax bottom max wave-current stress magnitude
+
+Aout(idUbot) == F ! Ubot bed wave orbital U-velocity
+Aout(idVbot) == F ! Vbot bed wave orbital V-velocity
+Aout(idUbur) == F ! Ur bottom U-velocity above bed
+Aout(idVbvr) == F ! Vr bottom V-velocity above bed
+
+Aout(idWztw) == F ! zetaw WEC_VF quasi-static sea level adjustment
+Aout(idWqsp) == F ! qsp WEC_VF quasi-static pressure adjustment
+Aout(idWbeh) == F ! bernoulli_head WEC_VF Bernoulli head adjustment
+
+Aout(idU2rs) == F ! ubar_wec_stress WEC 2D U-stress
+Aout(idV2rs) == F ! vbar_wec_stress WEC 2D V-stress
+Aout(idU3rs) == F ! u_wec_stress WEC 3D U-stress
+Aout(idV3rs) == F ! v_wec_stress WEC 3D V-stress
+
+Aout(idU2Sd) == F ! ubar_stokes 2D Stokes U-velocity
+Aout(idV2Sd) == F ! vbar_stokes 2D Stokes V-velocity
+Aout(idU3Sd) == F ! u_stokes 3D Stokes U-velocity
+Aout(idV3Sd) == F ! v_stokes 3D Stokes V-velocity
+Aout(idW3St) == F ! w_stokes 3D Stokes W-velocity
+Aout(idW3Sd) == F ! omega_stokes 3D Stokes omega-velocity
+
+Aout(idWamp) == F ! Hwave wave significant height
+Aout(idWlen) == F ! Lwave wave mean wavelength
+Aout(idWlep) == F ! Lwavep wave peak wavelength
+Aout(idWdir) == F ! Dwave wave mean direction
+Aout(idWptp) == F ! Pwave_top wave surface period
+Aout(idWpbt) == F ! Pwave_bot wave bottom period
+Aout(idWorb) == F ! Uwave_rms wave bottom orbital velocity
+Aout(idWbrk) == F ! Wave_break wave breaking (percent)
+Aout(idUwav) == F ! uWave wave-depth averaged U-velocity
+Aout(idVwav) == F ! vWave wave-depth averaged V-velocity
+Aout(idWdif) == F ! Dissip_fric wave dissipation from bottom friction
+Aout(idWdib) == F ! Dissip_break wave dissipation from breaking
+Aout(idWdiw) == F ! Dissip_wcap wave dissipation from whitecapping
+Aout(idWdis) == F ! Dissip_roller wave roller dissipation
+Aout(idWrol) == F ! roller_action wave roller action density
+
+Aout(idPair) == F ! Pair surface air pressure
+Aout(idTair) == F ! Tair surface air temperature
+Aout(idUair) == F ! Uwind surface U-wind
+Aout(idVair) == F ! Vwind surface V-wind
+Aout(idUaiE) == F ! Uwind_eastward surface Eastward U-wind
+Aout(idVaiN) == F ! Vwind_northward surface Northward V-wind
+
+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) == T ! 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(idv2dD) == 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) == T ! Huon u-volume flux, Huon
+Aout(idHVav) == T ! Hvom v-volume flux, Hvom
+Aout(idUUav) == T ! uu quadratic term
+Aout(idUVav) == T ! uv quadratic term
+Aout(idVVav) == T ! vv quadratic term
+Aout(idU2av) == T ! ubar2 quadratic term
+Aout(idV2av) == T ! vbar2 quadratic term
+Aout(idZZav) == T ! zeta2 quadratic term
+
+Aout(idTTav) == T T ! temp_2, ... quadratic tracer terms
+Aout(idUTav) == T T ! u_temp, ... quadratic tracer terms
+Aout(idVTav) == T T ! v_temp, ... quadratic tracer terms
+Aout(iHUTav) == T T ! Huon_temp, ... tracer volume flux,
+Aout(iHVTav) == T T ! Hvom_temp, ... tracer volume flux,
+
+! Logical switches (TRUE/FALSE) to activate writing of extra inert passive
+! tracers other than biological and sediment tracers into the AVERAGE file.
+
+ Aout(inert) == T ! dye_01, ... inert passive tracers
+
+! Logical switches (TRUE/FALSE) to activate writing of time-averaged,
+! 2D momentum (ubar,vbar) diagnostic terms into DIAGNOSTIC 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(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 DIAGNOSTIC 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,
+! Waves Effect on Currents (WEC) 2D and 3D diagnostic terms into DIAGNOSTIC
+! output file.
+
+Dout(M2hjvf) == T ! ubar_hjvf, ... 2D horizontal J vortex force
+Dout(M2kvrf) == T ! ubar_kvrf, ... 2D K vortex force
+Dout(M2fsco) == T ! ubar_fsco, ... 2D Stokes Coriolis
+Dout(M2sstm) == T ! ubar_sstm, ... 2D surface streaming
+Dout(M2bstm) == T ! ubar_bstm, ... 2D bottom streaming
+Dout(M2wrol) == T ! ubar_wrol, ... 2D wave roller acceleration
+Dout(M2wbrk) == T ! ubar_wbrk, ... 2D wave breaking
+Dout(M2zeta) == T ! ubar_zeta, ... 2D Eulerian SSH adjustment
+Dout(M2zetw) == T ! ubar_zetaw, ... 2D quasi-static SSH adjustment
+Dout(M2zqsp) == T ! ubar_zqsp, ... 2D quasi-static pressure
+Dout(M2zbeh) == T ! ubar_zbeh, ... 2D Bernoulli head adjustment
+Dout(M2fsgr) == T ! ubar_fsgr, ... 2D seagrass drag force
+
+Dout(M3hjvf) == T ! u_hjvf, ... 3D horizontal J vortex force
+Dout(M3vjvf) == T ! u_vjvf, ... 3D vertical J vortex force
+Dout(M3kvrf) == T ! u_kvrf, ... 3D K vortex force
+Dout(M3fsco) == T ! u_fsco, ... 3D Stokes Coriolis
+Dout(M3sstm) == T ! u_sstm, ... 3D surface streaming
+Dout(M3bstm) == T ! u_bstm, ... 3D bottom streaming
+Dout(M3wrol) == T ! u_wrol, ... 3D wave roller acceleration
+Dout(M3wbrk) == T ! u_wbrk, ... 3D wave breaking
+Dout(M3fsgr) == T ! u_fsgr, ... 3D seagrass drag force
+
+! Logical switches (TRUE/FALSE) to activate writing of time-averaged,
+! active (temperature and salinity) and passive (inert) tracer diagnostic
+! terms into DIAGNOSTIC output file: [1:NAT+NPT,Ngrids].
+
+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, [1:NUSER].
+
+ NUSER = 1
+ USER = 5.d0 ! sponge parameter
+
+! Input and Output files processing library to use:
+!
+! [1] Standard NetCDF-3 or NetCDF-4 library
+! [2] Serial or Parallel I/O with Parallel-IO (PIO) library (MPI only)
+
+ INP_LIB = 1
+ OUT_LIB = 1
+
+! PIO library methods for reading/writing NetCDF files:
+!
+! [0] parallel read and write of PnetCDF (CDF-5, not recommended)
+! [1] parallel read and write of NetCDF3 (64-bit offset)
+! [2] serial read and write of NetCDF3 (64-bit offset)
+! [3] parallel read and serial write of NetCDF4/HDF5
+! [4] parallel read and write of NETCDF4/HDF5
+
+ PIO_METHOD = 1
+
+! PIO library MPI processes set-up:
+
+ PIO_IOTASKS = 1 ! number of I/O tasks to define
+ PIO_STRIDE = 1 ! stride in the MPI-rank between I/O tasks
+ PIO_BASE = 0 ! offset for the first I/O task
+ PIO_AGGREG = 1 ! number of MPI-aggregators to use
+
+! PIO library rearranger methods for moving data between computational and I/O
+! processes:
+!
+! [1] Box rearrangement
+! [2] Subset rearrangement
+
+ PIO_REARR = 1
+
+! PIO library rearranger flag for MPI communications between computational
+! and I/O processes:
+!
+! [0] Point-to-Point (low-level communications)
+! [1] Collective (high-level grouped communications)
+
+PIO_REARRCOM = 0
+
+! PIO library rearranger flow control direction flag for MPI communications
+! between computational and I/O processes:
+!
+! [0] Enable computational to I/O processes, and vice versa
+! [2] Enable computational to I/O processes only
+! [3] Enable I/O to computational processes only
+! [4] Disable flow control
+
+PIO_REARRDIR = 0
+
+! PIO rearranger options for computational to I/O processes (C2I):
+
+ PIO_C2I_HS = T ! Enable C2I handshake (T/F)
+PIO_C2I_Send = T ! Enable C2I Isends (T/F)
+PIO_C2I_Preq = 64 ! Maximum pending C2I requests
+
+! PIO rearranger options for I/O to computational processes (I2C):
+
+ PIO_I2C_HS = T ! Enable I2C handshake (T/F)
+PIO_I2C_Send = T ! Enable I2C Isends (T/F)
+PIO_I2C_Preq = 65 ! Maximum pending I2C requests
+
+! If OUT_LIB=1, NetCDF-4/HDF5 compression parameters for output files.
+
+ 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 grid extraction flag and input extraction grid geometry
+! NetCDF filename. They are used to extract a history solution at
+! the desired geometry by decimation or horizontal interpolation:
+!
+! ExtractFlag = 0 no extraction
+! ExtractFlag = 1 horizontal interpolation
+! ExtractFlag > 1 coarsening by decimation
+!
+! If decimation, ExtracTFlag is the sampling factor. For now, use
+! ExtractFlag=2 so data is written at every other point. Notice
+! that it is required to satisfy the following criteria:
+!
+! MOD(Lm+1, ExtractFlag) = 0
+! MOD(Mm+1, ExtractFlag) = 0
+
+ ExtractFlag == 0
+
+ GRXNAME == wc13_extract_grd.nc
+
+! Input NetCDF file names, [1:Ngrids].
+
+ GRDNAME == ../Data/wc13_grd.nc
+ ININAME == wc13_roms_ini_20040103.nc
+ ITLNAME == wc13_itl_20040103.nc
+ IRPNAME == wc13_irp_20040103.nc
+ IADNAME == wc13_iad_20040103.nc
+ FWDNAME == wc13_fwd_20040103.nc
+ ADSNAME == wc13_ads_20040103.nc
+
+! 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.
+
+ FOInameA == wc13_foi_a.nc
+ FOInameB == wc13_foi_b.nc
+
+! 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).
+
+ FCTnameA == wc13_fct_a.nc
+ FCTnameB == wc13_fct_b.nc
+
+! 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 = wc13_ngc.nc
+
+! Input lateral boundary conditions file names. The USER has the option
+! to separate the required lateral boundary variables into individual
+! NetCDF files (NBCFILES > 1), as in the input surface forcing. Also,
+! the USER may split input data time records into several NetCDF files
+! (monthly, seasonal, or annual). See prologue instructions above. Use
+! a single line per entry with a continuation (\) or a vertical bar (|)
+! symbol after each entry, except the last one.
+
+ NBCFILES == 1 ! number of boundary files
+
+ BRYNAME == ../Data/wc13_ecco_bry.nc
+
+! Input climatology file names. The USER has the option to separate the
+! climatology variables into individual NetCDF files (NCLMFILES > 1),
+! as in the input surface forcing. Also, the USER may split input data
+! time records into several NetCDF files (monthly, seasonal, or annual).
+! See prologue instructions above. Use a single line per entry with a
+! continuation (\) or a vertical bar (|) symbol after each entry, except
+! the last one.
+
+ NCLMFILES == 1 ! number of climatology files
+
+ CLMNAME == wc13_clm.nc
+
+! Input climatology nudging coefficients file name.
+
+ NUDNAME == wc13_nud.nc
+
+! Input Sources/Sinks forcing (like river runoff) file name.
+
+ SSFNAME == wc13_rivers.nc
+
+! Input tidal forcing file name.
+
+ TIDENAME == wc13_tides.nc
+
+! Input forcing NetCDF file name(s).
+!
+! The USER has the option to enter several sets of file names for each
+! nested grid. For example, the USER may have different data for the
+! wind products, heat fluxes, etc. Alternatively, if the all the forcing
+! files are the same for nesting and the data is in its native resolution,
+! we could enter only one set of files names and ROMS will replicate those
+! files internally to the remaining grids using the plural KEYWORD protocol.
+!
+! The model will scan the files and will read the needed data from the first
+! file in the list containing the forcing field. Therefore, the order of the
+! filenames is critical. If using multiple forcing files per grid, first
+! enter all the file names for grid one followed by two, and so on. It is
+! also possible to split input data time records into several NetCDF files
+! (see Prolog instructions above). Use a single line per entry with a
+! continuation (\) or a vertical bar (|) symbol after each entry, except
+! the last one.
+
+ NFFILES == 7 ! number of unique forcing files
+
+ FRCNAME == ../Data/coamps_wc13_lwrad_down.nc \
+ ../Data/coamps_wc13_Pair.nc \
+ ../Data/coamps_wc13_Qair.nc \
+ ../Data/coamps_wc13_rain.nc \
+ ../Data/coamps_wc13_swrad.nc \
+ ../Data/coamps_wc13_Tair.nc \
+ ../Data/coamps_wc13_wind.nc
+
+! Output NetCDF file names, [1:Ngrids].
+
+ DAINAME == wc13_roms_dai_20040103.nc
+ GSTNAME == wc13_roms_gst_20040103.nc
+ RSTNAME == wc13_roms_rst_20040103.nc
+ HISNAME == wc13_roms_his_20040103.nc
+ XTRNAME == wc13_roms_xtr_20040103.nc
+ QCKNAME == wc13_roms_qck_20040103.nc
+ TLMNAME == wc13_roms_tlm_20040103.nc
+ TLFNAME == wc13_roms_tlf_20040103.nc
+ ADJNAME == wc13_roms_adj_20040103.nc
+ AVGNAME == wc13_roms_avg_20040103.nc
+ HARNAME == wc13_roms_har_20040103.nc
+ DIANAME == wc13_roms_dia_20040103.nc
+ STANAME == wc13_roms_sta_20040103.nc
+ FLTNAME == wc13_roms_flt_20040103.nc
+
+! Input ASCII parameter filenames.
+
+ APARNAM = rbl4dvar.in
+ SPOSNAM = stations.in
+ FPOSNAM = floats.in
+ BPARNAM = bioFasham.in
+ SPARNAM = sediment.in
+ USRNAME = MyFile.dat
+
+!
+! GLOSSARY:
+! =========
+!
+!------------------------------------------------------------------------------
+! Application title (string with a maximum of 80 characters) and
+! C-preprocessing flag.
+!------------------------------------------------------------------------------
+!
+! TITLE Application title.
+!
+! MyAppCPP Application C-preprocessing option.
+!
+!------------------------------------------------------------------------------
+! Variable information filename (string with a maximum of 256 characters).
+!------------------------------------------------------------------------------
+!
+! VARNAME Input/Output variable information filename. This file needs to
+! be processed first so all information arrays and indices can
+! be initialized properly in "mod_ncparam.F".
+!
+!------------------------------------------------------------------------------
+! Nested grid parameters (processing order of these parameters is important).
+!------------------------------------------------------------------------------
+!
+! Ngrids Number of nested grids. It needs to be read before all other
+! parameters in order to allocate all model variables.
+!
+! NestLayers Number of grid nesting layers. It is used to allow applications
+! with both composite and refinement grid combinations, as shown
+! in WikiROMS diagrams for the Refinement and Partial Boundary
+! Composite Sub-Classes. See,
+!
+! https://www.myroms.org/wiki/index.php/Nested_Grids
+!
+! In non-nesting applications, set NestLayers = 1.
+!
+! GridsInLayer Number of grids in each nested layer, a vector of size
+! [1:NestLayers]. Notice that,
+!
+! SUM(GridsInLayer) = Ngrids
+! LENGHT(GridsInLayer) = NestLayers
+!
+! The order of grids and nesting layers is extremely important.
+! It determines the order of the sequential solution at every
+! sub-timestep. See WikiROMS nesting Sub-Classes diagrams.
+!
+! In non-nesting applications, set GridsInLayer = 1.
+!
+! NOTE: In main3d, we use these parameters to determine which
+! ==== grid index, ng, to solve when calling the routines of
+! the computational kernel:
+!
+! NEST_LAYER : DO nl=1,NestLayers
+! ...
+! STEP_LOOP : DO istep=1,Nsteps
+! ...
+! DO ig=1,GridsInLayer(nl)
+! ng=GridNumber(ig,nl)
+! ...
+! END DO
+! ...
+! END DO STEP_LOOP
+! END DO NEST_LAYER
+!
+! Here, the grid order "ng" for the computations is determined
+! from array "GridNumber", which is computed at initialization
+! in "read_phypar.F". It can be computed on the fly as:
+!
+! ng=Ngrids+1
+! DO j=NestLayers,nl,-1
+! DO i=GridsInLayer(j),1,-1
+! ng=ng-1
+! IF ((j.eq.nl).and.(i.eq.ig)) EXIT
+! END DO
+! END DO
+!
+! but it is too inefficient. This information is provided here
+! to help you configure the order of nested grids.
+!
+!------------------------------------------------------------------------------
+! Grid dimension parameters.
+!------------------------------------------------------------------------------
+!
+! These parameters are very important since they determine the grid of the
+! application to solve. They need to be read first in order to dynamically
+! allocate all model variables.
+!
+! WARNING: It is trivial and possible to change these dimension parameters in
+! ------- idealized applications via analytical expressions. However, in
+! realistic applications any change to these parameters requires redoing all
+! input NetCDF files.
+!
+! Lm Number of INTERIOR grid RHO-points in the XI-direction for
+! each nested grid, [1:Ngrids]. If using NetCDF files as
+! input, Lm=xi_rho-2 where "xi_rho" is the NetCDF file
+! dimension of RHO-points. Recall that all RHO-point
+! variables have a computational I-range of [0:Lm+1].
+!
+! Mm Number of INTERIOR grid RHO-points in the ETA-direction for
+! each nested grid, [1:Ngrids]. If using NetCDF files as
+! input, Mm=eta_rho-2 where "eta_rho" is the NetCDF file
+! dimension of RHO-points. Recall that all RHO-point
+! variables have a computational J-range of [0:Mm+1].
+!
+! N Number of vertical terrain-following levels at RHO-points,
+! [1:Ngrids].
+!
+! Nbed Number of sediment bed layers, [1:Ngrids]. This parameter
+! is only relevant if CPP option SEDIMENT is activated.
+!
+! Mm+1 ___________________ _______ Kw = N
+! | | | |
+! Mm | _____________ | | | Kr = N
+! | | | | |_______|
+! | | | | | |
+! Jr | | | | | |
+! | | | | |_______|
+! | | | | | |
+! 1 | |_____________| | | |
+! | | |_______|
+! 0 |___________________| | |
+! Ir | | 1
+! 0 1 Lm Lm+1 h(i,j) |_______|
+! ::::::::: 0
+! :::::::::
+! ::::::::: Nbed-1
+! ::::::::: Nbed
+!
+! NAT Number of active tracer type variables. Usually, NAT=2 for
+! potential temperature and salinity.
+!
+! NPT Number of inert (dyes, age, etc) passive tracer type variables
+! to advect and diffuse only. This parameter is only relevant
+! if CPP option T_PASSIVE is activated.
+!
+! NCS Number of cohesive (mud) sediment tracer type variables. This
+! parameter is only relevant if CPP option SEDIMENT is
+! activated.
+!
+! NNS Number of non-cohesive (sand) sediment tracer type variables.
+! This parameter is only relevant if CPP option SEDIMENT is
+! activated.
+!
+! The total number of sediment tracers is NST=NCS+NNS. Notice
+! that NST must be greater than zero (NST>0).
+!
+!------------------------------------------------------------------------------
+! Domain tile partition parameters.
+!------------------------------------------------------------------------------
+!
+! Model tile decomposition parameters for serial and parallel configurations
+! which are used to determine tile horizontal range indices (Istr,Iend and
+! Jstr,Jend). In some computers, it is advantageous to have tile partitions
+! in serial applications.
+!
+! NtileI Number of domain partitions in the I-direction (XI-coordinate).
+! It must be equal to or greater than one.
+!
+! NtileJ Number of domain partitions in the J-direction (ETA-coordinate).
+! It must be equal to or greater than one.
+!
+! WARNING: In shared-memory (OpenMP), the product of NtileI and NtileJ must
+! be a MULTIPLE of the number of parallel threads specified with
+! the OpenMP environmental variable OMP_NUM_THREADS.
+!
+! In distributed-memory (MPI), the product of NtileI and NtileJ
+! must be EQUAL to the number of parallel nodes specified during
+! execution with the "mprun" or "mpirun" command.
+!
+!------------------------------------------------------------------------------
+! Tracer advection scheme
+!------------------------------------------------------------------------------
+!
+! 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 (Margolin and
+! Smolarkiewicz, 1998) options, the user needs to set the same scheme
+! for both horizontal and vertical advection to preserve monotonicity.
+!
+! Hadvection Horizontal advection for each active (temperature and
+! salinity) and inert tracers, [1:NAT+NPT,Ngrids]
+! values are expected.
+!
+! Vadvection Vertical advection for each active (temperature and
+! salinity) and inert tracers, [1:NAT+NPT,Ngrids]
+! values are expected.
+!
+! ad_Hadvection Horizontal advection for each active (temperature and
+! salinity) and inert tracers in the adjoint-based
+! algorithms, [1:NAT+NPT,Ngrids] values are expected.
+!
+! ad_Vadvection Vertical advection for each active (temperature and
+! salinity) and inert tracers in the adjoint-based
+! algorithms, [1:NAT+NPT,Ngrids] values are expected.
+!
+! Examples:
+!
+! Hadvection == A4 \ ! temperature
+! MPDATA \ ! salinity
+! HSIMT \ ! dye_01, inert(1)
+! HSIMT ! dy2_02, inert(2)
+!
+! Vadvection == A4 \ ! temperature
+! MPDATA \ ! salinity
+! HSIMT \ ! dye_01, inert(1)
+! HSIMT ! dye_02, inert(2)
+!
+! or in nested applications
+!
+! Hadvection == U3 \ ! temperature, Grid 1
+! HSIMT \ ! salinity, Grid 1
+! U3 \ ! temperature, Grid 2
+! HSIMT \ ! salinity, Grid 2
+! U3 \ ! temperature, Grid 3
+! HSIMT ! salinity, Grid 3
+!
+! Vadvection == C4 \ ! temperature, Grid 1
+! HSIMT \ ! salinity, Grid 1
+! C4 \ ! temperature, Grid 2
+! HSIMT \ ! salinity, Grid 2
+! C4 \ ! temperature, Grid 3
+! HSIMT ! salinity, Grid 3
+!
+!------------------------------------------------------------------------------
+! Lateral 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 structured array:
+!
+! LBC(1:4, nLBCvar, Ngrids)
+!
+! where 1:4 are the number of boundary edges, nLBCvar are the number of LBC
+! state variables, and Ngrids is the number of nested grids. For Example, to
+! apply gradient boundary conditions we use:
+!
+! LBC(iwest, isFsur, ng) % gradient
+! LBC(ieast, ... , ng) % gradient
+! LBC(isouth, ... , ng) % gradient
+! LBC(inorth, ... , ng) % gradient
+!
+! The lateral boundary conditions are entered with a keyword. This 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_implicit (free-surface only)
+! Che Chapman_explicit (free-surface only)
+! Cla Clamped
+! Clo Closed
+! Fla Flather (2D momentum only) _____N_____ j=Mm
+! Gra Gradient | 4 |
+! Nes Nested (refinement only) | |
+! Nud Nudging 1 W E 3
+! Per Periodic | |
+! Rad Radiation |_____S_____|
+! Red Reduced Physics (2D momentum only) 2 j=1
+! Shc Shchepetkin (2D momentum only) i=1 i=Lm
+!
+! LBC(isFsur) Free-surface, [1:4, Ngrids] values are expected.
+! LBC(isUbar) 2D U-momentum, [1:4, Ngrids] values are expected.
+! LBC(isVbar) 2D V-momentum, [1:4, Ngrids] values are expected.
+! LBC(isUvel) 3D U-momentum, [1:4, Ngrids] values are expected.
+! LBC(isVvel) 3D V-momentum, [1:4, Ngrids] values are expected.
+! LBC(isMtke) Mixing TKE, [1:4, Ngrids] values are expected.
+! LBC(isTvar) Tracers, [1:4, 1:NAT+NPT, Ngrids] values are expected.
+!
+! WEC boundary conditions for Stokes velocities:
+!
+! LBC(isU2Sd) 2D U-Stokes, [1:4, Ngrids] values are expected.
+! LBC(isV2Sd) 2D V-Stokes, [1:4, Ngrids] values are expected.
+! LBC(isU3Sd) 3D U-Stokes, [1:4, Ngrids] values are expected.
+! LBC(isV3Sd) 3D V-Stokes, [1:4, Ngrids] values are expected.
+!
+! Similarly, the adjoint-based algorithms (ADM, TLM, RPM) can have different
+! lateral boundary conditions keywords:
+!
+! ad_LBC(isFsur) Free-surface, [1:4, Ngrids] values are expected.
+! ad_LBC(isUbar) 2D U-momentum, [1:4, Ngrids] values are expected.
+! ad_LBC(isVbar) 2D V-momentum, [1:4, Ngrids] values are expected.
+! ad_LBC(isUvel) 3D U-momentum, [1:4, Ngrids] values are expected.
+! ad_LBC(isVvel) 3D V-momentum, [1:4, Ngrids] values are expected.
+! ad_LBC(isMtke) Mixing TKE, [1:4, Ngrids] values are expected.
+! ad_LBC(isTvar) Tracers, [1:4, 1:NAT+NPT, Ngrids] values are expected.
+!
+! Lateral open boundary edge volume conservation switch for nonlinear model
+! and adjoint-based algorithm. Usually activated with radiation boundary
+! conditions to enforce global mass conservation. Notice that these switches
+! should not be activated if tidal forcing is enabled, [1:Ngrids] values are
+! expected.
+!
+! VolCons(west) Western boundary volume conservation switch.
+! VolCons(east) Eastern boundary volume conservation switch.
+! VolCons(south) Southern boundary volume conservation switch.
+! VolCons(north) Northern boundary volume conservation switch.
+!
+! ad_VolCons(west) Western boundary volume conservation switch.
+! ad_VolCons(east) Eastern boundary volume conservation switch.
+! ad_VolCons(south) Southern boundary volume conservation switch.
+! ad_VolCons(north) Northern boundary volume conservation switch.
+!
+!------------------------------------------------------------------------------
+! Timestepping parameters.
+!------------------------------------------------------------------------------
+!
+! NTIMES Total number of timesteps in current run. If 3D configuration,
+! NTIMES is the total of baroclinic timesteps. If only 2D
+! configuration, NTIMES is the total of barotropic timesteps.
+!
+! DT TimeStep size in seconds. If 3D configuration, DT is the
+! size of the baroclinic timestep. If only 2D configuration,
+! DT is the size of the barotropic timestep.
+!
+! NDTFAST Number of barotropic timesteps between each baroclinic time
+! step. If only 2D configuration, NDTFAST should be unity since
+! there is no need to split timestepping.
+!
+! NTIMES_ANA Total number of timesteps for computing observations impacts
+! interval during the analysis cycle. It is only used when
+! RBL4DVAR_FCT_SENSITIVITY is activated.
+!
+! NTIMES_FCT Total number of timesteps for computing observations impacts
+! interval during the forecast cycle. It is only used when
+! RBL4DVAR_FCT_SENSITIVITY is activated.
+!
+!------------------------------------------------------------------------------
+! Model iteration loops parameters.
+!------------------------------------------------------------------------------
+!
+! ERstr Starting ensemble run (perturbation or iteration) number.
+!
+! ERend Ending ensemble run (perturbation or iteration) number.
+!
+! Nouter Maximum number of 4DVAR outer loop iterations.
+!
+! Ninner Maximum number of 4DVAR inner loop iterations.
+!
+! Nsaddle Number of kernel trajectory intervals for the solution of the
+! Saddle-Point 4D-Var (SP4DVAR). It is used to accelerate
+! 4D-Var by parallelizing the inner loops in time. The tangent
+! linear and adjoint models are time-stepped concurrently over
+! the short time integration windows. Make sure that
+!
+! MOD(NTIMES/NHIS, Nsaddle) = 0
+!
+! for legal computations.
+!
+! Nintervals Number of time interval divisions for Stochastic Optimals
+! computations. It must be a multiple of NTIMES. The tangent
+! linear model (TLM) and the adjoint model (ADM) are integrated
+! forward and backward at different intervals. For example,
+! if Nintervals=3,
+!
+! 1 NTIMES/3 2*NTIMES/3 NTIMES
+! +..................+..................+..................+
+! <========================================================> (1)
+! <=====================================> (2)
+! <==================> (3)
+!
+! In the first iteration (1), the TLM is integrated forward from
+! 1 to NTIMES and the ADM is integrated backward from NTIMES to 1.
+! In the second iteration (2), the TLM is integrated forward from
+! NTIMES/3 to NTIMES and the ADM is integrated backward from
+! NTIMES to NTIMES/3. And so on.
+!
+!------------------------------------------------------------------------------
+! Eigenproblem parameters.
+!------------------------------------------------------------------------------
+!
+! NEV Number of eigenvalues to compute for the Lanczos/Arnoldi
+! problem. Notice that the model memory requirement increases
+! substantially as NEV increases. The GST requires NEV+1
+! copies of the model state vector. The memory requirements
+! are decreased in distributed-memory applications.
+!
+! NCV Number of eigenvectors to compute for the Lanczos/Arnoldi
+! problem. NCV must be greater than NEV.
+!
+! 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 greater than or
+! equal to 2*NEV. In Finite Time Eigenmodes (FTE) and Adjoint Finite Time
+! Eigenmodes (AFTE) the requirement is to have NCV greater than or equal to
+! 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 a very long time.
+!
+!------------------------------------------------------------------------------
+! Input/Output parameters.
+!------------------------------------------------------------------------------
+!
+! NRREC Switch to indicate re-start from a previous solution. Use
+! NRREC=0 for new solutions. In a re-start solution, NRREC
+! is the time index of the re-start NetCDF file assigned for
+! initialization. If NRREC is negative (say NRREC=-1), the
+! model will re-start from the most recent time record. That
+! is, the initialization record is assigned internally.
+! Notice that it is also possible to re-start from a history
+! or time-averaged NetCDF file. If a history file is used
+! for re-start, it must contains all the necessary primitive
+! variables at all levels.
+!
+! LcycleRST Logical switch (T/F) used to recycle time records in output
+! restart file. If TRUE, only the latest two re-start time
+! records are maintained. If FALSE, all re-start fields are
+! saved every NRST timesteps without recycling. The restart
+! fields are written at all levels in double precision.
+!
+! NRST Number of timesteps between the writing of re-start fields.
+! Set NRST=0 to suppress writing of RESTART file.
+!
+! NSTA Number of timesteps between writing data into STATIONS file.
+! Station data is written at all levels.
+!
+! NFLT Number of timesteps between writing data into FLOATS file.
+!
+! NINFO Number of timesteps between the print of single line information
+! to standard output. It also determines the interval between
+! computation of global energy diagnostics.
+!
+!------------------------------------------------------------------------------
+! Output HISTORY, QUICKSAVE, AVERAGE and DIAGNOSTIC files parameters.
+!------------------------------------------------------------------------------
+!
+! Notice that it is possible to have two types of output NetCDF files for
+! instantaneous fields: HISTORY and QUICKSAVE. The QUICKSAVE file can be used
+! for writing fewer fields at shorter time intervals. For example, the User
+! may just write 2D and surface fields frequently (hourly) to reduce file
+! size and to time resolve fast dynamics. In conjunction, the User may write
+! full HISTORY fields infrequently (daily, weekly, etc) to avoid creating
+! large output files. This gives a lot of flexibility to manage ROMS output.
+!
+!
+! LDEFOUT Logical switch (T/F) used to create new output files when
+! initializing from a re-start file, abs(NRREC) > 0. If TRUE
+! and applicable, a new HISTORY, QUICKSAVE, AVERAGE, DIAGNOSTIC
+! and STATIONS files are created during the initialization
+! stage. If FALSE and applicable, data is appended to existing
+! HISTORY, QUICKSAVE, AVERAGE, DIAGNOSTIC and STATIONS files.
+! See also parameters NDEFHIS, NDEFQCK, NDEFAVG and NDEFDIA
+! below.
+!
+! NHIS Number of timesteps between writing fields into the HISTORY
+! file. Set NHIS=0 to suppress writing of HISTORY file.
+!
+! NDEFHIS Number of timesteps between the creation of new HISTORY file.
+! If NDEFHIS=0, the model will only process one HISTORY file.
+! This feature is useful for extended simulations when HISTORY
+! file get too large; it creates a new file every NDEFHIS
+! timesteps.
+!
+! NXTR Number of timesteps between writing fields into the EXTRACT
+! file, if GRID_EXTRACT is activated. Set NXTR=0 to suppress
+! writing of EXTRACT file.
+!
+! NDEFXTR Number of timesteps between the creation of new EXTRACT file.
+! If NDEFXTR=0, the model will only process one EXTRACT file.
+! This feature is useful for extended simulations when EXTRACT
+! file get too large; it creates a new file every EXTRACT
+! timesteps.
+!
+! NQCK Number of timesteps between writing fields into QUICKSAVE file.
+! Set NQCK=0 to suppress writing of QUICKSAVE file.
+!
+! NDEFQCK Number of timesteps between the creation of new QUICKSAVE file.
+! If NDEFQCK=0, the model will only process one QUICKSAVE file.
+! This feature is useful for extended simulations when QUICKSAVE
+! file get too large; it creates a new file every NDEFQCK
+! timesteps.
+!
+! NTSAVG Starting timestep for the accumulation of output time-averaged
+! data.
+!
+! NAVG Number of timesteps between writing time-averaged data
+! into AVERAGE file. Averaged date is written for all fields.
+! Set NAVG=0 to suppress writing of AVERAGE file.
+!
+! NDEFAVG Number of timesteps between the creation of new AVERAGE
+! file. If NDEFAVG=0, the model will only process one AVERAGE
+! file. This feature is useful for extended simulations when
+! AVERAGE file get too large; it creates a new file every
+! NDEFAVG timesteps.
+!
+! NTSDIA Starting timestep for the accumulation of output time-averaged
+! diagnostics data.
+!
+! NDIA Number of timesteps between writing time-averaged diagnostics
+! data into DIAGNOSTIC file. Averaged date is written for all
+! fields. Set NDIA=0 to suppress writing of DIAGNOSTIC file.
+!
+! NDEFDIA Number of timesteps between the creation of new time-averaged
+! diagnostics file. If NDEFDIA=0, the model will only process
+! one DIAGNOSTICS file. This feature is useful for long
+! simulations when DIAGNOSTIC file get too large; it creates
+! a new file every NDEFDIA timesteps.
+!
+!------------------------------------------------------------------------------
+! Output tangent linear and adjoint model parameters.
+!------------------------------------------------------------------------------
+!
+! LcycleTLM Logical switch (T/F) used to recycle time records in output
+! tangent linear file. If TRUE, only the latest two time
+! records are maintained. If FALSE, all tangent linear fields
+! are saved every NTLM timesteps without recycling.
+!
+! NTLM Number of timesteps between writing fields into tangent linear
+! model file.
+!
+! NDEFTLM Number of timesteps between the creation of new tangent linear
+! file. If NDEFTLM=0, the model will only process one tangent
+! linear file. This feature is useful for extended simulations
+! when output NetCDF files get too large; it creates a new file
+! every NDEFTLM timesteps.
+!
+! LcycleADJ Logical switch (T/F) used to recycle time records in output
+! adjoint file. If TRUE, only the latest two time records are
+! maintained. If FALSE, all tangent linear fields are saved
+! every NADJ timesteps without recycling.
+!
+! NADJ Number of timesteps between writing fields into the adjoint
+! model file.
+!
+! NDEFADJ Number of timesteps between the creation of the new adjoint
+! file. If NDEFADJ=0, the model will only process one adjoint
+! file. This feature is useful for extensive simulations when
+! the output NetCDF files get too large; it creates a new file
+! every NDEFADJ timesteps.
+!
+! NSFF Number of timesteps between 4DVAR adjustment of surface forcing
+! fluxes. In strong constraint 4DVAR, it is possible to adjust
+! surface forcing at other time intervals in addition to initial
+! time. This parameter is used to store the appropriate number
+! of surface forcing records in the output history NetCDF files:
+! 1+NTIMES/NSFF records. NSFF must be a factor of NTIMES or
+! greater than NTIMES. If NSFF > NTIMES, only one record is
+! stored in the NetCDF files and the adjustment is for constant
+! forcing with constant correction. This parameter is only
+! relevant in 4DVAR when activating either ADJUST_STFLUX or
+! ADJUST_WSTRESS.
+!
+! NOBC Number of timesteps between 4DVAR adjustment of open boundary
+! fields. In strong constraint 4DVAR, it is possible to adjust
+! open boundaries at other time intervals in addition to initial
+! time. This parameter is used to store the appropriate number
+! of open boundary records in the output history NetCDF files:
+! 1+NTIMES/NOBC records. NOBC must be a factor of NTIMES or
+! greater than NTIMES. If NOBC > NTIMES, only one record is
+! stored in the NetCDF files and the adjustment is for constant
+! forcing with constant correction. This parameter is only
+! relevant in 4DVAR when activating ADJUST_BOUNDARY.
+!
+!------------------------------------------------------------------------------
+! Generalized Stability Theory (GST) analysis parameters.
+!------------------------------------------------------------------------------
+!
+! LmultiGST Logical switch (TRUE/FALSE) to write out one GST analysis
+! eigenvector per history file.
+!
+! LrstGST Logical switch (TRUE/FALSE) to restart GST analysis. If TRUE,
+! the check pointing data is read in from the GST restart NetCDF
+! file. If FALSE and applicable, the checkpointing GST data is
+! saved and overwritten every NGST iterations of the algorithm.
+!
+! MaxIterGST Maximum number of GST algorithm iterations.
+!
+! NGST Number of GST iterations between storing of check pointing
+! data into NetCDF file. The restart data is always saved if
+! MaxIterGST is reached without convergence. It is also saved
+! when convergence is achieved. It is always a good idea to
+! save the checkpointing data at regular intervals so there
+! is a mechanism to recover from an unexpected interruption
+! in this costly computation. The check pointing data can
+! be used also to recompute the Ritz vectors by changing some
+! of the parameters, like convergence criteria (Ritz_tol)
+! and number of Arnoldi iterations (iparam(3)).
+!
+! Ritz_tol Relative accuracy of the Ritz values computed in the GST
+! analysis.
+!
+!------------------------------------------------------------------------------
+! Harmonic/Biharmonic horizontal diffusion for active tracers and viscosity
+! for momentum.
+!------------------------------------------------------------------------------
+!
+! TNU2 Nonlinear model lateral, harmonic, constant, mixing
+! coefficient (m2/s) for active (NAT) and inert (NPT) tracer
+! variables. If variable horizontal diffusion is activated,
+! TNU2 is the mixing coefficient for the largest grid-cell
+! in the domain.
+!
+! TNU4 Nonlinear model lateral, biharmonic, constant, mixing
+! coefficient (m4/s) for active (NAT) and inert (NPT) tracer
+! variables. If variable horizontal diffusion is activated,
+! TNU4 is the mixing coefficient for the largest grid-cell
+! in the domain.
+!
+! ad_TNU2 Adjoint-based algorithms lateral, harmonic, constant, mixing
+! coefficient (m2/s) for active (NAT) and inert (NPT) tracer
+! variables. If variable horizontal diffusion is activated,
+! ad_TNU2 is the mixing coefficient for the largest grid-cell
+! in the domain. In some applications, a larger value than
+! that used in the nonlinear model (basic state) is necessary
+! for stability.
+!
+! ad_TNU4 Adjoint-based algorithms lateral, biharmonic, constant, mixing
+! coefficient (m4/s) for active (NAT) and inert (NPT) tracer
+! variables. If variable horizontal diffusion is activated,
+! ad_TNU4 is the mixing coefficient for the largest grid-cell
+! in the domain. In some applications, a larger value than
+! that used in the nonlinear model (basic state) is necessary
+! for stability.
+!
+! VISC2 Nonlinear model lateral, harmonic, constant, mixing
+! coefficient (m2/s) for momentum. If variable horizontal
+! viscosity is activated, UVNU2 is the mixing coefficient
+! for the largest grid-cell in the domain.
+!
+! VISC4 Nonlinear model lateral, biharmonic, constant mixing
+! coefficient (m4/s) for momentum. If variable horizontal
+! viscosity is activated, UVNU4 is the mixing coefficient
+! for the largest grid-cell in the domain.
+!
+! ad_VISC2 Adjoint-based algorithms lateral, harmonic, constant, mixing
+! coefficient (m2/s) for momentum. If variable horizontal
+! viscosity is activated, ad_UVNU2 is the mixing coefficient
+! for the largest grid-cell in the domain. In some applications,
+! a larger value than that used in the nonlinear model (basic
+! state) is necessary for stability.
+!
+! ad_VISC4 Adjoint-based algorithms lateral, biharmonic, constant mixing
+! coefficient (m4/s) for momentum. If variable horizontal
+! viscosity is activated, ad_UVNU4 is the mixing coefficient
+! for the largest grid-cell in the domain. In some applications,
+! a larger value than that used in the nonlinear model (basic
+! state) is necessary for stability.
+!
+!------------------------------------------------------------------------------
+! Switches to activate sponge areas with enhanced horizontal mixing.
+!------------------------------------------------------------------------------
+!
+! LuvSponge Logical switch (TRUE/FALSE) to increase/decrease horizontal
+! viscosity in specific areas of the domain. It can be used
+! to specify sponge areas with larger horizontal mixing
+! coefficients for damping of high frequency noise due to
+! open boundary conditions or nesting. The CPP option SPONGE
+! is now deprecated and replaced with this switch to facilitate
+! or not sponge areas over a particular nested grid.
+!
+! The horizontal mixing distribution is specified in
+! "ini_hmixcoef.F" as:
+!
+! visc2_r(i,j) = visc_factor(i,j) * visc2_r(i,j)
+! visc4_r(i,j) = visc_factor(i,j) * visc4_r(i,j)
+!
+! The variable "visc_factor" can be read from the grid
+! NetCDF file. Alternately, the horizontal viscosity in the
+! sponge area can be set-up with analytical functions in
+! "ana_sponge.h" using CPP ANA_SPONGE when the switch
+! "LuvSponge" is turned ON for a particular grid.
+!
+! LtracerSponge Logical switch (TRUE/FALSE) to increase/decrease horizontal
+! diffusivity in specific areas of the domain. It can be used
+! to specify sponge areas with larger horizontal mixing
+! coefficients for damping of high frequency noise due to
+! open boundary conditions or nesting. The CPP option SPONGE
+! is now deprecated and replaced with this switch to facilitate
+! or not sponge areas over a particular nested grid.
+!
+! The horizontal mixing distribution is specified in
+! "ini_hmixcoef.F" as:
+!
+! diff2(i,j,itrc) = diff_factor(i,j) * diff2(i,j,itrc)
+! diff4(i,j,itrc) = diff_factor(i,j) * diff4(i,j,itrc)
+!
+! The variable "diff_factor" can be read from the grid
+! NetCDF file. Alternately, the horizontal viscosity in the
+! sponge area can be set-up with analytical functions in
+! "ana_sponge.h" using CPP ANA_SPONGE when the switch
+! "LuvSponge" is turned ON for a particular grid.
+!
+!------------------------------------------------------------------------------
+! Vertical mixing coefficients for active tracers.
+!------------------------------------------------------------------------------
+!
+! AKT_BAK Background vertical mixing coefficient (m2/s) for active
+! (NAT) and inert (NPT) tracer variables.
+!
+! AKT_LIMIT Upper threshold values to limit vertical diffusion coefficients
+! computed from vertical mixing parameterizations (GLS_MIXING,
+! LMD_MIXING, MY25_MIXING). Sometimes, these parameterizations
+! yield high mixing values and the threshold values are used as
+! upper limiter when LIMIT_VDIFF is activated.
+!
+! ad_AKT_fac Adjoint-based algorithms vertical mixing, basic state, scale
+! factor (nondimensional) for active (NAT) and inert (NPT)
+! tracer variables. In some applications, smaller/larger
+! values of vertical mixing are necessary for stability. It
+! is only used when FORWARD_MIXING is activated.
+!
+!------------------------------------------------------------------------------
+! Vertical mixing coefficient for momentum.
+!------------------------------------------------------------------------------
+!
+! AKV_BAK Background vertical mixing coefficient (m2/s) for momentum.
+!
+! AKV_LIMIT Upper threshold value to limit vertical viscosity coefficient
+! computed from vertical mixing parameterizations (GLS_MIXING,
+! LMD_MIXING, MY25_MIXING). Sometimes, these parameterizations
+! yield a high mixing value and the threshold value is used as
+! upper limiter when LIMIT_VVISC is activated.
+!
+! ad_AKV_fac Adjoint-based algorithms vertical mixing, basic state, scale
+! factor (nondimensional) for momentum. In some applications,
+! smaller/larger values of vertical mixing are necessary for
+! stability. It is only used when FORWARD_MIXING is activated.
+!
+!------------------------------------------------------------------------------
+! Turbulent closure parameters.
+!------------------------------------------------------------------------------
+!
+! AKK_BAK Background vertical mixing coefficient (m2/s) for turbulent
+! kinetic energy.
+!
+! AKP_BAK Background vertical mixing coefficient (m2/s) for turbulent
+! generic statistical field, "psi".
+!
+! TKENU2 Lateral, harmonic, constant, mixing coefficient (m2/s) for
+! turbulent closure variables.
+!
+! TKENU4 Lateral, biharmonic, constant mixing coefficient (m4/s) for
+! turbulent closure variables.
+!
+!------------------------------------------------------------------------------
+! Generic length-scale turbulence closure parameters.
+!------------------------------------------------------------------------------
+!
+! GLS_P Stability exponent (nondimensional).
+!
+! GLS_M Turbulent kinetic energy exponent (nondimensional).
+!
+! GLS_N Turbulent length scale exponent (nondimensional).
+!
+! GLS_Kmin Minimum value of specific turbulent kinetic energy
+!
+! GLS_Pmin Minimum Value of dissipation.
+!
+! Closure independent constraint parameters (nondimensional):
+!
+! GLS_CMU0 Stability coefficient.
+!
+! GLS_C1 Shear production coefficient.
+!
+! GLS_C2 Dissipation coefficient.
+!
+! GLS_C3M Buoyancy production coefficient (minus).
+!
+! GLS_C3P Buoyancy production coefficient (plus).
+!
+! GLS_SIGK Constant Schmidt number (nondimensional) for turbulent
+! kinetic energy diffusivity.
+!
+! GLS_SIGP Constant Schmidt number (nondimensional) for turbulent
+! generic statistical field, "psi".
+!
+! Suggested values for various parameterizations:
+!
+! k-kl k-epsilon k-omega gen
+!
+! GLS_P = 0.d0 3.0d0 -1.0d0 2.0d0
+! GLS_M = 1.d0 1.5d0 0.5d0 1.0d0
+! GLS_N = 1.d0 -1.0d0 -1.0d0 -0.67d0
+! GLS_Kmin = 5.0d-6 7.6d-6 7.6d-6 1.0d-8
+! GLS_Pmin = 5.0d-6 1.0d-12 1.0d-12 1.0d-8
+!
+! GLS_CMU0 = 0.5544d0 0.5477d0 0.5477d0 0.5544d0
+! GLS_C1 = 0.9d0 1.44d0 0.555d0 1.00d0
+! GLS_C2 = 0.52d0 1.92d0 0.833d0 1.22d0
+! GLS_C3M = 2.5d0 -0.4d0 -0.6d0 0.1d0
+! GLS_C3P = 1.0d0 1.0d0 1.0d0 1.0d0
+! GLS_SIGK = 1.96d0 1.0d0 2.0d0 0.8d0
+! GLS_SIGP = 1.96d0 1.30d0 2.0d0 1.07d0
+!
+!------------------------------------------------------------------------------
+! Constants used in the various formulations of surface turbulent kinetic
+! energy flux in the GLS.
+!------------------------------------------------------------------------------
+!
+! CHARNOK_ALPHA Charnock surface roughness,
+! Zos: (charnok_alpha * u_star**2) / g
+!
+! ZOS_HSIG_ALPHA Roughness from wave amplitude,
+! Zos: zos_hsig_alpha * Hsig
+!
+! SZ_ALPHA Surface flux from wave dissipation,
+! flux: dt * sz_alpha * Wave_dissip
+!
+! CRGBAN_CW Surface flux due to Craig and Banner wave breaking,
+! flux: dt * crgban_cw * u_star**3
+!
+!------------------------------------------------------------------------------
+! Constants used in the Waves Effect on Currents formulations.
+!------------------------------------------------------------------------------
+!
+! WEC_ALPHA Wave dissipation action scale bounds:
+!
+! [0.0] All dissipation goes to breaking and none to roller
+! [1.0] All dissipation goes to roller and none to breaking
+!
+!------------------------------------------------------------------------------
+! Constants used in the computation of momentum stress.
+!------------------------------------------------------------------------------
+!
+! RDRG Linear bottom drag coefficient (m/s).
+!
+! RDRG2 Quadratic bottom drag coefficient.
+!
+! Zob Bottom roughness (m).
+!
+! Zos Surface roughness (m).
+!
+!------------------------------------------------------------------------------
+! Height of atmospheric measurements for bulk fluxes parameterization.
+!------------------------------------------------------------------------------
+!
+! BLK_ZQ Height (m) of surface air humidity measurement. Usually,
+! recorded at 10 m.
+!
+! BLK_ZT Height (m) of surface air temperature measurement. Usually,
+! recorded at 2 or 10 m.
+!
+! BLK_ZW Height (m) of surface winds measurement. Usually, recorded
+! at 10 m.
+!
+!------------------------------------------------------------------------------
+! Wetting and drying parameters.
+!------------------------------------------------------------------------------
+!
+! DCRIT Minimum depth (m) for wetting and drying.
+!
+!------------------------------------------------------------------------------
+! Jerlov Water type.
+!------------------------------------------------------------------------------
+!
+! WTYPE Jerlov water type array index used to model the light absorption
+! with a double exponential function (Paulson and Simpson,
+! 1977). The classification ranges from clear open ocean
+! waters (type I) to dark turbulent coastal waters (type 7).
+!
+! Array Jerlov
+! Index Water Type Examples
+! ----- ---------- --------
+!
+! 1 I Open Pacific
+! 2 IA Eastern Mediterranean, Indian Ocean
+! 3 IB Western Mediterranean, Open Atlantic
+! 4 II Coastal waters, Azores
+! 5 III Coastal waters, North Sea
+! 6 1 Skagerrak Strait
+! 7 3 Baltic
+! 8 5 Black Sea
+! 9 7 Dark coastal water
+!
+!------------------------------------------------------------------------------
+! Body-force parameters. Used when CPP option BODYFORCE is activated.
+!------------------------------------------------------------------------------
+!
+! LEVSFRC Deepest level to apply surface momentum stress as a body-force.
+!
+! LEVBFRC Shallowest level to apply bottom momentum stress as a body-force.
+!
+!------------------------------------------------------------------------------
+! Vertical S-coordinates parameters.
+!------------------------------------------------------------------------------
+!
+! The parameters below must be consistent in all input fields associated with
+! the vertical grid. The same vertical grid transformation (depths) needs to
+! be used when preparing initial conditions, boundary conditions, climatology,
+! observations, and so on. Please check:
+!
+! https://www.myroms.org/wiki/index.php/Vertical_S-coordinate
+!
+! for details, rules and examples.
+!
+!
+! Vtransform Vertical transformation equation:
+!
+! (1) Original formulation (Shchepetkin and McWilliams, 2005),
+! Vtransform=1 (In ROMS since 1999)
+!
+! z(x,y,s,t)=Zo(x,y,s)+zeta(x,y,t)*[1+Zo(x,y,s)/h(x,y)]
+!
+! where
+!
+! Zo(x,y,s)=hc*s+[h(x,y)-hc]*C(s)
+!
+! (2) Improved formulation (A. Shchepetkin, 2005),
+! Vtransform=2
+!
+! z(x,y,s,t)=zeta(x,y,t)*[zeta(x,y,t)+h(x,y)]*Zo(x,y,s)
+!
+! where
+!
+! Zo(x,y,s)=[hc*s(k)+h(x,y)*C(k)]/[hc+h(x,y)]
+!
+! The true sigma-coordinate system is recovered as hc goes
+! to INFINITY. This is useful when configuring applications
+! with flat bathymetry and uniform level thickness.
+! Practically, you can achieve this by setting:
+!
+! THETA_S = 0.0d0
+! THETA_B = 0.0d0
+! TCLINE = 1.0d+17 (a large number)
+!
+!
+! Vstretching Vertical stretching function, C(s):
+!
+! (1) Original function (Song and Haidvogel, 1994),
+! Vstretching=1
+!
+! C(s)=(1-theta_b)*[SINH(s*theta_s)/SINH(theta_s)]+
+! theta_b*[-0.5+0.5*TANH(theta_s*(s+0.5))/
+! TANH(0.5*theta_s)]
+!
+! (2) A. Shchepetkin (2005) function,
+! Vstretching=2
+!
+! C(s)=Cweight*Csur(s)+(1-Cweight)*Cbot(s)
+!
+! where
+!
+! Csur(s)=[1-COSH(theta_s*s)]/[COSH(theta_s)-1]
+!
+! Cbot(s)=-1+[1-SINH(theta_b*(s+1))]/SINH(theta_b)
+!
+! Cweight=(s+1)**alpha*
+! (1+(alpha/beta)*(1-(s+1)**beta))
+!
+! (3) R. Geyer function for shallow sediment applications,
+! Vstretching=3
+!
+! C(s)=Cweight*Cbot(s)+(1-Cweight)*Csur(s)
+!
+! where
+!
+! Csur(s)=-LOG(COSH(Hscale*ABS(s)** alpha))/
+! LOG(COSH(Hscale))
+!
+! Cbot(s)= LOG(COSH(Hscale*(s+1)** beta))/
+! LOG(COSH(Hscale))-1
+!
+! Cweight=0.5*(1-TANH(Hscale*(s+0.5))
+!
+! (4) A. Shchepetkin (2010) improved double stretching function,
+! Vstretching=4
+!
+! C(s)=[1-COSH(theta_s*s)]/[COSH(theta_s)-1]
+!
+! with bottom refinement
+!
+! C(s)=[EXP(theta_b*C(s))-1]/[1-EXP(-theta_b)]
+!
+! The resulting double transformation is continuous with
+! respect control parameters theta_s and theta_b with a
+! meaningful range of:
+!
+! 0 < theta_s <= 10.0
+! 0 <= theta_b <= 4.0
+!
+! (5) Souza et al. (2015) quadratic Legendre polynomial function
+! that allows higher resolution near the surface,
+! Vstretching=5. It is similar to Vstretching=4, but the
+! fractional stretched vertical coordinate (s) is re-defined
+! as:
+!
+! s(k)=- [(k*k - 2*k*N + k + N*N - N) / (N*N - N)]
+! - weight * [(k*k - k*N) / (1 - N)]
+!
+! at vertical W-points, k=0,...,N and weight=0.01. To get
+! the equation at vertical RHO-points, replace k with k-0.5.
+!
+! Many other stretching functions (Vstretching>5) are possible
+! provided that:
+!
+! * C(s) is a dimensionless, nonlinear, monotonic function.
+! * C(s) is a continuous differentiable function, or
+! a differentiable piecewise function with smooth transition.
+! * The stretching vertical coordinate ,s, is constrained
+! between -1 <= s <= 0, with s=0 corresponding to the
+! free-surface and s=-1 corresponding to the bathymetry.
+! * Similarly, the stretching function, C(s), is constrained
+! between -1 <= C(s) <= 0, with C(0)=0 corresponding to the
+! free-surface and C(-1)=-1 corresponding to the bathymetry.
+!
+! These functions are coded in routine "Utility/set_scoord.F".
+!
+! Due to its functionality and properties, the default and recommended vertical
+! coordinates transformation is:
+!
+! Vtransform = 2
+! Vstretching = 4
+!
+!
+! THETA_S S-coordinate surface control parameter. The range of optimal
+! values depends on the vertical stretching function, C(s).
+!
+! THETA_B S-coordinate bottom control parameter. The range of optimal
+! values depends on the vertical stretching function, C(s).
+!
+! TCLINE 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.
+!
+!------------------------------------------------------------------------------
+! Mean Density and background Brunt-Vaisala frequency.
+!------------------------------------------------------------------------------
+!
+! RHO0 Mean density (Kg/m3) used when the Boussinesq approximation
+! is inferred.
+!
+! BVF_BAK Background Brunt-Vaisala frequency squared (1/s2). Typical
+! values for the ocean range (as a function of depth) from
+! 1.0E-4 to 1.0E-6.
+!
+!------------------------------------------------------------------------------
+! Tide Genearting Forces (TGF) parameter.
+!------------------------------------------------------------------------------
+!
+! Lnodal Switch to account for the slow modulation of the equilibrium
+! tides constituents due primarily to the 18.6-year lunar nodal
+! cycle.
+!
+!------------------------------------------------------------------------------
+! Time Stamps.
+!------------------------------------------------------------------------------
+!
+! DSTART Time stamp assigned to model initialization (days). Usually
+! a Calendar linear coordinate, like modified Julian Day. For
+! Example:
+!
+! Julian Day = 1 for Nov 25, 00:00:00 4713 BCE
+! modified Julian Day = 1 for May 24, 00:00:00 1968 GMT
+! Days since Jan 1, 2000 = 988.5 for Sep 15, 12:00:00 2002
+!
+! It is called truncated or modified Julian day because an
+! offset of 2440000 needs to be added.
+!
+! TIDE_START Reference time origin for tidal forcing (days since application
+! reference date, TIME_REF). It is defined as the time of phase
+! zero when preparing the input forcing tidal boundary data. The
+! tide reference time is important and often ignored parameter
+! by the users. If TIDE_START=0.0, it implies that the date of
+! zero phase is the same as the application date reference,
+! TIME_REF.
+!
+! To avoid any ambiguity with the tide generating forcing in the
+! pressure gradient, it is preferable if the "zero_phase_date"
+! variable is available in the input tidal forcing NetCDF file.
+! It is a floating-point variable of the form YYYYMMDD.dddd with
+! the following metadata:
+!
+! double zero_phase_date
+! zero_phase_date:long_name = "tidal reference date for zero phase"
+! zero_phase_date:units = "days as %Y%m%d.%f"
+! zero_phase_date:C_format = "%13.4f"
+! zero_phase_date:FORTRAN_format = "(f13.4)"
+!
+! Use "forcing/add_tide_date.m" from the ROMS Matlab repository
+! to add the "zero_phase_date" variable to your existing tidal
+! forcing NetCDF file. It is highly recommended to use this
+! approach. If such a variable is found, the TIDE_START value
+! will overwritten during execution.
+!
+! Notice that it is possible to have different reference values
+! for "zero_phase_date" and ROMS clock defined as seconds from
+! reference date TIME_REF. If TIME_REF is earlier than variable
+! "zero_phase_date", the frequencies (omega) to harmonic terms
+! will be negative since they are computed as follows:
+!
+! tide_start = Rclock%tide_DateNumber(2) -
+! Rclock%DateNumber(2))
+! omega = 2 * pi * (time - tide_start) / Tperiod
+!
+! TIME_REF Reference time (yyyymmdd.f) used to compute relative time:
+! elapsed time interval since reference-time. The "units"
+! attribute takes the form "time-unit since reference-time".
+! This parameter also provides information about the calendar
+! used:
+!
+! If TIME_REF = -2, model time and DSTART are in modified Julian
+! days units. The "units" attribute is:
+!
+! 'time-units since 1968-05-23 00:00:00 GMT' (May 23, 1968)
+!
+! If TIME_REF = -1, model time and DSTART are in a calendar
+! with 360 days in every year (30 days each month). The "units"
+! attribute is:
+!
+! 'time-units since 0000-12-30 00:00:00' (Dec 30, 0000)
+!
+! If TIME_REF = 0, model time and DSTART are in a common year
+! calendar with 365.25 days. The "units" attribute is:
+!
+! 'time-units since 0001-01-01 00:00:00' (Jan 1, 0001)
+!
+! If TIME_REF > 0, model time and DSTART are the elapsed time
+! units since specified reference time. For example,
+! TIME_REF=20020115.5 will yield the following attribute:
+!
+! 'time-units since 2002-01-15 12:00:00' (Jan 15, 2002)
+!
+!------------------------------------------------------------------------------
+! Nudging/relaxation time scales, inverse scales will be computed internally.
+!------------------------------------------------------------------------------
+!
+! When passive/active open boundary conditions are activated, these nudging
+! values correspond to the passive (outflow) nudging time scales.
+!
+! TNUDG Nudging time scale (days) for active tracer variables.
+! (1:NAT+NPT,1:Ngrids) values are expected.
+!
+! ZNUDG Nudging time scale (days) for free-surface.
+!
+! M2NUDG Nudging time scale (days) for 2D momentum.
+!
+! M3NUDG Nudging time scale (days) for 3D momentum.
+!
+! OBCFAC Factor between passive (outflow) and active (inflow) open
+! boundary conditions. The nudging time scales for the
+! active (inflow) conditions are obtained by multiplying
+! the passive values by OBCFAC. If OBCFAC > 1, nudging on
+! inflow is stronger than on outflow (recommended).
+!
+!------------------------------------------------------------------------------
+! Linear equation of State parameters.
+!------------------------------------------------------------------------------
+!
+! Ignoring pressure, the linear equation of state is:
+!
+! rho(:,:,:) = R0 - R0 * TCOEF * (t(:,:,:,:,itemp) - T0)
+! + R0 * SCOEF * (t(:,:,:,:,isalt) - S0)
+!
+! Typical values: R0 = 1027.0 kg/m3
+! T0 = 10.0 Celsius
+! S0 = 35.0 nondimensional
+! TCOEF = 1.7d-4 1/Celsius
+! SCOEF = 7.6d-4 1/nondimensional
+!
+! Notice that salinity has NO UNITS, it is nondimensional. Many
+! people use PSU (Practical Salinity Unit). However, salinity
+! has always been defined as a conductivity ratio and does not
+! have physical units. For details, check the following forum
+! post: www.myroms.org/forum/viewtopic.php?f=30&t=294
+!
+! R0 Background density value (Kg/m3) used in Linear Equation of
+! State.
+!
+! T0 Background potential temperature (Celsius) constant.
+!
+! S0 Background salinity (nondimensional) constant.
+!
+! TCOEF Thermal expansion coefficient in Linear Equation of State.
+!
+! SCOEF Saline contraction coefficient in Linear Equation of State.
+!
+!------------------------------------------------------------------------------
+! Slipperiness parameter.
+!------------------------------------------------------------------------------
+!
+! GAMMA2 Slipperiness variable, either 1.0 (free slip) or -1.0 (no slip).
+!
+!------------------------------------------------------------------------------
+! Point Sources/Sink sources activation switches.
+!------------------------------------------------------------------------------
+!
+! LuvSrc Logical switches (T/F) to activate momentum horizontal transport
+! points Sources/Sinks. Usually it is used to turn on/off river
+! runoff transport (u or v variables) in an application,
+! [1:Ngrids].
+!
+! In nesting applications, turn on only the grids that require
+! activation and processing of momentum point Sources/Sinks.
+!
+! LwSrc Logical switches (T/F) to activate mass points Sources/Sinks.
+! Usually, it is used to turn on/off volume vertical influx (w)
+! in an application.
+!
+! In nesting applications, turn on only the grids that require
+! activation and processing of mass influx point Sources/Sinks.
+!
+! LtracerSrc Logical switches (T/F) to activate tracer variables point
+! Sources/Sinks. Only NAT active tracers (temperature, salinity)
+! and NPT inert tracers are activated here:
+!
+! LtracerSrc(itemp,ng) for temperature (itemp=1)
+! LtracerSrc(isalt,ng) for salinity (isalt=2)
+! LtracerSrc(NAT+1,ng) for inert tracer 1
+! ... ...
+! LtracerSrc(NAT+NPT,ng) for inert tracer NPT
+!
+! Other biological and sediment tracers switches are activated
+! in their respective input scripts.
+!
+! In nesting applications, turn on only the grids that require
+! activation and processing of tracers point Sources/Sinks.
+!
+! Recall that switches are usually activated to add river runoff
+! as a point source. At minimum, it is necessary to specify both
+! temperature and salinity for all rivers. The other tracers are
+! optional.
+!
+! This logical switch REPLACES and ELIMINATES the need to have
+! or read the variable "river_flag(river)" in the input rivers
+! forcing NetCDF file:
+!
+! double river_flag(river)
+! river_flag:long_name = "river runoff tracer flag"
+! river_flag:option_0 = "all tracers are off"
+! river_flag:option_1 = "only temperature"
+! river_flag:option_2 = "only salinity"
+! river_flag:option_3 = "both temperature and salinity"
+! river_flag:units = "nondimensional"
+!
+! The above variable was too cumbersome and complicated when
+! additional tracers are considered. However, this change is
+! backward compatible.
+!
+! The LtracerSrc switch will be used to activate the reading of
+! respective tracer variable from input river forcing NetCDF
+! file. If you want to add other tracer variables (other than
+! temperature and salinity) as a source for a particular
+! river(s), you just need to specify such values on those
+! river(s). Then, set the values to ZERO on the other river(s)
+! that do NOT require such river forcing for that tracer.
+! Recall that you need to specify the tracer values for all
+! rivers, even if their values are zero.
+!
+!------------------------------------------------------------------------------
+! Logical switches to process climatology fields. The climatology fields are
+! either read from a NetCDF file or set with analytical CPP options.
+!------------------------------------------------------------------------------
+!
+! LsshCLM Logical switch (T/F) to process sea-surface height climatology.
+! The CPP option ZCLIMATOLOGY is now obsolete and replaced with
+! this switch to facilitate nesting applications. Currently,
+! the sea-surface height climatology, CLIMA(ng)%ssh, is NOT
+! used but it is kept for future use.
+!
+! The nudging of SSH on the free-surface governing equation
+! (vertically integrated continuity equation) is NOT allowed
+! because it violates mass/volume conservation. Recall that
+! the time rate of change of free-surface is computed from the
+! divergence of "ubar" and "vbar". If such nudging term is
+! required, it needs to be specified on the momentum equations
+! for (u,v) and/or (ubar,vbar). If done on (u,v) only, its
+! effects enter the 2D momentum equations via the residual
+! vertically integrated forcing term.
+!
+! Lm2CLM Logical switch (T/F) to process 2D momentum (ubar, vbar)
+! climatology. The CPP option M2CLIMATOLOGY is now obsolete
+! and replaced with this switch to facilitate nesting
+! applications. Currently, the CLIMA(ng)%ubarclm and
+! CLIMA(ng)%vbarclm are used for sponges and nudging. If
+! tidal forcing, the climatological values are adjusted to
+! include tides.
+!
+! Lm3CLM Logical switch (T/F) to process 3D momentum climatology (u,v)
+! The CPP option M3CLIMATOLOGY is now obsolete and replaced
+! with this switch to facilitate nesting applications.
+! Currently, the CLIMA(ng)%uclm and CLIMA(ng)%vclm are used
+! for sponges and nudging.
+!
+! LtracerCLM Logical switches (T/F) to process active and inert tracer
+! variables climatology. The CPP option TCLIMATOLOGY is now
+! obsolete and replaced with these switches to facilitate
+! nesting applications. Currently, the CLIMA(ng)%tclm is
+! used for horizontal mixing, sponges, and nudging.
+!
+! Only NAT active tracers (temperature, salinity) and NPT inert
+! tracers need to be specified here:
+!
+! LtracerCLM(itemp,ng) for temperature (itemp=1)
+! LtracerCLM(isalt,ng) for salinity (isalt=2)
+! LtracerCLM(NAT+1,ng) for inert tracer 1
+! ... ...
+! LtracerCLM(NAT+NPT,ng) for inert tracer NPT
+!
+! Other biological and sediment tracers switches are specified
+! in their respective input scripts.
+!
+! These switches also controls which climatology tracer fields
+! (specially passive tracers) needs to be processed. So we
+! may reduce the memory allocation for the CLIMA(ng)%tclm array.
+!
+!------------------------------------------------------------------------------
+! Logical switches for nudging to climatology fields.
+!------------------------------------------------------------------------------
+!
+! LnudgeM2CLM Logical switch (T/F) to activate the nudging of 2D momentum
+! climatology. The CPP option M2CLM_NUDGING is now obsolete
+! and replaced with this switch to facilitate nesting
+! applications. Users also need to TURN ON the logical
+! switch "Lm2CLM", described above, to process the required
+! 2D momentum climatology data. This data can be set with
+! analytical functions (ANA_M2CLIMA) or read from input
+! climatology NetCDF file(s).
+!
+! The nudging coefficients CLIMA(ng)%M2nudgcof can be set
+! with analytical functions in "ana_nudgcoef.h" using CPP
+! option ANA_NUDGCOEF. Otherwise, it will be read from
+! NetCDF file NUDNAME.
+!
+! LnudgeM3CLM Logical switch (T/F) to activate the nudging of 3D momentum
+! climatology. The CPP option M3CLM_NUDGING is now obsolete
+! and replaced with this switch to facilitate nesting
+! applications.
+!
+! Users also need to TURN ON the logical switch "Lm3CLM",
+! described above, to process the required 3D momentum
+! climatology data. This data can be set with analytical
+! functions (ANA_M3CLIMA) or read from input climatology
+! NetCDF file(s).
+!
+! The nudging coefficients CLIMA(ng)%M3nudgcof can be set
+! with analytical functions in "ana_nudgcoef.h" using CPP
+! option ANA_NUDGCOEF. Otherwise, it will be read from
+! NetCDF file NUDNAME.
+!
+! LnudgeTCLM Logical switches (T/F) to activate the nudging of active and
+! inert tracer variables climatology. These switches also
+! control which tracer variables to nudge. The CPP option
+! TCLM_NUDGING is now obsolete and replaced with these
+! switches to facilitate nesting applications.
+!
+! Only NAT active tracers (temperature, salinity) and NPT
+! inert tracers need to be specified here:
+!
+! LnudgeTCLM(itemp,ng) for temperature (itemp=1)
+! LnudgeTCLM(isalt,ng) for salinity (isalt=2)
+! LnudgeTCLM(NAT+1,ng) for inert tracer 1
+! ... ...
+! LnudgeTCLM(NAT+NPT,ng) for inert tracer NPT
+!
+! Other biological and sediment tracers switches are specified
+! in their respective input scripts.
+!
+! User also needs to TURN ON the respective logical switches
+! "LtracerCLM", described above, to process the required 3D
+! tracer climatology data. This data can be set with analytical
+! functions (ANA_TCLIMA) or read from input climatology
+! NetCDF file(s).
+!
+! The nudging coefficients CLIMA(ng)%Tnudgcof can be set
+! with analytical functions in "ana_nudgcoef.h" using CPP
+! option ANA_NUDGCOEF. Otherwise, it will be read from
+! NetCDF file NUDNAME.
+!
+!------------------------------------------------------------------------------
+! Adjoint sensitivity parameters.
+!------------------------------------------------------------------------------
+!
+! DstrS Starting day for adjoint sensitivity forcing.
+!
+! DendS Ending day for adjoint sensitivity forcing.
+!
+! The adjoint forcing is applied at every time step according
+! to desired state functional stored in the adjoint sensitivity
+! NetCDF file. DstrS must be less than or equal to DendS. If
+! both values are zero, their values are reset internally to
+! the full range of the adjoint integration.
+!
+! KstrS Starting vertical level of the 3D adjoint state variables whose
+! sensitivity is required.
+!
+! KendS Ending vertical level of the 3D adjoint state variables whose
+! sensitivity is required.
+!
+! Lstate Logical switches (TRUE/FALSE) to specify the adjoint state
+! variables whose sensitivity is required.
+!
+! Lstate(isFsur): Free-surface
+! Lstate(isUbar): 2D U-momentum
+! Lstate(isVbar): 2D V-momentum
+! Lstate(isUvel): 3D U-momentum
+! Lstate(isVvel): 3D V-momentum
+! Lstate(isWvel): 3D W-momentum
+! Lstate(isTvar): Traces (NT values expected)
+!
+!------------------------------------------------------------------------------
+! Forcing Singular Vectors or Stochastic Optimals parameters.
+!------------------------------------------------------------------------------
+!
+! Fstate Logical switches (TRUE/FALSE) to specify state variables for
+! which Forcing Singular Vectors or Stochastic Optimals is
+! required.
+!
+! Fstate(isFsur): Free-surface
+! Fstate(isUbar): 2D U-momentum
+! Fstate(isVbar): 2D V-momentum
+! Fstate(isUvel): 3D U-momentum
+! Fstate(isVvel): 3D V-momentum
+! Fstate(isTvar): Traces (NT values expected)
+!
+! Fstate(isUstr): surface U-stress
+! Fstate(isVstr): surface V-stress
+! Fstate(isTsur): surface tracers flux (NT values expected)
+!
+! SO_decay Stochastic Optimals time decorrelation scale (days) assumed
+! for red noise processes.
+!
+! SO_sdev Stochastic Optimals surface forcing standard deviation for
+! dimensionalization.
+!
+! SO_sdev(isFsur): Free-surface
+! SO_sdev(isUbar): 2D U-momentum
+! SO_sdev(isVbar): 2D V-momentum
+! SO_sdev(isUvel): 3D U-momentum
+! SO_sdev(isVvel): 3D V-momentum
+! SO_sdev(isTvar): Traces (NT values expected)
+!
+! SO_sdev(isUstr): surface U-stress
+! SO_sdev(isVstr): surface V-stress
+! SO_sdev(isTsur): surface tracer flux (NT values expected)
+!
+!------------------------------------------------------------------------------
+! Logical switches (T/F) to activate writing of instantaneous fields into
+! HISTORY file.
+!------------------------------------------------------------------------------
+!
+! Hout(idUvel) Write out 3D U-velocity component.
+! Hout(idVvel) Write out 3D V-velocity component.
+! Hout(idu3dE) Write out 3D Eastward velocity component at RHO-points.
+! Hout(idv3dN) Write out 3D Northward velocity component at RHO-points.
+! Hout(idWvel) Write out 3D W-velocity component.
+! Hout(idOvel) Write out 3D omega vertical velocity.
+! Hout(idOvil) Write out 3D omega implicit vertical velocity.
+! Hout(idUbar) Write out 2D U-velocity component.
+! Hout(idVbar) Write out 2D V-velocity component.
+! Hout(idu2dE) Write out 2D Eastward velocity component at RHO-points.
+! Hout(idv2dN) Write out 2D Northward velocity component at RHO-points.
+! Hout(idFsur) Write out free-surface.
+! Hout(idBath) Write out time-dependent bathymetry.
+!
+! Hout(idTvar) Write out active (NAT) tracers: temperature and salinity.
+!
+! Hout(idpthR) Write out time-varying depths of RHO-points.
+! Hout(idpthU) Write out time-varying depths of U-points.
+! Hout(idpthV) Write out time-varying depths of V-points.
+! Hout(idpthW) Write out time-varying depths of W-points.
+!
+! Hout(idUsms) Write out surface U-momentum stress.
+! Hout(idVsms) Write out surface V-momentum stress.
+! Hout(idUbms) Write out bottom U-momentum stress.
+! Hout(idVbms) Write out bottom V-momentum stress.
+!
+! Hout(idUbrs) Write out current-induced, U-momentum stress.
+! Hout(idVbrs) Write out current-induced, V-momentum stress.
+! Hout(idUbws) Write out wind-induced, bottom U-wave stress.
+! Hout(idVbws) Write out wind-induced, bottom V-wave stress.
+! Hout(idUbcs) Write out bottom maximum wave and current U-stress.
+! Hout(idVbcs) Write out bottom maximum wave and current V-stress.
+! Hout(idUVwc) Write out bottom max wave-current stress magnitude.
+!
+! Hout(idUbot) Write out wind-induced, bed wave orbital U-velocity.
+! Hout(idVbot) Write out wind-induced, bed wave orbital V-velocity.
+! Hout(idUbur) Write out bottom U-velocity above bed.
+! Hout(idVbvr) Write out bottom V-velocity above bed.
+!
+! Hout(idWztw) Write out WEC_VF quasi-static sea level adjustment.
+! Hout(idWqsp) Write out WEC_VF quasi-static pressure.
+! Hout(idWbeh) Write out WEC_VF Bernoulli head.
+!
+! Hout(idU2rs) Write out WEC 2D U-stress.
+! Hout(idV2rs) Write out WEC 2D V-stress.
+! Hout(idU3rs) Write out WEC 3D U-stress.
+! Hout(idV3rs) Write out WEC 3D V-stress.
+!
+! Hout(idU2Sd) Write out 2D Stokes U-velocity.
+! Hout(idV2Sd) Write out 2D Stokes V-velocity.
+! Hout(idU3Sd) Write out 3D Stokes U-velocity.
+! Hout(idV3Sd) Write out 3D Stokes V-velocity.
+! Hout(idW3St) Write out 3D Stokes W-velocity.
+! Hout(idW3Sd) Write out 3D Stokes omega-velocity.
+!
+! Hout(idWamp) Write out wave significat height.
+! Hout(idWlen) Write out wave mean wavelength.
+! Hout(idWlep) Write out wave peak wavelength.
+! Hout(idWdir) Write out wave mean direction.
+! Hout(idWdip) Write out wave peak direction.
+! Hout(idWptp) Write out wave surface period.
+! Hout(idWpbt) Write out wave bottom period.
+! Hout(idWorb) Write out wave bottom orbital velocity.
+! Hout(idWbrk) Write out wave breaking (percent).
+! Hout(idUwav) Write out wave depth-averaged U-velocity.
+! Hout(idVwav) Write out wave depth-averaged V-velocity.
+! Hout(idWdif) Write out wave dissipation from bottom friction.
+! Hout(idWdib) Write out wave dissipation from breaking.
+! Hout(idWdiw) Write out wave dissipation from whitecapping.
+! Hout(idWdis) Write out wave roller dissipation.
+! Hout(idWrol) Write out wave roller action density.
+!
+! Hout(idPair) Write out surface air pressure.
+! Hout(idTair) Write out surface air temperature.
+! Hout(idUair) Write out surface U-wind component.
+! Hout(idVair) Write out surface V-wind component.
+! Hout(idUaiE) Write out surface Eastward U-wind component.
+! Hout(idVaiN) Write out surface Northward V-wind component.
+!
+! Hout(idTsur) Write out surface net heat and salt flux
+! Hout(idLhea) Write out latent heat flux.
+! Hout(idShea) Write out sensible heat flux.
+! Hout(idLrad) Write out long-wave radiation flux.
+! Hout(idSrad) Write out short-wave radiation flux.
+! Hout(idEmPf) Write out E-P flux.
+! Hout(idevap) Write out evaporation rate.
+! Hout(idrain) Write out precipitation rate.
+!
+! Hout(idDano) Write out density anomaly.
+! Hout(idVvis) Write out vertical viscosity coefficient.
+! Hout(idTdif) Write out vertical diffusion coefficient of temperature.
+! Hout(idSdif) Write out vertical diffusion coefficient of salinity.
+! Hout(idHsbl) Write out depth of oceanic surface boundary layer.
+! Hout(idHbbl) Write out depth of oceanic bottom boundary layer.
+! Hout(idMtke) Write out turbulent kinetic energy.
+! Hout(idMtls) Write out turbulent kinetic energy times length scale.
+!
+! Hout(inert) Write out extra inert passive tracers.
+!
+!------------------------------------------------------------------------------
+! Logical switches (T/F) to activate writing of instantaneous fields into
+! QUICKSAVE file.
+!------------------------------------------------------------------------------
+!
+! Qout(idUvel) Write out 3D U-velocity component.
+! Qout(idVvel) Write out 3D V-velocity component.
+! Qout(idu3dE) Write out 3D Eastward velocity component at RHO-points.
+! Qout(idv3dN) Write out 3D Northward velocity component at RHO-points.
+! Qout(idWvel) Write out 3D W-velocity component.
+! Qout(idOvel) Write out 3D omega vertical velocity.
+! Qout(idUbar) Write out 2D U-velocity component.
+! Qout(idVbar) Write out 2D V-velocity component.
+! Qout(idu2dE) Write out 2D Eastward velocity component at RHO-points.
+! Qout(idv2dN) Write out 2D Northward velocity component at RHO-points.
+! Qout(idFsur) Write out free-surface.
+! Qout(idBath) Write out time-dependent bathymetry.
+!
+! Qout(idTvar) Write out active (NAT) tracers: temperature and salinity.
+!
+! Qout(idUsur) Write out surface U-velocity component.
+! Qout(idVsur) Write out surface V-velocity component.
+! Qout(idUsuE) Write out surface Eastward velocity component at RHO-points.
+! Qout(idVsuN) Write out surface Northward velocity component at RHO-points.
+!
+! Qout(idsurT) Write out surface temperature and salinity
+!
+! Qout(idpthR) Write out time-varying depths of RHO-points.
+! Qout(idpthU) Write out time-varying depths of U-points.
+! Qout(idpthV) Write out time-varying depths of V-points.
+! Qout(idpthW) Write out time-varying depths of W-points.
+!
+! Qout(idUsms) Write out surface U-momentum stress.
+! Qout(idVsms) Write out surface V-momentum stress.
+! Qout(idUbms) Write out bottom U-momentum stress.
+! Qout(idVbms) Write out bottom V-momentum stress.
+!
+! Qout(idUbrs) Write out current-induced, U-momentum stress.
+! Qout(idVbrs) Write out current-induced, V-momentum stress.
+! Qout(idUbws) Write out wind-induced, bottom U-wave stress.
+! Qout(idVbws) Write out wind-induced, bottom V-wave stress.
+! Qout(idUbcs) Write out bottom maximum wave and current U-stress.
+! Qout(idVbcs) Write out bottom maximum wave and current V-stress.
+!
+! Qout(idUbot) Write out wind-induced, bed wave orbital U-velocity.
+! Qout(idVbot) Write out wind-induced, bed wave orbital V-velocity.
+! Qout(idUbur) Write out bottom U-velocity above bed.
+! Qout(idVbvr) Write out bottom V-velocity above bed.
+!
+! Qout(idWztw) Write out WEC_VF quasi-static sea level adjustment.
+! Qout(idWqsp) Write out WEC_VF quasi-static pressure.
+! Qout(idWbeh) Write out WEC_VF Bernoulli head.
+!
+! Qout(idU2rs) Write out WEC 2D U-stress.
+! Qout(idV2rs) Write out WEC 2D V-stress.
+! Qout(idU3rs) Write out WEC 3D U-stress.
+! Qout(idV3rs) Write out WEC 3D V-stress.
+!
+! Qout(idU2Sd) Write out 2D Stokes U-velocity.
+! Qout(idV2Sd) Write out 2D Stokes V-velocity.
+! Qout(idU3Sd) Write out 3D Stokes U-velocity.
+! Qout(idV3Sd) Write out 3D Stokes V-velocity.
+! Qout(idW3St) Write out 3D Stokes W-velocity.
+! Qout(idW3Sd) Write out 3D Stokes omega-velocity.
+!
+! Qout(idWamp) Write out wave significat height.
+! Qout(idWlen) Write out wave mean wavelength.
+! Qout(idWlep) Write out wave peak wavelength.
+! Qout(idWdir) Write out wave mean direction.
+! Qout(idWdip) Write out wave peak direction.
+! Qout(idWptp) Write out wave surface period.
+! Qout(idWpbt) Write out wave bottom period.
+! Qout(idWorb) Write out wave bottom orbital velocity.
+! Qout(idWbrk) Write out wave breaking (percent).
+! Qout(idUwav) Write out wave depth-averaged U-velocity.
+! Qout(idVwav) Write out wave depth-averaged V-velocity.
+! Qout(idWdif) Write out wave dissipation from bottom friction.
+! Qout(idWdib) Write out wave dissipation from breaking.
+! Qout(idWdiw) Write out wave dissipation from whitecapping.
+! Qout(idWdis) Write out wave roller dissipation.
+! Qout(idWrol) Write out wave roller action density.
+!
+! Qout(idPair) Write out surface air pressure.
+! Qout(idTair) Write out surface air temperature.
+! Qout(idUair) Write out surface U-wind component.
+! Qout(idVair) Write out surface V-wind component.
+! Qout(idUaiE) Write out surface Eastward U-wind component.
+! Qout(idVaiN) Write out surface Northward V-wind component.
+!
+! Qout(idTsur) Write out surface net heat and salt flux
+! Qout(idLhea) Write out latent heat flux.
+! Qout(idShea) Write out sensible heat flux.
+! Qout(idLrad) Write out long-wave radiation flux.
+! Qout(idSrad) Write out short-wave radiation flux.
+! Qout(idEmPf) Write out E-P flux.
+! Qout(idevap) Write out evaporation rate.
+! Qout(idrain) Write out precipitation rate.
+!
+! Qout(idDano) Write out density anomaly.
+! Qout(idVvis) Write out vertical viscosity coefficient.
+! Qout(idTdif) Write out vertical diffusion coefficient of temperature.
+! Qout(idSdif) Write out vertical diffusion coefficient of salinity.
+! Qout(idHsbl) Write out depth of oceanic surface boundary layer.
+! Qout(idHbbl) Write out depth of oceanic bottom boundary layer.
+! Qout(idMtke) Write out turbulent kinetic energy.
+! Qout(idMtls) Write out turbulent kinetic energy times length scale.
+!
+! Qout(inert) Write out inert passive tracers.
+! Qout(Snert) Write out surface inert passive tracers.
+!
+!------------------------------------------------------------------------------
+! Logical switches (T/F) to activate writing of time-averaged fields into
+! AVERAGE file.
+!------------------------------------------------------------------------------
+!
+! Aout(idUvel) Write out 3D U-velocity component.
+! Aout(idVvel) Write out 3D V-velocity component.
+! Aout(idu3dE) Write out 3D Eastward velocity component at RHO-points.
+! Aout(idv3dN) Write out 3D Northward velocity component at RHO-points.
+! Aout(idWvel) Write out 3D W-velocity component.
+! Aout(idOvel) Write out 3D omega vertical velocity.
+! Aout(idUbar) Write out 2D U-velocity component.
+! Aout(idVbar) Write out 2D V-velocity component.
+! Aout(idu2dE) Write out 2D Eastward velocity component at RHO-points.
+! Aout(idv2dN) Write out 2D Northward velocity component at RHO-points.
+! Aout(idFsur) Write out free-surface.
+! Aout(idBath) Write out time-dependent bathymetry.
+!
+! Aout(idTvar) Write out active (NAT) tracers: temperature and salinity.
+!
+! Aout(idUsms) Write out surface U-momentum stress.
+! Aout(idVsms) Write out surface V-momentum stress.
+! Aout(idUbms) Write out bottom U-momentum stress.
+! Aout(idVbms) Write out bottom V-momentum stress.
+!
+! Aout(idUbrs) Write out current-induced, U-momentum stress.
+! Aout(idVbrs) Write out current-induced, V-momentum stress.
+! Aout(idUbws) Write out wind-induced, bottom U-wave stress.
+! Aout(idVbws) Write out wind-induced, bottom V-wave stress.
+! Aout(idUbcs) Write out bottom maximum wave and current U-stress.
+! Aout(idVbcs) Write out bottom maximum wave and current V-stress.
+! Aout(idUVwc) Write out bottom max wave-current stress magnitude.
+!
+! Aout(idUbot) Write out wind-induced, bed wave orbital U-velocity.
+! Aout(idVbot) Write out wind-induced, bed wave orbital V-velocity.
+! Aout(idUbur) Write out bottom U-velocity above bed.
+! Aout(idVbvr) Write out bottom V-velocity above bed.
+!
+! Aout(idWztw) Write out WEC_VF quasi-static sea level adjustment.
+! Aout(idWqsp) Write out WEC_VF quasi-static pressure.
+! Aout(idWbeh) Write out WEC_VF Bernoulli head.
+!
+! Aout(idU2rs) Write out WEC 2D U-stress.
+! Aout(idV2rs) Write out WEC 2D V-stress.
+! Aout(idU3rs) Write out WEC 3D U-stress.
+! Aout(idV3rs) Write out WEC 3D V-stress.
+!
+! Aout(idU2Sd) Write out 2D Stokes U-velocity.
+! Aout(idV2Sd) Write out 2D Stokes V-velocity.
+! Aout(idU3Sd) Write out 3D Stokes U-velocity.
+! Aout(idV3Sd) Write out 3D Stokes V-velocity.
+! Aout(idW3St) Write out 3D Stokes W-velocity.
+! Aout(idW3Sd) Write out 3D Stokes omega-velocity.
+!
+! Aout(idWamp) Write out wave significat height.
+! Aout(idWlen) Write out wave mean wavelength.
+! Aout(idWlep) Write out wave peak wavelength.
+! Aout(idWdir) Write out wave mean direction.
+! Aout(idWdip) Write out wave peak direction.
+! Aout(idWptp) Write out wave surface period.
+! Aout(idWpbt) Write out wave bottom period.
+! Aout(idWorb) Write out wave bottom orbital velocity.
+! Aout(idWbrk) Write out wave breaking (percent).
+! Aout(idUwav) Write out wave depth-averaged U-velocity.
+! Aout(idVwav) Write out wave depth-averaged V-velocity.
+! Aout(idWdif) Write out wave dissipation from bottom friction.
+! Aout(idWdib) Write out wave dissipation from breaking.
+! Aout(idWdiw) Write out wave dissipation from whitecapping.
+! Aout(idWdis) Write out wave roller dissipation.
+! Aout(idWrol) Write out wave roller action density.
+!
+! Aout(idPair) Write out surface air pressure.
+! Aout(idTair) Write out surface air temperature.
+! Aout(idUair) Write out surface U-wind component.
+! Aout(idVair) Write out surface V-wind component.
+! Aout(idUaiE) Write out surface Eastward U-wind component.
+! Aout(idVaiN) Write out surface Northward V-wind component.
+!
+! Aout(idTsur) Write out surface net heat and salt flux
+! Aout(idLhea) Write out latent heat flux.
+! Aout(idShea) Write out sensible heat flux.
+! Aout(idLrad) Write out long-wave radiation flux.
+! Aout(idSrad) Write out short-wave radiation flux.
+! Aout(idevap) Write out evaporation rate.
+! Aout(idrain) Write out precipitation rate.
+!
+! Aout(idDano) Write out density anomaly.
+! Aout(idVvis) Write out vertical viscosity coefficient.
+! Aout(idTdif) Write out vertical diffusion coefficient of temperature.
+! Aout(idSdif) Write out vertical diffusion coefficient of salinity.
+! Aout(idHsbl) Write out depth of oceanic surface boundary layer.
+! Aout(idHbbl) Write out depth of oceanic bottom boundary layer.
+!
+! Aout(id2dRV) Write out 2D relative vorticity (vertically integrated).
+! Aout(id3dRV) Write out 3D relative vorticity.
+! Aout(id2dPV) Write out 2D potential vorticity (shallow water).
+! Aout(id3dPV) Write out 3D potential vorticity.
+!
+! Aout(idu3dD) Write out detided 3D U-velocity.
+! Aout(idv3dD) Write out detided 3D V-velocity.
+! Aout(idu2dD) Write out detided 2D U-velocity.
+! Aout(idv2dD) Write out detided 2D V-velocity.
+! Aout(idFsuD) Write out detided free-surface
+!
+! Aout(idTrcD) Write out detided temperature and salinity.
+!
+! Aout(idHUav) Write out u-volume flux, Huon.
+! Aout(idHVav) Write out v-volume flux, Hvom.
+! Aout(idUUav) Write out quadratic term.
+! Aout(idUVav) Write out quadratic term.
+! Aout(idVVav) Write out quadratic term.
+! Aout(idU2av) Write out quadratic term.
+! Aout(idV2av) Write out quadratic term.
+! Aout(idZZav) Write out quadratic term.
+!
+! Aout(idTTav) Write out quadratic active and inert tracers terms.
+! Aout(idUTav) Write out quadratic active and inert tracers terms.
+! Aout(idVTav) Write out quadratic active and inert tracers terms.
+! Aout(iHUTav) Write out active and inert tracer u-volume flux, .
+! Aout(iHVTav) Write out active and inert tracer v-volume flux, .
+!
+! Aout(inert) Write out extra inert passive tracers.
+!
+!------------------------------------------------------------------------------
+! Logical switches (T/F) to activate writing of time-averaged fields into
+! DIAGNOSTIC file.
+!------------------------------------------------------------------------------
+!
+! Time-averaged, 2D momentum (ubar,vbar) diagnostic terms:
+! (if DIAGNOSTICS_UV)
+!
+! Dout(M2rate) Write out acceleration.
+! Dout(M2pgrd) Write out pressure gradient.
+! Dout(M2fcor) Write out Coriolis force, if UV_COR.
+! Dout(M2hadv) Write out horizontal total advection, if UV_ADV.
+! Dout(M2xadv) Write out horizontal XI-advection, if UV_ADV.
+! Dout(M2yadv) Write out horizontal ETA-advection, if UV_ADV.
+! Dout(M2hvis) Write out horizontal total viscosity, if UV_VIS2 or UV_VIS4.
+! Dout(M2xvis) Write out horizontal XI-viscosity, if UV_VIS2 or UV_VIS4.
+! Dout(M2yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4.
+! Dout(M2sstr) Write out surface stress.
+! Dout(M2bstr) Write out bottom stress
+!
+! Time-averaged, 3D momentum (u,v) diagnostic terms:
+! (if SOLVE3D and DIAGNOSTICS_UV)
+!
+! Dout(M3rate) Write out acceleration.
+! Dout(M3pgrd) Write out pressure gradient.
+! Dout(M3fcor) Write out Coriolis force, if UV_COR.
+! Dout(M3hadv) Write out horizontal total advection, if UV_ADV.
+! Dout(M3xadv) Write out horizontal XI-advection, if UV_ADV.
+! Dout(M3yadv) Write out horizontal ETA-advection, if UV_ADV.
+! Dout(M3hvis) Write out horizontal total viscosity, if UV_VIS2 or UV_VIS4.
+! Dout(M3xvis) Write out horizontal XI-viscosity, if UV_VIS2 or UV_VIS4.
+! Dout(M3yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4.
+! Dout(M3yvis) Write out horizontal ETA-viscosity, if UV_VIS2 or UV_VIS4.
+! Dout(M3vvis) Write out vertical viscosity.
+!
+! Time-averaged, Waves Effect on Currents diagnostic terms:
+! (if SOLVE3D, WEC, WEC_VF, and DIAGNOSTICS_UV)
+!
+! Dout(M2hjvf) Write out 2D horizontal J vortex force.
+! Dout(M2kvrf) Write out 2D K vortex force.
+! Dout(M2fsco) Write out 2D Stokes Coriolis.
+! Dout(M2sstm) Write out 2D surface streaming.
+! Dout(M2bstm) Write out 2D bottom streaming.
+! Dout(M2wrol) Write out 2D wave roller acceleration.
+! Dout(M2wbrk) Write out 2D wave breaking.
+! Dout(M2zeta) Write out 2D Eulerian sea level adjustment.
+! Dout(M2zetw) Write out 2D quasi-static sea level adjustment.
+! Dout(M2zqsp) Write out 2D quasi-static sea level pressure adjustment.
+! Dout(M2zbeh) Write out 2D Bernoulli head adjustment.
+! Dout(M2fsgr) Write out 2D seagrass drag force.
+!
+! Dout(M3hjvf) Write out 3D horizontal J vortex force.
+! Dout(M3vjvf) Write out 3D vertical J vortex force.
+! Dout(M3kvrf) Write out 3D K vortex force.
+! Dout(M3fsco) Write out 3D Stokes Coriolis.
+! Dout(M3sstm) Write out 3D surface streaming.
+! Dout(M3bstm) Write out 3D bottom streaming.
+! Dout(M3wrol) Write out 3D wave roller acceleration.
+! Dout(M3wbrk) Write out 3D wave breaking.
+! Dout(M3fsgr) Write out 3D seagrass drag force.
+!
+! Time-averaged, active (temperature and salinity) and passive (inert) tracer
+! diagnostic terms, [1:NAT+NPT,Ngrids] values expected:
+! (if SOLVE3D and DIAGNOSTICS_TS)
+!
+! Dout(iTrate) Write out time rate of change.
+! Dout(iThadv) Write out horizontal total advection.
+! Dout(iTxadv) Write out horizontal XI-advection.
+! Dout(iTyadv) Write out horizontal ETA-advection.
+! Dout(iTvadv) Write out vertical advection.
+! Dout(iThdif) Write out horizontal total diffusion, if TS_DIF2 or TS_DIF4.
+! Dout(iTxdif) Write out horizonta1 XI-diffusion, if TS_DIF2 or TS_DIF4.
+! Dout(iTydif) Write out horizontal ETA-diffusion, if TS_DIF2 or TS_DIF4.
+! Dout(iTsdif) Write out horizontal S-diffusion, if TS_DIF2 or TS_DIF4 and
+! rotated tensor (MIX_GEO_TS or MIX_ISO_TS).
+! Dout(iTvdif) Write out vertical diffusion.
+!
+!------------------------------------------------------------------------------
+! Generic User parameters.
+!------------------------------------------------------------------------------
+!
+! NUSER Number of User parameters to consider (integer).
+!
+! USER Vector containing user parameters (real array). This array
+! is used with the SANITY_CHECK to test the correctness of
+! the tangent linear adjoint models. It contains information
+! of the model variable and grid point to perturb:
+!
+! INT(user(1)): tangent state variable to perturb
+! 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
+!
+! Set tangent and adjoint parameters to the same values
+! if perturbing and reporting the same variable.
+!
+!------------------------------------------------------------------------------
+! I/O options and parameters. A more complete description of the available
+! options can be found in WikiROMS (https://myroms.org/wiki/IO).
+!------------------------------------------------------------------------------
+!
+! The ROMS input and output NetCDF files can be processed using the standard
+! NetCDF library developed by UNIDATA, the Parallel-IO (PIO) library developed
+! at NCAR, or the SCORPIO library available in E3SM (Sreepathi et al., 2013;
+! doi:10.1109/HiPC.2013.6799128). The SCORPIO library was forked from the PIO
+! library several years ago, and they have evolved separately. In addition to
+! the standard NetCDF library, ROMS can be compiled with either the PIO or
+! SCORPIO libraries. Check www.myroms.org/wiki/External_Libraries for more
+! information on how to obtain and install these libraries. The user has the
+! choice to select which library is used to process input and output NetCDF
+! files. For parallel I/O, we recommend using the PIO library because it is
+! more efficient than the SCORPIO library in our benchmark tests.
+!
+! The Parallel I/O using the PIO or SCORPIO libraries is restricted to
+! distributed-memory applications because it uses MPI-IO implementations
+! like ROMIO.
+!
+! * ROMS Input and Output NetCDF library to use flag: [1 or 2]
+!
+! [1] Standard NetCDF3 or NetCDF4 library (Unidata)
+! [2] Serial/Parallel I/O using Paralle-IO (PIO) library (MPI applications)
+!
+! INP_LIB Reading library flag for input NetCDF files
+!
+! OUT_LIB Creation/writing library flag for output NetCDF files
+!
+! * PIO method flag for reading/writing NetCDF files: [0,1,2,3,4]
+!
+! [0] parallel read and write of PnetCDF files (CDF-5 type)
+! [1] parallel read and write of PnetCDF files (NetCDF3 64-bit offset type)
+! [2] serial read and write of NetCDF3 files (NetCDF3 64-bit offset type)
+! [3] parallel read and serial write of NetCDF4/HDF5 files (NetCDF4 type)
+! [4] parallel read and write of NETCDF4/HDF5 files (NetCDF4 type)
+!
+! PIO_METHOD PIO library file type for reading or writing. Depending on
+! the build of the PIO library, not all the I/O types are
+! available. If NetCDF library does not support parallel I/O,
+! PIO_METHOD=3,4 are not available. Notice that we can create
+! CDF-5 type PnetCDF files (PIO_METHOD=0), but it is not
+! recommended because portability and post-processing
+! constraints. Currently, NetCDF4/HDF5 data compression is
+! possible with PIO_METHOD=3 during serial write.
+!
+! * PIO library processes set-up:
+!
+! PIO_IOTASKS Number of MPI processors used for I/O. If I/O decomposition is
+! identical to the computational decomposition, PIO_IOTASK is
+! equal to NtileI*NtileJ. Typically, it is advantageous and
+! highly recommended to define the I/O decomposition in smaller
+! number of processes for efficiency and to avoid MPI
+! communication bottlenecks.
+!
+! PIO_STRIDE Stride step in the MPI-rank between I/O tasks.
+!
+! PIO_BASE Offset for the first I/O task (usually, PIO_BASE=1).
+!
+! PIO_AGGREG Number of MPI-aggregators to use in intra-communication mode to
+! improve MPI collective I/O performance.
+!
+! In intra-communications mode, all processors in OCN_COMM_WORLD
+! are involved in computations. A subset or all processors does
+! I/O (and also computations). The PIO_IOTASKS and PIO_STRIDE
+! parameters specify the total number of I/O tasks and the stride
+! between them with respect to the ROMS MPI-communicator object,
+! OCN_COMM_WORLD. The optional PIO_BASE parameter is used to shift
+! the first I/O task away from the first computational task. This
+! is often desirable because the application's first computational
+! task usually has higher memory requirements than other processes.
+! If the MPI-processes are spread over several hardware nodes, it
+! is highly recommended to use a value for PIO_STRIDE that scatters
+! the I/O processes over all nodes. Avoid all the I/O processes
+! occupying the same node.
+!
+! In the inter-communications (asynchronous) mode, the I/O tasks
+! are a disjointed set of dedicated I/O processes and do not
+! perform computations. It is possible to have several groups of
+! computational units running separate models (coupling) where
+! all the I/O data are sent to dedicated processes. Asynchronous
+! I/O is still under development and not recommended for use at
+! this time.
+!
+!
+! * PIO rearranger methods for moving data between computational and I/O
+! processes:
+!
+! [1] Box rearrangement
+! [2] Subset rearrangement
+!
+! PIO_REARR Rearrangement method between computational and I/O processes. It
+! provides the ability to rearrange data between computational
+! and parallel I/O decompositions.
+!
+! In the box method, data is rearranged from computational to I/O
+! processes in a continuous manner to the data ordering in the
+! file. Since the ordering of data between computational and I/O
+! partitions may be different, the rearrangement will require
+! all-to-all MPI communications. Also, notice that each computing
+! tile may transfer data to one or more I/O processes.
+!
+! In the subset method, each I/O process is associated with a
+! subset of computing processes. The computing tile sends its data
+! to a unique I/O process. The data on I/O processes may be more
+! fragmented to the ordering on disk, which may increase the
+! communications to the storage medium. However, the rearrangement
+! scales better since all-to-all MPI communications are not
+! required.
+!
+! * PIO rearranger MPI communication flag:
+!
+! [0] Point-to-Point (basic send/receive individual operations)
+! [1] Collective (high-level gather/scatter grouped operations)
+!
+! PIO_REARRCOM Type of communications between computational to I/O processes.
+! In some systems with a generic MPI library implementation, the
+! Point-to-Point communications are more efficient.
+!
+! * PIO rearranger MPI communications direction control flag:
+!
+! [0] Enable computational to I/O processes, and vice versa
+! [1] Enable computational to I/O processes only
+! [2] Enable I/O to computational processes only
+! [3] Disable flow control
+!
+! PIO_REARRDIR Flow control algorithm between computational and I/O processes:
+!
+! Optimally, MPI communications should be designed to send a modest
+! number messages evenly distributed across a number of processes.
+! An excessive number of messages to a single MPI-process can
+! exhaust the buffer space which can affect efficiency or failure
+! due to the slowdown in the retransmitting of dropped messages.
+! PIO only send messages (Isend) when the receiver is ready and
+! has sufficient resources.
+!
+! * PIO rearranger options for communications from computational to I/O
+! processes (C2I):
+!
+! PIO_C2I_HS Logical switch (T/F) to enable C2I exchange handshake
+! PIO_C2I_Send Logical switch (T/F) to enable C2I MPI-Isends
+! PIO_C2I_Preq Maximum pending C2I requests
+!
+! * PIO rearranger options for communications from I/O to computational
+! processes (I2C):
+!
+! PIO_I2C_HS Logical switch (T/F) to enable I2C exchange handshake
+! PIO_I2C_Send Logical switch (T/F) to enable I2C MPI-Isends
+! PIO_I2C_Preq Maximum pending I2C requests
+!
+! * 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 because the compression makes it impossible for the
+! HDF5 library to exactly map the data to the disk location. For more
+! information, check NetCDF official website:
+!
+! www.unidata.ucar.edu/software/netcdf
+!
+! NC_SHUFFLE Shuffle filter integer flag. If non-zero, turn on shuffle
+! filter.
+!
+! NC_DEFLATE Deflate filter integer flag, If non-zero, turn on deflate
+! filter at the level specified by the NC_DLEVEL parameter.
+!
+! NC_DLEVEL Deflate filter level parameter (integer). If NC_DEFLATE is
+! non-zero, set the deflate level to this value. Must be
+! between 0 and 9.
+!
+!------------------------------------------------------------------------------
+! If GRID_EXTRACT is activated, set extraction parameters.
+!------------------------------------------------------------------------------
+!
+! ExtracFlag Flag to extract and write history solution into the EXTRACT
+! file at the desired grid geometry by decimation or horizontal
+! interpolation:
+!
+! ExtractFlag = 0 No extraction
+! ExtractFlag = 1 Extract via horizontal interpolation
+! ExtractFlag > 2 Extract via coarsening by decimation
+!
+! If decimation, ExtracTFlag is the sampling factor. For now, you
+! must use ExtractFlag=2 so data is written at every other point.
+! Notice that it is required to satisfy the following criteria:
+!
+! MOD(Lm+1, ExtractFlag) = 0
+! MOD(Mm+1, ExtractFlag) = 0
+!
+! Grid decimation is intended for the split 4D-Var algorithms to
+! facilitate running the inner loops at coarser resolution to
+! accelerate the computations. The advantage of ExtractFlag=2 is
+! that it is very trivial to decimate the staggered U- and
+! V-variables with a simple average. Also, we need to consider
+! special rules in the land/sea masking that limit its use to
+! other ExtractFlag values.
+!
+! GRXNAME Input extract grid geometry NetCDF filename. It must be created
+! with tools similar to the ROMS application grid and contained
+! inside the parent grid (GRDNAME).
+!
+!------------------------------------------------------------------------------
+! Input/output NetCDF filenames (string with a maximum of 256 characters).
+!------------------------------------------------------------------------------
+!
+! Input filenames:
+!
+! GRDNAME Input grid filename.
+!
+! ININAME Input nonlinear initial conditions filename. It can be a
+! re-start file.
+!
+! ITLNAME Input tangent linear model initial conditions filename.
+!
+! IRPNAME Input representer model initial conditions filename.
+!
+! IADNAME Input adjoint model initial conditions filename.
+!
+! FWDNAME Input forward solution fields filename.
+!
+! ADSNAME Input adjoint sensitivity functional filename.
+!
+! Input adjoint forcing filenames for computing observations impacts
+! during the analysis-forecast cycle when RBL4DVAR_FCT_SENSITIVITY is
+! activated. The files FOInameA and FOInameB are used when the forecast
+! metric is defined in state-space (CPP option OBS_SPACE is off). Both
+! are regular adjoint forcing files just like ADSname.
+!
+! (See www.myroms.org/wiki/Analysis-Forecast_Cycle_Observation_Impacts)
+!
+! FOInameA Forecast initialized with 4D-Var analysis (red curve)
+!
+! FOInameB Forecast initialized with 4D_Var background (blue curve)
+!
+!
+! Input NetCDF filenames for the forecasts initialized from the 4D-Var
+! analysis files:
+!
+! FCTnameA Current 4D-Var analysis cycle (red curve)
+!
+! FCTnameB Previous 4D-Var analysis cycle (blue curve)
+!
+!
+! Nesting grids connectivity data:
+!
+! NGCNAME Input nested grids contact points information filename. This
+! NetCDF file is currently generated using script:
+!
+! matlab/grid/contact.m
+!
+! from the ROMS Matlab repository. The nesting information
+! is not trivial and this Matlab scripts is quite complex. See
+!
+! https://www.myroms.org/wiki/index.php/Nested_Grids
+! https://www.myroms.org/wiki/index.php/Grid_Processing_Scripts
+!
+! for more information.
+!
+!
+! Input lateral boundary conditions file(s) name:
+!
+! NBCFILES Number of unique boundary files per nested grid.
+!
+! BRYNAME Input open boundary data filename(s) per nested grid.
+!
+! The USER has the option to enter several filenames for the lateral
+! boundary conditions variables and or split input data time records for
+! each nested grid. For example, the USER may have different files for
+! physical, biology, and sediment state variables. The model will scan
+! the file list and will read the needed data from the first file in the
+! list containing the lateral boundary variable. Therefore, the order of
+! the filenames is critical. It is also possible to split input data
+! time records into several NetCDF files.
+!
+! NBCFILES == 2 ! number of boundary files
+!
+! BRYNAME == my_physics_bry_year1.nc | ! physical kernel variables
+! my_physics_bry_year2.nc \
+! my_biology_bry_year1.nc | ! biological tracers
+! my_biology_bry_year2.nc
+!
+!
+! Input climatology file(s) name:
+!
+! NCLMFILES Number of unique climatology files per nested grid.
+!
+! CLMNAME Input climatology data filename(s) per nested grid.
+!
+! The USER has the option to enter several filenames for the climatology
+! variables and or split input data time records for each nested grid.
+! For example, the USER may have different files for physical, biology,
+! and sediment state variables. The model will scan the file list and
+! will read the needed data from the first file in the list containing
+! the lateral climatology variable. Therefore, the order of the filenames
+! is critical. It is also possible to split input data time records into
+! several NetCDF files.
+!
+! NCLMFILES == 2 ! number of climatology files
+!
+! CLMNAME == my_physics_clm_year1.nc | ! physical kernel variables
+! my_physics_bry_year2.nc \
+! my_biology_bry_year1.nc | ! biological tracers
+! my_biology_bry_year2.nc
+!
+!
+! Input nudging coefficients filename:
+!
+! NUDNAME Input nudging coefficients filename.
+!
+!
+! Input Sources/Sinks forcing filename:
+!
+! SSFNAME River runoff data. This file is now separated from the
+! regular forcing files to allow manipulations over nested
+! grids. A particular nesting grid may or may not have
+! Sources/Sinks forcing.
+!
+! For example, in an application with 3 nested grids but
+! with river forcing in grids 1 and 3 we would have:
+!
+! LuvSrc == T F T
+! LtracerSrc == 2*T 2*F 2*T
+!
+! SSFNAME == my_rivers_grid1.nc \
+! my_rivers_grid2.nc \
+! my_rivers_grid3.nc
+!
+! Here, "my_rivers_grid2.nc" is a dummy name that will never
+! be processed in ROMS because of the logical switches are
+! FALSE the second grid.
+!
+!
+! Input/output tidal forcing filename:
+!
+! TIDENAME Tidal constituents period, phase, elevation, and current data.
+! This data is needed when SSH_TIDES, UV_TIDES, or both are
+! activated to force tides at the open boundaries. Currently,
+! in nested applications, the tidal forcing is used in the
+! coarser/larger grid (ng=1). If AVERAGES_DETIDE is activated,
+! several least-squares time-accumulated harmonic variables
+! are written into this NetCDF file to facilitate restart for
+! during long fitting simulations.
+!
+!
+! Input forcing file(s) name:
+!
+! NFFILES Number of unique forcing files per nested grid.
+!
+! FRCNAME Input forcing fields filename per nested grid.
+!
+! The USER has the option to enter several filenames for forcing fields
+! and or split input data time records for each nested grid. For example,
+! the USER may have different files for wind products, heat fluxes, 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 filenames is essential. It is also possible to split
+! input data time records into several NetCDF files.
+!
+! Use a single line per entry with a continuation (\) or vertical bar (|)
+! symbol after each entry, except the last one:
+!
+! NFFILES == 6 ! number of unique forcing files
+!
+! FRCNAME == my_lwrad_year1.nc | ! net longwave radiation flux
+! my_lwrad_year2.nc \
+! my_swrad_year1.nc | ! solar shortwave radiation flux
+! my_swrad_year2.nc \
+! my_winds_year1.nc | ! surface winds
+! my_winds_year2.nc \
+! my_Pair_year1.nc | ! surface air pressure
+! my_Pair_year2.nc \
+! my_Qair_year1.nc | ! surface air relative humidity
+! my_Qair_year2.nc \
+! my_Tair_year1.nc | ! surface air temperature
+! my_Tair_year2.nc
+!
+!
+! Output filenames:
+!
+! DAINAME Output data assimilation next cycle initial conditions (4D-Var
+! analysis) or restart (Ensemble Kalman Filter, EnKF) filename.
+! GSTNAME Output GST analysis re-start filename.
+! RSTNAME Output re-start filename.
+! HISNAME Output history filename.
+! XTRNAME Output extrated solution filename.
+! QCKNAME Output quicksave filename.
+! TLFNAME Output impulse forcing for tangent linear (TLM and RPM) models.
+! TLMNAME Output tangent linear filename.
+! ADJNAME Output adjoint filename.
+! AVGNAME Output averages filename.
+! HARNAME Output least-squares detiding harmonics filename.
+! DIANAME Output diagnostics filename.
+! STANAME Output stations filename.
+! FLTNAME Output floats filename.
+!
+!------------------------------------------------------------------------------
+! Input ASCII parameters filenames.
+!------------------------------------------------------------------------------
+!
+! APARNAM Input assimilation parameters filename.
+! SPOSNAM Input stations positions filename.
+! FPOSNAM Input initial drifters positions filename.
+! BPARNAM Input biological parameters filename.
+! SPARNAM Input sediment transport parameters filename.
+! USRNAME USER's input generic filename.
+!
diff --git a/WC13/RBL4DVAR_IAU/s4dvar.in b/WC13/RBL4DVAR_IAU/s4dvar.in
new file mode 100644
index 00000000..b0880b78
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/s4dvar.in
@@ -0,0 +1,1073 @@
+! 4DVar assimilation input parameters.
+!
+! git $Id$
+!========================================================= Hernan G. Arango ===
+! Copyright (c) 2002-2024 The ROMS/TOMS Group !
+! Licensed under a MIT/X style license !
+! See License_ROMS.md !
+!==============================================================================
+! !
+! Input parameters can be entered in ANY order, provided that the parameter !
+! KEYWORD (usually, upper case) is typed correctly followed by "=" or "==" !
+! symbols. Any comment lines are allowed and must begin with an exclamation !
+! mark (!) in column one. Comments may appear to the right of a parameter !
+! specification to improve documentation. Comments will be ignored during !
+! reading. Blank lines are also allowed and ignored. Continuation lines in !
+! a parameter specification are allowed and must be preceded by a backslash !
+! (\). In some instances, more than one value is required for a parameter. !
+! If fewer values are provided, the last value is assigned for the entire !
+! parameter array. The multiplication symbol (*), without blank spaces in !
+! between, is allowed for a parameter specification. For example, in a two !
+! grids nested application: !
+! !
+! AKT_BAK == 2*1.0d-6 2*5.0d-6 ! m2/s !
+! !
+! indicates that the first two entries of array AKT_BAK, in fortran column- !
+! major order, will have the same value of "1.0d-6" for grid 1, whereas the !
+! next two entries will have the same value of "5.0d-6" for grid 2. !
+! !
+! In multiple levels of nesting and/or multiple connected domains setups, !
+! "Ngrids" entries are expected for some of these parameters. In such cases, !
+! the order of the entries for a parameter is extremely important. It must !
+! follow the same order (1:Ngrids) as in the state variable declaration. The !
+! USER may follow the above guidelines for specifying his/her values. These !
+! parameters are marked by "==" plural symbol after the KEYWORD. !
+! !
+!==============================================================================
+!
+
+! Number of iterations in the biconjugate gradient algorithm used to solve
+! the elliptic equation for sea surface height in the error covariance
+! balance operator, [1:Ngrids].
+
+ Nbico == 200
+
+! Parameters used to compute balanced salinity in terms of temperature using
+! empirical T-S relationships in the error covariance balance operator,
+! [1:Ngrids].
+
+ dTdz_min == 0.001d0 ! minimum dT/dz (Celsius/m)
+ ml_depth == 100.0d0 ! mixed-layer depth (m; positive)
+
+! Balance operator level of no motion depth (m) used when computing balanced
+! free-surface contribution, [1:Ngrids].
+
+ LNM_depth == 1000.0d0 ! meters, positive
+
+! Balance operator level of no motion flag used to compute balanced
+! free-surface contribution:
+!
+! [0] Integrate from local bottom to the surface
+! [1] Integrate from LNM_depth to surface or integrate from local bottom
+! if shallower than LNM_depth
+!
+
+ LNM_flag = 1
+
+! Balance operator logical switches for state variables to consider in the
+! error covariance multivariate constraints.
+
+balance(isSalt) = T ! salinity
+balance(isFsur) = T ! free-sruface
+balance(isVbar) = F ! 2D momentum (ubar, vbar)
+balance(isVvel) = T ! 3D momentum (u, v)
+
+! Parameter to process the Nvct eigenvector of the stabilized representer
+! matrix when computing array modes (here, Nvct=Ninner is the most important
+! while Nvct=1 is the least important) OR cut-off parameter for the clipped
+! analysis to disregard potentially unphysical array modes (that is, all
+! the eigenvectors < Nctv are disgarded).
+
+ Nvct = 50
+
+! Upper bound on the relative error of the gradient for the Lanczos
+! conjugate gradient algorithm.
+
+ GradErr = 1.0d-4
+
+! Maximum error bound on Hessian eigenvectors in the Lanczos conjugate
+! gradient algorithm. Note that even quite inaccurate eigenvectors are
+! useful for pre-conditioning purposes.
+
+ HevecErr = 1.0d-1
+
+! Switch (T/F) to compute approximated Hessian eigenpairs in the Lanczos
+! conjugate gradient algorithm.
+
+ LhessianEV = T
+
+! Switch (T/F) to activate hot start in weak-constraint (R4DVAR and
+! RBL4DVAR) algorithms of subsequent outer loops.
+
+ LhotStart = T
+
+! Switch (T/F) to activate I4DVAR conjugate gradient preconditioning.
+! Two types of Limited-Memory Preconditioner (LMP) are available
+! (Tshimanga et al., 2008): spectral LMP and Ritz LMP.
+
+ Lprecond = F
+
+! Switch to activate either Ritz Limited-Memory Preconditioner (T)
+! or spectral Limited-Memory Preconditioner (F) to the I4DVAR algorithm.
+
+ Lritz = T
+
+! If preconditioning, specify number of eigenpairs to use. If zero,
+! use HevecErr parameter to determine the number of converged eigenpairs.
+
+ NritzEV = 0
+
+! If weak constraint 4D-Var, set number of iterations in the Lanczos
+! algorithm used to estimate the posterior analysis error covariance
+! matrix.
+
+ NpostI = 50
+
+! If observations impact or observations sensitivity, set the 4D-Var
+! outer loop to process. It must be less or equal to Nouter.
+
+ Nimpact = 1
+
+! If multiple executables 4D-Var, set the current outer counter and
+! its computation phase (string). The 4D-Var running script assigns
+! their values.
+
+ OuterLoop = MyOuterLoop
+
+ Phase4DVAR = MyPhase4DVAR
+
+! Number of extra-observation classes (NextraObs), observation type
+! indices (ExtraIndex), and observation type names (ExtraName) to
+! consider in addition to the 1-to-1 associated with the state
+! variables. It is used in observation operators that require more than
+! one state variable to evaluate a particular observation type like
+! HF radials, travel time, pressure, etc.
+!
+! In any application, the number of observation types is computed as:
+! NobsVar = NstateVar + NextraObs.
+!
+! NextraObs values are expected for keywords ExtraIndex and ExtraName.
+! If NextraVar > 1, enter one observation type name per line and
+! use a backslash as the continuation.
+
+ NextraObs = 0
+
+ ExtraIndex = 20
+
+ ExtraName = radial
+
+! If weak constraint 4D-Var, set diffusive relaxation coefficients (m2/s)
+! used to relax representer tangent linear solution to privious Picard
+! iteration linearized trajectory.
+
+ tl_M2diff == 0.0d0 ! 2D momentum
+ tl_M3diff == 0.0d0 ! 3D momentum
+
+ tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 4.0d0
+
+! Switches (T/F) to create and write error covariance normalization
+! factors for model, initial conditions, boundary conditions, and
+! surface forcing. If TRUE, these factors are computed and written
+! to NRMname(1:4) NetCDF files. If FALSE, they are read from NRMname(1:4)
+! NetCDF file. The computation of these factors is very expensive and
+! needs to be computed only once for a particular application provided
+! that grid land/sea masking, and decorrelation scales remain
+! the same. Notice that four values are needed (1=initial conditions,
+! 2=model, 3=boundary conditions, 4=surface forcing) per each nested
+! grid, [1:4,1:Ngrids].
+
+ LdefNRM == F F F F ! Create a new normalization files
+ LwrtNRM == F F F F ! Compute and write normalization
+
+! Switches to compute the correlation normalization coefficients for
+! model error covariance.
+
+ CnormM(isFsur) = T ! 2D variable at RHO-points
+ CnormM(isUbar) = T ! 2D variable at U-points
+ CnormM(isVbar) = T ! 2D variable at V-points
+ CnormM(isUvel) = T ! 3D variable at U-points
+ CnormM(isVvel) = T ! 3D variable at V-points
+ CnormM(isTvar) = T T ! NT tracers
+
+! Switches to compute the correlation normalization coefficients for
+! initial conditions error covariance.
+
+ CnormI(isFsur) = T ! 2D variable at RHO-points
+ CnormI(isUbar) = T ! 2D variable at U-points
+ CnormI(isVbar) = T ! 2D variable at V-points
+ CnormI(isUvel) = T ! 3D variable at U-points
+ CnormI(isVvel) = T ! 3D variable at V-points
+ CnormI(isTvar) = T T ! NT tracers
+
+! Switches to compute the correlation normalization coefficients for
+! boundary conditions error covariance.
+
+ CnormB(isFsur) = T ! 2D variable at RHO-points
+ CnormB(isUbar) = T ! 2D variable at U-points
+ CnormB(isVbar) = T ! 2D variable at V-points
+ CnormB(isUvel) = T ! 3D variable at U-points
+ CnormB(isVvel) = T ! 3D variable at V-points
+ CnormB(isTvar) = T T ! NT tracers
+
+! Switches to compute the correlation normalization coefficients for
+! surface forcing error covariance.
+
+ CnormF(isUstr) = T ! surface U-momentum stress
+ CnormF(isVstr) = T ! surface V-momentum stress
+ CnormF(isTsur) = T T ! NT surface tracers flux
+
+! Correlation normalization method:
+!
+! [0] Exact, very expensive
+! [1] Approximated, randomization
+
+ Nmethod == 0
+
+! If randomization, select random number generation scheme:
+!
+! [1] Gaussian distributed deviates, numerical recipes
+
+ Rscheme == 1
+
+! Number of iterations to compute correlation normalization coefficients
+! via the randomization approach. A large number is required to be
+! statistically meaningful and achieve zero expectation mean and unit
+! variance. These factors insure that the error covariance diagonal
+! elements are equal to unity.
+
+ Nrandom = 5000
+
+! Horizontal and vertical stability and accuracy factors (< 1) used to
+! time-step discretized convolution operators below its theoretical limit.
+! Notice that four values [1:4] are needed for each factor to facilitate
+! the error covariance modeling: 1=initial conditions, 2=model,
+! 3=boundary conditions, and 4=surface forcing.
+!
+! IC Model OBC Sur For
+
+ Hgamma = 0.5 0.5 0.5 0.5 ! horizontal operator
+ Vgamma = 0.0005 0.0005 0.0005 0.0005 ! vertical operator
+
+! Model error covariance: horizontal, isotropic decorrelation scales (m).
+! This scales are only used in weak-constraint data assimilation.
+
+HdecayM(isFsur) == 50.0d+3 ! free-surface
+HdecayM(isUbar) == 50.0d+3 ! 2D U-momentum
+HdecayM(isVbar) == 50.0d+3 ! 2D V-momentum
+HdecayM(isUvel) == 50.0d+3 ! 3D U-momentum
+HdecayM(isVvel) == 50.0d+3 ! 3D V-momentum
+HdecayM(isTvar) == 50.0d+3 50.0d+3 ! 1:NT tracers
+
+! Model error covariance: vertical, isotropic decorrelation scales (m).
+
+VdecayM(isUvel) == 30.0d0 ! 3D U-momentum
+VdecayM(isVvel) == 30.0d0 ! 3D V-momentum
+VdecayM(isTvar) == 30.0d0 30.0d0 ! 1:NT tracers
+
+! Model error covariance: temporal decorrelation scales (days).
+! This scales are only used in weak-constraint data assimilation.
+
+TdecayM(isFsur) == 1.0d0 ! free-surface
+TdecayM(isUbar) == 1.0d0 ! 2D U-momentum
+TdecayM(isVbar) == 1.0d0 ! 2D V-momentum
+TdecayM(isUvel) == 1.0d0 ! 3D U-momentum
+TdecayM(isVvel) == 1.0d0 ! 3D V-momentum
+TdecayM(isTvar) == 1.0d0 1.0d0 ! 1:NT tracers
+
+! Initial conditions error covariance: horizontal, isotropic decorrelation
+! scales (m).
+
+HdecayI(isFsur) == 50.0d+3 ! free-surface
+HdecayI(isUbar) == 50.0d+3 ! 2D U-momentum
+HdecayI(isVbar) == 50.0d+3 ! 2D V-momentum
+HdecayI(isUvel) == 50.0d+3 ! 3D U-momentum
+HdecayI(isVvel) == 50.0d+3 ! 3D V-momentum
+HdecayI(isTvar) == 50.0d+3 50.0d+3 ! 1:NT tracers
+
+! Initial conditions error covariance: vertical, isotropic decorrelation
+! scales (m).
+
+VdecayI(isUvel) == 30.0d0 ! 3D U-momentum
+VdecayI(isVvel) == 30.0d0 ! 3D V-momentum
+VdecayI(isTvar) == 30.0d0 30.0d0 ! 1:NT tracers
+
+! Boundary conditions error covariance: horizontal, isotropic decorrelation
+! scales (m). A value is expected for each boundary edge in the following
+! order:
+! 1: west 2: south 3: east 4: north
+
+HdecayB(isFsur) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! free-surface
+HdecayB(isUbar) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 2D U-momentum
+HdecayB(isVbar) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 2D V-momentum
+HdecayB(isUvel) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 3D U-momentum
+HdecayB(isVvel) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 3D V-momentum
+HdecayB(isTvar) == 4*100.0d+3 4*100.0d+3 ! (4,1:NT) tracers
+
+! Boundary conditions error covariance: vertical, isotropic decorrelation
+! scales (m). A value is expected for each boundary edge in the following
+! order:
+! 1: west 2: south 3: east 4: north
+
+VdecayB(isUvel) == 30.0d0 30.0d0 30.0d0 30.0d0 ! 3D U-momentum
+VdecayB(isVvel) == 30.0d0 30.0d0 30.0d0 30.0d0 ! 3D V-momentum
+VdecayB(isTvar) == 4*30.d0 4*30.d0 ! (4,1:NT) tracers
+
+! Surface forcing error covariance: horizontal, isotropic decorrelation
+! scales (m).
+
+HdecayF(isUstr) == 100.0d+3 ! surface U-momentum stress
+HdecayF(isVstr) == 100.0d+3 ! surface V-momentum stress
+HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
+
+! Modeled standard deviation (STD) of Background Error Covarinace parameters.
+!
+! The Mogensen et al. (2012) formulation assumes that the background errors
+! are proportional to vertical derivatives of the state vector field. Its
+! error has the similar field profile shape, but the difference with its
+! ture error value is due to a vertical displacement.
+!
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
+! criterion from kara et al. (2000). Otherwise, it will be set to uniform
+! value provided below.
+
+Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
+
+Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
+ Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
+
+Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
+ Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
+
+Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
+ Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
+
+ mld_uniform == -75.0d0 ! Uniform mixed layer depth value
+
+! Select flag for BackGround Quality Control (BGQC) of observations:
+!
+! [1] Quality control in terms of state variable indices
+! [2] Quality control in terms of observation provenance
+
+ bgqc_type == 2
+
+! If BGQC is in terms of state variables, set the threshold, squared number
+! of standard deviations to use in the quality control rejection of
+! observations.
+!
+! Use a large value (say, 1.0d+5) if you do not want to reject observations
+! associated with a particular state variable.
+!
+! Use a small value (typically, 16 to rejecting based on on 4 standard
+! deviations) to perform quality control of observations for a particular
+! state variable.
+
+ S_bgqc(isFsur) == 1.0d+5 ! free-surface
+ S_bgqc(isUbar) == 1.0d+5 ! 2D U-momentum
+ S_bgqc(isVbar) == 1.0d+5 ! 2D V-momentum
+ S_bgqc(isUvel) == 1.0d+5 ! 3D U-momentum
+ S_bgqc(isVvel) == 1.0d+5 ! 3D V-momentum
+ S_bgqc(isTvar) == 4.0d0 4.0d0 ! 1:NT tracers
+
+! If BGQC is in terms of observation provenance, set the threshold, squared
+! number of standard deviations to use in the quality control rejection of
+! observations.
+!
+! Use a small value (say, 16 to rejecting based on on 4 standard deviations)
+! to perform quality control for the desired observation provenance(s).
+!
+! Nprovenance: Number of observation provenances to quality control
+! Iprovenance: Observation provenance indices to process [1:Nprovenance]
+! P_bgqc: Standard deviation threshold [1:Nprovenance]
+
+ Nprovenance == 6
+ Iprovenance == 6 7 8 9 10 11 ! ARGO and CDT T & S
+
+ P_bgqc == 4.0d0 4.0d0 4.0d0 4.0d0 4.0d0 4.0d0
+
+! If applicable, set switches (T/F) used to adjust surface tracer flux,
+! [1:NT,1:Ngrids].
+
+ Lstflux == T T ! NT tracers
+
+! If applicable, set switches to adjust state variables at the open
+! boundaries. Notice that a value is expected for each boundary segment
+! per nested grid, [1:4,1:Ngrids]. The boundary order is: 1=west,
+! 2=south, 3=east, and 4=north. That is, anticlockwise starting at
+! the western boundary.
+!
+! When processing momentum, you need to activate both components. If
+! processing 2D momentum, you need to activate both free-surface and
+! 3D-momentum at the processing boundary.
+!
+! W S E N _____N_____
+! e o a o | 4 |
+! s u s r | |
+! t t t t 1 W E 3
+! h h | |
+! |_____S_____|
+! 1 2 3 4 2
+
+ Lobc(isFsur) == T T F T ! free-surface
+ Lobc(isUbar) == T T F T ! 2D U-momentum
+ Lobc(isVbar) == T T F T ! 2D V-momentum
+ Lobc(isUvel) == T T F T ! 3D U-momentum
+ Lobc(isVvel) == T T F T ! 3D V-momentum
+
+! If applicable, set switches to adjust state tracer variables at the
+! open boundaries. Notice that a value is expected for each tracer at each
+! boundary segment per nested grid, [1:4,1:NT,1:Ngrids]. The boundary order
+! is the same as above. Notice that the first line has the values for
+! temperature boundaries, the second is salinity, and so on.
+
+ Lobc(isTvar) == T T F T \
+ T T F T
+
+! Input model, initial conditions, boundary conditions, and surface forcing
+! standard deviation file names, [1:Ngrids].
+
+ STDnameM == roms_std_m.nc
+ STDnameI == roms_std_i.nc
+ STDnameB == roms_std_b.nc
+ STDnameF == roms_std_f.nc
+
+! If computing the standard deviation from the background (prior) state
+! vector as an alternative to climatological values read from the
+! input NetCDF file, enter output standard deviation file name,
+! [1:Ngrids].
+
+ STDnameC == roms_std_c.nc
+
+! Input/output model, initial conditions, boundary conditions, and surface
+! forcing error covariance normalization factors file name, [1:Ngrids].
+
+ NRMnameM == roms_nrm_m.nc
+ NRMnameI == roms_nrm_i.nc
+ NRMnameB == roms_nrm_b.nc
+ NRMnameF == roms_nrm_f.nc
+
+! Input/output observation file name, [1:Ngrids].
+
+ OBSname == roms_obs.nc
+
+! Input/output Hessian eigenvectors file name, [1:Ngrids].
+
+ HSSname == roms_hss.nc
+
+! Input/output Lanczos vectors file name, [1:Ngrids].
+
+ LCZname == roms_lcz.nc
+
+! Output time-evolved Lanczos vectors file name, [1:Ngrids].
+
+ LZEname == roms_lze.nc
+
+! Output model data at observation locations file name, [1:Ngrids].
+
+ MODname == roms_mod.nc
+
+! Output posterior error covariance matrix file name, [1:Ngrids].
+
+ ERRname == roms_err.nc
+
+! Input forcing filenames at observation locations for computing observations
+! impacts during the analysis-forecast cycle when the forecast is initialized
+! with the 4D-Var analysis (OIFnameA) or the 4D-Var background (OIFnameB).
+
+ OIFnameA == roms_oif_a.nc
+ OIFnameB == roms_oif_b.nc
+
+!
+! GLOSSARY:
+! =========
+!
+!------------------------------------------------------------------------------
+! Error covariance matrix balance operator parameters. These parameters are
+! only used when BALANCE_OPERATOR and ZETA_ELLIPTIC are activated.
+!------------------------------------------------------------------------------
+!
+! Nbico Number of iterations in the biconjugate gradient algorithm
+! used to solve the elliptic equation for sea surface height
+! in the error covariance balance operator, [1:Ngrids]. We
+! need as many iterations as required to decrease the error
+! value of the reference free-surface to 1E-8 or smaller. In
+! some applications Nbico=200 will do the job.
+!
+! Warning: be aware that there are 4 arrays that are
+! ------- allocated with this parameter array and its
+! value may be constrained by available memory:
+!
+! FOURDVAR(ng) % p_r2d (LBi:UBi,LBj:UBj,Nbico(ng))
+! FOURDVAR(ng) % r_r2d (LBi:UBi,LBj:UBj,Nbico(ng))
+! FOURDVAR(nd) % bp_r2d(LBi:UBi,LBj:UBj,Nbico(ng))
+! FOURDVAR(ng) % br_r2d(LBi:UBi,LBj:UBj,Nbico(ng))
+!
+! All the iterations values are needed in the backward
+! stepping of the adjoint.
+!
+! dTdz_min Minimum d(T)/d(z) above which the balanced salinity
+! (deltaS_b) is computed, [1:Ngrids]:
+!
+! deltaS_b = cff * dSdT * deltaT; dSdT = dSdz / dTdz
+!
+! where cff is a coefficient that depends on the mixed-layer
+! depth (ml_depth):
+!
+! cff = 1.0 - EXP (z_r / ml_depth)
+!
+! ml_depth Mixed-layer depth (m; positive) used above in smoothing
+! coefficient (cff), [1:Ngrids].
+!
+! LNM_depth Level of no motion depth (m; positive) used to compute the
+! balanced free-surface contribution in the error covariance
+! balance operator. It is only relevant when LNM_flag=1,
+! balance(isFsur)=T, and ZETA_ELLIPTIC is NOT activated. It
+! is used to integrate the non-hydrostatic equation.
+!
+! LNM_flag Level of no motion integration flag used to used to compute
+! the balanced free-surface contribution:
+!
+! LNM_flag = 0, integrate from local bottom to the surface
+!
+! LNM_flag = 1, integrate from LNM_depth to surface or
+! integrate from local bottom if shallower
+! than LNM_depth
+!
+! balance Balance operator logical switches for state variables to
+! consider in the error covariance off-diagonal multivariate
+! constraints:
+!
+! balance(isSalt) = T, salinity
+! balance(isFsur) = T, free-sruface
+! balance(isVbar) = F, 2D momentum (ubar, vbar)
+! balance(isVvel) = T, 3D momentum (u, v)
+!
+! Guidelines:
+!
+! 1) The salinity contribution, balance(isSalt), depends
+! only on temperature. Notice that temperature is used
+! to establish the balanced part of the other state
+! variables.
+!
+! 2) The free-surface contribution, balance(isFsur), depends
+! on salinity since we need to compute balanced density
+! and integrate properly using LNM_flag and LNM_depth.
+! This implies that balance(isSalt) needs to be TRUE too.
+! It is independent of the 2D or 3D balance velocity terms.
+!
+! 3) The 3D momentum, balance(isVvel), depends on salinity
+! since we need to compute balanced density. This
+! implies that balance(isSalt) needs to be TRUE too.
+!
+!------------------------------------------------------------------------------
+! Array modes parameter.
+!------------------------------------------------------------------------------
+!
+! Nvct Which eigenvector of the stabilized representer matrix to
+! process to computing array modes when option ARRAY_MODES is
+! activated. In this case, Nvct =< Ninner,
+!
+! Nvct=1 least important eigenvector
+! Nvct=Ninner most important eigenvector
+!
+! or cut-off eigenvector for the clipped analysis when
+! the option CLIPPING is activated to remove potentially
+! unphysical array modes. In this case, Nvct =< Ninner. All
+! the eigenvectors are ordered according to their significance,
+! Nvct=Ninner is the most important.
+!
+! Nvct:Ninner eigenvectors will be processed
+! 1:Nvct-1 eigenvectors will be disgarded
+!
+!------------------------------------------------------------------------------
+! Lanczos conjugate gradient algorithm parameters.
+!------------------------------------------------------------------------------
+!
+! GradErr Upper bound on the relative error of the gradient.
+!
+! HevecErr Maximum error bound on Hessian eigenvectors. Note that
+! even quite inaccurate eigenvectors are useful
+! for pre-conditioning purposes.
+!
+! LhessianEV Switch (T/F) to compute approximated Hessian eigenvalues
+! and eigenvectors.
+!
+!
+! LhotStart Switch (T/F) to activate hot start in weak-constraint
+! (R4DVAR and RBL4DVAR) algorithms.
+!
+! Lprecond Switch (T/F) to activate preconditioning in the I4DVAR
+! algorithm. Two types of Limited-Memory preconditioner (LMP)
+! are available Tshimanga et al., 2008): Spectral and Ritz.
+!
+! If Lprecond=T and Lritz=F, Spectral LMP
+! If Lprecond=T and Lritz=T, Ritz LMP
+!
+! Lritz Switch to activate either Ritz Limited-Memory Preconditioner
+! (T) or spectral Limited-Memory Preconditioner (F) to the
+! I4DVAR algorithm using eigenpairs approximation for the
+! Hessian matrix. The accuracy of the Hessian eigenvectors
+! (HevecErr) can be used to fine tune the minimization. That
+! is, HevecErr can be used to control number of eigenvalues
+! of the preconditioning Hessian matrix. See Tshimanga et al.
+! (2008) Q. J. R. Met. Soc. paper for details.
+!
+! NritzEV If preconditioning, specify number of eigenpairs to use.
+! If zero, use HevecErr parameter to determine the number
+! of converged eigenpairs.
+!
+! NpostI If weak constraint 4D-Var (RBL4DVAR or R4DVAR), set number
+! of iterations in the Lanczos algorithm used to estimate the
+! posterior analysis error covariance matrix.
+!
+!------------------------------------------------------------------------------
+! Observations impact or observations sensitivity.
+!------------------------------------------------------------------------------
+!
+! Nimpact Outer loop to consider in the computation of the observations
+! impact or observation sensitivity, Nimpact =< Nouter. This
+! facilitates the computations with multiple outer loop 4D-Var
+! applications. The observation analysis needs to be computed
+! separately for each outer loop. The full analysis for all
+! outer loops is combined offline.
+!
+!------------------------------------------------------------------------------
+! Outer loop counter and phase for split 4D-Var in multiple executables.
+!------------------------------------------------------------------------------
+!
+! OuterLoop Current outer loop counter. It is set by the running shell
+! script.
+!
+! Phase4DVAR Current split 4D-Var algorithm elementary phases to compute:
+!
+! Phase4DVAR = 'background' Xb
+! Phase4DVAR = 'increment' dXa
+! Phase4DVAR = 'analysis' Xa = Xb + dXa
+! Phase4DVAR = 'post_analysis' (posterior analysis)
+! Phase4DVAR = 'post_error' (posterior error)
+!
+! There is a 'prior_error' phase that it is always done in
+! 'ROMS_initialize'.
+!
+!------------------------------------------------------------------------------
+! Additional observation operators.
+!------------------------------------------------------------------------------
+!
+! Currently, only one extra-observation operator has been implemented to
+! process radial velocities from HF radars instruments.
+!
+! NextraObs Number of extra-observation classes to consider in addition
+! to those associated with the state variables (one-to-one
+! correspondence. They are used in observation operators that
+! require more than one state variable to evaluate a particular
+! extra-observation type like HF radials, travel time,
+! pressure, etc.
+!
+! In any application, the number of observation types is
+! computed as:
+!
+! NobsVar(ng) = NstateVar(ng) + NextraObs
+!
+! If not processing extra-observation classes, set NextraObs
+! to zero.
+!
+! ExtraIndex Extra-observation class identification indices, as specified
+! in input observation NetCDF file variable "obs_type". The
+! index has to be a number greater than 7+2*NT, where NT is
+! the total of active plus passive tracers. NextraObs values
+! are expected for this Keyword. This parameter is only
+! processed when NextraObs > 0.
+!
+! ExtraName Extra-observation class names. NextraObs values are expected.
+! This parameter is only processed when NextraObs > 0. Enter
+! one class type name per line and use a backslash for
+! continuation. For example:
+!
+! ExtraName = radials \
+! pressure
+!
+! Currently, however, only the radials operator is coded.
+!
+!------------------------------------------------------------------------------
+! Diffusive relaxation coefficients.
+!------------------------------------------------------------------------------
+!
+! If weak constraint 4D-Var and RPM_RELAXATION flag is activated, these
+! coefficients are used to relax the representer tangent linear solution
+! to the previous outer loop linearized trajectory during the Picard
+! iterations. The user may turn off relaxation on a particular variable
+! by setting the coefficient to zero.
+!
+! tl_M2diff 2D momentum diffusion relaxation coefficient (m2/s).
+!
+! tl_M3diff 3D momentum diffusion relaxation coefficient (m2/s).
+!
+! tl_Tdiff Tracers type variables diffusion relaxation coefficients
+! (m2/s). NT values are expected.
+!
+!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
+! Background/model correlation parameters.
+!------------------------------------------------------------------------------
+!
+! LdefNRM Switch (T/F) to create a new normalization NetCDF file
+! for, [4,1:Ngrids]:
+!
+! LdefNRM(1,:) initial conditions error covariance
+! LdefNRM(2,:) model error covariance
+! LdefNRM(3,:) boundary conditions error covariance
+! LdefNRM(4,:) surface forcing error covariance
+!
+! The computation of the correlation normalization
+! coefficients is very expensive and needs to be computed
+! only once for a particular application provided that grid,
+! land/sea masking (if any), and decorrelation scales (see
+! below) remain the same. The user can use this switch
+! in conjunction with the CnormM, CnormI, CnormB, CnormF
+! (see below) switches to compute each coefficient separately.
+! The normalization NetCDF only needs to be created once
+! and simultaneous runs can write to the same NetCDF. If
+! using this approach, compute the normalization factors
+! with the CORRELATION CPP-option and not I4DVAR, RBL4DVAR
+! or R4DVAR.
+!
+! LwrtNRM Switch (T/F) to write out correlation normalization factors
+! for, [4,1:Ngrids]:
+!
+! LwrtNRM(1,:) initial conditions error covariance
+! LwrtNRM(2,:) model error covariance
+! LwrtNRM(3,:) boundary conditions error covariance
+! LwrtNRM(4,:) surface forcing error covariance
+!
+! If TRUE, these factors are computed and written to NRMnameI,
+! NRMnameM, NRMnameB, and NRMnameF NetCDF files, respectively.
+! If FALSE, they are read from NRMname NetCDF file.
+!
+! CnormM Compute (T/F) model error covariance
+! normalization factors:
+!
+! CnormM(isFsur) free-surface
+! CnormM(isUbar) 2D U-momentum
+! CnormM(isVbar) 2D V-momentum
+! CnormM(isUvel) 3D U-momentum
+! CnormM(isVvel) 3D V-momentum
+! CnormM(isTvar) tracers (1:NT)
+!
+! CnormI Compute (T/F) initial conditions error covariance
+! normalization factors:
+!
+! CnormI(isFsur) free-surface
+! CnormI(isUbar) 2D U-momentum
+! CnormI(isVbar) 2D V-momentum
+! CnormI(isUvel) 3D U-momentum
+! CnormI(isVvel) 3D V-momentum
+! CnormI(isTvar) tracers (1:NT)
+!
+! CnormB Compute (T/F) open boundary conditions error covariance
+! normalization factors:
+!
+! CnormB(isFsur) free-surface
+! CnormB(isUbar) 2D U-momentum
+! CnormB(isVbar) 2D V-momentum
+! CnormB(isUvel) 3D U-momentum
+! CnormB(isVvel) 3D V-momentum
+! CnormB(isTvar) tracers (1:NT)
+!
+! CnormF Compute (T/F) surface forcing error covariance
+! normalization factors:
+!
+! CnormF(isTsur) tracer flux (1:NT)
+! CnormF(isUstr) wind U-stress
+! CnormF(isVstr) wind V-stress
+!
+! Nmethod Correlation normalization method:
+!
+! [0] Exact, very expensive
+! [1] Approximated, randomization
+!
+! Rscheme Random number generation scheme if randomization:
+!
+! [1] Gaussian distributed deviates, numerical recipes
+!
+! Nrandom Number of iterations to compute correlation normalization
+! factors using the randomization approach of Fisher and
+! Courtier (1995). A large number is required to be
+! statistically meaningful and achieve zero expectation
+! mean and unit variance, approximately. These factors ensure
+! that the error covariance diagonal elements are equal to
+! unity.
+!
+! Hgamma Horizontal stability and accuracy factor (< 1) used to
+! scale the time-step of the convolution operator below its
+! theoretical limit, [1:4]. Notice that four values are
+! needed for Hgamma to facilitate the error covariance
+! modeling for initial conditions (1), model (2), boundary
+! conditions (3), and surface forcing (4).
+!
+! Vgamma Vertical stability and accuracy factor (< 1) used to
+! scale the time-step of the convolution operator below its
+! theoretical limit, [1:4]. Notice that four values are
+! needed for Vgamma to facilitate the error covariance
+! modeling for initial conditions (1), model (2), boundary
+! conditions (3), and surface forcing (4).
+!
+! HdecayM Model error covariance, [1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayM(isFsur) free-surface
+! HdecayM(isUbar) 2D U-momentum
+! HdecayM(isVbar) 2D V-momentum
+! HdecayM(isUvel) 3D U-momentum
+! HdecayM(isVvel) 3D V-momentum
+! HdecayM(isTvar) tracers (1:NT,1:Ngrids)
+!
+! VdecayM Model error covariance, [1:Ngrids],
+! vertical, isotropic decorrelation scale (m):
+!
+! VdecayM(isUvel) 3D U-momentum
+! VdecayM(isVvel) 3D V-momentum
+! VdecayM(isTvar) tracers (1:NT,1:Ngrids)
+!
+! HdecayI Initial conditions error covariance, [1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayI(isFsur) free-surface
+! HdecayI(isUbar) 2D U-momentum
+! HdecayI(isVbar) 2D V-momentum
+! HdecayI(isUvel) 3D U-momentum
+! HdecayI(isVvel) 3D V-momentum
+! HdecayI(isTvar) tracers (1:NT,1:Ngrids)
+!
+! VdecayI Model error covariance, [1:Ngrids],
+! vertical, isotropic decorrelation scale (m):
+!
+! VdecayI(isUvel) 3D U-momentum
+! VdecayI(isVvel) 3D V-momentum
+! VdecayI(isTvar) tracers (1:NT)
+!
+! HdecayB Open boundary conditions error covariance, [4,1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayB(:,isFsur) free-surface
+! HdecayB(:,isUbar) 2D U-momentum
+! HdecayB(:,isVbar) 2D V-momentum
+! HdecayB(:,isUvel) 3D U-momentum
+! HdecayB(:,isVvel) 3D V-momentum
+! HdecayB(:,isTvar) tracers (4,1:NT,1:Ngrids)
+!
+! boundary index 1: west 2: south 3: east 4: north
+!
+! VdecayB Model error covariance, [4,1:Ngrids],
+! vertical, isotropic decorrelation scale (m):
+!
+! VdecayB(isUvel) 3D U-momentum
+! VdecayB(isVvel) 3D V-momentum
+! VdecayB(isTvar) tracers (4,1:NT,1:Ngrids)
+!
+! boundary index 1: west 2: south 3: east 4: north
+!
+! HdecayF Surface forcing error covariance, [1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayF(isTsur) tracers flux (1:NT,1:Ngrids)
+! HdecayF(isUstr) wind U-stress
+! HdecayF(isVstr) wind V-stress
+!
+!------------------------------------------------------------------------------
+! Modeled standard deviation (STD) of Background Error Covarinace parameters.
+!------------------------------------------------------------------------------
+!
+! The user may activate STD_MODEL to compute the standard deviation directly
+! from the background (prior) field as an alternative to climatological values
+! read from the input NetCDF files. It follows the work of Mogensen et al.
+! (2012) by assuming the background errors are proportional to the vertical
+! derivatives of the background field. The field error has a similar profile
+! shape, but the difference with the actual error value is due to a vertical
+! displacement.
+!
+! The modeling of standard deviation (STD) uses the following parameters per
+! state field:
+!
+! Sigma_max(:) Maximum STD value
+!
+! Sigma_ml(:) Minimum STD at mixed layer
+!
+! Sigma_do(:) Minimum STD in deep ocean
+!
+! Sigma_dz(:) Vertical profile displacement
+!
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
+! approach of Kara et al. (2000). Otherwise, a constant value is used.
+!
+! mld_uniform Uniform mixed-layer depth value
+!
+!------------------------------------------------------------------------------
+! Background Quality Control (BCQC) of observations parameters.
+!------------------------------------------------------------------------------
+!
+! bgqc_type Flag to determine the type of background quality control:
+!
+! bgqc_type = 1 Background quality control in terms of
+! the state variable index (1 - MstateVar)
+! read from the input observation NetCDF,
+! variable "obs_type".
+!
+! It is general because it includes all the
+! observation provenances for a particular
+! state variable. For example, all the
+! temperature observations.
+!
+! bgqc_type = 2 Background quality control in terms of
+! the observation provenance index read
+! from the input observation NetCDF,
+! variable "obs_provenance".
+!
+! It is specific because it only includes
+! the observations for a particular
+! provenance or instrument. For example,
+! temperature observation from ARGO buoys.
+!
+! S_bgqc Threshold, squared number of standard deviations to use in
+! the quality control rejection of observations in terms of
+! the state variable index.
+!
+! S_bgqc(isFsur) free-surface
+! S_bgqc(isUbar) 2D U-momentum
+! S_bgqc(isVbar) 2D V-momentum
+! S_bgqc(isUvel) 3D U-momentum
+! S_bgqc(isVvel) 3D V-momentum
+! S_bgqc(isTvar) NT tracers (4,NT,Ngrids)
+!
+! It used when bgqc_type = 1. Use a large value (say 1.0d+5)
+! to indicate that the observations are spread out over a wider
+! range of background values. Otherwise, you use values like
+! 16 for rejecting observations based on 2 standard deviations.
+!
+! Nprovenance Number of observation provenances to consider for background
+! quality control. Used when bgqc_type = 2.
+!
+! Iprovenance Observation provenance index to consider for background
+! quality control. Use the same index value as specified
+! in input observations NetCDF, variable "obs_provenance".
+! 1:Nprovenance values are expected for each nested grid.
+! Used when bgqc_type = 2.
+!
+! P_bgqc Threshold, squared number of standard deviations to use in
+! the quality control rejection of observations in terms of
+! the provenance index, 1:Nprovenance values are expected for
+! each nested grid. Used when bgqc_type = 2.
+!
+!------------------------------------------------------------------------------
+! 4D-Var adjustment switches.
+!------------------------------------------------------------------------------
+!
+! Lstflux Logical switches (T/F) used to adjust surface tracer flux,
+! including active and passive tracers, [1:NT, 1:Ngrids].
+! These switches are used when ADJUST_STFLUX is activated.
+!
+! Lobc Logical switches (T/F) used to adjust state variables at
+! the open boundaries. A value is expected for each boundary
+! segment per nested grid, [1:4, 1:Ngrids].
+!
+! The boundary order is anticlockwise starting at the western
+! edge as follows:
+!
+! 1 = western edge
+! 2 = southern edge
+! 3 = eastern edge
+! 4 = northern edge
+!
+! Lobc(isFsur) free-surface
+! Lobc(isUbar) 2D U-momentum
+! Lobc(isVbar) 2D V-momentum
+! Lobc(isUvel) 3D U-momentum
+! Lobc(isVvel) 3D V-momentum
+! Lobc(isTvar) NT tracers (4,NT,Ngrids)
+!
+! WARNING: When processing momentum, you need to activate both
+! ======= components. If processing 2D momentum, you need to
+! activate both free-surface and 3D-momentum at the processing
+! boundary. The 2D momentum adjustment is computed by vertically
+! integretating the 3D momentum increments.
+!
+!------------------------------------------------------------------------------
+! Input/Output NetCDF files (a string with a maximum of 256 characters).
+!------------------------------------------------------------------------------
+!
+! STDnameM Input model error covariance
+! standard deviation file name.
+!
+! STDnameI Input initial conditions error covariance
+! standard deviation file name.
+!
+! STDnameB Input open boundary conditions error covariance
+! standard deviation file name.
+!
+! STDnameF Input surface forcing error covariance
+! standard deviation file name.
+!
+! STDnameC Output standard deviation file name
+! computed from background (prior) state
+!
+! NRMnameM Input/output model error covariance
+! normalization factors file name.
+!
+! NRMnameI Input/output initial conditions error covariance
+! normalization factors file name.
+!
+! NRMnameB Input/output open boundary conditions error covariance
+! normalization factors file name.
+!
+! NRMnameF Input/output surface forcing error covariance
+! normalization factors file name.
+!
+! OBSname Input/Output observations data file name.
+!
+! HSSname Input/Output Hessian eigenvectors file name.
+!
+! LCZname Input/output Lanczos vectors file name.
+!
+! LZEname Output time-evolved Lanczos vectors file name.
+!
+! MODname Output model data at observations locations file name.
+!
+! ERRname Output posterior error covariance matrix file name.
+!
+! Input forcing filenames at observation locations for computing observations
+! impacts during the analysis-forecast cycle when RBL4DVAR_FCT_SENSITIVITY and
+! OBS_SPACE are activated:
+!
+! (See www.myroms.org/wiki/Analysis-Forecast_Cycle_Observation_Impacts)
+!
+! OIFnameA Forecast initialized with 4D-Var analysis (red curve)
+!
+! OIFnameB Forecast initialized with 4D_Var background (blue curve)
+!
diff --git a/WC13/RBL4DVAR_IAU/wc13.h b/WC13/RBL4DVAR_IAU/wc13.h
new file mode 100644
index 00000000..8cd652cf
--- /dev/null
+++ b/WC13/RBL4DVAR_IAU/wc13.h
@@ -0,0 +1,179 @@
+/*
+** git $Id$
+*******************************************************************************
+** Copyright (c) 2002-2024 The ROMS/TOMS Group **
+** Licensed under a MIT/X style license **
+** See License_ROMS.md **
+*******************************************************************************
+**
+** Options for the California Current System, 1/3 degree resolution.
+**
+** Application flag: WC13
+** Input script: roms_wc13.in
+** s4dvar.in
+**
+** Available Drivers options: choose only one and activate it in the
+** build.sh script (MY_CPP_FLAGS definition)
+**
+** AD_SENSITIVITY Adjoint Sensitivity Driver
+** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
+** ARRAY_MODES Stabilized representer matrix array modes
+** CLIPPING Stabilized representer matrix clipped analysis
+** CORRELATION Background-error Correlation Check
+** GRADIENT_CHECK TLM/ADM Gradient Check
+** FORCING_SV Forcing Singular Vectors
+** FT_EIGENMODES Finite Time Eigenmodes
+** I4DVAR Incremental, strong constraint I4D-Var
+** NLM_DRIVER Nonlinear Basic State trajectory
+** OPT_PERTURBATION Optimal perturbations
+** PICARD_TEST Picard Iterations Test
+** RBL4DVAR Strong/Weak constraint RBL4D-Var
+** R4DVAR Strong/Weak constraint R4D-Var
+** R_SYMMETRY Representer Matrix Symmetry Test
+** SPLIT_I4DVAR Strong constraint Split I4D-Var
+** SPLIT_R4DVAR Strong/Weak constraint Split R4D-Var
+** SPLIT_RBL4DVAR Strong/Weak constraint Split RBL4D-Var
+** SANITY_CHECK Sanity Check
+** SO_SEMI Stochastic Optimals: Semi-norm
+** TLM_CHECK Tangent Linear Model Check
+** VERIFICATION NL Observation Verification Driver
+** NORMALIZATION Background error Covariance Normalization
+*/
+
+/*
+**-----------------------------------------------------------------------------
+** Nonlinear basic state settings.
+**-----------------------------------------------------------------------------
+*/
+
+#ifdef VERIFICATION
+# define FULL_GRID
+#endif
+
+#define ANA_BSFLUX
+#define ANA_BTFLUX
+
+#define UV_ADV
+#define DJ_GRADPS
+#define UV_COR
+#define UV_QDRAG
+#define UV_VIS2
+#define MIX_S_UV
+#define MIX_GEO_TS
+#define SPLINES_VDIFF
+#define SPLINES_VVISC
+#define TS_DIF2
+#define SOLVE3D
+#define SALINITY
+#define NONLIN_EOS
+#define CURVGRID
+#define PROFILE
+#define SPHERICAL
+#define MASKING
+
+#ifdef NLM_DRIVER
+# define AVERAGES /* define if writing out time-averaged data */
+#endif
+
+/*
+** Vertical Mixing parameterization
+*/
+
+#define GLS_MIXING
+#ifdef GLS_MIXING
+# define N2S2_HORAVG
+# define KANTHA_CLAYSON
+# define RI_SPLINES
+#endif
+
+/*
+** Surface atmospheric fluxes. Note, that we must define DIURNAL_SRFLUX
+** when using daily averaged fields.
+*/
+
+#define BULK_FLUXES /* turn ON or OFF bulk fluxes computation */
+
+#define DIURNAL_SRFLUX /* impose shortwave radiation local diurnal cycle */
+#define SOLAR_SOURCE /* define solar radiation source term */
+#define LONGWAVE_OUT /* Compute net longwave radiation internally */
+#define EMINUSP /* turn ON internal calculation of E-P */
+
+/*
+**-----------------------------------------------------------------------------
+** Variational Data Assimilation.
+**-----------------------------------------------------------------------------
+*/
+
+/*
+** Options to compute error covariance normalization coefficients.
+*/
+
+#ifdef NORMALIZATION
+# define ADJUST_BOUNDARY
+# define ADJUST_WSTRESS
+# define ADJUST_STFLUX
+# define CORRELATION
+# define VCONVOLUTION
+# define IMPLICIT_VCONV
+# define FULL_GRID
+# define FORWARD_WRITE
+# define FORWARD_READ
+# define FORWARD_MIXING
+# define OUT_DOUBLE
+#endif
+
+/*
+** Options for adjoint-based algorithms sanity checks.
+*/
+
+#ifdef SANITY_CHECK
+# define FULL_GRID
+# define FORWARD_READ
+# define FORWARD_WRITE
+# define FORWARD_MIXING
+# define OUT_DOUBLE
+# define ANA_PERTURB
+# define ANA_INITIAL
+#endif
+
+/*
+** Common options to all 4DVAR algorithms.
+*/
+
+#if defined ARRAY_MODES || \
+ defined CLIPPING || \
+ defined I4DVAR || \
+ defined I4DVAR_ANA_SENSITIVITY || \
+ defined RBL4DVAR || \
+ defined RBL4DVAR_ANA_SENSITIVITY || \
+ defined RBL4DVAR_FCT_SENSITIVITY || \
+ defined R4DVAR || \
+ defined R4DVAR_ANA_SENSITIVITY || \
+ defined SPLIT_I4DVAR || \
+ defined SPLIT_RBL4DVAR || \
+ defined SPLIT_R4DVAR
+# define ADJUST_BOUNDARY
+# define ADJUST_WSTRESS
+# define ADJUST_STFLUX
+# define PRIOR_BULK_FLUXES
+# define FORWARD_FLUXES
+# define VCONVOLUTION
+# define IMPLICIT_VCONV
+# ifdef BALANCE_OPERATOR
+# define ZETA_ELLIPTIC
+# endif
+# define FORWARD_WRITE
+# define FORWARD_READ
+# define FORWARD_MIXING
+# define OUT_DOUBLE
+#endif
+
+/*
+** Special options for each 4DVAR algorithm.
+*/
+
+#if defined ARRAY_MODES || \
+ defined R4DVAR || \
+ defined R4DVAR_ANA_SENSITIVITY
+# define RPM_RELAXATION
+#endif
diff --git a/WC13/RBL4DVAR_analysis_impact/Readme.md b/WC13/RBL4DVAR_analysis_impact/Readme.md
index 61819aae..f4e279a1 100644
--- a/WC13/RBL4DVAR_analysis_impact/Readme.md
+++ b/WC13/RBL4DVAR_analysis_impact/Readme.md
@@ -156,7 +156,7 @@ You need to take the following steps:
(2D state variables) or volume (3D state variables), and
then by convolving with the squared-root adjoint and tangent
linear diffusion operators.
-
+
- The **randomization method** is cheaper and an approximation.
The normalization coefficients are computed using the approach
of Fisher and Courtier (1995). The coefficients are initialized
@@ -165,7 +165,7 @@ You need to take the following steps:
they are scaled by the inverse squared root of the cell area
(2D state variable) or volume (3D state variable) and convolved
with the squared-root adjoint and tangent diffusion operators
- over a specified number of iterations, **Nrandom**.
+ over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script
**s4dvar.in**:
@@ -178,14 +178,14 @@ You need to take the following steps:
CnormM(isFsur) = T ! Model, 2D variable at RHO-points
CnormM(isUbar) = T ! Model, 2D variable at U-points
- CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
CnormM(isUvel) = T ! Model, 3D variable at U-points
CnormM(isVvel) = T ! Model, 3D variable at V-points
CnormM(isTvar) = T T ! Model, NT tracers
CnormI(isFsur) = T ! IC, 2D variable at RHO-points
CnormI(isUbar) = T ! IC, 2D variable at U-points
- CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
CnormI(isUvel) = T ! IC, 3D variable at U-points
CnormI(isVvel) = T ! IC, 3D variable at V-points
CnormI(isTvar) = T T ! IC, NT tracers
@@ -308,7 +308,7 @@ You need to take the following steps:
mpirun -np 8 romsM roms_wc13_2hours.in > & log &
```
-
+
Notice that the nonlinear trajectory can be written either
daily (**NHIS=48** if using **roms_wc13_daily.in**) or every
two hours (**NHIS=4** if using **roms_wc13_2hours.in**). It is
@@ -348,7 +348,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_analysis_impact/s4dvar.in b/WC13/RBL4DVAR_analysis_impact/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_analysis_impact/s4dvar.in
+++ b/WC13/RBL4DVAR_analysis_impact/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_analysis_sensitivity/Readme.md b/WC13/RBL4DVAR_analysis_sensitivity/Readme.md
index b3d882d7..8b7634a2 100644
--- a/WC13/RBL4DVAR_analysis_sensitivity/Readme.md
+++ b/WC13/RBL4DVAR_analysis_sensitivity/Readme.md
@@ -142,7 +142,7 @@ You need to take the following steps:
(2D state variables) or volume (3D state variables), and
then by convolving with the squared-root adjoint and tangent
linear diffusion operators.
-
+
- The **randomization method** is cheaper and an approximation.
The normalization coefficients are computed using the approach
of Fisher and Courtier (1995). The coefficients are initialized
@@ -151,7 +151,7 @@ You need to take the following steps:
they are scaled by the inverse squared root of the cell area
(2D state variable) or volume (3D state variable) and convolved
with the squared-root adjoint and tangent diffusion operators
- over a specified number of iterations, **Nrandom**.
+ over a specified number of iterations, **Nrandom**.
Check the following parameters in the **4D-Var** input script
**s4dvar.in**:
@@ -164,14 +164,14 @@ You need to take the following steps:
CnormM(isFsur) = T ! Model, 2D variable at RHO-points
CnormM(isUbar) = T ! Model, 2D variable at U-points
- CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
CnormM(isUvel) = T ! Model, 3D variable at U-points
CnormM(isVvel) = T ! Model, 3D variable at V-points
CnormM(isTvar) = T T ! Model, NT tracers
CnormI(isFsur) = T ! IC, 2D variable at RHO-points
CnormI(isUbar) = T ! IC, 2D variable at U-points
- CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
CnormI(isUvel) = T ! IC, 3D variable at U-points
CnormI(isVvel) = T ! IC, 3D variable at V-points
CnormI(isTvar) = T T ! IC, NT tracers
@@ -239,7 +239,7 @@ You need to take the following steps:
correct locations of these libraries for your computer.
If you want to ignore this section, comment (turn off) the
assignment for the macro **USE_MY_LIBS**.
-
+
- Notice that the most important CPP options for this application
are specified in the **build** script instead of the header file
**wc13.h** allows flexibility with different CPP options:
@@ -292,7 +292,7 @@ You need to take the following steps:
mpirun -np 8 romsM roms_wc13_2hours.in > & log &
```
-
+
Notice that the nonlinear trajectory can be written either
daily (**NHIS=48** if using **roms_wc13_daily.in**) or every
two hours (**NHIS=4** if using **roms_wc13_2hours.in**). It is
@@ -309,7 +309,7 @@ You need to take the following steps:
- Analyze the results using the plotting Matlab script
provided in the **`../plotting`** directory:
-
+
- **`plot_rbl4dvar_sensitivity.m`**: plots observation sensitivity
for **RBL4D-Var**. Before running
this script, be sure to copy
@@ -331,7 +331,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_analysis_sensitivity/s4dvar.in b/WC13/RBL4DVAR_analysis_sensitivity/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_analysis_sensitivity/s4dvar.in
+++ b/WC13/RBL4DVAR_analysis_sensitivity/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_impact/FCSTA/Readme.md b/WC13/RBL4DVAR_forecast_impact/FCSTA/Readme.md
index 631f3809..7900bf3d 100644
--- a/WC13/RBL4DVAR_forecast_impact/FCSTA/Readme.md
+++ b/WC13/RBL4DVAR_forecast_impact/FCSTA/Readme.md
@@ -6,13 +6,13 @@ It sets and runs the **ROMS** Nonlinear model in forecast mode,
initialized with the **RBL4D-Var** analysis file **wc13_dai.nc**
to compute the **`FCSTA` red curve** trajectory shown in **Figure 1**.
-
+
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -22,7 +22,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -128,14 +128,14 @@ You need to take the following steps:
```
setenv ROMS_ROOT ${HOME}/ocean/repository/git/roms
```
-
+
- Execute the configuration **job_fcstat.csh** `EFORE` running
the model. It copies the required files and creates **rbl4dvar.in**
input script from template **s4dvar.in**. This has to be done
EVERY TIME that you run this application. We need a clean and
fresh copy of the initial conditions and observation files
since they are modified by **ROMS** during execution.
-
+
- Run nonlinear **ROMS `FCSTA` Red Forecast**:
```
mpirun -np 8 romsM roms_wc13_daily.in > & log &
@@ -165,7 +165,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_impact/FCSTA/s4dvar.in b/WC13/RBL4DVAR_forecast_impact/FCSTA/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_impact/FCSTA/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_impact/FCSTA/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_impact/FCSTAT/Readme.md b/WC13/RBL4DVAR_forecast_impact/FCSTAT/Readme.md
index 61fda1b4..1648edcd 100644
--- a/WC13/RBL4DVAR_forecast_impact/FCSTAT/Readme.md
+++ b/WC13/RBL4DVAR_forecast_impact/FCSTAT/Readme.md
@@ -9,11 +9,11 @@ shown in **Figure 1**.
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -23,7 +23,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -103,7 +103,7 @@ You need to take the following steps:
For this to work, however, any **#undef** directives **must** be
avoided in the header file **wc13.h** since it has precedence
during C-preprocessing.
-
+
- You **must** use any of the **build** scripts to compile.
- Customize the **ROMS** input script **roms_wc13.in** and specify
@@ -128,7 +128,7 @@ You need to take the following steps:
```
setenv ROMS_ROOT ${HOME}/ocean/repository/git/roms
```
-
+
- Execute the configuration **job_fcstat.csh** `BEFORE` running
the model. It copies the required files and creates **rbl4dvar.in**
input script from template **s4dvar.in**. This has to be done
@@ -165,7 +165,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_impact/FCSTAT/s4dvar.in b/WC13/RBL4DVAR_forecast_impact/FCSTAT/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_impact/FCSTAT/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_impact/FCSTAT/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_impact/FCSTB/Readme.md b/WC13/RBL4DVAR_forecast_impact/FCSTB/Readme.md
index 7c44b87b..94a8f7b7 100644
--- a/WC13/RBL4DVAR_forecast_impact/FCSTB/Readme.md
+++ b/WC13/RBL4DVAR_forecast_impact/FCSTB/Readme.md
@@ -2,18 +2,18 @@
## RBL4D-Var Forecast Cycle Observation Impacts: Exercise 8, Step 3
-It sets and runs the **ROMS** Nonlinear model in forecast mode,
+It sets and runs the **ROMS** Nonlinear model in forecast mode,
initialized with the background circulation at the end of the
**RBL4D-Var** cycle (**EX3_RPCG**) **file wc13_fwd_000.nc** to
compute the **`FCSTB` green curve** trajectory shown in **Figure 1**.
-
+
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -23,7 +23,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -136,7 +136,7 @@ You need to take the following steps:
EVERY TIME that you run this application. We need a clean and
fresh copy of the initial conditions and observation files
since they are modified by **ROMS** during execution.
-
+
- Use Matlab script **create_ini_fcstb.m** to create ROMS initial
conditions from the previous **RBL4D-Var** background solution (**EXE_RPCG**)
forward file **`../../RBL4DVAR/EX3_RPCG/wc13_fwd_000.nc`**.
@@ -170,7 +170,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_impact/FCSTB/s4dvar.in b/WC13/RBL4DVAR_forecast_impact/FCSTB/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_impact/FCSTB/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_impact/FCSTB/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_impact/Readme.md b/WC13/RBL4DVAR_forecast_impact/Readme.md
index 3443fe49..3c57ae82 100644
--- a/WC13/RBL4DVAR_forecast_impact/Readme.md
+++ b/WC13/RBL4DVAR_forecast_impact/Readme.md
@@ -20,13 +20,13 @@ assessed by comparing it to a new analysis that verifies on the same day,
or by comparing the forecast with new observations that have not yet
been assimilated into the model.
-
+
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -36,7 +36,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -93,7 +93,7 @@ You must perform the following calculations in the order shown below:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact.csh b/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact.csh
index 35b4c41e..5b9967ce 100755
--- a/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact.csh
+++ b/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact.csh
@@ -41,7 +41,7 @@
echo ' '
echo 'Case 1: Forecast Error in the 37N Transport Metric'
if ($NHIS == 'daily') then
- echo '(Processing files from daily snapshots forward trajectory)'
+ echo '(Processing files from daily snapshots forward trajectory)'
else
echo '(Processing files from every 2-hours snapshots forward trajectory)'
endif
diff --git a/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact_obs_space.csh b/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact_obs_space.csh
index 1f71434f..cf52e5cc 100755
--- a/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact_obs_space.csh
+++ b/WC13/RBL4DVAR_forecast_impact/job_rbl4dvar_fct_impact_obs_space.csh
@@ -41,9 +41,9 @@
echo ' '
echo 'Case 2: Forecast Error in the SST Metric'
if ($NHIS == 'daily') then
- echo '(Processing files from daily snapshots forward trajectory)'
+ echo '(Processing files from daily snapshots forward trajectory)'
else
- echo '(Processing files from every 2-hours snapshots forward trajectory)'
+ echo '(Processing files from every 2-hours snapshots forward trajectory)'
endif
echo ' '
diff --git a/WC13/RBL4DVAR_forecast_impact/s4dvar.in b/WC13/RBL4DVAR_forecast_impact/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_impact/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_impact/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/Readme.md b/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/Readme.md
index 6ccbbead..925253d9 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/Readme.md
+++ b/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/Readme.md
@@ -6,13 +6,13 @@ It sets and runs the **ROMS** Nonlinear model in forecast mode,
initialized with the **RBL4D-Var** analysis file **wc13_dai.nc**
to compute the **`FCSTA` red curve** trajectory shown in **Figure 1**.
-
+
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -22,7 +22,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -128,14 +128,14 @@ You need to take the following steps:
```
setenv ROMS_ROOT ${HOME}/ocean/repository/git/roms
```
-
+
- Execute the configuration **job_fcstat.csh** `EFORE` running
the model. It copies the required files and creates **rbl4dvar.in**
input script from template **s4dvar.in**. This has to be done
EVERY TIME that you run this application. We need a clean and
fresh copy of the initial conditions and observation files
since they are modified by **ROMS** during execution.
-
+
- Run nonlinear **ROMS `FCSTA` Red Forecast**:
```
mpirun -np 8 romsM roms_wc13_daily.in > & log &
@@ -165,7 +165,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/s4dvar.in b/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_sensitivity/FCSTA/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/Readme.md b/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/Readme.md
index c1551a84..898526ee 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/Readme.md
+++ b/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/Readme.md
@@ -9,11 +9,11 @@ shown in **Figure 1**.
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -23,7 +23,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -103,7 +103,7 @@ You need to take the following steps:
For this to work, however, any **#undef** directives **must** be
avoided in the header file **wc13.h** since it has precedence
during C-preprocessing.
-
+
- You **must** use any of the **build** scripts to compile.
- Customize the **ROMS** input script **roms_wc13.in** and specify
@@ -128,7 +128,7 @@ You need to take the following steps:
```
setenv ROMS_ROOT ${HOME}/ocean/repository/git/roms
```
-
+
- Execute the configuration **job_fcstat.csh** `BEFORE` running
the model. It copies the required files and creates **rbl4dvar.in**
input script from template **s4dvar.in**. This has to be done
@@ -165,7 +165,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/s4dvar.in b/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_sensitivity/FCSTAT/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/Readme.md b/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/Readme.md
index a185b37b..39437e86 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/Readme.md
+++ b/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/Readme.md
@@ -2,18 +2,18 @@
## RBL4D-Var Forecast Cycle Observation Impacts: Exercise 9, Step 3
-It sets and runs the **ROMS** Nonlinear model in forecast mode,
+It sets and runs the **ROMS** Nonlinear model in forecast mode,
initialized with the background circulation at the end of the
**RBL4D-Var** cycle (**EX3_RPCG**) **file wc13_fwd_000.nc** to
compute the **`FCSTB` green curve** trajectory shown in **Figure 1**.
-
+
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -23,7 +23,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -136,7 +136,7 @@ You need to take the following steps:
EVERY TIME that you run this application. We need a clean and
fresh copy of the initial conditions and observation files
since they are modified by **ROMS** during execution.
-
+
- Use Matlab script **create_ini_fcstb.m** to create ROMS initial
conditions from the previous **RBL4D-Var** background solution (**EXE_RPCG**)
forward file **`../../RBL4DVAR/EX3_RPCG/wc13_fwd_000.nc`**.
@@ -170,7 +170,7 @@ You need to take the following steps:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/s4dvar.in b/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_sensitivity/FCSTB/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/Readme.md b/WC13/RBL4DVAR_forecast_sensitivity/Readme.md
index 57b5dca7..86301f6a 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/Readme.md
+++ b/WC13/RBL4DVAR_forecast_sensitivity/Readme.md
@@ -22,13 +22,13 @@ assessed by comparing it to a new analysis that verifies on the same day,
or by comparing the forecast with new observations that have not yet
been assimilated into the model.
-
+
-**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
+**`Figure 1:`** A schematic of a typical operational analysis-forecast cycle.
During the analysis cycle, an ocean state estimate is computed using
4D-Var to assimilate all available observations. The blue curve represents
the background circulation, **Xb**, for this cycle and is derived
-from the state estimate from the previous **4D-Var** cycle. The number of
+from the state estimate from the previous **4D-Var** cycle. The number of
time steps during the analysis cycle is given by **NTIMES_ANA**. At the end of
the analysis cycle, there are two possible forecasts: **FCAT** - the red forecast,
which is initialized using the state estimate at the end of the analysis cycle,
@@ -38,7 +38,7 @@ These two forecasts can be verified against either a new analysis or against
new observations during the `verification interval`. The red forecast **FCTA** has
benefited from the observations assimilated during the analysis interval, while
the **green** forecast **FCTB** has not. Therefore, the difference in forecast
-error between **FCTA** and **FCTB** can be used to quantify the impact of the
+error between **FCTA** and **FCTB** can be used to quantify the impact of the
observations assimilated during the analysis cycle on the subsequent forecast
skill of **FCTA**.
@@ -96,7 +96,7 @@ following calculations in the order shown below:
**2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
variational data assimilations systems, Part II - Performance
and application to the California Current System, *Prog.
- Oceanogr.*, **91**, 50-73,
+ Oceanogr.*, **91**, 50-73,
https://doi.org/10.1016/j.pocean.2011.05.003.
- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen.csh b/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen.csh
index e9c8cfe7..9a47b38d 100755
--- a/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen.csh
+++ b/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen.csh
@@ -41,7 +41,7 @@
echo ' '
echo 'Case 1: Forecast Error in the 37N Transport Metric'
if ($NHIS == 'daily') then
- echo '(Processing files from daily snapshots forward trajectory)'
+ echo '(Processing files from daily snapshots forward trajectory)'
else
echo '(Processing files from every 2-hours snapshots forward trajectory)'
endif
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen_obs_space.csh b/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen_obs_space.csh
index a1a69ebd..30cf6586 100755
--- a/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen_obs_space.csh
+++ b/WC13/RBL4DVAR_forecast_sensitivity/job_rbl4dvar_fct_sen_obs_space.csh
@@ -41,9 +41,9 @@
echo ' '
echo 'Case 2: Forecast Error in the SST Metric'
if ($NHIS == 'daily') then
- echo '(Processing files from daily snapshots forward trajectory)'
+ echo '(Processing files from daily snapshots forward trajectory)'
else
- echo '(Processing files from every 2-hours snapshots forward trajectory)'
+ echo '(Processing files from every 2-hours snapshots forward trajectory)'
endif
echo ' '
diff --git a/WC13/RBL4DVAR_forecast_sensitivity/s4dvar.in b/WC13/RBL4DVAR_forecast_sensitivity/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_forecast_sensitivity/s4dvar.in
+++ b/WC13/RBL4DVAR_forecast_sensitivity/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_mixed/Readme.md b/WC13/RBL4DVAR_mixed/Readme.md
new file mode 100644
index 00000000..4be46fa1
--- /dev/null
+++ b/WC13/RBL4DVAR_mixed/Readme.md
@@ -0,0 +1,348 @@
+
+
+## 4D-Var Tutorial: Exercise 3 and Exercise 4
+
+**Technical Description**: [Exercise_3.pdf](https://github.com/myroms/roms_test/edit/feature/info/WC13/RBL4DVAR/Exercise_3.pdf), [Exercise_4.pdf](https://github.com/myroms/roms_test/edit/feature/info/WC13/RBL4DVAR/Exercise_4.pdf)
+
+**Information**: www.myroms.org/wiki/4DVar_Tutorial_Introduction
+
+**Results**: www.myroms.org/wiki/RBL4DVAR_Tutorial
+
+This directory includes various files to run the strong/weak
+constraint, dual form of 4-Dimensional Variational data (**4D-Var**)
+assimilation based on the Restricted B-preconditioned Lanczos
+(**RBL4D-Var**) algorithm in the California Current System, 1/3
+degree resolution, application (**WC13**).
+
+### Important CPP Options:
+```
+ RBL4DVAR RBL4D-Var driver (observation space)
+ ANA_SPONGE Analytical enhanced viscosity/diffusion sponge
+ BGQC Background quality control of observations
+ MINRES Minimal Residual Method for minimization
+ RPCG Restricted B-preconditioned Lanczos minimization
+ POSTERIOR_EOFS Estimate posterior analysis error
+ POSTERIOR_ERROR_I Estimate initial posterior analysis error
+ TIME_CONV Weak-constraint 4D-Var time convolution
+ WC13 Application CPP option
+```
+
+### Input NetCDF Files:
+```
+ Grid File: ../Data/wc13_grd.nc
+ Nonlinear Initial File: wc13_ini.nc
+ Forcing File 01: ../Data/coamps_wc13_lwrad_down.nc
+ Forcing File 02: ../Data/coamps_wc13_Pair.nc
+ Forcing File 03: ../Data/coamps_wc13_Qair.nc
+ Forcing File 04: ../Data/coamps_wc13_rain.nc
+ Forcing File 05: ../Data/coamps_wc13_swrad.nc
+ Forcing File 06: ../Data/coamps_wc13_Tair.nc
+ Forcing File 07: ../Data/coamps_wc13_wind.nc
+ Boundary File: ../Data/wc13_ecco_bry.nc
+
+ Initial Conditions STD File: ../Data/wc13_std_i.nc
+ Model STD File: ../Data/wc13_std_m.nc
+ Boundary Conditions STD File: ../Data/wc13_std_b.nc
+ Surface Forcing STD File: ../Data/wc13_std_f.nc
+ Initial Conditions Norm File: ../Data/wc13_nrm_i.nc
+ Model Norm File: ../Data/wc13_nrm_m.nc
+ Boundary Conditions Norm File: ../Data/wc13_nrm_b.nc
+ Surface Forcing Norm File: ../Data/wc13_nrm_f.nc
+ Observations File: wc13_obs.nc
+```
+### Configuration and Input Scripts:
+```
+ build_roms.csh ROMS GNU make compiling and linking CSH script
+ build_roms.sh ROMS GNU make compiling and linking BASH script
+ cbuild_roms.csh ROMS CMake compiling and linking CSH script
+ cbuild_roms.sh ROMS CMake compiling and linking BASH script
+ job_rbl4dvar.csh job configuration script
+ roms_wc13_daily.in ROMS standard input script for WC13, NHIS=48,
+ daily forward trajectory snapshots
+ roms_wc13_2hours.in ROMS standard input script for WC13, NHIS=4,
+ two-hours forward trajectory snapshots
+ s4dvar.in 4D-Var standard input script template
+ wc13.h WC13 header with CPP options
+```
+
+### How to Run this Application:
+
+You need to take the following steps:
+
+- We need to run the model application for a long period
+ to compute meaningful circulation statistics,
+ like mean and standard deviations for all prognostic state
+ variables (**zeta**, **u**, **v**, **T**, and **S**). The standard deviations
+ are written to NetCDF files and are read by the **4D-Var**
+ algorithm to convert modeled error correlations to error
+ covariances. The error covariance matrix, **D**, is very large
+ and not well known. It is modeled as the solution of a
+ diffusion equation as in Weaver and Courtier (2001).
+
+ - In this application, we need standard deviations for
+ initial conditions, surface forcing (**ADJUST_WSTRESS** and
+ **ADJUST_STFLUX**), and open boundary conditions (**ADJUST_BOUNDARY**).
+ The standard deviations for the initial and open boundary
+ conditions are in terms of the unbalanced error covariance
+ (**K Du KT**) since the balanced operator is activated
+ (**BALANCE_OPERATOR** and **ZETA_ELLIPTIC**).
+
+ - The balance operator imposes a multivariate constraint on
+ the error covariance such that the unobserved variable
+ information is extracted from observed data by establishing
+ balance relationships (*i.e.*, **T-S** empirical formulas,
+ hydrostatic balance, and geostrophic balance) with other
+ state variables (Weaver *et al.*, 2005).
+
+ - These standard deviations have already been created for you:
+ ```
+ ../Data/wc13_std_i.nc initial conditions
+ ../Data/wc13_std_m.nc model error (if weak constraint)
+ ../Data/wc13_std_b.nc open boundary conditions
+ ../Data/wc13_std_f.nc surface forcing (wind stress and net heat flux)
+ ```
+- Since we are modeling the error covariance matrix, **D**, we
+ need to compute the normalization coefficients to ensure
+ that the diagonal elements of the associated correlation
+ matrix **C** are equal to unity. There are two methods to compute
+ normalization coefficients: **exact** and
+ **randomization** (an approximation).
+
+ - The **exact method** is very expensive on large grids. The
+ normalization coefficients are computed by perturbing each
+ model grid cell with a delta function scaled by the area
+ (2D state variables) or volume (3D state variables), and
+ then by convolving with the squared-root adjoint and tangent
+ linear diffusion operators.
+
+ - The **randomization method** is cheaper and an approximation.
+ The normalization coefficients are computed using the approach
+ of Fisher and Courtier (1995). The coefficients are initialized
+ with random numbers having a uniform distribution (drawn from a
+ normal distribution with zero mean and unit variance). Then,
+ they are scaled by the inverse squared root of the cell area
+ (2D state variable) or volume (3D state variable) and convolved
+ with the squared-root adjoint and tangent diffusion operators
+ over a specified number of iterations, **Nrandom**.
+
+ Check the following parameters in the **4D-Var** input script
+ **s4dvar.in**:
+ ```
+ Nmethod == 0 ! normalization method
+ Nrandom == 5000 ! randomization iterations
+
+ LdefNRM == F F F F ! Create a new normalization files
+ LwrtNRM == F F F F ! Compute and write normalization
+
+ CnormM(isFsur) = T ! Model, 2D variable at RHO-points
+ CnormM(isUbar) = T ! Model, 2D variable at U-points
+ CnormM(isVbar) = T ! Model, 2D variable at V-points
+ CnormM(isUvel) = T ! Model, 3D variable at U-points
+ CnormM(isVvel) = T ! Model, 3D variable at V-points
+ CnormM(isTvar) = T T ! Model, NT tracers
+
+ CnormI(isFsur) = T ! IC, 2D variable at RHO-points
+ CnormI(isUbar) = T ! IC, 2D variable at U-points
+ CnormI(isVbar) = T ! IC, 2D variable at V-points
+ CnormI(isUvel) = T ! IC, 3D variable at U-points
+ CnormI(isVvel) = T ! IC, 3D variable at V-points
+ CnormI(isTvar) = T T ! IC, NT tracers
+
+ CnormB(isFsur) = T ! OBC, 2D variable at RHO-points
+ CnormB(isUbar) = T ! OBC, 2D variable at U-points
+ CnormB(isVbar) = T ! OBC, 2D variable at V-points
+ CnormB(isUvel) = T ! OBC, 3D variable at U-points
+ CnormB(isVvel) = T ! OBC, 3D variable at V-points
+ CnormB(isTvar) = T T ! OBC, NT tracers
+
+ CnormF(isUstr) = T ! Surface Forcing, U-momentum stress
+ CnormF(isVstr) = T ! Surface Forcing, V-momentum stress
+ CnormF(isTsur) = T T ! Surface Forcing, NT tracers fluxes
+ ```
+ These normalization coefficients have already been computed for you
+ (see **`../Normalization`**) using the **exact method** since this
+ application has a small grid (**54x53x30**):
+ ```
+ ../Data/wc13_nrm_i.nc initial conditions
+ ../Data/wc13_nrm_m.nc model error (if weak constraint)
+ ../Data/wc13_nrm_b.nc open boundary conditions
+ ../Data/wc13_nrm_f.nc surface forcing (wind stress and net heat flux)
+ ```
+ Notice that the switches **LdefNRM** and **LwrtNRM** are all **.FALSE.**
+ (**F**) since we already computed these coefficients.
+
+ The normalization coefficients need to be computed only once
+ for a particular application provided that the grid, land/sea
+ masking (if any), and decorrelation scales (**HdecayI**, **VdecayI**,
+ **HdecayB**, **VdecayV**, and **HdecayF**) remain the same. Notice that
+ large spatial changes in the normalization coefficient
+ structure are observed near the open boundaries and land/sea
+ masking regions.
+
+- Customize your preferred **build** script and provide the
+ appropriate values for:
+
+ - Root directory, **MY_ROOT_DIR**
+ - **ROMS** source code path, **MY_ROMS_SRC**
+ - Fortran compiler, **FORT**
+ - MPI flags, **USE_MPI** and **USE_MPIF90**
+ - Path of **MPI**, **NetCDF**, and **ARPACK** libraries according to
+ the compiler. Notice that you need to provide the
+ correct locations of these libraries for your computer.
+ If you want to ignore this section, comment (turn off) the
+ assignment for the macro **USE_MY_LIBS**.
+
+- Notice that the most important CPP options for this application
+ are specified in the **build** script instead of the header file
+ **wc13.h** allows flexibility with different CPP options:
+ ```
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRBL4DVAR"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DANA_SPONGE"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DMINRES"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRPCG"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DTIME_CONV"
+
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DBGQC"
+
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DPOSTERIOR_EOFS"
+ #setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DPOSTERIOR_ERROR_I"
+ ```
+ For this to work, however, any **#undef** directives **must** be
+ avoided in the header file **wc13.h** since it has precedence
+ during C-preprocessing.
+
+- You **must** use any of the **build** scripts to compile.
+
+- Customize the **ROMS** input script **roms_wc13.in** and specify
+ the appropriate values for the distributed-memory tile partition.
+ It is set by default to:
+ ```
+ NtileI == 2 ! I-direction partition
+ NtileJ == 4 ! J-direction partition
+ ```
+ Notice that the adjoint-based algorithms can only be run
+ in parallel using **MPI**. This is because of the way that the
+ adjoint model is constructed.
+
+- Customize the configuration script **job_rbl4dvar.csh** and provide
+ the appropriate place for the **substitute** Perl script:
+ ```
+ set SUBSTITUTE=${ROMS_ROOT}/ROMS/Bin/substitute
+ ```
+ This Perl script is distributed with **ROMS**, and it is found in the
+ **ROMS/Bin** sub-directory. Alternatively, you can define
+ **ROMS_ROOT** environmental variable in your login script. For example, I have:
+ ```
+ setenv ROMS_ROOT ${HOME}/ocean/repository/git/roms
+ ```
+
+- Execute the configuration **job_rbl4dvar.csh** `BEFORE` running
+ the model. It copies the required files and creates **i4dvar.in**
+ input script from template **s4dvar.in**. This has to be done
+ EVERY TIME that you run this application. We need a clean and
+ fresh copy of the initial conditions and observation files
+ since they are modified by **ROMS** during execution.
+
+- Run **ROMS** with data assimilation:
+ ```
+ mpirun -np 8 romsM roms_wc13_daily.in > & log &
+
+ or
+
+ mpirun -np 8 romsM roms_wc13_2hours.in > & log &
+ ```
+
+ Notice that the nonlinear trajectory can be written either
+ daily (**NHIS=48** if using **roms_wc13_daily.in**) or every
+ two hours (**NHIS=4** if using **roms_wc13_2hours.in**). It is
+ the basic state trajectory used to linearize the tangent linear
+ and adjoint models.
+
+ It turns out that the daily sampling is over the
+ limit where the tangent linear approximation is valid. The
+ results are much better when using the two-hour snapshots.
+ The two set-ups are provided to make the user aware of the
+ validity of the tangent linear approximation in highly
+ nonlinear circulations. The differences will be noticeable
+ when computing observation impacts and observation sensitivities.
+
+- We recommend creating new subdirectories **EX3_CONGRAD**,
+ **EXE_MINRES**, and **EX3_RPCG** (Tutorial Exercise **3** using
+ default, **MINRES**, and **RPCG** algorithms) to save the solution
+ in it for analysis and plotting to avoid overwriting output
+ files when activating different CPP options and parameters.
+ For example:
+ ```
+ mkdir EX3_RPCG
+ mv Build_roms rbl4dvar.in *.nc log EX3_RPCG
+ cp -p romsM roms_wc13.in EX3_RPCG
+ ```
+ Check Exercise **3** instructions for more details.
+
+- Analyze the results using the plotting scripts (Matlab or
+ **ROMS** plotting package) provided in the **`../plotting`** directory:
+
+ - **`plot_rbl4dvar_cost.m`**: plots **RBL4D-Var** cost function.
+
+ - **`plot_rbl4dvar_increments.m`**: plots **RBL4D-Var** increments to
+ initial conditions.
+
+ - **`plot_eof_eigenvalues.m`**: plots the eigenvalues for each EOF
+ of the analysis error covariance
+ matrix and the randomized trace
+ estimates
+ (User needs to edit **Inp** file).
+
+ - **`plot_posterior_EOF_fields.m`**: plots selected **RBL4D-Var** analysis
+ error covariance matrix EOF
+ (User needs to edit **Inpa** file).
+
+ - **`plot_prior_posterior_errors.m`**: plots the difference between the
+ prior and posterior error
+ covariance deviations
+ (User needs to edit **Inpa** file).
+
+ - **`ccnt_rbl4dvar_increments.in`**: plots **RBL4D-Var** initial conditions
+ increments contours at **z=-100m**.
+
+ - **`csec_rbl4dvar_increments.in`**: plots **RBL4D-Var** initial conditions
+ increments cross-sections along **37N**.
+
+ - **`ccnt_posterior_EOF_fields.in`**: plots selected **RBL4D-Var** analysis
+ error covariance matrix EOF
+ contours at **z=-100m**
+ (User needs to change **R4DVAR**
+ directory to **RBL4DVAR**).
+
+ - **`csec_posterior_EOF_fields.in`** plots selected **RBL4D-Var** analysis
+ error covariance matrix EOF
+ cross-sections along **37N**
+ (User needs to change **R4DVAR**
+ directory to **RBL4DVAR**).
+
+ ---
+
+### References:
+
+- Moore, A.M., H.G. Arango, G. Broquet, B.S. Powell, A.T. Weaver,
+ and J. Zavala-Garay, **2011**: The Regional Ocean Modeling System
+ (ROMS) 4-dimensional variational data assimilation systems,
+ Part I - System overview and formulation, *Prog. Oceanogr.*,
+ **91**, 34-49, https://doi.org/10.1016/j.pocean.2011.05.004.
+
+- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
+ B. Powell, D. Foley, J.D. Doyle, D. Costa, and P. Robinson,
+ **2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
+ variational data assimilations systems, Part II - Performance
+ and application to the California Current System, *Prog.
+ Oceanogr.*, **91**, 50-73,
+ https://doi.org/10.1016/j.pocean.2011.05.003.
+
+- Moore, A.M., H.G. Arango, G. Broquet, C. Edward, M. Veneziani,
+ B. Powell, D. Foley, J.D. Doyle, D. Costa, and P. Robinson,
+ **2011**: The Regional Ocean Modeling System (ROMS) 4-dimensional
+ variational data assimilations systems, Part III - Observation
+ impact and observation sensitivity in the California Current
+ System, *Prog. Oceanogr.*, **91**, 74-94,
+ https://doi.org/10.1016/j.pocean.2011.05.005.
+
diff --git a/WC13/RBL4DVAR_mixed/build_split.csh b/WC13/RBL4DVAR_mixed/build_split.csh
new file mode 100755
index 00000000..f14307b8
--- /dev/null
+++ b/WC13/RBL4DVAR_mixed/build_split.csh
@@ -0,0 +1,463 @@
+#!/bin/csh -f
+#
+# git $Id$
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+# Copyright (c) 2002-2024 The ROMS/TOMS Group :::
+# Licensed under a MIT/X style license :::
+# See License_ROMS.md :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
+# :::
+# ROMS Compiling CSH Script :::
+# :::
+# Script to compile an user application where the application-specific :::
+# files are kept separate from the ROMS source code. :::
+# :::
+# Q: How/why does this script work? :::
+# :::
+# A: The ROMS makefile configures user-defined options with a set of :::
+# flags such as ROMS_APPLICATION. Browse the makefile to see these. :::
+# If an option in the makefile uses the syntax ?= in setting the :::
+# default, this means that make will check whether an environment :::
+# variable by that name is set in the shell that calls make. If so :::
+# the environment variable value overrides the default (and the :::
+# user need not maintain separate makefiles, or frequently edit :::
+# the makefile, to run separate applications). :::
+# :::
+# Usage: :::
+# :::
+# ./build_split.csh [options] :::
+# :::
+# Options: :::
+# :::
+# -sp Compile ROMS single precision executable :::
+# :::
+# build_split.csh -sp -j 5 :::
+# :::
+# -j [N] Compile in parallel using N CPUs :::
+# omit argument for all available CPUs :::
+# :::
+# -b Compile a specific ROMS GitHub branch :::
+# :::
+# build_split.csh -j 5 -b feature/kernel :::
+# :::
+# -p macro Prints any Makefile macro value. For example, :::
+# :::
+# build_split.csh -p FFLAGS :::
+# :::
+# -noclean Do not clean already compiled objects :::
+# :::
+# Notice that sometimes the parallel compilation fail to find MPI :::
+# include file "mpif.h". :::
+# :::
+# The branch option -b is only possible for ROMS source code from :::
+# https://github.com/myroms. Such versions are under development :::
+# and targeted to advanced users, superusers, and beta testers. :::
+# Regular and novice users must use the default 'develop' branch. :::
+# :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+setenv which_MPI openmpi # default, overwritten below
+
+set sp_exe = 0
+set parallel = 0
+set clean = 1
+set dprint = 0
+set branch = 0
+
+set command = "build_split.csh $argv[*]"
+
+set separator = `perl -e "print '<>' x 50;"`
+
+setenv MY_CPP_FLAGS ''
+
+while ( ($#argv) > 0 )
+ switch ($1)
+ case "-noclean"
+ shift
+ set clean = 0
+ breaksw
+
+ case "-sp"
+ shift
+ set clean = 0
+ set sp_exe = 1
+ breaksw
+
+ case "-p"
+ shift
+ set clean = 0
+ set dprint = 1
+ set debug = "print-$1"
+ shift
+ breaksw
+
+ case "-j"
+ shift
+ set parallel = 1
+ if (`echo $1 | grep '^[0-9]\+$'` != "" ) then
+ set NCPUS = "-j $1"
+ shift
+ else
+ set NCPUS = "-j"
+ endif
+ breaksw
+
+ case "-b"
+ shift
+ set branch = 1
+ set branch_name = `echo $1 | grep -v '^-'`
+ if ( "$branch_name" == "" ) then
+ echo "Please enter a branch name."
+ exit 1
+ endif
+ shift
+ breaksw
+
+ case "-*":
+ echo ""
+ echo "${separator}"
+ echo "$0 : Unknown option [ $1 ]"
+ echo ""
+ echo "Available Options:"
+ echo ""
+ echo "-j [N] Compile in parallel using N CPUs"
+ echo " omit argument for all avaliable CPUs"
+ echo ""
+ echo "-sp Compile ROMS single precision executable"
+ echo ""
+ echo "-b branch_name Compile specific ROMS GitHub branch name"
+ echo " For example: build_split.csh -b feature/kernel"
+ echo ""
+ echo "-p macro Prints any Makefile macro value"
+ echo " For example: build_split.csh -p FFLAGS"
+ echo ""
+ echo "-noclean Do not clean already compiled objects"
+ echo "${separator}"
+ echo ""
+ exit 1
+ breaksw
+
+ endsw
+end
+
+# Set the CPP option defining the particular application. This will
+# determine the name of the ".h" header file with the application
+# CPP definitions.
+
+setenv ROMS_APPLICATION WC13
+
+# Set a local environmental variable to define the path to the directories
+# where the ROMS source code is located (MY_ROOT_DIR), and this project's
+# configuration and files are kept (MY_PROJECT_DIR). Notice that if the
+# User sets the ROMS_ROOT_DIR environment variable in their computer logging
+# script describing the location from where the ROMS source code was cloned
+# or downloaded, it uses that value.
+
+if ($?ROMS_ROOT_DIR) then
+ setenv MY_ROOT_DIR ${ROMS_ROOT_DIR}
+else
+ setenv MY_ROOT_DIR ${HOME}/ocean/repository/git
+endif
+
+setenv MY_PROJECT_DIR ${PWD}
+
+# The path to the user's local current ROMS source code.
+#
+# If downloading ROMS locally, this would be the user's Working Copy Path.
+# One advantage of maintaining your source code copy is that when working
+# simultaneously on multiple machines (e.g., a local workstation, a local
+# cluster, and a remote supercomputer), you can update with the latest ROMS
+# release and always get an up-to-date customized source on each machine.
+# This script allows for differing paths to the code and inputs on other
+# computers.
+
+ setenv MY_ROMS_SRC ${MY_ROOT_DIR}/roms
+
+# Set path of the directory containing makefile configuration (*.mk) files.
+# The user has the option to specify a customized version of these files
+# in a different directory than the one distributed with the source code,
+# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep these
+# configurations files up-to-date.
+
+ setenv COMPILERS ${MY_ROMS_SRC}/Compilers
+#setenv COMPILERS ${HOME}/Compilers/ROMS
+
+#--------------------------------------------------------------------------
+# Set tunable CPP options.
+#--------------------------------------------------------------------------
+#
+# Sometimes it is desirable to activate one or more CPP options to run
+# different variants of the same application without modifying its header
+# file. If this is the case, specify each options here using the -D syntax.
+# Notice also that you need to use shell's quoting syntax to enclose the
+# definition. Both single or double quotes work. For example,
+#
+# setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DAVERAGES"
+# setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DDEBUGGING"
+#
+# can be used to write time-averaged fields. Notice that you can have as
+# many definitions as you want by appending values.
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DSPLIT_RBL4DVAR"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DANA_SPONGE"
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DROMS_STDOUT"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DSUPPRESS_REPORT"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DINITIALIZE_AUTOMATIC"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCHECKSUM"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DMINRES"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DRPCG"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DTIME_CONV"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DBGQC"
+
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_BOUNDARY"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_STFLUX"
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DADJUST_WSTRESS"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DSTD_MODEL"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCOMPUTE_MLD"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DCOLLECT_ALLREDUCE"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DREDUCE_ALLGATHER"
+
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DDEBUGGING"
+#setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DPOSITIVE_ZERO"
+
+if ( $sp_exe == 1 ) then
+ setenv MY_CPP_FLAGS "${MY_CPP_FLAGS} -DSINGLE_PRECISION"
+endif
+
+#--------------------------------------------------------------------------
+# Compiler options.
+#--------------------------------------------------------------------------
+#
+# Other user defined environmental variables. See the ROMS makefile for
+# details on other options the user might want to set here. Be sure to
+# leave the switches meant to be off set to an empty string or commented
+# out. Any string value (including off) will evaluate to TRUE in
+# conditional if-statements.
+
+ setenv USE_MPI on # distributed-memory parallelism
+ setenv USE_MPIF90 on # compile with mpif90 script
+#setenv which_MPI intel # compile with mpiifort library
+#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
+
+#setenv USE_OpenMP on # shared-memory parallelism
+
+ setenv FORT ifort
+#setenv FORT gfortran
+#setenv FORT pgi
+
+#setenv USE_DEBUG on # use Fortran debugging flags
+ setenv USE_LARGE on # activate 64-bit compilation
+
+#--------------------------------------------------------------------------
+# Building the ROMS executable using the shared library is not recommended
+# because it requires keeping track of the matching libROMS.{so|dylib}
+# which is located in the Build_roms or Build_romsG directory and will be
+# lost and/or replaced with each new build. The option to build the shared
+# version of libROMS was introduced for use in model coupling systems.
+#--------------------------------------------------------------------------
+
+#setenv SHARED on # build libROMS.{so|dylib}
+ setenv STATIC on # build libROMS.a
+
+ setenv EXEC on # build roms{G|M|O|S} executable
+
+# ROMS I/O choices and combinations. A more complete description of the
+# available options can be found in the wiki (https://myroms.org/wiki/IO).
+# Most users will want to enable at least USE_NETCDF4 because that will
+# instruct the ROMS build system to use nf-config to determine the
+# necessary libraries and paths to link into the ROMS executable.
+
+ setenv USE_NETCDF4 on # compile with NetCDF-4 library
+#setenv USE_PARALLEL_IO on # Parallel I/O with NetCDF-4/HDF5
+#setenv USE_PIO on # Parallel I/O with PIO library
+#setenv USE_SCORPIO on # Parallel I/O with SCORPIO library
+
+# If any of the coupling component use the HDF5 Fortran API for primary
+# I/O, we need to compile the main driver with the HDF5 library.
+
+#setenv USE_HDF5 on # compile with HDF5 library
+
+#--------------------------------------------------------------------------
+# If coupling Earth Systems Models (ESM), set the location of the ESM
+# component libraries and modules.
+#--------------------------------------------------------------------------
+
+source ${MY_ROMS_SRC}/ESM/esm_libs.csh ${MY_ROMS_SRC}/ESM/esm_libs.csh
+
+#--------------------------------------------------------------------------
+# If applicable, use my specified library paths.
+#--------------------------------------------------------------------------
+
+ setenv USE_MY_LIBS no # use system default library paths
+#setenv USE_MY_LIBS yes # use my customized library paths
+
+set MY_PATHS = ${COMPILERS}/my_build_paths.csh
+
+if ($USE_MY_LIBS == 'yes') then
+ source ${MY_PATHS} ${MY_PATHS}
+endif
+
+#--------------------------------------------------------------------------
+# The rest of this script sets the path to the users header file and
+# analytical source files, if any. See the templates in User/Functionals.
+#--------------------------------------------------------------------------
+#
+# If applicable, use the MY_ANALYTICAL_DIR directory to place your
+# customized biology model header file (like fennel.h, nemuro.h, ecosim.h,
+# etc).
+
+ setenv MY_HEADER_DIR ${MY_PROJECT_DIR}
+
+ setenv MY_ANALYTICAL_DIR `dirname ${PWD}`/Functionals
+
+# Put the binary to execute in the following directory.
+
+ setenv BINDIR ${MY_PROJECT_DIR}
+
+if ($?USE_DEBUG) then
+ if ( $sp_exe == 1 ) then
+ setenv BIN ${BINDIR}/romsG_sp
+ else
+ setenv BIN ${BINDIR}/romsG_dp
+ endif
+else
+ if ( $sp_exe == 1 ) then
+ setenv BIN ${BINDIR}/romsM_sp
+ else
+ setenv BIN ${BINDIR}/romsM_dp
+ endif
+endif
+
+ echo ""
+ echo "${separator}"
+
+# Stop if activating both MPI and OpenMP at the same time.
+
+if ( ${?USE_MPI} & ${?USE_OpenMP} ) then
+ echo ""
+ echo "You cannot activate USE_MPI and USE_OpenMP at the same time!"
+ exit 1
+endif
+
+# Put the f90 files in a project specific Build directory to avoid conflict
+# with other projects.
+
+if ($?USE_DEBUG) then
+ if ( $sp_exe == 1 ) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_romsG_sp
+ else
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_romsG_dp
+ endif
+else
+ if ( $sp_exe == 1 ) then
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_romsM_sp
+ else
+ setenv BUILD_DIR ${MY_PROJECT_DIR}/Build_romsM_dp
+ endif
+endif
+
+# For backward compatibility, set deprecated SCRATCH_DIR to compile
+# older released versions of ROMS.
+
+setenv SCRATCH_DIR ${BUILD_DIR}
+
+# If necessary, create ROMS build directory.
+
+if ( ! -d $BUILD_DIR ) then
+ echo ""
+ echo "Creating ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ mkdir $BUILD_DIR
+endif
+
+# Go to the users source directory to compile. The options set above will
+# pick up the application-specific code from the appropriate place.
+
+if ( $branch == 1 ) then
+
+ # Check out requested branch from ROMS GitHub.
+
+ if ( ! -d ${MY_PROJECT_DIR}/src ) then
+ echo ""
+ echo "Downloading ROMS source code from GitHub: https://www.github.com/myroms"
+ echo ""
+ git clone https://www.github.com/myroms/roms.git src
+ endif
+ echo ""
+ echo "Checking out ROMS GitHub branch: $branch_name"
+ echo ""
+ cd src
+ git checkout $branch_name
+
+ # If we are using the COMPILERS from the ROMS source code
+ # overide the value set above
+
+ if ( ${COMPILERS} =~ ${MY_ROMS_SRC}* ) then
+ setenv COMPILERS ${MY_PROJECT_DIR}/src/Compilers
+ endif
+ setenv MY_ROMS_SRC ${MY_PROJECT_DIR}/src
+
+else
+ echo ""
+ echo "Using ROMS source code from: ${MY_ROMS_SRC}"
+ echo ""
+ cd ${MY_ROMS_SRC}
+endif
+
+#--------------------------------------------------------------------------
+# Compile.
+#--------------------------------------------------------------------------
+
+# Remove build directory.
+
+if ( $clean == 1 ) then
+ echo ""
+ echo "Cleaning ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ make clean
+endif
+
+# Compile (the binary will go to BINDIR set above).
+
+if ( $dprint == 1 ) then
+ make $debug
+else
+ echo ""
+ echo "Compiling ROMS source code:"
+ echo ""
+ if ( $parallel == 1 ) then
+ make $NCPUS
+ else
+ make
+ endif
+
+ set HEADER = `echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+
+ echo ""
+ echo "${separator}"
+ echo "GNU Build script command: ${command}"
+ echo "ROMS source directory: ${MY_ROMS_SRC}"
+ echo "ROMS header file: ${MY_HEADER_DIR}/${HEADER}"
+ echo "ROMS build directory: ${BUILD_DIR}"
+ if ( $branch == 1 ) then
+ echo "ROMS downloaded from: https://github.com/myroms/roms.git"
+ echo "ROMS compiled branch: $branch_name"
+ endif
+ echo "ROMS Application: ${ROMS_APPLICATION}"
+ set FFLAGS = `make print-FFLAGS | cut -d " " -f 3-`
+ echo "Fortran compiler: ${FORT}"
+ echo "Fortran flags: ${FFLAGS}"
+ if ($?MY_CPP_FLAGS) then
+ echo "Added CPP Options: ${MY_CPP_FLAGS}"
+ endif
+ echo "${separator}"
+ echo ""
+endif
diff --git a/WC13/RBL4DVAR_mixed/build_split.sh b/WC13/RBL4DVAR_mixed/build_split.sh
new file mode 100755
index 00000000..48f7f44d
--- /dev/null
+++ b/WC13/RBL4DVAR_mixed/build_split.sh
@@ -0,0 +1,464 @@
+0#!/bin/bash
+#
+# git $Id$
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+# Copyright (c) 2002-2024 The ROMS/TOMS Group :::
+# Licensed under a MIT/X style license :::
+# See License_ROMS.md :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
+# :::
+# ROMS Compiling BASH Script :::
+# :::
+# Script to compile an user application where the application-specific :::
+# files are kept separate from the ROMS source code. :::
+# :::
+# Q: How/why does this script work? :::
+# :::
+# A: The ROMS makefile configures user-defined options with a set of :::
+# flags such as ROMS_APPLICATION. Browse the makefile to see these. :::
+# If an option in the makefile uses the syntax ?= in setting the :::
+# default, this means that make will check whether an environment :::
+# variable by that name is set in the shell that calls make. If so :::
+# the environment variable value overrides the default (and the :::
+# user need not maintain separate makefiles, or frequently edit :::
+# the makefile, to run separate applications). :::
+# :::
+# Usage: :::
+# :::
+# ./build_split.sh [options] :::
+# :::
+# Options: :::
+# :::
+# -sp Compile ROMS single precision executable :::
+# :::
+# build_split.sh -sp -j 5 :::
+# :::
+# -j [N] Compile in parallel using N CPUs :::
+# omit argument for all available CPUs :::
+# :::
+# -b Compile a specific ROMS GitHub branch :::
+# :::
+# build_split.sh -j 5 -b feature/kernel :::
+# :::
+# -p macro Prints any Makefile macro value. For example, :::
+# :::
+# build_split.sh -p FFLAGS :::
+# :::
+# -noclean Do not clean already compiled objects :::
+# :::
+# Notice that sometimes the parallel compilation fail to find MPI :::
+# include file "mpif.h". :::
+# :::
+# The branch option -b is only possible for ROMS source code from :::
+# https://github.com/myroms. Such versions are under development :::
+# and targeted to advanced users, superusers, and beta testers. :::
+# Regular and novice users must use the default 'develop' branch. :::
+# :::
+#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+export which_MPI=openmpi # default, overwritten below
+
+sp_exe=0
+parallel=0
+clean=1
+dprint=0
+branch=0
+
+command="build_split.sh $@"
+
+separator=`perl -e "print '<>' x 50;"`
+
+export MY_CPP_FLAGS=
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ -j )
+ shift
+ parallel=1
+ test=`echo $1 | grep '^[0-9]\+$'`
+ if [ "$test" != "" ]; then
+ NCPUS="-j $1"
+ shift
+ else
+ NCPUS="-j"
+ fi
+ ;;
+
+ -sp )
+ shift
+ clean=0
+ sp_exe=1
+ ;;
+
+ -p )
+ shift
+ clean=0
+ dprint=1
+ debug="print-$1"
+ shift
+ ;;
+
+ -noclean )
+ shift
+ clean=0
+ ;;
+
+ -b )
+ shift
+ branch=1
+ branch_name=`echo $1 | grep -v '^-'`
+ if [ "$branch_name" == "" ]; then
+ echo "Please enter a ROMS GitHub branch name."
+ exit 1
+ fi
+ shift
+ ;;
+
+ * )
+ echo ""
+ echo "${separator}"
+ echo "$0 : Unknown option [ $1 ]"
+ echo ""
+ echo "Available Options:"
+ echo ""
+ echo "-j [N] Compile in parallel using N CPUs"
+ echo " omit argument for all avaliable CPUs"
+ echo ""
+ echo "-sp Compile ROMS single precision executable"
+ echo ""
+ echo "-b branch_name Compile specific ROMS GitHub branch name"
+ echo " For example: build_split.sh -b feature/kernel"
+ echo ""
+ echo "-p macro Prints any Makefile macro value"
+ echo " For example: build_split.sh -p FFLAGS"
+ echo ""
+ echo "-noclean Do not clean already compiled objects"
+ echo "${separator}"
+ echo ""
+ exit 1
+ ;;
+ esac
+done
+
+# Set the CPP option defining the particular application. This will
+# determine the name of the ".h" header file with the application
+# CPP definitions.
+
+export ROMS_APPLICATION=WC13
+
+# Set a local environmental variable to define the path to the directories
+# where the ROMS source code is located (MY_ROOT_DIR), and this project's
+# configuration and files are kept (MY_PROJECT_DIR). Notice that if the
+# User sets the ROMS_ROOT_DIR environment variable in their computer logging
+# script describing the location from where the ROMS source code was cloned
+# or downloaded, it uses that value.
+
+if [ -n "${ROMS_ROOT_DIR:+1}" ]; then
+ export MY_ROOT_DIR=${ROMS_ROOT_DIR}
+else
+ export MY_ROOT_DIR=${HOME}/ocean/repository/git
+fi
+
+export MY_PROJECT_DIR=${PWD}
+
+# The path to the user's local current ROMS source code.
+#
+# If downloading ROMS locally, this would be the user's Working Copy Path.
+# One advantage of maintaining your source code copy is that when working
+# simultaneously on multiple machines (e.g., a local workstation, a local
+# cluster, and a remote supercomputer), you can update with the latest ROMS
+# release and always get an up-to-date customized source on each machine.
+# This script allows for differing paths to the code and inputs on other
+# computers.
+
+ export MY_ROMS_SRC=${MY_ROOT_DIR}/roms
+
+# Set path of the directory containing makefile configuration (*.mk) files.
+# The user has the option to specify a customized version of these files
+# in a different directory than the one distributed with the source code,
+# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep these
+# configurations files up-to-date.
+
+ export COMPILERS=${MY_ROMS_SRC}/Compilers
+#export COMPILERS=${HOME}/Compilers/ROMS
+
+#--------------------------------------------------------------------------
+# Set tunable CPP options.
+#--------------------------------------------------------------------------
+#
+# Sometimes it is desirable to activate one or more CPP options to run
+# different variants of the same application without modifying its header
+# file. If this is the case, specify each options here using the -D syntax.
+# Notice also that you need to use shell's quoting syntax to enclose the
+# definition. Both single or double quotes work. For example,
+#
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DAVERAGES"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DDEBUGGING"
+#
+# can be used to write time-averaged fields. Notice that you can have as
+# many definitions as you want by appending values.
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DSPLIT_RBL4DVAR"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DANA_SPONGE"
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DROMS_STDOUT"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DSUPPRESS_REPORT"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DINITIALIZE_AUTOMATIC"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCHECKSUM"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DMINRES"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DRPCG"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DTIME_CONV"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DBGQC"
+
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_BOUNDARY"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_STFLUX"
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DADJUST_WSTRESS"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DSTD_MODEL"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCOMPUTE_MLD"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DCOLLECT_ALLREDUCE"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DREDUCE_ALLGATHER"
+
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DDEBUGGING"
+#export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DPOSITIVE_ZERO"
+
+if [ $sp_exe -eq 1 ]; then
+ export MY_CPP_FLAGS="${MY_CPP_FLAGS} -DSINGLE_PRECISION"
+fi
+
+#--------------------------------------------------------------------------
+# Compiler options.
+#--------------------------------------------------------------------------
+#
+# Other user defined environmental variables. See the ROMS makefile for
+# details on other options the user might want to set here. Be sure to
+# leave the switches meant to be off set to an empty string or commented
+# out. Any string value (including off) will evaluate to TRUE in
+# conditional if-statements.
+
+ export USE_MPI=on # distributed-memory parallelism
+ export USE_MPIF90=on # compile with mpif90 script
+#export which_MPI=intel # compile with mpiifort library
+#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
+
+#export USE_OpenMP=on # shared-memory parallelism
+
+ export FORT=ifort
+#export FORT=gfortran
+#export FORT=pgi
+
+#export USE_DEBUG=on # use Fortran debugging flags
+ export USE_LARGE=on # activate 64-bit compilation
+
+#--------------------------------------------------------------------------
+# Building the ROMS executable using the shared library is not recommended
+# because it requires keeping track of the matching libROMS.{so|dylib}
+# which is located in the Build_roms or Build_romsG directory and will be
+# lost and/or replaced with each new build. The option to build the shared
+# version of libROMS was introduced for use in model coupling systems.
+#--------------------------------------------------------------------------
+
+#export SHARED=on # build libROMS.{so|dylib}
+ export STATIC=on # build libROMS.a
+
+ export EXEC=on # build roms{G|M|O|S} executable
+
+# ROMS I/O choices and combinations. A more complete description of the
+# available options can be found in the wiki (https://myroms.org/wiki/IO).
+# Most users will want to enable at least USE_NETCDF4 because that will
+# instruct the ROMS build system to use nf-config to determine the
+# necessary libraries and paths to link into the ROMS executable.
+
+ export USE_NETCDF4=on # compile with NetCDF-4 library
+#export USE_PARALLEL_IO=on # Parallel I/O with NetCDF-4/HDF5
+#export USE_PIO=on # Parallel I/O with PIO library
+#export USE_SCORPIO=on # Parallel I/O with SCORPIO library
+
+# If any of the coupling component use the HDF5 Fortran API for primary
+# I/O, we need to compile the main driver with the HDF5 library.
+
+#export USE_HDF5=on # compile with HDF5 library
+
+#--------------------------------------------------------------------------
+# If coupling Earth System Models (ESM), set the location of the ESM
+# component libraries and modules.
+#--------------------------------------------------------------------------
+
+source ${MY_ROMS_SRC}/ESM/esm_libs.sh ${MY_ROMS_SRC}/ESM/esm_libs.sh
+
+#--------------------------------------------------------------------------
+# If applicable, use my specified library paths.
+#--------------------------------------------------------------------------
+
+ export USE_MY_LIBS=no # use system default library paths
+#export USE_MY_LIBS=yes # use my customized library paths
+
+MY_PATHS=${COMPILERS}/my_build_paths.sh
+
+if [ "${USE_MY_LIBS}" == "yes" ]; then
+ source ${MY_PATHS} ${MY_PATHS}
+fi
+
+#--------------------------------------------------------------------------
+# The rest of this script sets the path to the users header file and
+# analytical source files, if any. See the templates in User/Functionals.
+#--------------------------------------------------------------------------
+#
+# If applicable, use the MY_ANALYTICAL_DIR directory to place your
+# customized biology model header file (like fennel.h, nemuro.h, ecosim.h,
+# etc).
+
+ export MY_HEADER_DIR=${MY_PROJECT_DIR}
+
+ export MY_ANALYTICAL_DIR=`dirname ${PWD}`/Functionals
+
+# Put the binary to execute in the following directory.
+
+ export BINDIR=${MY_PROJECT_DIR}
+
+if [ -n "${USE_DEBUG:+1}" ]; then
+ if [ $sp_exe -eq 1 ]; then
+ export BIN=${BINDIR}/romsG_sp
+ else
+ export BIN=${BINDIR}/romsG_dp
+ fi
+else
+ if [ $sp_exe -eq 1 ]; then
+ export BIN=${BINDIR}/romsM_sp
+ else
+ export BIN=${BINDIR}/romsM_dp
+ fi
+fi
+
+ echo ""
+ echo "${separator}"
+
+# Stop if activating both MPI and OpenMP at the same time.
+
+if [ -n "${USE_MPI:+1}" ] && [ -n "${USE_OpenMP:+1}" ]; then
+ echo ""
+ echo "You cannot activate USE_MPI and USE_OpenMP at the same time!"
+ exit 1
+fi
+
+# Put the f90 files in a project specific Build directory to avoid conflict
+# with other projects.
+
+if [ -n "${USE_DEBUG:+1}" ]; then
+ if [ $sp_exe -eq 1 ]; then
+ export BUILD_DIR=${MY_PROJECT_DIR}/build_romsG_sp
+ else
+ export BUILD_DIR=${MY_PROJECT_DIR}/build_romsG_dp
+ fi
+else
+ if [ $sp_exe -eq 1 ]; then
+ export BUILD_DIR=${MY_PROJECT_DIR}/build_romsM_sp
+ else
+ export BUILD_DIR=${MY_PROJECT_DIR}/build_romsM_dp
+ fi
+fi
+
+# For backward compatibility, set deprecated SCRATCH_DIR to compile
+# older released versions of ROMS.
+
+export SCRATCH_DIR=${BUILD_DIR}
+
+# If necessary, create ROMS build directory.
+
+if [ ! -d ${BUILD_DIR} ]; then
+ echo ""
+ echo "Creating ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ mkdir $BUILD_DIR
+fi
+
+# Go to the users source directory to compile. The options set above will
+# pick up the application-specific code from the appropriate place.
+
+if [ $branch -eq 1 ]; then
+
+ # Check out requested branch from ROMS GitHub.
+
+ if [ ! -d ${MY_PROJECT_DIR}/src ]; then
+ echo ""
+ echo "Downloading ROMS source code from GitHub: https://www.github.com/myroms"
+ echo ""
+ git clone https://www.github.com/myroms/roms.git src
+ fi
+ echo ""
+ echo "Checking out ROMS GitHub branch: $branch_name"
+ echo ""
+ cd src
+ git checkout $branch_name
+
+ # If we are using the COMPILERS from the ROMS source code
+ # overide the value set above
+
+ if [[ ${COMPILERS} == ${MY_ROMS_SRC}* ]]; then
+ export COMPILERS=${MY_PROJECT_DIR}/src/Compilers
+ fi
+ export MY_ROMS_SRC=${MY_PROJECT_DIR}/src
+
+else
+ echo ""
+ echo "Using ROMS source code from: ${MY_ROMS_SRC}"
+ echo ""
+ cd ${MY_ROMS_SRC}
+fi
+
+#--------------------------------------------------------------------------
+# Compile.
+#--------------------------------------------------------------------------
+
+# Remove build directory.
+
+if [ $clean -eq 1 ]; then
+ echo ""
+ echo "Cleaning ROMS build directory: ${BUILD_DIR}"
+ echo ""
+ make clean
+fi
+
+# Compile (the binary will go to BINDIR set above).
+
+if [ $dprint -eq 1 ]; then
+ make $debug
+else
+ echo ""
+ echo "Compiling ROMS source code:"
+ echo ""
+ if [ $parallel -eq 1 ]; then
+ make $NCPUS
+ else
+ make
+ fi
+
+ HEADER=`echo ${ROMS_APPLICATION} | tr '[:upper:]' '[:lower:]'`.h
+
+ echo ""
+ echo "${separator}"
+ echo "GNU Build script command: ${command}"
+ echo "ROMS source directory: ${MY_ROMS_SRC}"
+ echo "ROMS header file: ${MY_HEADER_DIR}/${HEADER}"
+ echo "ROMS build directory: ${BUILD_DIR}"
+ if [ $branch -eq 1 ]; then
+ echo "ROMS downloaded from: https://github.com/myroms/roms.git"
+ echo "ROMS compiled branch: $branch_name"
+ fi
+ echo "ROMS Application: ${ROMS_APPLICATION}"
+ FFLAGS=`make print-FFLAGS | cut -d " " -f 3-`
+ echo "Fortran compiler: ${FORT}"
+ echo "Fortran flags: ${FFLAGS}"
+ if [ -n "${MY_CPP_FLAGS:+1}" ]; then
+ echo "Added CPP Options: ${MY_CPP_FLAGS}"
+ fi
+ echo "${separator}"
+ echo ""
+fi
diff --git a/WC13/RBL4DVAR_mixed/job_rbl4dvar.csh b/WC13/RBL4DVAR_mixed/job_rbl4dvar.csh
new file mode 100755
index 00000000..fd9ccdf8
--- /dev/null
+++ b/WC13/RBL4DVAR_mixed/job_rbl4dvar.csh
@@ -0,0 +1,98 @@
+#!/bin/csh -f
+#
+# svn $Id$
+#######################################################################
+# Copyright (c) 2002-2019 The ROMS/TOMS Group #
+# Licensed under a MIT/X style license #
+# See License_ROMS.md #
+#######################################################################
+# #
+# Strong/Weak constraint RBL4D-Var job script: #
+# #
+# This script NEEDS to be run before any run: #
+# #
+# (1) It copies a new clean nonlinear model initial conditions #
+# file. The nonlinear model is initialized from the #
+# background or reference state. #
+# (2) Specify model, initial conditions, boundary conditions, and #
+# surface forcing error convariance input standard deviations #
+# files. #
+# (3) Specify model, initial conditions, boundary conditions, and #
+# surface forcing error convariance input/output normalization #
+# factors files. #
+# (4) Copy a clean copy of the observations NetCDF file. #
+# (5) Create 4D-Var input script "rbl4dvar.in" from template and #
+# specify the error covariance standard deviation, error #
+# covariance normalization factors, and observation files to #
+# be used. #
+# #
+#######################################################################
+
+ echo ' '
+ echo 'Strong/Weak Constraint RBL4D-Var Configuration:'
+ echo ' '
+
+# Set path definition to one directory up in the tree.
+
+ set Dir=`dirname ${PWD}`
+
+# Set string manipulations perl script.
+
+ set SUBSTITUTE=${ROMS_ROOT}/ROMS/Bin/substitute
+
+# Copy nonlinear model initial conditions file.
+
+ cp -vp ${Dir}/Data/wc13_ini.nc wc13_ini.nc
+
+# Set model, initial conditions, boundary conditions and surface
+# forcing error covariance standard deviations files.
+
+ set STDnameM=../Data/wc13_std_m.nc
+ set STDnameI=../Data/wc13_std_i.nc
+ set STDnameB=../Data/wc13_std_b.nc
+ set STDnameF=../Data/wc13_std_f.nc
+
+# Set output file for standard deviation computed/modeled from background
+# (prior) state.
+
+ set STDnameC=wc13_std_computed.nc
+
+# Set model, initial conditions, boundary conditions and surface
+# forcing error covariance normalization factors files.
+
+ set NRMnameM=../Data/wc13_nrm_m.nc
+ set NRMnameI=../Data/wc13_nrm_i.nc
+ set NRMnameB=../Data/wc13_nrm_b.nc
+ set NRMnameF=../Data/wc13_nrm_f.nc
+
+# Set observations file.
+
+ set OBSname=wc13_obs.nc
+
+# Get a clean copy of the observation file. This is really
+# important since this file is modified.
+
+ cp -vp ${Dir}/Data/${OBSname} .
+
+# Modify 4D-Var template input script and specify above files.
+
+ set RBL4DVAR=rbl4dvar.in
+ if (-e $RBL4DVAR) then
+ /bin/rm $RBL4DVAR
+ endif
+ cp -v s4dvar.in $RBL4DVAR
+
+ $SUBSTITUTE $RBL4DVAR roms_std_m.nc $STDnameM
+ $SUBSTITUTE $RBL4DVAR roms_std_i.nc $STDnameI
+ $SUBSTITUTE $RBL4DVAR roms_std_b.nc $STDnameB
+ $SUBSTITUTE $RBL4DVAR roms_std_f.nc $STDnameF
+ $SUBSTITUTE $RBL4DVAR roms_std_c.nc $STDnameC
+ $SUBSTITUTE $RBL4DVAR roms_nrm_m.nc $NRMnameM
+ $SUBSTITUTE $RBL4DVAR roms_nrm_i.nc $NRMnameI
+ $SUBSTITUTE $RBL4DVAR roms_nrm_b.nc $NRMnameB
+ $SUBSTITUTE $RBL4DVAR roms_nrm_f.nc $NRMnameF
+ $SUBSTITUTE $RBL4DVAR roms_obs.nc $OBSname
+ $SUBSTITUTE $RBL4DVAR roms_hss.nc wc13_hss.nc
+ $SUBSTITUTE $RBL4DVAR roms_lcz.nc wc13_lcz.nc
+ $SUBSTITUTE $RBL4DVAR roms_mod.nc wc13_mod.nc
+ $SUBSTITUTE $RBL4DVAR roms_err.nc wc13_err.nc
diff --git a/WC13/RBL4DVAR_mixed/s4dvar.in b/WC13/RBL4DVAR_mixed/s4dvar.in
new file mode 100644
index 00000000..ad23146d
--- /dev/null
+++ b/WC13/RBL4DVAR_mixed/s4dvar.in
@@ -0,0 +1,1073 @@
+! 4DVar assimilation input parameters.
+!
+! git $Id$
+!========================================================= Hernan G. Arango ===
+! Copyright (c) 2002-2024 The ROMS/TOMS Group !
+! Licensed under a MIT/X style license !
+! See License_ROMS.md !
+!==============================================================================
+! !
+! Input parameters can be entered in ANY order, provided that the parameter !
+! KEYWORD (usually, upper case) is typed correctly followed by "=" or "==" !
+! symbols. Any comment lines are allowed and must begin with an exclamation !
+! mark (!) in column one. Comments may appear to the right of a parameter !
+! specification to improve documentation. Comments will be ignored during !
+! reading. Blank lines are also allowed and ignored. Continuation lines in !
+! a parameter specification are allowed and must be preceded by a backslash !
+! (\). In some instances, more than one value is required for a parameter. !
+! If fewer values are provided, the last value is assigned for the entire !
+! parameter array. The multiplication symbol (*), without blank spaces in !
+! between, is allowed for a parameter specification. For example, in a two !
+! grids nested application: !
+! !
+! AKT_BAK == 2*1.0d-6 2*5.0d-6 ! m2/s !
+! !
+! indicates that the first two entries of array AKT_BAK, in fortran column- !
+! major order, will have the same value of "1.0d-6" for grid 1, whereas the !
+! next two entries will have the same value of "5.0d-6" for grid 2. !
+! !
+! In multiple levels of nesting and/or multiple connected domains setups, !
+! "Ngrids" entries are expected for some of these parameters. In such cases, !
+! the order of the entries for a parameter is extremely important. It must !
+! follow the same order (1:Ngrids) as in the state variable declaration. The !
+! USER may follow the above guidelines for specifying his/her values. These !
+! parameters are marked by "==" plural symbol after the KEYWORD. !
+! !
+!==============================================================================
+!
+
+! Number of iterations in the biconjugate gradient algorithm used to solve
+! the elliptic equation for sea surface height in the error covariance
+! balance operator, [1:Ngrids].
+
+ Nbico == 200
+
+! Parameters used to compute balanced salinity in terms of temperature using
+! empirical T-S relationships in the error covariance balance operator,
+! [1:Ngrids].
+
+ dTdz_min == 0.001d0 ! minimum dT/dz (Celsius/m)
+ ml_depth == 100.0d0 ! mixed-layer depth (m; positive)
+
+! Balance operator level of no motion depth (m) used when computing balanced
+! free-surface contribution, [1:Ngrids].
+
+ LNM_depth == 1000.0d0 ! meters, positive
+
+! Balance operator level of no motion flag used to compute balanced
+! free-surface contribution:
+!
+! [0] Integrate from local bottom to the surface
+! [1] Integrate from LNM_depth to surface or integrate from local bottom
+! if shallower than LNM_depth
+!
+
+ LNM_flag = 1
+
+! Balance operator logical switches for state variables to consider in the
+! error covariance multivariate constraints.
+
+balance(isSalt) = T ! salinity
+balance(isFsur) = T ! free-sruface
+balance(isVbar) = F ! 2D momentum (ubar, vbar)
+balance(isVvel) = T ! 3D momentum (u, v)
+
+! Parameter to process the Nvct eigenvector of the stabilized representer
+! matrix when computing array modes (here, Nvct=Ninner is the most important
+! while Nvct=1 is the least important) OR cut-off parameter for the clipped
+! analysis to disregard potentially unphysical array modes (that is, all
+! the eigenvectors < Nctv are disgarded).
+
+ Nvct = 50
+
+! Upper bound on the relative error of the gradient for the Lanczos
+! conjugate gradient algorithm.
+
+ GradErr = 1.0d-4
+
+! Maximum error bound on Hessian eigenvectors in the Lanczos conjugate
+! gradient algorithm. Note that even quite inaccurate eigenvectors are
+! useful for pre-conditioning purposes.
+
+ HevecErr = 1.0d-1
+
+! Switch (T/F) to compute approximated Hessian eigenpairs in the Lanczos
+! conjugate gradient algorithm.
+
+ LhessianEV = T
+
+! Switch (T/F) to activate hot start in weak-constraint (R4DVAR and
+! RBL4DVAR) algorithms of subsequent outer loops.
+
+ LhotStart = T
+
+! Switch (T/F) to activate I4DVAR conjugate gradient preconditioning.
+! Two types of Limited-Memory Preconditioner (LMP) are available
+! (Tshimanga et al., 2008): spectral LMP and Ritz LMP.
+
+ Lprecond = F
+
+! Switch to activate either Ritz Limited-Memory Preconditioner (T)
+! or spectral Limited-Memory Preconditioner (F) to the I4DVAR algorithm.
+
+ Lritz = T
+
+! If preconditioning, specify number of eigenpairs to use. If zero,
+! use HevecErr parameter to determine the number of converged eigenpairs.
+
+ NritzEV = 0
+
+! If weak constraint 4D-Var, set number of iterations in the Lanczos
+! algorithm used to estimate the posterior analysis error covariance
+! matrix.
+
+ NpostI = 50
+
+! If observations impact or observations sensitivity, set the 4D-Var
+! outer loop to process. It must be less or equal to Nouter.
+
+ Nimpact = 1
+
+! If multiple executables 4D-Var, set the current outer counter and
+! its computation phase (string). The 4D-Var running script assigns
+! their values.
+
+ OuterLoop = MyOuterLoop
+
+ Phase4DVAR = MyPhase4DVAR
+
+! Number of extra-observation classes (NextraObs), observation type
+! indices (ExtraIndex), and observation type names (ExtraName) to
+! consider in addition to the 1-to-1 associated with the state
+! variables. It is used in observation operators that require more than
+! one state variable to evaluate a particular observation type like
+! HF radials, travel time, pressure, etc.
+!
+! In any application, the number of observation types is computed as:
+! NobsVar = NstateVar + NextraObs.
+!
+! NextraObs values are expected for keywords ExtraIndex and ExtraName.
+! If NextraVar > 1, enter one observation type name per line and
+! use a backslash as the continuation.
+
+ NextraObs = 0
+
+ ExtraIndex = 20
+
+ ExtraName = radial
+
+! If weak constraint 4D-Var, set diffusive relaxation coefficients (m2/s)
+! used to relax representer tangent linear solution to privious Picard
+! iteration linearized trajectory.
+
+ tl_M2diff == 0.0d0 ! 2D momentum
+ tl_M3diff == 0.0d0 ! 3D momentum
+
+ tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
+! Switches (T/F) to create and write error covariance normalization
+! factors for model, initial conditions, boundary conditions, and
+! surface forcing. If TRUE, these factors are computed and written
+! to NRMname(1:4) NetCDF files. If FALSE, they are read from NRMname(1:4)
+! NetCDF file. The computation of these factors is very expensive and
+! needs to be computed only once for a particular application provided
+! that grid land/sea masking, and decorrelation scales remain
+! the same. Notice that four values are needed (1=initial conditions,
+! 2=model, 3=boundary conditions, 4=surface forcing) per each nested
+! grid, [1:4,1:Ngrids].
+
+ LdefNRM == F F F F ! Create a new normalization files
+ LwrtNRM == F F F F ! Compute and write normalization
+
+! Switches to compute the correlation normalization coefficients for
+! model error covariance.
+
+ CnormM(isFsur) = T ! 2D variable at RHO-points
+ CnormM(isUbar) = T ! 2D variable at U-points
+ CnormM(isVbar) = T ! 2D variable at V-points
+ CnormM(isUvel) = T ! 3D variable at U-points
+ CnormM(isVvel) = T ! 3D variable at V-points
+ CnormM(isTvar) = T T ! NT tracers
+
+! Switches to compute the correlation normalization coefficients for
+! initial conditions error covariance.
+
+ CnormI(isFsur) = T ! 2D variable at RHO-points
+ CnormI(isUbar) = T ! 2D variable at U-points
+ CnormI(isVbar) = T ! 2D variable at V-points
+ CnormI(isUvel) = T ! 3D variable at U-points
+ CnormI(isVvel) = T ! 3D variable at V-points
+ CnormI(isTvar) = T T ! NT tracers
+
+! Switches to compute the correlation normalization coefficients for
+! boundary conditions error covariance.
+
+ CnormB(isFsur) = T ! 2D variable at RHO-points
+ CnormB(isUbar) = T ! 2D variable at U-points
+ CnormB(isVbar) = T ! 2D variable at V-points
+ CnormB(isUvel) = T ! 3D variable at U-points
+ CnormB(isVvel) = T ! 3D variable at V-points
+ CnormB(isTvar) = T T ! NT tracers
+
+! Switches to compute the correlation normalization coefficients for
+! surface forcing error covariance.
+
+ CnormF(isUstr) = T ! surface U-momentum stress
+ CnormF(isVstr) = T ! surface V-momentum stress
+ CnormF(isTsur) = T T ! NT surface tracers flux
+
+! Correlation normalization method:
+!
+! [0] Exact, very expensive
+! [1] Approximated, randomization
+
+ Nmethod == 0
+
+! If randomization, select random number generation scheme:
+!
+! [1] Gaussian distributed deviates, numerical recipes
+
+ Rscheme == 1
+
+! Number of iterations to compute correlation normalization coefficients
+! via the randomization approach. A large number is required to be
+! statistically meaningful and achieve zero expectation mean and unit
+! variance. These factors insure that the error covariance diagonal
+! elements are equal to unity.
+
+ Nrandom = 5000
+
+! Horizontal and vertical stability and accuracy factors (< 1) used to
+! time-step discretized convolution operators below its theoretical limit.
+! Notice that four values [1:4] are needed for each factor to facilitate
+! the error covariance modeling: 1=initial conditions, 2=model,
+! 3=boundary conditions, and 4=surface forcing.
+!
+! IC Model OBC Sur For
+
+ Hgamma = 0.5 0.5 0.5 0.5 ! horizontal operator
+ Vgamma = 0.0005 0.0005 0.0005 0.0005 ! vertical operator
+
+! Model error covariance: horizontal, isotropic decorrelation scales (m).
+! This scales are only used in weak-constraint data assimilation.
+
+HdecayM(isFsur) == 50.0d+3 ! free-surface
+HdecayM(isUbar) == 50.0d+3 ! 2D U-momentum
+HdecayM(isVbar) == 50.0d+3 ! 2D V-momentum
+HdecayM(isUvel) == 50.0d+3 ! 3D U-momentum
+HdecayM(isVvel) == 50.0d+3 ! 3D V-momentum
+HdecayM(isTvar) == 50.0d+3 50.0d+3 ! 1:NT tracers
+
+! Model error covariance: vertical, isotropic decorrelation scales (m).
+
+VdecayM(isUvel) == 30.0d0 ! 3D U-momentum
+VdecayM(isVvel) == 30.0d0 ! 3D V-momentum
+VdecayM(isTvar) == 30.0d0 30.0d0 ! 1:NT tracers
+
+! Model error covariance: temporal decorrelation scales (days).
+! This scales are only used in weak-constraint data assimilation.
+
+TdecayM(isFsur) == 1.0d0 ! free-surface
+TdecayM(isUbar) == 1.0d0 ! 2D U-momentum
+TdecayM(isVbar) == 1.0d0 ! 2D V-momentum
+TdecayM(isUvel) == 1.0d0 ! 3D U-momentum
+TdecayM(isVvel) == 1.0d0 ! 3D V-momentum
+TdecayM(isTvar) == 1.0d0 1.0d0 ! 1:NT tracers
+
+! Initial conditions error covariance: horizontal, isotropic decorrelation
+! scales (m).
+
+HdecayI(isFsur) == 50.0d+3 ! free-surface
+HdecayI(isUbar) == 50.0d+3 ! 2D U-momentum
+HdecayI(isVbar) == 50.0d+3 ! 2D V-momentum
+HdecayI(isUvel) == 50.0d+3 ! 3D U-momentum
+HdecayI(isVvel) == 50.0d+3 ! 3D V-momentum
+HdecayI(isTvar) == 50.0d+3 50.0d+3 ! 1:NT tracers
+
+! Initial conditions error covariance: vertical, isotropic decorrelation
+! scales (m).
+
+VdecayI(isUvel) == 30.0d0 ! 3D U-momentum
+VdecayI(isVvel) == 30.0d0 ! 3D V-momentum
+VdecayI(isTvar) == 30.0d0 30.0d0 ! 1:NT tracers
+
+! Boundary conditions error covariance: horizontal, isotropic decorrelation
+! scales (m). A value is expected for each boundary edge in the following
+! order:
+! 1: west 2: south 3: east 4: north
+
+HdecayB(isFsur) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! free-surface
+HdecayB(isUbar) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 2D U-momentum
+HdecayB(isVbar) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 2D V-momentum
+HdecayB(isUvel) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 3D U-momentum
+HdecayB(isVvel) == 100.0d+3 100.0d+3 100.0d+3 100.0d+3 ! 3D V-momentum
+HdecayB(isTvar) == 4*100.0d+3 4*100.0d+3 ! (4,1:NT) tracers
+
+! Boundary conditions error covariance: vertical, isotropic decorrelation
+! scales (m). A value is expected for each boundary edge in the following
+! order:
+! 1: west 2: south 3: east 4: north
+
+VdecayB(isUvel) == 30.0d0 30.0d0 30.0d0 30.0d0 ! 3D U-momentum
+VdecayB(isVvel) == 30.0d0 30.0d0 30.0d0 30.0d0 ! 3D V-momentum
+VdecayB(isTvar) == 4*30.d0 4*30.d0 ! (4,1:NT) tracers
+
+! Surface forcing error covariance: horizontal, isotropic decorrelation
+! scales (m).
+
+HdecayF(isUstr) == 100.0d+3 ! surface U-momentum stress
+HdecayF(isVstr) == 100.0d+3 ! surface V-momentum stress
+HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
+
+! Modeled standard deviation (STD) of Background Error Covarinace parameters.
+!
+! The Mogensen et al. (2012) formulation assumes that the background errors
+! are proportional to vertical derivatives of the state vector field. Its
+! error has the similar field profile shape, but the difference with its
+! ture error value is due to a vertical displacement.
+!
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
+! criterion from kara et al. (2000). Otherwise, it will be set to uniform
+! value provided below.
+
+Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
+
+Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
+ Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
+
+Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
+ Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
+
+Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
+ Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
+
+ mld_uniform == -75.0d0 ! Uniform mixed layer depth value
+
+! Select flag for BackGround Quality Control (BGQC) of observations:
+!
+! [1] Quality control in terms of state variable indices
+! [2] Quality control in terms of observation provenance
+
+ bgqc_type == 2
+
+! If BGQC is in terms of state variables, set the threshold, squared number
+! of standard deviations to use in the quality control rejection of
+! observations.
+!
+! Use a large value (say, 1.0d+5) if you do not want to reject observations
+! associated with a particular state variable.
+!
+! Use a small value (typically, 16 to rejecting based on on 4 standard
+! deviations) to perform quality control of observations for a particular
+! state variable.
+
+ S_bgqc(isFsur) == 1.0d+5 ! free-surface
+ S_bgqc(isUbar) == 1.0d+5 ! 2D U-momentum
+ S_bgqc(isVbar) == 1.0d+5 ! 2D V-momentum
+ S_bgqc(isUvel) == 1.0d+5 ! 3D U-momentum
+ S_bgqc(isVvel) == 1.0d+5 ! 3D V-momentum
+ S_bgqc(isTvar) == 4.0d0 4.0d0 ! 1:NT tracers
+
+! If BGQC is in terms of observation provenance, set the threshold, squared
+! number of standard deviations to use in the quality control rejection of
+! observations.
+!
+! Use a small value (say, 16 to rejecting based on on 4 standard deviations)
+! to perform quality control for the desired observation provenance(s).
+!
+! Nprovenance: Number of observation provenances to quality control
+! Iprovenance: Observation provenance indices to process [1:Nprovenance]
+! P_bgqc: Standard deviation threshold [1:Nprovenance]
+
+ Nprovenance == 6
+ Iprovenance == 6 7 8 9 10 11 ! ARGO and CDT T & S
+
+ P_bgqc == 4.0d0 4.0d0 4.0d0 4.0d0 4.0d0 4.0d0
+
+! If applicable, set switches (T/F) used to adjust surface tracer flux,
+! [1:NT,1:Ngrids].
+
+ Lstflux == T T ! NT tracers
+
+! If applicable, set switches to adjust state variables at the open
+! boundaries. Notice that a value is expected for each boundary segment
+! per nested grid, [1:4,1:Ngrids]. The boundary order is: 1=west,
+! 2=south, 3=east, and 4=north. That is, anticlockwise starting at
+! the western boundary.
+!
+! When processing momentum, you need to activate both components. If
+! processing 2D momentum, you need to activate both free-surface and
+! 3D-momentum at the processing boundary.
+!
+! W S E N _____N_____
+! e o a o | 4 |
+! s u s r | |
+! t t t t 1 W E 3
+! h h | |
+! |_____S_____|
+! 1 2 3 4 2
+
+ Lobc(isFsur) == T T F T ! free-surface
+ Lobc(isUbar) == T T F T ! 2D U-momentum
+ Lobc(isVbar) == T T F T ! 2D V-momentum
+ Lobc(isUvel) == T T F T ! 3D U-momentum
+ Lobc(isVvel) == T T F T ! 3D V-momentum
+
+! If applicable, set switches to adjust state tracer variables at the
+! open boundaries. Notice that a value is expected for each tracer at each
+! boundary segment per nested grid, [1:4,1:NT,1:Ngrids]. The boundary order
+! is the same as above. Notice that the first line has the values for
+! temperature boundaries, the second is salinity, and so on.
+
+ Lobc(isTvar) == T T F T \
+ T T F T
+
+! Input model, initial conditions, boundary conditions, and surface forcing
+! standard deviation file names, [1:Ngrids].
+
+ STDnameM == roms_std_m.nc
+ STDnameI == roms_std_i.nc
+ STDnameB == roms_std_b.nc
+ STDnameF == roms_std_f.nc
+
+! If computing the standard deviation from the background (prior) state
+! vector as an alternative to climatological values read from the
+! input NetCDF file, enter output standard deviation file name,
+! [1:Ngrids].
+
+ STDnameC == roms_std_c.nc
+
+! Input/output model, initial conditions, boundary conditions, and surface
+! forcing error covariance normalization factors file name, [1:Ngrids].
+
+ NRMnameM == roms_nrm_m.nc
+ NRMnameI == roms_nrm_i.nc
+ NRMnameB == roms_nrm_b.nc
+ NRMnameF == roms_nrm_f.nc
+
+! Input/output observation file name, [1:Ngrids].
+
+ OBSname == roms_obs.nc
+
+! Input/output Hessian eigenvectors file name, [1:Ngrids].
+
+ HSSname == roms_hss.nc
+
+! Input/output Lanczos vectors file name, [1:Ngrids].
+
+ LCZname == roms_lcz.nc
+
+! Output time-evolved Lanczos vectors file name, [1:Ngrids].
+
+ LZEname == roms_lze.nc
+
+! Output model data at observation locations file name, [1:Ngrids].
+
+ MODname == roms_mod.nc
+
+! Output posterior error covariance matrix file name, [1:Ngrids].
+
+ ERRname == roms_err.nc
+
+! Input forcing filenames at observation locations for computing observations
+! impacts during the analysis-forecast cycle when the forecast is initialized
+! with the 4D-Var analysis (OIFnameA) or the 4D-Var background (OIFnameB).
+
+ OIFnameA == roms_oif_a.nc
+ OIFnameB == roms_oif_b.nc
+
+!
+! GLOSSARY:
+! =========
+!
+!------------------------------------------------------------------------------
+! Error covariance matrix balance operator parameters. These parameters are
+! only used when BALANCE_OPERATOR and ZETA_ELLIPTIC are activated.
+!------------------------------------------------------------------------------
+!
+! Nbico Number of iterations in the biconjugate gradient algorithm
+! used to solve the elliptic equation for sea surface height
+! in the error covariance balance operator, [1:Ngrids]. We
+! need as many iterations as required to decrease the error
+! value of the reference free-surface to 1E-8 or smaller. In
+! some applications Nbico=200 will do the job.
+!
+! Warning: be aware that there are 4 arrays that are
+! ------- allocated with this parameter array and its
+! value may be constrained by available memory:
+!
+! FOURDVAR(ng) % p_r2d (LBi:UBi,LBj:UBj,Nbico(ng))
+! FOURDVAR(ng) % r_r2d (LBi:UBi,LBj:UBj,Nbico(ng))
+! FOURDVAR(nd) % bp_r2d(LBi:UBi,LBj:UBj,Nbico(ng))
+! FOURDVAR(ng) % br_r2d(LBi:UBi,LBj:UBj,Nbico(ng))
+!
+! All the iterations values are needed in the backward
+! stepping of the adjoint.
+!
+! dTdz_min Minimum d(T)/d(z) above which the balanced salinity
+! (deltaS_b) is computed, [1:Ngrids]:
+!
+! deltaS_b = cff * dSdT * deltaT; dSdT = dSdz / dTdz
+!
+! where cff is a coefficient that depends on the mixed-layer
+! depth (ml_depth):
+!
+! cff = 1.0 - EXP (z_r / ml_depth)
+!
+! ml_depth Mixed-layer depth (m; positive) used above in smoothing
+! coefficient (cff), [1:Ngrids].
+!
+! LNM_depth Level of no motion depth (m; positive) used to compute the
+! balanced free-surface contribution in the error covariance
+! balance operator. It is only relevant when LNM_flag=1,
+! balance(isFsur)=T, and ZETA_ELLIPTIC is NOT activated. It
+! is used to integrate the non-hydrostatic equation.
+!
+! LNM_flag Level of no motion integration flag used to used to compute
+! the balanced free-surface contribution:
+!
+! LNM_flag = 0, integrate from local bottom to the surface
+!
+! LNM_flag = 1, integrate from LNM_depth to surface or
+! integrate from local bottom if shallower
+! than LNM_depth
+!
+! balance Balance operator logical switches for state variables to
+! consider in the error covariance off-diagonal multivariate
+! constraints:
+!
+! balance(isSalt) = T, salinity
+! balance(isFsur) = T, free-sruface
+! balance(isVbar) = F, 2D momentum (ubar, vbar)
+! balance(isVvel) = T, 3D momentum (u, v)
+!
+! Guidelines:
+!
+! 1) The salinity contribution, balance(isSalt), depends
+! only on temperature. Notice that temperature is used
+! to establish the balanced part of the other state
+! variables.
+!
+! 2) The free-surface contribution, balance(isFsur), depends
+! on salinity since we need to compute balanced density
+! and integrate properly using LNM_flag and LNM_depth.
+! This implies that balance(isSalt) needs to be TRUE too.
+! It is independent of the 2D or 3D balance velocity terms.
+!
+! 3) The 3D momentum, balance(isVvel), depends on salinity
+! since we need to compute balanced density. This
+! implies that balance(isSalt) needs to be TRUE too.
+!
+!------------------------------------------------------------------------------
+! Array modes parameter.
+!------------------------------------------------------------------------------
+!
+! Nvct Which eigenvector of the stabilized representer matrix to
+! process to computing array modes when option ARRAY_MODES is
+! activated. In this case, Nvct =< Ninner,
+!
+! Nvct=1 least important eigenvector
+! Nvct=Ninner most important eigenvector
+!
+! or cut-off eigenvector for the clipped analysis when
+! the option CLIPPING is activated to remove potentially
+! unphysical array modes. In this case, Nvct =< Ninner. All
+! the eigenvectors are ordered according to their significance,
+! Nvct=Ninner is the most important.
+!
+! Nvct:Ninner eigenvectors will be processed
+! 1:Nvct-1 eigenvectors will be disgarded
+!
+!------------------------------------------------------------------------------
+! Lanczos conjugate gradient algorithm parameters.
+!------------------------------------------------------------------------------
+!
+! GradErr Upper bound on the relative error of the gradient.
+!
+! HevecErr Maximum error bound on Hessian eigenvectors. Note that
+! even quite inaccurate eigenvectors are useful
+! for pre-conditioning purposes.
+!
+! LhessianEV Switch (T/F) to compute approximated Hessian eigenvalues
+! and eigenvectors.
+!
+!
+! LhotStart Switch (T/F) to activate hot start in weak-constraint
+! (R4DVAR and RBL4DVAR) algorithms.
+!
+! Lprecond Switch (T/F) to activate preconditioning in the I4DVAR
+! algorithm. Two types of Limited-Memory preconditioner (LMP)
+! are available Tshimanga et al., 2008): Spectral and Ritz.
+!
+! If Lprecond=T and Lritz=F, Spectral LMP
+! If Lprecond=T and Lritz=T, Ritz LMP
+!
+! Lritz Switch to activate either Ritz Limited-Memory Preconditioner
+! (T) or spectral Limited-Memory Preconditioner (F) to the
+! I4DVAR algorithm using eigenpairs approximation for the
+! Hessian matrix. The accuracy of the Hessian eigenvectors
+! (HevecErr) can be used to fine tune the minimization. That
+! is, HevecErr can be used to control number of eigenvalues
+! of the preconditioning Hessian matrix. See Tshimanga et al.
+! (2008) Q. J. R. Met. Soc. paper for details.
+!
+! NritzEV If preconditioning, specify number of eigenpairs to use.
+! If zero, use HevecErr parameter to determine the number
+! of converged eigenpairs.
+!
+! NpostI If weak constraint 4D-Var (RBL4DVAR or R4DVAR), set number
+! of iterations in the Lanczos algorithm used to estimate the
+! posterior analysis error covariance matrix.
+!
+!------------------------------------------------------------------------------
+! Observations impact or observations sensitivity.
+!------------------------------------------------------------------------------
+!
+! Nimpact Outer loop to consider in the computation of the observations
+! impact or observation sensitivity, Nimpact =< Nouter. This
+! facilitates the computations with multiple outer loop 4D-Var
+! applications. The observation analysis needs to be computed
+! separately for each outer loop. The full analysis for all
+! outer loops is combined offline.
+!
+!------------------------------------------------------------------------------
+! Outer loop counter and phase for split 4D-Var in multiple executables.
+!------------------------------------------------------------------------------
+!
+! OuterLoop Current outer loop counter. It is set by the running shell
+! script.
+!
+! Phase4DVAR Current split 4D-Var algorithm elementary phases to compute:
+!
+! Phase4DVAR = 'background' Xb
+! Phase4DVAR = 'increment' dXa
+! Phase4DVAR = 'analysis' Xa = Xb + dXa
+! Phase4DVAR = 'post_analysis' (posterior analysis)
+! Phase4DVAR = 'post_error' (posterior error)
+!
+! There is a 'prior_error' phase that it is always done in
+! 'ROMS_initialize'.
+!
+!------------------------------------------------------------------------------
+! Additional observation operators.
+!------------------------------------------------------------------------------
+!
+! Currently, only one extra-observation operator has been implemented to
+! process radial velocities from HF radars instruments.
+!
+! NextraObs Number of extra-observation classes to consider in addition
+! to those associated with the state variables (one-to-one
+! correspondence. They are used in observation operators that
+! require more than one state variable to evaluate a particular
+! extra-observation type like HF radials, travel time,
+! pressure, etc.
+!
+! In any application, the number of observation types is
+! computed as:
+!
+! NobsVar(ng) = NstateVar(ng) + NextraObs
+!
+! If not processing extra-observation classes, set NextraObs
+! to zero.
+!
+! ExtraIndex Extra-observation class identification indices, as specified
+! in input observation NetCDF file variable "obs_type". The
+! index has to be a number greater than 7+2*NT, where NT is
+! the total of active plus passive tracers. NextraObs values
+! are expected for this Keyword. This parameter is only
+! processed when NextraObs > 0.
+!
+! ExtraName Extra-observation class names. NextraObs values are expected.
+! This parameter is only processed when NextraObs > 0. Enter
+! one class type name per line and use a backslash for
+! continuation. For example:
+!
+! ExtraName = radials \
+! pressure
+!
+! Currently, however, only the radials operator is coded.
+!
+!------------------------------------------------------------------------------
+! Diffusive relaxation coefficients.
+!------------------------------------------------------------------------------
+!
+! If weak constraint 4D-Var and RPM_RELAXATION flag is activated, these
+! coefficients are used to relax the representer tangent linear solution
+! to the previous outer loop linearized trajectory during the Picard
+! iterations. The user may turn off relaxation on a particular variable
+! by setting the coefficient to zero.
+!
+! tl_M2diff 2D momentum diffusion relaxation coefficient (m2/s).
+!
+! tl_M3diff 3D momentum diffusion relaxation coefficient (m2/s).
+!
+! tl_Tdiff Tracers type variables diffusion relaxation coefficients
+! (m2/s). NT values are expected.
+!
+!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
+! Background/model correlation parameters.
+!------------------------------------------------------------------------------
+!
+! LdefNRM Switch (T/F) to create a new normalization NetCDF file
+! for, [4,1:Ngrids]:
+!
+! LdefNRM(1,:) initial conditions error covariance
+! LdefNRM(2,:) model error covariance
+! LdefNRM(3,:) boundary conditions error covariance
+! LdefNRM(4,:) surface forcing error covariance
+!
+! The computation of the correlation normalization
+! coefficients is very expensive and needs to be computed
+! only once for a particular application provided that grid,
+! land/sea masking (if any), and decorrelation scales (see
+! below) remain the same. The user can use this switch
+! in conjunction with the CnormM, CnormI, CnormB, CnormF
+! (see below) switches to compute each coefficient separately.
+! The normalization NetCDF only needs to be created once
+! and simultaneous runs can write to the same NetCDF. If
+! using this approach, compute the normalization factors
+! with the CORRELATION CPP-option and not I4DVAR, RBL4DVAR
+! or R4DVAR.
+!
+! LwrtNRM Switch (T/F) to write out correlation normalization factors
+! for, [4,1:Ngrids]:
+!
+! LwrtNRM(1,:) initial conditions error covariance
+! LwrtNRM(2,:) model error covariance
+! LwrtNRM(3,:) boundary conditions error covariance
+! LwrtNRM(4,:) surface forcing error covariance
+!
+! If TRUE, these factors are computed and written to NRMnameI,
+! NRMnameM, NRMnameB, and NRMnameF NetCDF files, respectively.
+! If FALSE, they are read from NRMname NetCDF file.
+!
+! CnormM Compute (T/F) model error covariance
+! normalization factors:
+!
+! CnormM(isFsur) free-surface
+! CnormM(isUbar) 2D U-momentum
+! CnormM(isVbar) 2D V-momentum
+! CnormM(isUvel) 3D U-momentum
+! CnormM(isVvel) 3D V-momentum
+! CnormM(isTvar) tracers (1:NT)
+!
+! CnormI Compute (T/F) initial conditions error covariance
+! normalization factors:
+!
+! CnormI(isFsur) free-surface
+! CnormI(isUbar) 2D U-momentum
+! CnormI(isVbar) 2D V-momentum
+! CnormI(isUvel) 3D U-momentum
+! CnormI(isVvel) 3D V-momentum
+! CnormI(isTvar) tracers (1:NT)
+!
+! CnormB Compute (T/F) open boundary conditions error covariance
+! normalization factors:
+!
+! CnormB(isFsur) free-surface
+! CnormB(isUbar) 2D U-momentum
+! CnormB(isVbar) 2D V-momentum
+! CnormB(isUvel) 3D U-momentum
+! CnormB(isVvel) 3D V-momentum
+! CnormB(isTvar) tracers (1:NT)
+!
+! CnormF Compute (T/F) surface forcing error covariance
+! normalization factors:
+!
+! CnormF(isTsur) tracer flux (1:NT)
+! CnormF(isUstr) wind U-stress
+! CnormF(isVstr) wind V-stress
+!
+! Nmethod Correlation normalization method:
+!
+! [0] Exact, very expensive
+! [1] Approximated, randomization
+!
+! Rscheme Random number generation scheme if randomization:
+!
+! [1] Gaussian distributed deviates, numerical recipes
+!
+! Nrandom Number of iterations to compute correlation normalization
+! factors using the randomization approach of Fisher and
+! Courtier (1995). A large number is required to be
+! statistically meaningful and achieve zero expectation
+! mean and unit variance, approximately. These factors ensure
+! that the error covariance diagonal elements are equal to
+! unity.
+!
+! Hgamma Horizontal stability and accuracy factor (< 1) used to
+! scale the time-step of the convolution operator below its
+! theoretical limit, [1:4]. Notice that four values are
+! needed for Hgamma to facilitate the error covariance
+! modeling for initial conditions (1), model (2), boundary
+! conditions (3), and surface forcing (4).
+!
+! Vgamma Vertical stability and accuracy factor (< 1) used to
+! scale the time-step of the convolution operator below its
+! theoretical limit, [1:4]. Notice that four values are
+! needed for Vgamma to facilitate the error covariance
+! modeling for initial conditions (1), model (2), boundary
+! conditions (3), and surface forcing (4).
+!
+! HdecayM Model error covariance, [1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayM(isFsur) free-surface
+! HdecayM(isUbar) 2D U-momentum
+! HdecayM(isVbar) 2D V-momentum
+! HdecayM(isUvel) 3D U-momentum
+! HdecayM(isVvel) 3D V-momentum
+! HdecayM(isTvar) tracers (1:NT,1:Ngrids)
+!
+! VdecayM Model error covariance, [1:Ngrids],
+! vertical, isotropic decorrelation scale (m):
+!
+! VdecayM(isUvel) 3D U-momentum
+! VdecayM(isVvel) 3D V-momentum
+! VdecayM(isTvar) tracers (1:NT,1:Ngrids)
+!
+! HdecayI Initial conditions error covariance, [1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayI(isFsur) free-surface
+! HdecayI(isUbar) 2D U-momentum
+! HdecayI(isVbar) 2D V-momentum
+! HdecayI(isUvel) 3D U-momentum
+! HdecayI(isVvel) 3D V-momentum
+! HdecayI(isTvar) tracers (1:NT,1:Ngrids)
+!
+! VdecayI Model error covariance, [1:Ngrids],
+! vertical, isotropic decorrelation scale (m):
+!
+! VdecayI(isUvel) 3D U-momentum
+! VdecayI(isVvel) 3D V-momentum
+! VdecayI(isTvar) tracers (1:NT)
+!
+! HdecayB Open boundary conditions error covariance, [4,1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayB(:,isFsur) free-surface
+! HdecayB(:,isUbar) 2D U-momentum
+! HdecayB(:,isVbar) 2D V-momentum
+! HdecayB(:,isUvel) 3D U-momentum
+! HdecayB(:,isVvel) 3D V-momentum
+! HdecayB(:,isTvar) tracers (4,1:NT,1:Ngrids)
+!
+! boundary index 1: west 2: south 3: east 4: north
+!
+! VdecayB Model error covariance, [4,1:Ngrids],
+! vertical, isotropic decorrelation scale (m):
+!
+! VdecayB(isUvel) 3D U-momentum
+! VdecayB(isVvel) 3D V-momentum
+! VdecayB(isTvar) tracers (4,1:NT,1:Ngrids)
+!
+! boundary index 1: west 2: south 3: east 4: north
+!
+! HdecayF Surface forcing error covariance, [1:Ngrids],
+! horizontal, isotropic decorrelation scales (m):
+!
+! HdecayF(isTsur) tracers flux (1:NT,1:Ngrids)
+! HdecayF(isUstr) wind U-stress
+! HdecayF(isVstr) wind V-stress
+!
+!------------------------------------------------------------------------------
+! Modeled standard deviation (STD) of Background Error Covarinace parameters.
+!------------------------------------------------------------------------------
+!
+! The user may activate STD_MODEL to compute the standard deviation directly
+! from the background (prior) field as an alternative to climatological values
+! read from the input NetCDF files. It follows the work of Mogensen et al.
+! (2012) by assuming the background errors are proportional to the vertical
+! derivatives of the background field. The field error has a similar profile
+! shape, but the difference with the actual error value is due to a vertical
+! displacement.
+!
+! The modeling of standard deviation (STD) uses the following parameters per
+! state field:
+!
+! Sigma_max(:) Maximum STD value
+!
+! Sigma_ml(:) Minimum STD at mixed layer
+!
+! Sigma_do(:) Minimum STD in deep ocean
+!
+! Sigma_dz(:) Vertical profile displacement
+!
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
+! approach of Kara et al. (2000). Otherwise, a constant value is used.
+!
+! mld_uniform Uniform mixed-layer depth value
+!
+!------------------------------------------------------------------------------
+! Background Quality Control (BCQC) of observations parameters.
+!------------------------------------------------------------------------------
+!
+! bgqc_type Flag to determine the type of background quality control:
+!
+! bgqc_type = 1 Background quality control in terms of
+! the state variable index (1 - MstateVar)
+! read from the input observation NetCDF,
+! variable "obs_type".
+!
+! It is general because it includes all the
+! observation provenances for a particular
+! state variable. For example, all the
+! temperature observations.
+!
+! bgqc_type = 2 Background quality control in terms of
+! the observation provenance index read
+! from the input observation NetCDF,
+! variable "obs_provenance".
+!
+! It is specific because it only includes
+! the observations for a particular
+! provenance or instrument. For example,
+! temperature observation from ARGO buoys.
+!
+! S_bgqc Threshold, squared number of standard deviations to use in
+! the quality control rejection of observations in terms of
+! the state variable index.
+!
+! S_bgqc(isFsur) free-surface
+! S_bgqc(isUbar) 2D U-momentum
+! S_bgqc(isVbar) 2D V-momentum
+! S_bgqc(isUvel) 3D U-momentum
+! S_bgqc(isVvel) 3D V-momentum
+! S_bgqc(isTvar) NT tracers (4,NT,Ngrids)
+!
+! It used when bgqc_type = 1. Use a large value (say 1.0d+5)
+! to indicate that the observations are spread out over a wider
+! range of background values. Otherwise, you use values like
+! 16 for rejecting observations based on 2 standard deviations.
+!
+! Nprovenance Number of observation provenances to consider for background
+! quality control. Used when bgqc_type = 2.
+!
+! Iprovenance Observation provenance index to consider for background
+! quality control. Use the same index value as specified
+! in input observations NetCDF, variable "obs_provenance".
+! 1:Nprovenance values are expected for each nested grid.
+! Used when bgqc_type = 2.
+!
+! P_bgqc Threshold, squared number of standard deviations to use in
+! the quality control rejection of observations in terms of
+! the provenance index, 1:Nprovenance values are expected for
+! each nested grid. Used when bgqc_type = 2.
+!
+!------------------------------------------------------------------------------
+! 4D-Var adjustment switches.
+!------------------------------------------------------------------------------
+!
+! Lstflux Logical switches (T/F) used to adjust surface tracer flux,
+! including active and passive tracers, [1:NT, 1:Ngrids].
+! These switches are used when ADJUST_STFLUX is activated.
+!
+! Lobc Logical switches (T/F) used to adjust state variables at
+! the open boundaries. A value is expected for each boundary
+! segment per nested grid, [1:4, 1:Ngrids].
+!
+! The boundary order is anticlockwise starting at the western
+! edge as follows:
+!
+! 1 = western edge
+! 2 = southern edge
+! 3 = eastern edge
+! 4 = northern edge
+!
+! Lobc(isFsur) free-surface
+! Lobc(isUbar) 2D U-momentum
+! Lobc(isVbar) 2D V-momentum
+! Lobc(isUvel) 3D U-momentum
+! Lobc(isVvel) 3D V-momentum
+! Lobc(isTvar) NT tracers (4,NT,Ngrids)
+!
+! WARNING: When processing momentum, you need to activate both
+! ======= components. If processing 2D momentum, you need to
+! activate both free-surface and 3D-momentum at the processing
+! boundary. The 2D momentum adjustment is computed by vertically
+! integretating the 3D momentum increments.
+!
+!------------------------------------------------------------------------------
+! Input/Output NetCDF files (a string with a maximum of 256 characters).
+!------------------------------------------------------------------------------
+!
+! STDnameM Input model error covariance
+! standard deviation file name.
+!
+! STDnameI Input initial conditions error covariance
+! standard deviation file name.
+!
+! STDnameB Input open boundary conditions error covariance
+! standard deviation file name.
+!
+! STDnameF Input surface forcing error covariance
+! standard deviation file name.
+!
+! STDnameC Output standard deviation file name
+! computed from background (prior) state
+!
+! NRMnameM Input/output model error covariance
+! normalization factors file name.
+!
+! NRMnameI Input/output initial conditions error covariance
+! normalization factors file name.
+!
+! NRMnameB Input/output open boundary conditions error covariance
+! normalization factors file name.
+!
+! NRMnameF Input/output surface forcing error covariance
+! normalization factors file name.
+!
+! OBSname Input/Output observations data file name.
+!
+! HSSname Input/Output Hessian eigenvectors file name.
+!
+! LCZname Input/output Lanczos vectors file name.
+!
+! LZEname Output time-evolved Lanczos vectors file name.
+!
+! MODname Output model data at observations locations file name.
+!
+! ERRname Output posterior error covariance matrix file name.
+!
+! Input forcing filenames at observation locations for computing observations
+! impacts during the analysis-forecast cycle when RBL4DVAR_FCT_SENSITIVITY and
+! OBS_SPACE are activated:
+!
+! (See www.myroms.org/wiki/Analysis-Forecast_Cycle_Observation_Impacts)
+!
+! OIFnameA Forecast initialized with 4D-Var analysis (red curve)
+!
+! OIFnameB Forecast initialized with 4D_Var background (blue curve)
+!
diff --git a/WC13/RBL4DVAR_mixed/submit_split_rbl4dvar.sh b/WC13/RBL4DVAR_mixed/submit_split_rbl4dvar.sh
new file mode 100755
index 00000000..14f698ff
--- /dev/null
+++ b/WC13/RBL4DVAR_mixed/submit_split_rbl4dvar.sh
@@ -0,0 +1,706 @@
+#!/bin/bash
+#
+# svn $Id$
+#######################################################################
+## Copyright (c) 2002-2020 The ROMS/TOMS Group #
+## Licensed under a MIT/X style license #
+## See License_ROMS.txt #
+################################################## Hernan G. Arango ###
+## #
+## ROMS Split RBL4D-Var Data Assimilation running BASH script: #
+## #
+## The RBL4D-Var is split in several phases and executables: #
+## #
+## 1) background ROMS_EXE_A #
+## 2) increment ROMS_EXE_B #
+## 3) analysis ROMS_EXE_A #
+## 4) posterior_error (if activated) ROMS_EXE_B #
+## #
+## The 4D-Var algorithm is split into Executable A and B: #
+## #
+## ROMS_EXE_A: Computes ROMS NLM trajectory used to linearize the #
+## TLM and ADM kernels used in the 4D-Var minimization. #
+## It interpolates the NLM solution to the observation #
+## locations in space and time. The NLM could be a part #
+## of a coupling system and or include nested grids. #
+## #
+## ROMS_EXE_B: It is used in the "increment" and "posterior_error" #
+## phases. The 4D-Var increment is obtained by minimizing #
+## the cost function over Ninner loops. It is possible to #
+## use a coarser grid resolution in the iterations of the #
+## inner loops. If so, the "background" trajectory needs #
+## to be interpolated into the coarser grid. Then, after #
+## the inner loops, the coarser grid increment needs to #
+## be interpolated to the finer grid before the "analysis"#
+## phase. The "increment" phase could be run at a lower #
+## precision. #
+## #
+## Notice that this script has a customizable function, My4DVarScript,#
+## at the top that creates "rbl4dvar.in" from a template, which is #
+## overwritten in each phase. The "rbl4dvar.in" passes to ROMS the #
+## phase and outer loop value to compute. #
+## #
+## Then, there is the customizable section for the computer batch #
+## directives and the tunable parameters. #
+## #
+## RBL4D-Var phases workflow: #
+## #
+## CALL prior_error #
+## #
+## CALL background (outer=0, RunInterval) #
+## #
+## OuterLoop : DO outer=1:Nouter #
+## CALL increment (outer, RunInterval) Inner-loops #
+## CALL analysis (outer, RunInterval) #
+## END DO OuterLoop #
+## #
+## CALL posterior_error (RunInterval) if requested #
+## #
+#######################################################################
+
+## SLURM configuration for amarel:
+##
+## Use 'sbatch submit_split_rbl4dvar.sh' to queue the job
+## Use 'squeue -p p_omg_1' to check our group jobs (including JOBID)
+## Use 'sacct -j JOBID -l' to check job accounting data
+## Use 'scontrol show job JOBID' to check job configuration
+## Use 'sinfo JOBID' to check job information
+## Use 'scancel JOBID' to cancel a job
+
+#SBATCH --exclusive # don't run on nodes with other jobs running
+#SBATCH --partition=p_omg_1 # Partition (job queue), NodeList: 108,116-120
+#SBATCH --requeue # Return job to the queue if preempted
+#SBATCH --job-name=ROMS_split_rb4dvar # Assign an short name to your job
+#SBATCH --nodes=1 # Number of nodes you require (each has 32 PETs)
+#SBATCH --ntasks=12 # Total number of tasks you'll launch
+#SBATCH --ntasks-per-node=32 # Number of tasks you'll launch on each node
+#SBATCH --cpus-per-task=1 # Cores per task (>1 if multithread tasks)
+#SBATCH --mem=177000 # Real memory (RAM) required (MB)
+#SBATCH --time=00-01:00:00 # Total run time limit (DD-HH:MM:SS)
+#SBATCH --output=log.%N.%j # STDOUT output file
+#SBATCH --error=err.%N.%j # STDERR output file (optional)
+#SBATCH --export=ALL # Export you current env to the job env
+
+#######################################################################
+## RBL4D-Var data assimilation input script function. It generates #
+## 'rbl4dvar.in' from the 's4dvar.in' template. #
+#######################################################################
+
+## Start of My4DVarScript() function definition
+
+My4DVarScript() {
+
+ DataDir=$1 # Data directory
+ SUBSTITUTE=$2 # ROMS Perl subtitution function
+ OuterLoop=$3 # current outer loop counter
+ Phase4DVAR=$4 # current 4D-Var computation phase
+ OBSname=$5 # 4D-Var observations NetCDF file
+ Fprefix=$6 # ROMS output files prefix (use roms_app)
+ Fsuffix=$7 # ROMS output files suffix
+ Inp4DVAR=$8 # 4D-Var standard input
+
+ echo
+ if [ "${Phase4DVAR}" = "post_error" ]; then
+ echo " Creating 4D-Var Input Script from Template: ${Inp4DVAR}" \
+ " Phase = ${Phase4DVAR}"
+ else
+ echo " Creating 4D-Var Input Script from Template: ${Inp4DVAR}" \
+ " Outer = ${OuterLoop} Phase = ${Phase4DVAR}"
+ fi
+ echo
+
+## Set model, initial conditions, boundary conditions and surface
+## forcing error covariance standard deviations files.
+
+ STDnameM=${DataDir}/wc13_std_m.nc
+ STDnameI=${DataDir}/wc13_std_i.nc
+ STDnameB=${DataDir}/wc13_std_b.nc
+ STDnameF=${DataDir}/wc13_std_f.nc
+
+## Set output file for standard deviation computed/modeled from background
+## (prior) state.
+
+ STDnameC=wc13_std_computed.nc
+
+## Set model, initial conditions, boundary conditions and surface
+## forcing error covariance normalization factors files.
+
+ NRMnameM=${DataDir}/wc13_nrm_m.nc
+ NRMnameI=${DataDir}/wc13_nrm_i.nc
+ NRMnameB=${DataDir}/wc13_nrm_b.nc
+ NRMnameF=${DataDir}/wc13_nrm_f.nc
+
+## Modify 4D-Var template input script and specify above files.
+
+ if [ -f $Inp4DVAR ]; then
+ /bin/rm ${Inp4DVAR}
+ fi
+
+ cp ../s4dvar.in ${Inp4DVAR}
+
+ $SUBSTITUTE $Inp4DVAR MyOuterLoop ${OuterLoop}
+ $SUBSTITUTE $Inp4DVAR MyPhase4DVAR ${Phase4DVAR}
+ $SUBSTITUTE $Inp4DVAR roms_std_m.nc ${STDnameM}
+ $SUBSTITUTE $Inp4DVAR roms_std_i.nc ${STDnameI}
+ $SUBSTITUTE $Inp4DVAR roms_std_b.nc ${STDnameB}
+ $SUBSTITUTE $Inp4DVAR roms_std_f.nc ${STDnameF}
+ $SUBSTITUTE $Inp4DVAR roms_std_c.nc ${STDnameC}
+ $SUBSTITUTE $Inp4DVAR roms_nrm_m.nc ${NRMnameM}
+ $SUBSTITUTE $Inp4DVAR roms_nrm_i.nc ${NRMnameI}
+ $SUBSTITUTE $Inp4DVAR roms_nrm_b.nc ${NRMnameB}
+ $SUBSTITUTE $Inp4DVAR roms_nrm_f.nc ${NRMnameF}
+ $SUBSTITUTE $Inp4DVAR roms_obs.nc ${OBSname}
+ $SUBSTITUTE $Inp4DVAR roms_hss.nc ${Fprefix}_hss_${Fsuffix}.nc
+ $SUBSTITUTE $Inp4DVAR roms_lcz.nc ${Fprefix}_lcz_${Fsuffix}.nc
+ $SUBSTITUTE $Inp4DVAR roms_lze.nc ${Fprefix}_lze_${Fsuffix}.nc
+ $SUBSTITUTE $Inp4DVAR roms_mod.nc ${Fprefix}_mod_${Fsuffix}.nc
+ $SUBSTITUTE $Inp4DVAR roms_err.nc ${Fprefix}_err_${Fsuffix}.nc
+}
+
+## End of My4DVarScript() function definition
+
+##---------------------------------------------------------------------
+## Control switches: What do you want to do?
+##---------------------------------------------------------------------
+
+# DRYRUN=1 # Print configuration but do not execute
+ DRYRUN=0 # Run 4D-Var cycle
+
+ BATCH=0 # No batch system submission
+# BATCH=1 # Use batch system SLURM to submit
+
+ POSTERIOR=0 # DO NOT compute 4D-Var posterior error
+# POSTERIOR=1 # compute 4D-Var posterior error
+
+##---------------------------------------------------------------------
+## User tunable parameters. If you follow recommendations, this is
+## the only section that you need to customize..
+##---------------------------------------------------------------------
+
+ ROMS_APP="WC13" # ROMS Application CPP
+
+ roms_app=`echo ${ROMS_APP} | tr '[:upper:]' '[:lower:]'` # lowercase
+
+ ROMS_ROOT=${HOME}/ocean/repository/svn/branches/arango
+
+ HereDir=${PWD} # current directory
+
+ DataDir="../../Data" # data directory
+
+ ObsDir=${DataDir} # observations directory
+
+ if [[ "$OSTYPE" == "darwin"* ]]; then
+ DATE_EXE=gdate # macOS system GNU date
+ else
+ DATE_EXE=date # Linux system date
+ fi
+
+ if [ ${BATCH} -eq 1 ]; then
+ SRUN="srun --mpi=pmi2" # SLURM workload manager
+ else
+ MPIrun="mpirun -np" # Basic MPI workload manager
+ fi
+
+ ROMS_EXE_A="romsM_dp" # ROMS executable A
+ ROMS_EXE_B="romsM_sp" # ROMS executable B
+
+ START_DATE="2004-01-03" # 4D-Var starting date
+
+ FRST_INI_DAY="${START_DATE}" # first cycle initialization date
+# FRST_INI_DAY="2004-01-07" # restart initialization date
+
+ LAST_INI_DAY="${START_DATE}" # last cycle initialization date
+# LAST_INI_DAY="2017-12-27" # last cycle initialization date
+
+ ROMS_TIMEREF="1968-05-23" # ROMS time reference date
+
+ INTERVAL=4 # 4D-Var interval window (days)
+
+ nPETsX=3 # number PETs in the X-direction
+ nPETsY=4 # number PETs in the Y-direction
+
+ MyNouter=1 # number of 4D-Var outer loops
+# MyNouter=2 # number of 4D-Var outer loops
+
+# MyNinner=13 # number of 4D-Var inner loops: RPCG
+# MyNinner=25 # number of 4D-Var inner loops: CONGRAD, MINRES
+ MyNinner=26 # number of 4D-Var inner loops: RPCG
+
+ MyNHIS=4 # NLM trajectory is saved every 2 hours
+ MyNDEFHIS=0 # No multi-file NLM trajectory
+# MyNHIS=48 # NLM trajectory is saved every 24 hours
+
+ MyNQCK=4 # NLM quicksave trajectory is saved every 2 hours
+
+# MyNADJ=48 # weak constraint, ADM trajectory daily
+ MyNADJ=192 # strong contraint, ADM saved at end
+
+ MyINP_LIB=1 # reading library: [1] standard [2] PIO
+ MyOUT_LIB=1 # writing library: [1] standard [2] PIO
+ MyPIO_METHOD=1 # [1] NetCDF3, ...
+ MyPIO_IOTASKS=1 # number of I/O processes
+ MyPIO_STRIDE=1 # stride in MPI-rank between I/O tasks
+ MyPIO_BASE=0 # offset for the first I/O task
+ MyPIO_REARR=1 # rearranger method: [1] box [2] subset
+MyPIO_REARRCOM=1 # rearranger communications: [0] p2p [1] coll
+MyPIO_REARRDIR=0 # rearranger direction: [0] I2C/C2I, ... [3]
+
+ restart=0 # restart 4D-Var cycle (0:no, 1:yes)
+# restart=1 # restart 4D-Var cycle (0:no, 1:yes)
+
+ ROMS_NLpre="roms_nl_${roms_app}" # ROMS NLM stdinp prefix
+ ROMS_NLtmp="${ROMS_NLpre}.tmp" # ROMS NLM stdinp template
+
+ ROMS_DApre="roms_da_${roms_app}" # ROMS ADM/TLM stdinp prefix
+ ROMS_DAtmp="${ROMS_DApre}.tmp" # ROMS ADM/TLM stdinp template
+
+ if [ ${restart} -eq 0 ]; then
+ ROMSini="wc13_roms_ini_20040103.nc" # ROMS IC
+ ROMSiniDir=${DataDir} # ROMS IC directory
+ else
+ ROMSini="wc13_roms_dai_20040103.nc" # restart ROMS IC
+ ROMSiniDir=../2004.01.03 # restart ROMS IC directory
+ fi
+
+ Inp4DVAR="rbl4dvar.in" # ROMS 4D-Var input script
+
+ if [ ${BATCH} -eq 1 ]; then
+ etime=00:00:00 # elapsed time
+ ptime=${etime} # previous time
+ else
+ stime=`${DATE_EXE} -u +"%s"` # start time (sec) since epoch
+ ptime=$stime # previous time
+ fi
+
+#######################################################################
+## Main body of script starts here. It is very unlikely that the USER
+## needs to modify it.
+#######################################################################
+
+ SUBSTITUTE=${ROMS_ROOT}/ROMS/Bin/substitute # Perl substitution
+ separator1=`perl -e "print ':' x 100;"` # title sparator
+ separator2=`perl -e "print '-' x 100;"` # run sparator
+
+ nPETs=$(( $nPETsX * $nPETsY ))
+
+echo
+echo "${separator1}"
+echo " ROMS Split RBL4D-Var Data Assimilation: ${ROMS_APP}"
+echo "${separator1}"
+echo
+echo " ROMS Root: ${ROMS_ROOT}"
+echo " ROMS Executable A: ${ROMS_EXE_A} (background, analysis)"
+echo " ROMS Executable B: ${ROMS_EXE_B} (increment, post_error)"
+echo
+
+##---------------------------------------------------------------------
+## Compute date number for reference date, and first and last
+## initialization dates.
+##---------------------------------------------------------------------
+
+ S_DN=`${ROMS_ROOT}/ROMS/Bin/dates datenum ${START_DATE}`
+ F_DN=`${ROMS_ROOT}/ROMS/Bin/dates datenum ${FRST_INI_DAY}`
+ L_DN=`${ROMS_ROOT}/ROMS/Bin/dates datenum ${LAST_INI_DAY}`
+ REF_DN=`${ROMS_ROOT}/ROMS/Bin/dates datenum ${ROMS_TIMEREF}`
+
+echo " RBL4D-Var Starting Date: ${START_DATE} datenum = ${S_DN}"
+echo " First RBL4D-Var Cycle Date: ${FRST_INI_DAY} datenum = ${F_DN}"
+echo " Last RBL4D-Var Cycle Date: ${LAST_INI_DAY} datenum = ${L_DN}"
+echo " ROMS Reference Date: ${ROMS_TIMEREF} datenum = ${REF_DN}"
+echo " RBL4D-Var Cycle Window: ${INTERVAL} days"
+echo " Number of parallel PETs: ${nPETs} (${nPETsX}x${nPETsY})"
+echo " Current Starting Directory: ${HereDir}"
+echo " ROMS Application CPP: ${ROMS_APP}"
+echo " Descriptor in filenames: ${roms_app}"
+echo
+
+##=====================================================================
+## Loop over all 4D-Var Cycles: FRST_INI_DAY to LAST_INI_DAY
+##=====================================================================
+
+if [ ${restart} -eq 0 ]; then
+ Cycle=0 # 4D-Var cycle counter
+else
+ EDAYS=`${ROMS_ROOT}/ROMS/Bin/dates daysdiff ${START_DATE} ${FRST_INI_DAY}`
+
+ let "Cycle=${EDAYS} / ${INTERVAL}" # restart cycle counter
+fi
+
+SDAY=${F_DN} # initialize starting day
+
+while [ $SDAY -le $L_DN ]; do
+
+## Set coupling parameters.
+
+ Cycle=$(( $Cycle + 1 )) # advance cycle by one
+ DSTART=$(( $SDAY - $REF_DN )) # ROMS DSTART parameter
+ EDAY=$(( $SDAY + $INTERVAL )) # end day for 4D-Var cycle
+
+ RDATE=`${ROMS_ROOT}/ROMS/Bin/dates numdate ${REF_DN}`
+ SDATE=`${ROMS_ROOT}/ROMS/Bin/dates numdate ${SDAY}`
+ EDATE=`${ROMS_ROOT}/ROMS/Bin/dates numdate ${EDAY}`
+ DOY=`${ROMS_ROOT}/ROMS/Bin/dates yday ${SDATE}`
+ yday=`printf %03d $DOY`
+
+ ReferenceTime=`${DATE_EXE} -d "${RDATE}" '+%Y %m %d %H %M %S'`
+ StartTime=`${DATE_EXE} -d "${SDATE}" '+%Y %m %d %H %M %S'`
+ StopTime=`${DATE_EXE} -d "${EDATE}" '+%Y %m %d %H %M %S'`
+ Fprefix="${roms_app}"
+ Fsuffix=`${DATE_EXE} -d "${SDATE}" '+%Y%m%d'`
+ RunDir=`${DATE_EXE} -d "${SDATE}" '+%Y.%m.%d'`
+ ROMS_INI="${ROMSini}"
+
+ echo "${separator2}"
+ echo
+ echo " RBL4D-Var Cycle Date: ${SDATE} DayOfYear = ${yday}" \
+ " Cycle = ${Cycle}"
+ echo " Data sub-directory: ${DataDir}"
+ echo " Run sub-directory: ${RunDir}"
+ echo " Number of outer loops: ${MyNouter}"
+ echo " Number of inner loops: ${MyNinner}"
+ echo " NLM trajectory writing: ${MyNHIS} NHIS timesteps"
+ echo " NLM quicksave writing: ${MyNQCK} NQCK timesteps"
+ echo " NLM multi-file trajectory: ${MyNDEFHIS} NDEFHIS timesteps"
+ echo " ADM trajectory writing: ${MyNADJ} NADJ timesteps"
+ echo " ROMS DSTART: ${DSTART}.0d0"
+ echo " I/O Files Prefix: ${Fprefix}"
+ echo " I/O Files Suffix: ${Fsuffix}"
+ echo " ReferenceTime: ${ReferenceTime}"
+ echo " RBL4D-Var StartTime: ${StartTime}"
+ echo " RBL4D-Var StopTime: ${StopTime}"
+ echo " ROMS Initial Conditions: ${ROMSiniDir}/${ROMS_INI}"
+
+##---------------------------------------------------------------------
+## Create run sub-directory based on cycle date (YYYY.MM.DD) and create
+## ROMS standard input script from template.
+##---------------------------------------------------------------------
+
+ ROMS_NLinp=`echo ${ROMS_NLpre}_${Fsuffix}'.in'`
+ ROMS_DAinp=`echo ${ROMS_DApre}_${Fsuffix}'.in'`
+
+ echo "NL ROMS Standard Input Script: ${ROMS_NLinp}"
+ echo "DA ROMS Standard Input Script: ${ROMS_DAinp}"
+ echo " 4D-Var Input Script: ${Inp4DVAR}"
+ echo
+
+ if [ ${DRYRUN} -eq 1 ]; then # if dry-run, remove run
+ if [ -d ${RunDir} ]; then # sub-directory if exist
+ /bin/rm -rf ${RunDir}
+ fi
+ fi
+
+ if [ ! -d ./${RunDir} ]; then
+ mkdir ${RunDir}
+ echo "Cycle ${Cycle}, Creating run sub-directory: ${RunDir}"
+ echo
+ fi
+
+ echo "Changing to directory: ${HereDir}/${RunDir}"
+ echo
+
+ cd ${RunDir}
+
+ echo " Creating NL ROMS Standart Input Script: ${ROMS_NLinp}"
+
+ if [ -f ${ROMS_NLinp} ]; then
+ /bin/rm ${ROMS_NLinp}
+ fi
+ cp -f ../${ROMS_NLtmp} ${ROMS_NLinp}
+
+ $SUBSTITUTE ${ROMS_NLinp} MyNtileI ${nPETsX}
+ $SUBSTITUTE ${ROMS_NLinp} MyNtileJ ${nPETsY}
+ $SUBSTITUTE ${ROMS_NLinp} MyNouter ${MyNouter}
+ $SUBSTITUTE ${ROMS_NLinp} MyNinner ${MyNinner}
+ $SUBSTITUTE ${ROMS_NLinp} MyNHIS ${MyNHIS}
+ $SUBSTITUTE ${ROMS_NLinp} MyNDEFHIS ${MyNDEFHIS}
+ $SUBSTITUTE ${ROMS_NLinp} MyNQCK ${MyNQCK}
+ $SUBSTITUTE ${ROMS_NLinp} MyNADJ ${MyNADJ}
+ $SUBSTITUTE ${ROMS_NLinp} MyDSTART "${DSTART}.0d0"
+ $SUBSTITUTE ${ROMS_NLinp} MyINP_LIB ${MyINP_LIB}
+ $SUBSTITUTE ${ROMS_NLinp} MyOUT_LIB ${MyOUT_LIB}
+ $SUBSTITUTE ${ROMS_NLinp} MyPIO_METHOD ${MyPIO_METHOD}
+ $SUBSTITUTE ${ROMS_NLinp} MyPIO_IOTASKS ${MyPIO_IOTASKS}
+ $SUBSTITUTE ${ROMS_NLinp} MyPIO_STRIDE ${MyPIO_STRIDE}
+ $SUBSTITUTE ${ROMS_NLinp} MyPIO_BASE ${MyPIO_BASE}
+ $SUBSTITUTE ${ROMS_NLinp} MyPIO_REARRCOM ${MyPIO_REARRCOM}
+ $SUBSTITUTE ${ROMS_NLinp} MyPIO_REARRDIR ${MyPIO_REARRDIR}
+ $SUBSTITUTE ${ROMS_NLinp} MyPIO_REARR ${MyPIO_REARR}
+ $SUBSTITUTE ${ROMS_NLinp} MyFprefix "${Fprefix}"
+ $SUBSTITUTE ${ROMS_NLinp} MyFsuffix "${Fsuffix}"
+ $SUBSTITUTE ${ROMS_NLinp} MyININAME "${ROMS_INI}"
+ $SUBSTITUTE ${ROMS_NLinp} MyAPARNAM "${Inp4DVAR}"
+
+ echo " Creating DA ROMS Standart Input Script: ${ROMS_DAinp}"
+
+ if [ -f ${ROMS_DAinp} ]; then
+ /bin/rm ${ROMS_DAinp}
+ fi
+ cp -f ../${ROMS_DAtmp} ${ROMS_DAinp}
+
+ $SUBSTITUTE ${ROMS_DAinp} MyNtileI ${nPETsX}
+ $SUBSTITUTE ${ROMS_DAinp} MyNtileJ ${nPETsY}
+ $SUBSTITUTE ${ROMS_DAinp} MyNouter ${MyNouter}
+ $SUBSTITUTE ${ROMS_DAinp} MyNinner ${MyNinner}
+ $SUBSTITUTE ${ROMS_DAinp} MyNHIS ${MyNHIS}
+ $SUBSTITUTE ${ROMS_DAinp} MyNDEFHIS ${MyNDEFHIS}
+ $SUBSTITUTE ${ROMS_DAinp} MyNQCK ${MyNQCK}
+ $SUBSTITUTE ${ROMS_DAinp} MyNADJ ${MyNADJ}
+ $SUBSTITUTE ${ROMS_DAinp} MyDSTART "${DSTART}.0d0"
+ $SUBSTITUTE ${ROMS_DAinp} MyINP_LIB ${MyINP_LIB}
+ $SUBSTITUTE ${ROMS_DAinp} MyOUT_LIB ${MyOUT_LIB}
+ $SUBSTITUTE ${ROMS_DAinp} MyPIO_METHOD ${MyPIO_METHOD}
+ $SUBSTITUTE ${ROMS_DAinp} MyPIO_IOTASKS ${MyPIO_IOTASKS}
+ $SUBSTITUTE ${ROMS_DAinp} MyPIO_STRIDE ${MyPIO_STRIDE}
+ $SUBSTITUTE ${ROMS_DAinp} MyPIO_BASE ${MyPIO_BASE}
+ $SUBSTITUTE ${ROMS_DAinp} MyPIO_REARRCOM ${MyPIO_REARRCOM}
+ $SUBSTITUTE ${ROMS_DAinp} MyPIO_REARRDIR ${MyPIO_REARRDIR}
+ $SUBSTITUTE ${ROMS_DAinp} MyPIO_REARR ${MyPIO_REARR}
+ $SUBSTITUTE ${ROMS_DAinp} MyFprefix "${Fprefix}"
+ $SUBSTITUTE ${ROMS_DAinp} MyFsuffix "${Fsuffix}"
+ $SUBSTITUTE ${ROMS_DAinp} MyININAME "${ROMS_INI}"
+ $SUBSTITUTE ${ROMS_DAinp} MyAPARNAM "${Inp4DVAR}"
+
+##---------------------------------------------------------------------
+## Run RBL4D-Var for the current time window
+##---------------------------------------------------------------------
+
+ OuterLoop=0 # initialize outer loop counter
+ Phase4DVAR="background" # initialize 4D-Var phase
+
+## Set observations NetCDF filename.
+
+ OBSname="${Fprefix}_obs_${Fsuffix}.nc"
+
+## Copy nonlinear model initial conditions file.
+
+ echo " Copying NLM IC file ${ROMSiniDir}/${ROMS_INI} as ${ROMS_INI}"
+
+ cp ${ROMSiniDir}/${ROMS_INI} ${ROMS_INI}
+ chmod u+w ${ROMS_INI} # change protection
+
+## Get a clean copy of the observation file. This is really important
+## since this file will be modified.
+
+ echo " Copying OBS file ${ObsDir}/${OBSname} as ${OBSname}"
+
+ cp -p ${ObsDir}/${OBSname} .
+ chmod u+w ${OBSname} # change protection
+
+## Set ROMS executable file links.
+
+ if [ "$ROMS_EXE_A" = "$ROMS_EXE_B" ]; then
+ ln -sf "../${ROMS_EXE_A}" .
+ else
+ ln -sf "../${ROMS_EXE_A}" .
+ ln -sf "../${ROMS_EXE_B}" .
+ fi
+
+ if [ ${BATCH} -eq 1 ]; then
+ EXECUTE_A="${SRUN} ${ROMS_EXE_A} ${ROMS_NLinp}"
+ EXECUTE_B="${SRUN} ${ROMS_EXE_B} ${ROMS_DAinp}"
+ else
+ EXECUTE_A="${MPIrun} ${nPETs} ${ROMS_EXE_A} ${ROMS_NLinp}"
+ EXECUTE_B="${MPIrun} ${nPETs} ${ROMS_EXE_B} ${ROMS_DAinp}"
+ fi
+
+## Run 4D-Var 'background' phase ......................................
+
+ echo
+ echo "Running 4D-Var System: Cycle = ${Cycle}" \
+ " Outer = ${OuterLoop}" \
+ " Phase = ${Phase4DVAR}"
+
+## Create ROMS 4D-Var input script 'rbl4dvar.in' from template.
+
+ My4DVarScript ${DataDir} ${SUBSTITUTE} ${OuterLoop} ${Phase4DVAR} \
+ ${OBSname} ${Fprefix} ${Fsuffix} ${Inp4DVAR}
+
+ echo " ${EXECUTE_A}"
+
+ if [ ${DRYRUN} -eq 0 ]; then
+
+ if [ ${BATCH} -eq 1 ]; then
+ ${SRUN} ${ROMS_EXE_A} ${ROMS_NLinp}
+ else
+ ${MPIrun} ${nPETs} ${ROMS_EXE_A} ${ROMS_NLinp} > err
+ fi
+
+ if [ $? -ne 0 ] ; then
+ echo
+ echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
+ " Outer = ${OuterLoop}" \
+ " Phase = ${Phase4DVAR}"
+ echo "Check ${RunDir}/log.roms for details ..."
+ exit 1
+ fi
+ fi
+
+## Start 4D-Var outer loops :::::::::::::::::::::::::::::::::::::::::::
+
+ while [ $OuterLoop -lt $MyNouter ]; do
+
+ OuterLoop=$(( $OuterLoop + 1 ))
+
+## Run 4D-Var 'increment' phase .......................................
+
+ Phase4DVAR="increment"
+
+ echo
+ echo "Running 4D-Var System: Cycle = ${Cycle}" \
+ " Outer = ${OuterLoop}" \
+ " Phase = ${Phase4DVAR}"
+
+ My4DVarScript ${DataDir} ${SUBSTITUTE} ${OuterLoop} ${Phase4DVAR} \
+ ${OBSname} ${Fprefix} ${Fsuffix} ${Inp4DVAR}
+
+ echo " ${EXECUTE_B}"
+
+ if [ ${DRYRUN} -eq 0 ]; then
+
+ if [ ${BATCH} -eq 1 ]; then
+ ${SRUN} ${ROMS_EXE_B} ${ROMS_DAinp}
+ else
+ ${MPIrun} ${nPETs} ${ROMS_EXE_B} ${ROMS_DAinp} >> err
+ fi
+
+ if [ $? -ne 0 ] ; then
+ echo
+ echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
+ " Outer = ${OuterLoop}" \
+ " Phase = ${Phase4DVAR}"
+ echo "Check ${RunDir}/log.roms for details ..."
+ exit 1
+ fi
+ fi
+
+## Run 4D-Var 'analysis' phase ........................................
+
+ Phase4DVAR="analysis"
+
+ echo
+ echo "Running 4D-Var System: Cycle = ${Cycle}" \
+ " Outer = ${OuterLoop}" \
+ " Phase = ${Phase4DVAR}"
+
+ My4DVarScript ${DataDir} ${SUBSTITUTE} ${OuterLoop} ${Phase4DVAR} \
+ ${OBSname} ${Fprefix} ${Fsuffix} ${Inp4DVAR}
+
+ echo " ${EXECUTE_A}"
+
+ if [ ${DRYRUN} -eq 0 ]; then
+
+ if [ ${BATCH} -eq 1 ]; then
+ ${SRUN} ${ROMS_EXE_A} ${ROMS_NLinp}
+ else
+ ${MPIrun} ${nPETs} ${ROMS_EXE_A} ${ROMS_NLinp} >> err
+ fi
+
+ if [ $? -ne 0 ] ; then
+ echo
+ echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
+ " Outer = ${OuterLoop}" \
+ " Phase = ${Phase4DVAR}"
+ echo "Check ${RunDir}/log.roms for details ..."
+ exit 1
+ fi
+ fi
+
+## End of outer loops :::::::::::::::::::::::::::::::::::::::::::::::::
+
+ done
+
+ echo
+ echo "Finished 4D-Var outer loops iterations"
+
+## Compute 4D-Var analysis posterior error covariance .................
+##
+## If POSTERIOR_ERROR_I or and POSTERIOR_ERROR_F are activated in
+## ROMS Executable B.
+
+ if [ ${POSTERIOR} -eq 1 ]; then
+
+ Phase4DVAR="post_error"
+
+ echo
+ echo "Running 4D-Var System: Cycle = ${Cycle}" \
+ " Phase = ${Phase4DVAR}"
+
+ My4DVarScript ${DataDir} ${SUBSTITUTE} ${OuterLoop} ${Phase4DVAR} \
+ ${OBSname} ${Fprefix} ${Fsuffix} ${Inp4DVAR}
+
+ echo " ${EXECUTE_B}"
+
+ if [ ${DRYRUN} -eq 0 ]; then
+
+ if [ ${BATCH} -eq 1 ]; then
+ ${SRUN} ${ROMS_EXE_B} ${ROMS_DAinp}
+ else
+ ${MPIrun} ${nPETs} ${ROMS_EXE_B} ${ROMS_DAinp} >> err
+ fi
+
+ if [ $? -ne 0 ] ; then
+ echo
+ echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
+ " Phase = ${Phase4DVAR}"
+ echo "Check ${RunDir}/log.roms for details ..."
+ exit 1
+ fi
+ fi
+ fi
+
+##---------------------------------------------------------------------
+## Advance to the next RBL4D-Var cycle, if any.
+##---------------------------------------------------------------------
+
+ echo
+
+ if [ ${BATCH} -eq 1 ]; then
+ etime=`sacct -n -X -j $SLURM_JOBID --format=Elapsed | sed 's/-/ days /'`
+ ptime_sec=$(date -u -d "$ptime" +"%s")
+ etime_sec=$(date -u -d "$etime" +"%s")
+ time_diff=`date -u -d "0 ${etime_sec} sec - ${ptime_sec} sec" +"%H:%M:%S"`
+ ptime=$etime
+ else
+ now=`${DATE_EXE} -u +"%s"`
+ time_diff=`${DATE_EXE} -u -d "0 ${now} sec - ${ptime} sec" +"%H:%M:%S"`
+ ptime=$now
+ fi
+
+ echo "Finished RBL4D-Var Cycle ${Cycle}, Elapsed time = $time_diff"
+
+ echo
+ echo "Changing to directory: ${HereDir}"
+
+ cd ../ # go back to start directory
+
+ SDAY=$(( $SDAY + $INTERVAL ))
+
+ ROMSini="${Fprefix}_roms_dai_${Fsuffix}.nc" # new ROMS IC (DAI file)
+ ROMSiniDir="../${RunDir}" # new ROMS IC directory
+
+ echo
+
+## End of RBL4D-Var cycle.
+
+done
+
+##---------------------------------------------------------------------
+## Done with computations.
+##---------------------------------------------------------------------
+
+if [ ${BATCH} -eq 1 ]; then
+ total_time=`sacct -n -X -j $SLURM_JOBID --format=Elapsed`
+else
+ days=$(( (${ptime} - ${stime}) / 86400 ))
+ hms=`${DATE_EXE} -u -d "0 ${ptime} sec - ${stime} sec" +"%H:%M:%S"`
+
+ if (( ${days} == 0 )); then
+ total_time=$hms
+ else
+ total_time="${days}-${hms}"
+ fi
+fi
+
+echo "Finished computations, Total time = $total_time"
+
+exit 0
diff --git a/WC13/RBL4DVAR_mixed/wc13.h b/WC13/RBL4DVAR_mixed/wc13.h
new file mode 100644
index 00000000..8cd652cf
--- /dev/null
+++ b/WC13/RBL4DVAR_mixed/wc13.h
@@ -0,0 +1,179 @@
+/*
+** git $Id$
+*******************************************************************************
+** Copyright (c) 2002-2024 The ROMS/TOMS Group **
+** Licensed under a MIT/X style license **
+** See License_ROMS.md **
+*******************************************************************************
+**
+** Options for the California Current System, 1/3 degree resolution.
+**
+** Application flag: WC13
+** Input script: roms_wc13.in
+** s4dvar.in
+**
+** Available Drivers options: choose only one and activate it in the
+** build.sh script (MY_CPP_FLAGS definition)
+**
+** AD_SENSITIVITY Adjoint Sensitivity Driver
+** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
+** ARRAY_MODES Stabilized representer matrix array modes
+** CLIPPING Stabilized representer matrix clipped analysis
+** CORRELATION Background-error Correlation Check
+** GRADIENT_CHECK TLM/ADM Gradient Check
+** FORCING_SV Forcing Singular Vectors
+** FT_EIGENMODES Finite Time Eigenmodes
+** I4DVAR Incremental, strong constraint I4D-Var
+** NLM_DRIVER Nonlinear Basic State trajectory
+** OPT_PERTURBATION Optimal perturbations
+** PICARD_TEST Picard Iterations Test
+** RBL4DVAR Strong/Weak constraint RBL4D-Var
+** R4DVAR Strong/Weak constraint R4D-Var
+** R_SYMMETRY Representer Matrix Symmetry Test
+** SPLIT_I4DVAR Strong constraint Split I4D-Var
+** SPLIT_R4DVAR Strong/Weak constraint Split R4D-Var
+** SPLIT_RBL4DVAR Strong/Weak constraint Split RBL4D-Var
+** SANITY_CHECK Sanity Check
+** SO_SEMI Stochastic Optimals: Semi-norm
+** TLM_CHECK Tangent Linear Model Check
+** VERIFICATION NL Observation Verification Driver
+** NORMALIZATION Background error Covariance Normalization
+*/
+
+/*
+**-----------------------------------------------------------------------------
+** Nonlinear basic state settings.
+**-----------------------------------------------------------------------------
+*/
+
+#ifdef VERIFICATION
+# define FULL_GRID
+#endif
+
+#define ANA_BSFLUX
+#define ANA_BTFLUX
+
+#define UV_ADV
+#define DJ_GRADPS
+#define UV_COR
+#define UV_QDRAG
+#define UV_VIS2
+#define MIX_S_UV
+#define MIX_GEO_TS
+#define SPLINES_VDIFF
+#define SPLINES_VVISC
+#define TS_DIF2
+#define SOLVE3D
+#define SALINITY
+#define NONLIN_EOS
+#define CURVGRID
+#define PROFILE
+#define SPHERICAL
+#define MASKING
+
+#ifdef NLM_DRIVER
+# define AVERAGES /* define if writing out time-averaged data */
+#endif
+
+/*
+** Vertical Mixing parameterization
+*/
+
+#define GLS_MIXING
+#ifdef GLS_MIXING
+# define N2S2_HORAVG
+# define KANTHA_CLAYSON
+# define RI_SPLINES
+#endif
+
+/*
+** Surface atmospheric fluxes. Note, that we must define DIURNAL_SRFLUX
+** when using daily averaged fields.
+*/
+
+#define BULK_FLUXES /* turn ON or OFF bulk fluxes computation */
+
+#define DIURNAL_SRFLUX /* impose shortwave radiation local diurnal cycle */
+#define SOLAR_SOURCE /* define solar radiation source term */
+#define LONGWAVE_OUT /* Compute net longwave radiation internally */
+#define EMINUSP /* turn ON internal calculation of E-P */
+
+/*
+**-----------------------------------------------------------------------------
+** Variational Data Assimilation.
+**-----------------------------------------------------------------------------
+*/
+
+/*
+** Options to compute error covariance normalization coefficients.
+*/
+
+#ifdef NORMALIZATION
+# define ADJUST_BOUNDARY
+# define ADJUST_WSTRESS
+# define ADJUST_STFLUX
+# define CORRELATION
+# define VCONVOLUTION
+# define IMPLICIT_VCONV
+# define FULL_GRID
+# define FORWARD_WRITE
+# define FORWARD_READ
+# define FORWARD_MIXING
+# define OUT_DOUBLE
+#endif
+
+/*
+** Options for adjoint-based algorithms sanity checks.
+*/
+
+#ifdef SANITY_CHECK
+# define FULL_GRID
+# define FORWARD_READ
+# define FORWARD_WRITE
+# define FORWARD_MIXING
+# define OUT_DOUBLE
+# define ANA_PERTURB
+# define ANA_INITIAL
+#endif
+
+/*
+** Common options to all 4DVAR algorithms.
+*/
+
+#if defined ARRAY_MODES || \
+ defined CLIPPING || \
+ defined I4DVAR || \
+ defined I4DVAR_ANA_SENSITIVITY || \
+ defined RBL4DVAR || \
+ defined RBL4DVAR_ANA_SENSITIVITY || \
+ defined RBL4DVAR_FCT_SENSITIVITY || \
+ defined R4DVAR || \
+ defined R4DVAR_ANA_SENSITIVITY || \
+ defined SPLIT_I4DVAR || \
+ defined SPLIT_RBL4DVAR || \
+ defined SPLIT_R4DVAR
+# define ADJUST_BOUNDARY
+# define ADJUST_WSTRESS
+# define ADJUST_STFLUX
+# define PRIOR_BULK_FLUXES
+# define FORWARD_FLUXES
+# define VCONVOLUTION
+# define IMPLICIT_VCONV
+# ifdef BALANCE_OPERATOR
+# define ZETA_ELLIPTIC
+# endif
+# define FORWARD_WRITE
+# define FORWARD_READ
+# define FORWARD_MIXING
+# define OUT_DOUBLE
+#endif
+
+/*
+** Special options for each 4DVAR algorithm.
+*/
+
+#if defined ARRAY_MODES || \
+ defined R4DVAR || \
+ defined R4DVAR_ANA_SENSITIVITY
+# define RPM_RELAXATION
+#endif
diff --git a/WC13/RBL4DVAR_split/s4dvar.in b/WC13/RBL4DVAR_split/s4dvar.in
index 6e5b84bb..ad23146d 100644
--- a/WC13/RBL4DVAR_split/s4dvar.in
+++ b/WC13/RBL4DVAR_split/s4dvar.in
@@ -165,6 +165,11 @@ balance(isVvel) = T ! 3D momentum (u, v)
tl_Tdiff == 0.0d0 0.0d0 ! NT tracers
+! Duration of the Incremental Analysis Update (days) [1:Ngrids].
+! NOTE: This option is only available for RBL4DVAR and when using RPCG.
+
+ timeIAU == 0.0d0
+
! Switches (T/F) to create and write error covariance normalization
! factors for model, initial conditions, boundary conditions, and
! surface forcing. If TRUE, these factors are computed and written
@@ -326,7 +331,7 @@ HdecayF(isTsur) == 100.0d+3 100.0d+3 ! 1:NT surface tracers flux
! error has the similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
-! If COMPUTE_MLD is activated, the mixed-layer depth is computes using the
+! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from kara et al. (2000). Otherwise, it will be set to uniform
! value provided below.
@@ -334,17 +339,17 @@ Sigma_max(isFsur) == 0.025d0 ! free surface maximum STD value
Sigma_max(isUvel) == 0.06d0 ! U-velocity maximum STD value
Sigma_ml(isUvel) == 0.05d0 ! U-velocity minimum STD at mixed layer
- Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
+ Sigma_do(isUvel) == 0.02d0 ! U-velocity minimum STD in deep ocean
Sigma_dz(isUvel) == 500.0d0 ! U-velocity vertical displacement
Sigma_max(isVvel) == 0.06d0 ! V-velocity maximum STD
Sigma_ml(isVvel) == 0.05d0 ! V-velocity minimum STD at mixed layer
- Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
+ Sigma_do(isVvel) == 0.02d0 ! V-velocity minimum STD in deep ocean
Sigma_dz(isVvel) == 500.0d0 ! V-velocity vertical displacement
Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
Sigma_ml(isTvar) == 0.05d0 0.05d0 ! 1:NT tracers minimum STD at mixed layer
- Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
+ Sigma_do(isTvar) == 0.02d0 0.0028d0 ! 1:NT tracers minimum STD in deep ocean
Sigma_dz(isTvar) == 40.0d0 40.0d0 ! 1:NT tracer vertical displacement
mld_uniform == -75.0d0 ! Uniform mixed layer depth value
@@ -711,6 +716,25 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! (m2/s). NT values are expected.
!
!------------------------------------------------------------------------------
+! Incremental Analysis Update (IAU)
+!------------------------------------------------------------------------------
+!
+! timeIAU Duration of the Incremental Analysis Update (days),
+! [1:Ngrids]. It controls the time interval over which
+! the IAU is applied.
+!
+! This option is only available for RBL4DVAR and when using
+! RPCG minimizer.
+!
+! In SPLIT_RBL4DVAR, you can the analysis phase multiple
+! times experimenting with different values of timeIAU
+! to see which works best, without having to rerun the
+! inner-loops again (increment phase). You can only do
+! this if SPLIT_RBL4DVAR is first run with a non-zero
+! value of timeIAU, otherwise the initial condition will
+! get overwritten in the initial NetCDF file.
+!
+!------------------------------------------------------------------------------
! Background/model correlation parameters.
!------------------------------------------------------------------------------
!
@@ -896,7 +920,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
!
! Sigma_ml(:) Minimum STD at mixed layer
!
-! Sigma_do(:) Minimum STD in deep ocean
+! Sigma_do(:) Minimum STD in deep ocean
!
! Sigma_dz(:) Vertical profile displacement
!
diff --git a/WC13/RBL4DVAR_split/submit_split_rbl4dvar.sh b/WC13/RBL4DVAR_split/submit_split_rbl4dvar.sh
index ff01d43f..99c1baa2 100755
--- a/WC13/RBL4DVAR_split/submit_split_rbl4dvar.sh
+++ b/WC13/RBL4DVAR_split/submit_split_rbl4dvar.sh
@@ -179,7 +179,7 @@ My4DVarScript() {
HereDir=${PWD} # current directory
- DataDir="../../Data" # data directory
+ DataDir="../../Data" # data directory
ObsDir=${DataDir} # observations directory
@@ -191,7 +191,7 @@ My4DVarScript() {
if [ ${BATCH} -eq 1 ]; then
SRUN="srun --mpi=pmi2" # SLURM workload manager
- else
+ else
MPIrun="mpirunI -np" # Basic MPI workload manager
fi
@@ -225,7 +225,7 @@ My4DVarScript() {
MyNQCK=4 # NLM quicksave trajectory is saved every 2 hours
-# MyNADJ=48 # weak constraint, ADM trajectory daily
+# MyNADJ=48 # weak constraint, ADM trajectory daily
MyNADJ=192 # strong contraint, ADM saved at end
restart=0 # restart 4D-Var cycle (0:no, 1:yes)
@@ -491,7 +491,7 @@ while [ $SDAY -le $L_DN ]; do
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Outer = ${OuterLoop}" \
" Phase = ${Phase4DVAR}"
@@ -503,7 +503,7 @@ while [ $SDAY -le $L_DN ]; do
## Start 4D-Var outer loops :::::::::::::::::::::::::::::::::::::::::::
while [ $OuterLoop -lt $MyNouter ]; do
-
+
OuterLoop=$(( $OuterLoop + 1 ))
## Run 4D-Var 'increment' phase .......................................
@@ -529,7 +529,7 @@ while [ $SDAY -le $L_DN ]; do
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Outer = ${OuterLoop}" \
" Phase = ${Phase4DVAR}"
@@ -561,7 +561,7 @@ while [ $SDAY -le $L_DN ]; do
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Outer = ${OuterLoop}" \
" Phase = ${Phase4DVAR}"
@@ -600,11 +600,11 @@ while [ $SDAY -le $L_DN ]; do
if [ ${BATCH} -eq 1 ]; then
${SRUN} ${ROMS_EXE_B} ${ROMS_DAinp}
else
- ${MPIrun} ${nPETs} ${ROMS_EXE_B} ${ROMS_DAinp} >> err
+ ${MPIrun} ${nPETs} ${ROMS_EXE_B} ${ROMS_DAinp} >> err
fi
if [ $? -ne 0 ] ; then
- echo
+ echo
echo "Error while running 4D-Var System: Cycle = ${Cycle}" \
" Phase = ${Phase4DVAR}"
echo "Check ${RunDir}/log.roms for details ..."
diff --git a/WC13/plotting/compare_error_for_FCSTAT_and_FCSTA.m b/WC13/plotting/compare_error_for_FCSTAT_and_FCSTA.m
index de893ca3..2ff22ceb 100644
--- a/WC13/plotting/compare_error_for_FCSTAT_and_FCSTA.m
+++ b/WC13/plotting/compare_error_for_FCSTAT_and_FCSTA.m
@@ -30,7 +30,7 @@
Eradius=6371315.0;
lonr=ncread(Gname,'lon_rho'); lonr=lonr';
-latr=ncread(Gname,'lat_rho'); latr=latr';
+latr=ncread(Gname,'lat_rho'); latr=latr';
lonv=ncread(Gname,'lon_v'); lonv=lonv';
latv=ncread(Gname,'lat_v'); latv=latv';
lonu=ncread(Gname,'lon_u'); lonu=lonu';
@@ -53,37 +53,37 @@
ntimes=ncread(InpA,'ntimes');
%facdt1=nHIS/ntimes;
facdt1=1/nAVG;
-
+
clear f;
-v='v';
+v='v';
fAT=nc_read(InpAT,v);
fA=nc_read(InpA,v);
fB=nc_read(InpB,v);
fVA=nc_read(InpVA,v);
-
+
clear varr;
varr=zeros(size(fA));
-
-
+
+
for it=(size(fA,4)-nAVG):size(fA,4)
facdt=facdt1;
-
+
clear z_w;
[z_w]=depths(InpA,Gname,5,0);
-
+
nlevt=size(fA,3);
-
+
clear Hz;
for k=1:nlevt
Hz(:,:,k)=z_w(:,:,k+1)-z_w(:,:,k);
end
-
+
clear z_v;
[z_v]=depths(InpA,Gname,4,0);
-
+
clear df;
-
+
for k=1:nlevt,
for i=section,
if z_v(i,jlat,k) > depth
@@ -93,7 +93,7 @@
end
end
end
-
+
end
% Compute dJA and dJB.
diff --git a/WC13/plotting/plot_obs.m b/WC13/plotting/plot_obs.m
index 3b1cc0ff..ca8ddc62 100644
--- a/WC13/plotting/plot_obs.m
+++ b/WC13/plotting/plot_obs.m
@@ -87,7 +87,7 @@
0.16863 0.15294 0.14118 0.11373];
Cpal(1:13)=[]; % Remove water colors
-R(1:13)=[];
+R(1:13)=[];
G(1:13)=[];
B(1:13)=[];
@@ -191,5 +191,5 @@
print -dpng -r100 s_obs
end,
-
-
+
+
diff --git a/WC13/plotting/plot_rbl4dvar_analysis_sensitivity.m b/WC13/plotting/plot_rbl4dvar_analysis_sensitivity.m
index 7688516b..65eef2a3 100644
--- a/WC13/plotting/plot_rbl4dvar_analysis_sensitivity.m
+++ b/WC13/plotting/plot_rbl4dvar_analysis_sensitivity.m
@@ -123,5 +123,5 @@
if (exist('/opt/local/bin/convert','file'))
unix(['/opt/local/bin/convert -verbose -crop 2100x1132+100+45', ...
' +repage ', png_file, blanks(1), png_file]);
- end
+ end
end
diff --git a/WC13/plotting/plot_rbl4dvar_forecast_impact.m b/WC13/plotting/plot_rbl4dvar_forecast_impact.m
index 6cbdda56..2c2d7d9d 100644
--- a/WC13/plotting/plot_rbl4dvar_forecast_impact.m
+++ b/WC13/plotting/plot_rbl4dvar_forecast_impact.m
@@ -50,7 +50,7 @@
Eradius=6371315.0;
lonr=ncread(Gname,'lon_rho'); lonr=lonr';
-latr=ncread(Gname,'lat_rho'); latr=latr';
+latr=ncread(Gname,'lat_rho'); latr=latr';
lonv=ncread(Gname,'lon_v'); lonv=lonv';
latv=ncread(Gname,'lat_v'); latv=latv';
lonu=ncread(Gname,'lon_u'); lonu=lonu';
@@ -73,35 +73,35 @@
ntimes=ncread(InpA,'ntimes');
%facdt1=nHIS/ntimes;
facdt1=1/nAVG;
-
+
clear f;
-v='v';
+v='v';
fA =ncread(InpA,v);
fB =ncread(InpB,v);
fVA=ncread(InpVA,v);
-
+
clear varr;
varr=zeros(size(fA));
-
+
for it=(size(fA,4)-nAVG):size(fA,4),
facdt=facdt1;
-
+
clear z_w;
[z_w]=depths(InpA,Gname,5,0);
-
+
nlevt=size(fA,3);
-
+
clear Hz;
for k=1:nlevt
Hz(:,:,k)=z_w(:,:,k+1)-z_w(:,:,k);
end
-
+
clear z_v;
[z_v]=depths(InpA,Gname,4,0);
-
+
clear df;
-
+
for k=1:nlevt
for i=section
if z_v(i,jlat,k) > depth
@@ -111,7 +111,7 @@
end
end
end
-
+
end
% Compute the forecast error metrics
@@ -206,5 +206,5 @@
if (exist('/opt/local/bin/convert','file'))
unix(['/opt/local/bin/convert -verbose -crop 2100x1132+100+45', ...
' +repage ', png_file, blanks(1), png_file]);
- end
+ end
end
diff --git a/WC13/plotting/plot_rbl4dvar_forecast_impact_obs_space.m b/WC13/plotting/plot_rbl4dvar_forecast_impact_obs_space.m
index 3f0951fb..4bfe40d7 100644
--- a/WC13/plotting/plot_rbl4dvar_forecast_impact_obs_space.m
+++ b/WC13/plotting/plot_rbl4dvar_forecast_impact_obs_space.m
@@ -129,5 +129,5 @@
if (exist('/opt/local/bin/convert','file'))
unix(['/opt/local/bin/convert -verbose -crop 2100x1132+100+45', ...
' +repage ', png_file, blanks(1), png_file]);
- end
+ end
end
diff --git a/WC13/plotting/plot_rbl4dvar_forecast_sensitivity.m b/WC13/plotting/plot_rbl4dvar_forecast_sensitivity.m
index 8c7b46fa..e3549e27 100644
--- a/WC13/plotting/plot_rbl4dvar_forecast_sensitivity.m
+++ b/WC13/plotting/plot_rbl4dvar_forecast_sensitivity.m
@@ -50,7 +50,7 @@
Eradius=6371315.0;
lonr=ncread(Gname,'lon_rho'); lonr=lonr';
-latr=ncread(Gname,'lat_rho'); latr=latr';
+latr=ncread(Gname,'lat_rho'); latr=latr';
lonv=ncread(Gname,'lon_v'); lonv=lonv';
latv=ncread(Gname,'lat_v'); latv=latv';
lonu=ncread(Gname,'lon_u'); lonu=lonu';
@@ -73,36 +73,36 @@
ntimes=nc_read(InpA,'ntimes');
%facdt1=nHIS/ntimes;
facdt1=1/nAVG;
-
+
clear f;
-v='v';
+v='v';
fA=nc_read(InpA,v);
fB=nc_read(InpB,v);
fVA=nc_read(InpVA,v);
-
+
clear varr;
varr=zeros(size(fA));
-
-
+
+
for it=(size(fA,4)-nAVG):size(fA,4),
facdt=facdt1;
-
+
clear z_w;
[z_w]=depths(InpA,Gname,5,0);
-
+
nlevt=size(fA,3);
-
+
clear Hz;
for k=1:nlevt
Hz(:,:,k)=z_w(:,:,k+1)-z_w(:,:,k);
end
-
+
clear z_v;
[z_v]=depths(InpA,Gname,4,0);
-
+
clear df;
-
+
for k=1:nlevt,
for i=section,
if z_v(i,jlat,k) > depth
@@ -112,7 +112,7 @@
end
end
end
-
+
end
% Compute the forecast error metrics
@@ -207,5 +207,5 @@
if (exist('/opt/local/bin/convert','file'))
unix(['/opt/local/bin/convert -verbose -crop 2100x1132+100+45', ...
' +repage ', png_file, blanks(1), png_file]);
- end
+ end
end
diff --git a/WC13/plotting/plot_rbl4dvar_forecast_sensitivity_obs_space.m b/WC13/plotting/plot_rbl4dvar_forecast_sensitivity_obs_space.m
index 770ac9af..1f4788fc 100644
--- a/WC13/plotting/plot_rbl4dvar_forecast_sensitivity_obs_space.m
+++ b/WC13/plotting/plot_rbl4dvar_forecast_sensitivity_obs_space.m
@@ -129,5 +129,5 @@
if (exist('/opt/local/bin/convert','file'))
unix(['/opt/local/bin/convert -verbose -crop 2100x1132+100+45', ...
' +repage ', png_file, blanks(1), png_file]);
- end
+ end
end
diff --git a/bio_toy/ecosim_optics.m b/bio_toy/ecosim_optics.m
index 746f32a8..74c15c61 100644
--- a/bio_toy/ecosim_optics.m
+++ b/bio_toy/ecosim_optics.m
@@ -1,4 +1,4 @@
-%
+%
% ECOSIM_OPTICS: Plots EcoSim optical diagnostics for BIO_TOY
%
@@ -31,7 +31,7 @@
stride5 = [1 1 1 1 dt];
time = ncread(Dname, 'ocean_time', T, Inf, dt)./86400;
-wavelength = ncread(Dname, 'light');
+wavelength = ncread(Dname, 'light');
Nrec = length(time);
Nbands = length(wavelength);
diff --git a/channel/Forward/channel.h b/channel/Forward/channel.h
index 8e269c7a..9a48bfe6 100644
--- a/channel/Forward/channel.h
+++ b/channel/Forward/channel.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/channel/OP/channel.h b/channel/OP/channel.h
index 9cf5ee0d..4d7c7cd7 100644
--- a/channel/OP/channel.h
+++ b/channel/OP/channel.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/channel/OP/plot_op.m b/channel/OP/plot_op.m
index e27d720d..c4f0da86 100644
--- a/channel/OP/plot_op.m
+++ b/channel/OP/plot_op.m
@@ -17,7 +17,7 @@
NEV=4; % eingenvector to process
NC=8; % number of contours
-
+
% Read in Optimal Perturbations data.
Xr=nc_read(TLMname,'x_rho');
@@ -67,7 +67,7 @@
% Plot initial and final perturbations.
figure;
-
+
h1=subplot(2,2,1);
contourf(Xr,Yr,D.Zini,NC);
colorbar; caxis(CiniZ);
diff --git a/channel/OP/plot_op_tlm.csh b/channel/OP/plot_op_tlm.csh
index 4ca39cea..ee09cb09 100755
--- a/channel/OP/plot_op_tlm.csh
+++ b/channel/OP/plot_op_tlm.csh
@@ -58,7 +58,7 @@ set TITLE4=" "
set YEAR=2011
set YDAY=-1
-set VINT=0 # vertical interpolation scheme
+set VINT=0 # vertical interpolation scheme
set GRID=1.0
set BLAT=0.0
@@ -173,7 +173,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -235,7 +235,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -297,7 +297,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -359,7 +359,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -421,7 +421,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -483,7 +483,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
diff --git a/double_gyre/AFTE/double_gyre.h b/double_gyre/AFTE/double_gyre.h
index 84ac26da..f9dd95a7 100644
--- a/double_gyre/AFTE/double_gyre.h
+++ b/double_gyre/AFTE/double_gyre.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/double_gyre/AFTE/plt_afte.csh b/double_gyre/AFTE/plt_afte.csh
index 1a76b9f2..a7557fa2 100755
--- a/double_gyre/AFTE/plt_afte.csh
+++ b/double_gyre/AFTE/plt_afte.csh
@@ -58,7 +58,7 @@ set TITLE4=" "
set YEAR=2011
set YDAY=-1
-set VINT=0 # vertical interpolation scheme
+set VINT=0 # vertical interpolation scheme
set GRID=1.0
set BLAT=0.0
@@ -181,7 +181,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -243,7 +243,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -305,7 +305,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -367,7 +367,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -429,7 +429,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -491,7 +491,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -553,7 +553,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
diff --git a/double_gyre/FSV/double_gyre.h b/double_gyre/FSV/double_gyre.h
index 3dd51a1d..dbe66179 100644
--- a/double_gyre/FSV/double_gyre.h
+++ b/double_gyre/FSV/double_gyre.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/double_gyre/FSV/plt_fsv.csh b/double_gyre/FSV/plt_fsv.csh
index 05003dce..c5a140d5 100755
--- a/double_gyre/FSV/plt_fsv.csh
+++ b/double_gyre/FSV/plt_fsv.csh
@@ -58,7 +58,7 @@ set TITLE4=" "
set YEAR=2011
set YDAY=-1
-set VINT=0 # vertical interpolation scheme
+set VINT=0 # vertical interpolation scheme
set GRID=1.0
set BLAT=0.0
@@ -197,7 +197,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -263,7 +263,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -329,7 +329,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -395,7 +395,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -461,7 +461,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -527,7 +527,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -593,7 +593,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
diff --git a/double_gyre/FTE/double_gyre.h b/double_gyre/FTE/double_gyre.h
index 3dd51a1d..dbe66179 100644
--- a/double_gyre/FTE/double_gyre.h
+++ b/double_gyre/FTE/double_gyre.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/double_gyre/FTE/plt_fte.csh b/double_gyre/FTE/plt_fte.csh
index 44ceb531..2df226a7 100755
--- a/double_gyre/FTE/plt_fte.csh
+++ b/double_gyre/FTE/plt_fte.csh
@@ -58,7 +58,7 @@ set TITLE4=" "
set YEAR=2011
set YDAY=-1
-set VINT=0 # vertical interpolation scheme
+set VINT=0 # vertical interpolation scheme
set GRID=1.0
set BLAT=0.0
@@ -181,7 +181,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -243,7 +243,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -305,7 +305,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -367,7 +367,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -429,7 +429,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -491,7 +491,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -553,7 +553,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
diff --git a/double_gyre/Forward/double_gyre.h b/double_gyre/Forward/double_gyre.h
index 3dd51a1d..dbe66179 100644
--- a/double_gyre/Forward/double_gyre.h
+++ b/double_gyre/Forward/double_gyre.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/double_gyre/OP/double_gyre.h b/double_gyre/OP/double_gyre.h
index 3dd51a1d..dbe66179 100644
--- a/double_gyre/OP/double_gyre.h
+++ b/double_gyre/OP/double_gyre.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/double_gyre/OP/plt_op.csh b/double_gyre/OP/plt_op.csh
index ba36e1fe..2f755b8b 100755
--- a/double_gyre/OP/plt_op.csh
+++ b/double_gyre/OP/plt_op.csh
@@ -58,7 +58,7 @@ set TITLE4=" "
set YEAR=2011
set YDAY=-1
-set VINT=0 # vertical interpolation scheme
+set VINT=0 # vertical interpolation scheme
set GRID=1.0
set BLAT=0.0
@@ -174,7 +174,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -236,7 +236,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -298,7 +298,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -360,7 +360,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -422,7 +422,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -484,7 +484,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
@@ -546,7 +546,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
T WRTHDR : logical switch to write out the plot header titles.
diff --git a/double_gyre/SOsemi/double_gyre.h b/double_gyre/SOsemi/double_gyre.h
index 3dd51a1d..dbe66179 100644
--- a/double_gyre/SOsemi/double_gyre.h
+++ b/double_gyre/SOsemi/double_gyre.h
@@ -13,7 +13,7 @@
**
**
** Available Driver options: choose only one and activate it in the
-** build.sh script (MY_CPP_FLAGS definition)
+** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
diff --git a/double_gyre/SOsemi/plt_so.csh b/double_gyre/SOsemi/plt_so.csh
index 56cce7d7..af3fbdbf 100755
--- a/double_gyre/SOsemi/plt_so.csh
+++ b/double_gyre/SOsemi/plt_so.csh
@@ -58,7 +58,7 @@ set TITLE4=" "
set YEAR=2011
set YDAY=-1
-set VINT=0 # vertical interpolation scheme
+set VINT=0 # vertical interpolation scheme
set GRID=1.0
set BLAT=0.0
@@ -161,7 +161,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
@@ -223,7 +223,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
@@ -285,7 +285,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
@@ -347,7 +347,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
@@ -409,7 +409,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
@@ -471,7 +471,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
@@ -533,7 +533,7 @@ $GRID LGRID : Desired longitude/latitude grid spacing (degrees)
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
1 LMSK : flag to color mask land: [0] no, [1] yes
--1 NPAGE : number of plots per page (currently 1, 2, or 4)
+-1 NPAGE : number of plots per page (currently 1, 2, or 4)
F READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
diff --git a/flt_test/plt_floats.m b/flt_test/plt_floats.m
index 262a84ad..2b9a31d0 100644
--- a/flt_test/plt_floats.m
+++ b/flt_test/plt_floats.m
@@ -30,10 +30,10 @@
Fname='roms_flt.nc';
end,
-PPM_MOVIE = 0;
+PPM_MOVIE = 0;
%---------------------------------------------------------------------
-% Read in domain data.
+% Read in domain data.
%---------------------------------------------------------------------
spherical=nc_read(Hname,'spherical');
@@ -41,11 +41,11 @@
if (spherical),
Xr=nc_read(Hname,'lon_rho');
Yr=nc_read(Hname,'lat_rho');
-else,
+else,
Xr=nc_read(Hname,'x_rho').*0.001;
Yr=nc_read(Hname,'y_rho').*0.001;
-end,
-
+end,
+
rmask=ones(size(Xr));
[vname,nvars]=nc_vname(Hname);
for n=1:nvars,
@@ -57,7 +57,7 @@
end,
%---------------------------------------------------------------------
-% Read in floats data.
+% Read in floats data.
%---------------------------------------------------------------------
spval=0.9e+35;
@@ -68,10 +68,10 @@
if (spherical),
xfloat=nc_read(Fname,'lon');
yfloat=nc_read(Fname,'lat');
-else,
+else,
xfloat=nc_read(Fname,'x').*0.001;
yfloat=nc_read(Fname,'y').*0.001;
-end,
+end,
[nf,nt]=size(xfloat);
ind=find(xfloat > spval);
@@ -90,24 +90,24 @@
axis manual
set(gca,'nextplot','replacechildren');
-
+
for n=1:nt,
pcolorjw(Xr,Yr,rmask);
colormap([0 0 0; 1 1 1]);
title(['Time = ',num2str(time(n),'%10.5f'), ' days']);
hold on;
-
+
h=plot(xfloat(:,n),yfloat(:,n),'ro');
% set(h(1),'markersize',5)
hold off;
-
+
F(n)=getframe(fig);
outfile=sprintf('floats%3.3d.ppm',n);
-
+
print('-dppmraw', outfile);
-
+
end,
nx=560; % Size of default Matlab window
@@ -121,19 +121,19 @@
eval(cmd);
unix('/bin/rm -v allppm.list');
unix('/bin/rm -v *.ppm');
-
+
else,
fig=figure;
aviobj=avifile('floats.avi');
-
+
for n=1:nt,
pcolorjw(Xr,Yr,rmask);
colormap([0 0 0; 1 1 1]);
title(['Time = ',num2str(time(n),'%10.5f'), ' days']);
hold on;
-
+
h=plot(xfloat(:,n),yfloat(:,n),'ro');
% set(h(1),'markersize',5)
hold off;
@@ -141,7 +141,7 @@
F=getframe(fig);
aviobj=addframe(aviobj,F);
-
+
end,
close(fig);
aviobj=close(aviobj);
diff --git a/lake_decimate/Decimate/Readme.md b/lake_decimate/Decimate/Readme.md
index 8a816d79..aa0dcc25 100644
--- a/lake_decimate/Decimate/Readme.md
+++ b/lake_decimate/Decimate/Readme.md
@@ -17,7 +17,7 @@ This directory includes various files to run the idealized **`LAKE_DECIMATE`** t
- **`XTRNAME:`** The output extracted solution NetCDF filename.
-▶️ We provide the extraction fields geometry grid NetCDF file **`../Data/lake_decimate_grd_2km.nc`** at the input (**GRXNAME**). This grid must be created with tools like the parent **`../Data/lake_decimate_grd_1km.nc`** application grid and contained inside.
+▶️ We provide the extraction fields geometry grid NetCDF file **`../Data/lake_decimate_grd_2km.nc`** at the input (**GRXNAME**). This grid must be created with tools like the parent **`../Data/lake_decimate_grd_1km.nc`** application grid and contained inside.
### Test Important CPP options:
@@ -26,7 +26,7 @@ They are activated in the build scripts.
```
AVERAGES Activates time-averaged output
BULK_FLUXES Activates COARE bulk parameterization of surface fluxes
- CHECKSUM Reports checksum when processing I/O
+ CHECKSUM Reports checksum when processing I/O
GLS_MIXING Generic Length-Scale turbulence closure
GRID_EXTRACT Writing output extraction history file
LAKE_DECIMATE ROMS application CPP option
@@ -88,7 +88,7 @@ or
lake_decimate_avg.nc ROMS 5-day average files
lake_decimate_his.nc ROMS 5-day history files
lake_decimate_rst.n ROMS restart file
- lake_decimate_sta.nc ROMS hourly stations file
+ lake_decimate_sta.nc ROMS hourly stations file
lake_decimate_xtr.nc ROMS extracted history by decimation
```
----
@@ -109,7 +109,7 @@ On principle, the **`LAKE_DECIMATE`** parent grid satisfies decimation factors o
### Results:
- Free surface and surface temperature.
-
+
| Parent Grid 1.0x1.0 km | Extracted Grid 2.0x2.0 km |
:------------------------------:|:--------------------------:
| | |
diff --git a/lake_decimate/Decimate/ana_rain.h b/lake_decimate/Decimate/ana_rain.h
index 2a3f82ee..5c3aaa94 100644
--- a/lake_decimate/Decimate/ana_rain.h
+++ b/lake_decimate/Decimate/ana_rain.h
@@ -92,7 +92,7 @@
& 1.47e-5_r8*COS(2.0_r8*pi*tdays(ng)/365.25_r8)
END DO
END DO
-# else
+# else
DO j=JstrT,JendT
DO i=IstrT,IendT
rain(i,j)=0.0_r8
diff --git a/lake_decimate/Decimate/ana_smflux.h b/lake_decimate/Decimate/ana_smflux.h
index 14587a78..c7e40bc2 100644
--- a/lake_decimate/Decimate/ana_smflux.h
+++ b/lake_decimate/Decimate/ana_smflux.h
@@ -120,7 +120,7 @@
!
integer :: i, j
#ifdef LAKE_DECIMATE
- real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
+ real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
#endif
#include "set_bounds.h"
diff --git a/lake_decimate/Decimate/ana_srflux.h b/lake_decimate/Decimate/ana_srflux.h
index 7eed8b14..9ae487bc 100644
--- a/lake_decimate/Decimate/ana_srflux.h
+++ b/lake_decimate/Decimate/ana_srflux.h
@@ -174,9 +174,9 @@
!
# ifdef LAKE_DECIMATE
LatRad=42.0_r8*deg2rad
-# else
+# else
LatRad=latr(i,j)*deg2rad
-# endif
+# endif
cff1=SIN(LatRad)*SIN(Dangle)
cff2=COS(LatRad)*COS(Dangle)
# if defined ALBEDO
@@ -197,9 +197,9 @@
srflx(i,j)=0.0_r8
# ifdef LAKE_DECIMATE
LonRad=-81.0_r8*deg2rad
-# else
+# else
LatRad=latr(i,j)*deg2rad
-# endif
+# endif
zenith=cff1+cff2*COS(Hangle-LonRad)
IF (zenith.gt.0.0_r8) THEN
cff=(0.7859_r8+0.03477_r8*Tair(i,j))/ &
diff --git a/lake_decimate/Decimate/roms_lake_decimate.in b/lake_decimate/Decimate/roms_lake_decimate.in
index cb816cee..4fe3a4bd 100644
--- a/lake_decimate/Decimate/roms_lake_decimate.in
+++ b/lake_decimate/Decimate/roms_lake_decimate.in
@@ -259,7 +259,7 @@ ad_VolCons(north) == F ! northern boundary
NRREC == 0
LcycleRST == T
- NRST == 1440
+ NRST == 1440
NSTA == 1
NFLT == 1
NINFO == 1
diff --git a/lake_decimate/Interpolate/Readme.md b/lake_decimate/Interpolate/Readme.md
index 1a225d02..6ec846a9 100644
--- a/lake_decimate/Interpolate/Readme.md
+++ b/lake_decimate/Interpolate/Readme.md
@@ -17,7 +17,7 @@ This directory includes various files to run the idealized **`LAKE_DECIMATE`** t
- **`XTRNAME:`** The output extracted solution NetCDF filename.
-▶️ We provide the extraction fields geometry grid NetCDF files **`../Data/lake_decimate_grd_bay.nc`** or **`../Data/lake_decimate_grd_inlet.nc`** at the input (**GRXNAME**). This grid must be created with tools like the parent **`../Data/lake_decimate_grd_1km.nc`** application grid and contained inside.
+▶️ We provide the extraction fields geometry grid NetCDF files **`../Data/lake_decimate_grd_bay.nc`** or **`../Data/lake_decimate_grd_inlet.nc`** at the input (**GRXNAME**). This grid must be created with tools like the parent **`../Data/lake_decimate_grd_1km.nc`** application grid and contained inside.
### Test Important CPP options:
@@ -26,7 +26,7 @@ They are activated in the build scripts.
```
AVERAGES Activates time-averaged output
BULK_FLUXES Activates COARE bulk parameterization of surface fluxes
- CHECKSUM Reports checksum when processing I/O
+ CHECKSUM Reports checksum when processing I/O
GLS_MIXING Generic Length-Scale turbulence closure
GRID_EXTRACT Writing output extraction history file
LAKE_DECIMATE ROMS application CPP option
@@ -89,7 +89,7 @@ or
lake_decimate_avg.nc ROMS 5-day average files
lake_decimate_his.nc ROMS 5-day history files
lake_decimate_rst.n ROMS restart file
- lake_decimate_sta.nc ROMS hourly stations file
+ lake_decimate_sta.nc ROMS hourly stations file
lake_decimate_xtr.nc ROMS extracted history by decimation
```
----
diff --git a/lake_decimate/Interpolate/ana_rain.h b/lake_decimate/Interpolate/ana_rain.h
index 2a3f82ee..5c3aaa94 100644
--- a/lake_decimate/Interpolate/ana_rain.h
+++ b/lake_decimate/Interpolate/ana_rain.h
@@ -92,7 +92,7 @@
& 1.47e-5_r8*COS(2.0_r8*pi*tdays(ng)/365.25_r8)
END DO
END DO
-# else
+# else
DO j=JstrT,JendT
DO i=IstrT,IendT
rain(i,j)=0.0_r8
diff --git a/lake_decimate/Interpolate/ana_smflux.h b/lake_decimate/Interpolate/ana_smflux.h
index 14587a78..c7e40bc2 100644
--- a/lake_decimate/Interpolate/ana_smflux.h
+++ b/lake_decimate/Interpolate/ana_smflux.h
@@ -120,7 +120,7 @@
!
integer :: i, j
#ifdef LAKE_DECIMATE
- real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
+ real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
#endif
#include "set_bounds.h"
diff --git a/lake_decimate/Interpolate/ana_srflux.h b/lake_decimate/Interpolate/ana_srflux.h
index 7eed8b14..9ae487bc 100644
--- a/lake_decimate/Interpolate/ana_srflux.h
+++ b/lake_decimate/Interpolate/ana_srflux.h
@@ -174,9 +174,9 @@
!
# ifdef LAKE_DECIMATE
LatRad=42.0_r8*deg2rad
-# else
+# else
LatRad=latr(i,j)*deg2rad
-# endif
+# endif
cff1=SIN(LatRad)*SIN(Dangle)
cff2=COS(LatRad)*COS(Dangle)
# if defined ALBEDO
@@ -197,9 +197,9 @@
srflx(i,j)=0.0_r8
# ifdef LAKE_DECIMATE
LonRad=-81.0_r8*deg2rad
-# else
+# else
LatRad=latr(i,j)*deg2rad
-# endif
+# endif
zenith=cff1+cff2*COS(Hangle-LonRad)
IF (zenith.gt.0.0_r8) THEN
cff=(0.7859_r8+0.03477_r8*Tair(i,j))/ &
diff --git a/lake_decimate/Interpolate/roms_lake_decimate_bay.in b/lake_decimate/Interpolate/roms_lake_decimate_bay.in
index 3097272d..5eb1b75c 100644
--- a/lake_decimate/Interpolate/roms_lake_decimate_bay.in
+++ b/lake_decimate/Interpolate/roms_lake_decimate_bay.in
@@ -259,7 +259,7 @@ ad_VolCons(north) == F ! northern boundary
NRREC == 0
LcycleRST == T
- NRST == 1440
+ NRST == 1440
NSTA == 1
NFLT == 1
NINFO == 1
diff --git a/lake_ice/Forward/Readme.md b/lake_ice/Forward/Readme.md
index f90ade94..afa190f5 100644
--- a/lake_ice/Forward/Readme.md
+++ b/lake_ice/Forward/Readme.md
@@ -29,7 +29,7 @@ The sea ice model state variables **iSice** indices are:
| 10 | **isUice** | Ice U-velocity (m/s) |
| 11 | **isVice** | Ice V-velocity (m/s) |
| 12 | **isEnth** | Enthalpy of the ice/brine system, ice heat content |
-| 13 | **isHage** | Thickness associated with the age of ice (m) |
+| 13 | **isHage** | Thickness associated with the age of ice (m) |
| 14 | **isUevp** | Elastic-viscous-plastic ice U-velocity (m/s) |
| 15 | **isVevp** | Elastic-viscous-plastic ice V-velocity (m/s) |
@@ -50,7 +50,7 @@ The sea ice model internal field **iFice** indices are:
| 11 | **icPice** | Ice pressure or strength (N/m2) |
| 12 | **icQcon** | Gradient heat conductivity over ice/snow (W/m2/K) |
| 13 | **icQrhs** | RHS surface net heat flux over ice/snow (W/m2) |
-| 14 | **icSvis** | Ice shear viscosity |
+| 14 | **icSvis** | Ice shear viscosity |
| 15 | **icS0mk** | Salinity of molecular sublayer under ice (unitless) |
| 16 | **icT0mk** | Temperature of molecular sublayer under ice (Celsius) |
| 17 | **icUavg** | Vertically averaged mixed-layer U-velocity (m/s) |
@@ -145,7 +145,7 @@ or
roms_lake_ice_his_0001.nc to *_0005.nc ROMS 5-day history files
roms_lake_ice_qck_0001.nc to *_0005.nc ROMS daily quicksave files for sea ice model
roms_lake_ice_rst.nc ROMS restart file
- roms_lake_ice_sta.nc ROMS hourly stations file
+ roms_lake_ice_sta.nc ROMS hourly stations file
```
----
@@ -197,7 +197,7 @@ The **`STATION`** option was activated to output the ice model solution time ser
:------------------------------:|:--------------------------:
| | |
-----
+----
**References:**
@@ -205,4 +205,4 @@ Durski, S.M., and A.L. Kurapov, 2019: A high-resolution coupled ice-ocean model
Durski, S.M., and A.L. Kurapov, 2020: A high-resolution coupled ice-ocean model of winter circulation on the Bering Sea Shelf. Part II: Polynyas and the shelf salinity distribution, _Ocean Modelling_, 156, 101696, **doi:**/10.1016/j.ocemod.2020.101696.
-Mellor, G.L. and L. Kantha, 1989: An Ice-Ocean Coupled Model, _J. Geophys. Res._, **94**, 10937-10954.
+Mellor, G.L. and L. Kantha, 1989: An Ice-Ocean Coupled Model, _J. Geophys. Res._, **94**, 10937-10954.
diff --git a/lake_ice/Forward/ana_initial.h b/lake_ice/Forward/ana_initial.h
index a00a29a9..5298aaa9 100644
--- a/lake_ice/Forward/ana_initial.h
+++ b/lake_ice/Forward/ana_initial.h
@@ -1,4 +1,4 @@
-!!
+!
SUBROUTINE ana_initial (ng, tile, model)
!
!! git $Id$
@@ -199,6 +199,7 @@
IF (first) THEN
first=.FALSE.
DO i=1,SIZE(Stats,1)
+ Stats(i) % checksum=0_i8b
Stats(i) % count=0.0_r8
Stats(i) % min=Large
Stats(i) % max=-Large
@@ -237,14 +238,14 @@
!
! Report statistics.
!
- CALL stats_2dfld (ng, tile, iNLM, u2dvar, Stats(1), &
+ CALL stats_2dfld (ng, tile, iNLM, u2dvar, Stats(1), 0, &
& LBi, UBi, LBj, UBj, ubar(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idUbar))//': '// &
& TRIM(Vname(1,idUbar)), &
& ng, Stats(1)%min, Stats(1)%max
END IF
- CALL stats_2dfld (ng, tile, iNLM, v2dvar, Stats(2), &
+ CALL stats_2dfld (ng, tile, iNLM, v2dvar, Stats(2), 0, &
& LBi, UBi, LBj, UBj, vbar(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idVbar))//': '// &
@@ -272,7 +273,7 @@
!
! Report statistics.
!
- CALL stats_2dfld (ng, tile, iNLM, r2dvar, Stats(3), &
+ CALL stats_2dfld (ng, tile, iNLM, r2dvar, Stats(3), 0, &
& LBi, UBi, LBj, UBj, zeta(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idFsur))//': '// &
@@ -316,14 +317,14 @@
!
! Report statistics.
!
- CALL stats_3dfld (ng, tile, iNLM, u3dvar, Stats(4), &
+ CALL stats_3dfld (ng, tile, iNLM, u3dvar, Stats(4), 0, &
& LBi, UBi, LBj, UBj, 1, N(ng), u(:,:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idUvel))//': '// &
& TRIM(Vname(1,idUvel)), &
& ng, Stats(4)%min, Stats(4)%max
END IF
- CALL stats_3dfld (ng, tile, iNLM, v3dvar, Stats(5), &
+ CALL stats_3dfld (ng, tile, iNLM, v3dvar, Stats(5), 0, &
& LBi, UBi, LBj, UBj, 1, N(ng), v(:,:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idVvel))//': '// &
@@ -366,7 +367,7 @@
! Report statistics.
!
DO itrc=1,NAT
- CALL stats_3dfld (ng, tile, iNLM, u3dvar, Stats(itrc+5), &
+ CALL stats_3dfld (ng, tile, iNLM, r3dvar, Stats(itrc+5), 0, &
& LBi, UBi, LBj, UBj, 1, N(ng), t(:,:,:,1,itrc))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idTvar(itrc)))//': '// &
diff --git a/lake_ice/Forward/ana_rain.h b/lake_ice/Forward/ana_rain.h
index b99cc3d0..efc72b67 100644
--- a/lake_ice/Forward/ana_rain.h
+++ b/lake_ice/Forward/ana_rain.h
@@ -92,7 +92,7 @@
& 1.47e-5_r8*COS(2.0_r8*pi*tdays(ng)/365.25_r8)
END DO
END DO
-# else
+# else
DO j=JstrT,JendT
DO i=IstrT,IendT
rain(i,j)=0.0_r8
diff --git a/lake_ice/Forward/ana_srflux.h b/lake_ice/Forward/ana_srflux.h
index 4babbbb8..7d6ae51f 100644
--- a/lake_ice/Forward/ana_srflux.h
+++ b/lake_ice/Forward/ana_srflux.h
@@ -174,9 +174,9 @@
!
# ifdef LAKE_ICE
LatRad=42.0_r8*deg2rad
-# else
+# else
LatRad=latr(i,j)*deg2rad
-# endif
+# endif
cff1=SIN(LatRad)*SIN(Dangle)
cff2=COS(LatRad)*COS(Dangle)
# if defined ALBEDO
@@ -197,9 +197,9 @@
srflx(i,j)=0.0_r8
# ifdef LAKE_ICE
LonRad=-81.0_r8*deg2rad
-# else
+# else
LatRad=latr(i,j)*deg2rad
-# endif
+# endif
zenith=cff1+cff2*COS(Hangle-LonRad)
IF (zenith.gt.0.0_r8) THEN
cff=(0.7859_r8+0.03477_r8*Tair(i,j))/ &
diff --git a/lake_ice/Forward/plot_lake_ice.m b/lake_ice/Forward/plot_lake_ice.m
index 4f3191f7..8219ee76 100644
--- a/lake_ice/Forward/plot_lake_ice.m
+++ b/lake_ice/Forward/plot_lake_ice.m
@@ -81,7 +81,7 @@
hold on;
F = nc_read(Qname{nf}, 'Aice', Recs(ir));
if (Contours)
- contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
+ contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
else
pcolor(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho));
end
@@ -92,13 +92,13 @@
caxis([0 1]);
axis([0 200 0 100]);
hold off;
-
+
subplot(2,1,2)
set(gca, 'color', Land);
hold on;
F = nc_read(Qname{nf}, 'ice_age', Recs(ir));
if (Contours)
- contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
+ contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
else
pcolor(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho));
end
@@ -124,7 +124,7 @@
hold on;
F = nc_read(Qname{nf}, 'ice_thickness', Recs(ir));
if (Contours)
- contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
+ contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
else
pcolor(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho));
end
@@ -141,7 +141,7 @@
hold on;
F = nc_read(Qname{nf}, 'meltpond_thickness', Recs(ir));
if (Contours)
- contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
+ contourf(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho),20);
else
pcolor(G.x_rho/1000,G.y_rho/1000,nanland(F,G.mask_rho));
end
@@ -151,7 +151,7 @@
colormap(flipud(vivid('mvbscflyor',[0.2 1])));
caxis([0 0.1]);
axis([0 200 0 100]);
- hold off;
+ hold off;
if (doPNG)
png_file = strcat('ice_tickness_', num2str(ir), '.png');
diff --git a/lake_ice/Forward/roms_lake_ice.in b/lake_ice/Forward/roms_lake_ice.in
index 3e4405ee..d6aef1e2 100644
--- a/lake_ice/Forward/roms_lake_ice.in
+++ b/lake_ice/Forward/roms_lake_ice.in
@@ -106,7 +106,7 @@ GridsInLayer = 1
! 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].
-
+
NtileI == 3 ! I-direction partition
NtileJ == 4 ! J-direction partition
diff --git a/lake_jersey/Forward/ana_smflux.h b/lake_jersey/Forward/ana_smflux.h
index 57bed83a..52765f1f 100644
--- a/lake_jersey/Forward/ana_smflux.h
+++ b/lake_jersey/Forward/ana_smflux.h
@@ -120,7 +120,7 @@
!
integer :: i, j
#ifdef LAKE_JERSEY
- real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
+ real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
#endif
#include "set_bounds.h"
diff --git a/lake_jersey/Refined/ana_smflux.h b/lake_jersey/Refined/ana_smflux.h
index 57bed83a..52765f1f 100644
--- a/lake_jersey/Refined/ana_smflux.h
+++ b/lake_jersey/Refined/ana_smflux.h
@@ -120,7 +120,7 @@
!
integer :: i, j
#ifdef LAKE_JERSEY
- real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
+ real(r8) :: cff1, mxst, ramp_d, ramp_time, ramp_u
#endif
#include "set_bounds.h"
diff --git a/lake_jersey/Refined/roms_lake_jersey_nested_2g_ab.in b/lake_jersey/Refined/roms_lake_jersey_nested_2g_ab.in
index 91f41e2f..8f196df9 100644
--- a/lake_jersey/Refined/roms_lake_jersey_nested_2g_ab.in
+++ b/lake_jersey/Refined/roms_lake_jersey_nested_2g_ab.in
@@ -392,16 +392,16 @@ LtracerSponge == F F ! temperature, salinity, inert
! Generic length-scale turbulence closure parameters.
- GLS_P == 2*0.0d0 ! k-kl
+ GLS_P == 2*0.0d0 ! k-kl
GLS_M == 2*1.0d0
GLS_N == 2*1.0d0
GLS_Kmin == 2*5.0d-06
GLS_Pmin == 2*5.0d-06
GLS_CMU0 == 2*0.5544d0
- GLS_C1 == 2*0.9d0
+ GLS_C1 == 2*0.9d0
GLS_C2 == 2*0.52d0
- GLS_C3M == 2*2.5d0
+ GLS_C3M == 2*2.5d0
GLS_C3P == 2*1.0d0
GLS_SIGK == 2*1.96d0
GLS_SIGP == 2*1.96d0
diff --git a/lake_jersey/Refined/roms_lake_jersey_nested_2g_ac.in b/lake_jersey/Refined/roms_lake_jersey_nested_2g_ac.in
index d23671cc..55f82a98 100644
--- a/lake_jersey/Refined/roms_lake_jersey_nested_2g_ac.in
+++ b/lake_jersey/Refined/roms_lake_jersey_nested_2g_ac.in
@@ -392,16 +392,16 @@ LtracerSponge == F F ! temperature, salinity, inert
! Generic length-scale turbulence closure parameters.
- GLS_P == 2*0.0d0 ! k-kl
+ GLS_P == 2*0.0d0 ! k-kl
GLS_M == 2*1.0d0
GLS_N == 2*1.0d0
GLS_Kmin == 2*5.0d-06
GLS_Pmin == 2*5.0d-06
GLS_CMU0 == 2*0.5544d0
- GLS_C1 == 2*0.9d0
+ GLS_C1 == 2*0.9d0
GLS_C2 == 2*0.52d0
- GLS_C3M == 2*2.5d0
+ GLS_C3M == 2*2.5d0
GLS_C3P == 2*1.0d0
GLS_SIGK == 2*1.96d0
GLS_SIGP == 2*1.96d0
diff --git a/lake_jersey/Refined/roms_lake_jersey_nested_2g_ad.in b/lake_jersey/Refined/roms_lake_jersey_nested_2g_ad.in
index 43eaf406..9a2eb4c1 100644
--- a/lake_jersey/Refined/roms_lake_jersey_nested_2g_ad.in
+++ b/lake_jersey/Refined/roms_lake_jersey_nested_2g_ad.in
@@ -392,16 +392,16 @@ LtracerSponge == F F ! temperature, salinity, inert
! Generic length-scale turbulence closure parameters.
- GLS_P == 2*0.0d0 ! k-kl
+ GLS_P == 2*0.0d0 ! k-kl
GLS_M == 2*1.0d0
GLS_N == 2*1.0d0
GLS_Kmin == 2*5.0d-06
GLS_Pmin == 2*5.0d-06
GLS_CMU0 == 2*0.5544d0
- GLS_C1 == 2*0.9d0
+ GLS_C1 == 2*0.9d0
GLS_C2 == 2*0.52d0
- GLS_C3M == 2*2.5d0
+ GLS_C3M == 2*2.5d0
GLS_C3P == 2*1.0d0
GLS_SIGK == 2*1.96d0
GLS_SIGP == 2*1.96d0
diff --git a/lake_jersey/Refined/roms_lake_jersey_nested_3g_abd.in b/lake_jersey/Refined/roms_lake_jersey_nested_3g_abd.in
index 7739deb2..3bfb6cb7 100644
--- a/lake_jersey/Refined/roms_lake_jersey_nested_3g_abd.in
+++ b/lake_jersey/Refined/roms_lake_jersey_nested_3g_abd.in
@@ -420,16 +420,16 @@ LtracerSponge == F F ! temperature, salinity, inert
! Generic length-scale turbulence closure parameters.
- GLS_P == 3*0.0d0 ! k-kl
+ GLS_P == 3*0.0d0 ! k-kl
GLS_M == 3*1.0d0
GLS_N == 3*1.0d0
GLS_Kmin == 3*5.0d-06
GLS_Pmin == 3*5.0d-06
GLS_CMU0 == 3*0.5544d0
- GLS_C1 == 3*0.9d0
+ GLS_C1 == 3*0.9d0
GLS_C2 == 3*0.52d0
- GLS_C3M == 3*2.5d0
+ GLS_C3M == 3*2.5d0
GLS_C3P == 3*1.0d0
GLS_SIGK == 3*1.96d0
GLS_SIGP == 3*1.96d0
diff --git a/lake_jersey/Refined/roms_lake_jersey_nested_3g_ade.in b/lake_jersey/Refined/roms_lake_jersey_nested_3g_ade.in
index 1ff6ba38..8f0f4f86 100644
--- a/lake_jersey/Refined/roms_lake_jersey_nested_3g_ade.in
+++ b/lake_jersey/Refined/roms_lake_jersey_nested_3g_ade.in
@@ -420,16 +420,16 @@ LtracerSponge == F F ! temperature, salinity, inert
! Generic length-scale turbulence closure parameters.
- GLS_P == 3*0.0d0 ! k-kl
+ GLS_P == 3*0.0d0 ! k-kl
GLS_M == 3*1.0d0
GLS_N == 3*1.0d0
GLS_Kmin == 3*5.0d-06
GLS_Pmin == 3*5.0d-06
GLS_CMU0 == 3*0.5544d0
- GLS_C1 == 3*0.9d0
+ GLS_C1 == 3*0.9d0
GLS_C2 == 3*0.52d0
- GLS_C3M == 3*2.5d0
+ GLS_C3M == 3*2.5d0
GLS_C3P == 3*1.0d0
GLS_SIGK == 3*1.96d0
GLS_SIGP == 3*1.96d0
diff --git a/lake_jersey/Refined/roms_lake_jersey_nested_4g_abdc.in b/lake_jersey/Refined/roms_lake_jersey_nested_4g_abdc.in
index 9685892f..600c1653 100644
--- a/lake_jersey/Refined/roms_lake_jersey_nested_4g_abdc.in
+++ b/lake_jersey/Refined/roms_lake_jersey_nested_4g_abdc.in
@@ -448,16 +448,16 @@ LtracerSponge == F F ! temperature, salinity, inert
! Generic length-scale turbulence closure parameters.
- GLS_P == 4*0.0d0 ! k-kl
+ GLS_P == 4*0.0d0 ! k-kl
GLS_M == 4*1.0d0
GLS_N == 4*1.0d0
GLS_Kmin == 4*5.0d-06
GLS_Pmin == 4*5.0d-06
GLS_CMU0 == 4*0.5544d0
- GLS_C1 == 4*0.9d0
+ GLS_C1 == 4*0.9d0
GLS_C2 == 4*0.52d0
- GLS_C3M == 4*2.5d0
+ GLS_C3M == 4*2.5d0
GLS_C3P == 4*1.0d0
GLS_SIGK == 4*1.96d0
GLS_SIGP == 4*1.96d0
diff --git a/lake_jersey/Refined/roms_lake_jersey_nested_4g_acde.in b/lake_jersey/Refined/roms_lake_jersey_nested_4g_acde.in
index f66e565b..d0c1ff64 100644
--- a/lake_jersey/Refined/roms_lake_jersey_nested_4g_acde.in
+++ b/lake_jersey/Refined/roms_lake_jersey_nested_4g_acde.in
@@ -448,16 +448,16 @@ LtracerSponge == F F ! temperature, salinity, inert
! Generic length-scale turbulence closure parameters.
- GLS_P == 4*0.0d0 ! k-kl
+ GLS_P == 4*0.0d0 ! k-kl
GLS_M == 4*1.0d0
GLS_N == 4*1.0d0
GLS_Kmin == 4*5.0d-06
GLS_Pmin == 4*5.0d-06
GLS_CMU0 == 4*0.5544d0
- GLS_C1 == 4*0.9d0
+ GLS_C1 == 4*0.9d0
GLS_C2 == 4*0.52d0
- GLS_C3M == 4*2.5d0
+ GLS_C3M == 4*2.5d0
GLS_C3P == 4*1.0d0
GLS_SIGK == 4*1.96d0
GLS_SIGP == 4*1.96d0
diff --git a/riverplume/roms_riverplume1_w.in b/riverplume/roms_riverplume1_w.in
index 40bd129d..964c1c00 100644
--- a/riverplume/roms_riverplume1_w.in
+++ b/riverplume/roms_riverplume1_w.in
@@ -64,7 +64,7 @@
!
! Application title.
- TITLE = River Plume Test 1, flow across w-face grid cell
+ TITLE = River Plume Test 1, flow across w-face grid cell
! C-preprocessing Flag.
diff --git a/soliton/Refined/ana_initial.h b/soliton/Refined/ana_initial.h
index c6f4a03e..fb3fa2e3 100644
--- a/soliton/Refined/ana_initial.h
+++ b/soliton/Refined/ana_initial.h
@@ -1,4 +1,4 @@
-!!
+!
SUBROUTINE ana_initial (ng, tile, model)
!
!! git $Id$
@@ -116,6 +116,7 @@
IF (first) THEN
first=.FALSE.
DO i=1,SIZE(Stats,1)
+ Stats(i) % checksum=0_i8b
Stats(i) % count=0.0_r8
Stats(i) % min=Large
Stats(i) % max=-Large
@@ -182,14 +183,14 @@
!
! Report statistics.
!
- CALL stats_2dfld (ng, tile, iNLM, u2dvar, Stats(1), &
+ CALL stats_2dfld (ng, tile, iNLM, u2dvar, Stats(1), 0, &
& LBi, UBi, LBj, UBj, ubar(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idUbar))//': '// &
& TRIM(Vname(1,idUbar)), &
& ng, Stats(1)%min, Stats(1)%max
END IF
- CALL stats_2dfld (ng, tile, iNLM, v2dvar, Stats(2), &
+ CALL stats_2dfld (ng, tile, iNLM, v2dvar, Stats(2), 0, &
& LBi, UBi, LBj, UBj, vbar(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idVbar))//': '// &
@@ -235,7 +236,7 @@
!
! Report statistics.
!
- CALL stats_2dfld (ng, tile, iNLM, r2dvar, Stats(3), &
+ CALL stats_2dfld (ng, tile, iNLM, r2dvar, Stats(3), 0, &
& LBi, UBi, LBj, UBj, zeta(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idFsur))//': '// &
diff --git a/soliton/Refined/soliton_movie.m b/soliton/Refined/soliton_movie.m
index 3869107c..3960278b 100644
--- a/soliton/Refined/soliton_movie.m
+++ b/soliton/Refined/soliton_movie.m
@@ -16,7 +16,7 @@
% type Input file prefix (string)
% type = 'avg' => average file
% type = 'his' => history file
-%
+%
% Caxis Color axis bounds (optional; vector)
%
% mytitle Plot title (optional, string)
@@ -25,10 +25,10 @@
%
% Example:
%
-% soliton_movie('r01','zeta','his',[0 0.16])
-% soliton_movie('r01','zeta','his',[Inf Inf],'FB AB3-AM4','zeta_fb.gif')
-% soliton_movie('r01','ubar','his')
-% soliton_movie('r01','rvorticity_bar','avg')
+% soliton_movie('r01','zeta','his',[0 0.16])
+% soliton_movie('r01','zeta','his',[Inf Inf],'FB AB3-AM4','zeta_fb.gif')
+% soliton_movie('r01','ubar','his')
+% soliton_movie('r01','rvorticity_bar','avg')
% git $Id$
%=========================================================================%
@@ -38,7 +38,7 @@
%=========================================================================%
% Read in requested variable.
-
+
Cncname = strcat(Dir,'/soliton_',type,'_coarse.nc');
Fncname = strcat(Dir,'/soliton_',type,'_fine.nc');
@@ -50,7 +50,7 @@
Ctime = nc_read(Cncname, 'ocean_time');
Ftime = nc_read(Fncname, 'ocean_time');
-long_name = nc_getatt(Cncname, 'long_name', Vname);
+long_name = nc_getatt(Cncname, 'long_name', Vname);
switch Vname
case {'ubar'}
@@ -138,14 +138,14 @@
Fmax=max(max(squeeze(F(:,:,1))));
xlabel(['Min = ', num2str(Fmin), blanks(4), 'Max = ', num2str(Fmax)]);
-frame = getframe(fig);
+frame = getframe(fig);
im = frame2im(frame);
-[imind,cm] = rgb2ind(im,256);
+[imind,cm] = rgb2ind(im,256);
-% Write to the GIF File.
+% Write to the GIF File.
count = 1;
-imwrite(imind, cm, GIFname, 'gif', 'Loopcount', inf);
+imwrite(imind, cm, GIFname, 'gif', 'Loopcount', inf);
% Plot the rest of the time frames.
@@ -180,11 +180,11 @@
drawnow
pause(0.5)
- frame = getframe(fig);
- im = frame2im(frame);
- [imind,cm] = rgb2ind(im,256);
+ frame = getframe(fig);
+ im = frame2im(frame);
+ [imind,cm] = rgb2ind(im,256);
- imwrite(imind, cm, GIFname, 'gif', 'WriteMode', 'append');
+ imwrite(imind, cm, GIFname, 'gif', 'WriteMode', 'append');
end
return
diff --git a/upwelling/ana_humid.h b/upwelling/ana_humid.h
index 0cbfb69d..745570aa 100644
--- a/upwelling/ana_humid.h
+++ b/upwelling/ana_humid.h
@@ -1,3 +1,4 @@
+!
SUBROUTINE ana_humid (ng, tile, model)
!
!! git $Id$
diff --git a/upwelling/ana_initial.h b/upwelling/ana_initial.h
index 25af0650..dbe2b667 100644
--- a/upwelling/ana_initial.h
+++ b/upwelling/ana_initial.h
@@ -1,3 +1,4 @@
+!
SUBROUTINE ana_initial (ng, tile, model)
!
!! git $Id$
@@ -157,7 +158,8 @@
IF (first) THEN
first=.FALSE.
DO i=1,SIZE(Stats,1)
- Stats(i) % count=0.0_r8
+ Stats(i) % checksum=0_i8b
+ Stats(i) % count=0
Stats(i) % min=Large
Stats(i) % max=-Large
Stats(i) % avg=0.0_r8
@@ -182,14 +184,14 @@
!
! Report statistics.
!
- CALL stats_2dfld (ng, tile, iNLM, u2dvar, Stats(1), &
+ CALL stats_2dfld (ng, tile, iNLM, u2dvar, Stats(1), 0, &
& LBi, UBi, LBj, UBj, ubar(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idUbar))//': '// &
& TRIM(Vname(1,idUbar)), &
& ng, Stats(1)%min, Stats(1)%max
END IF
- CALL stats_2dfld (ng, tile, iNLM, v2dvar, Stats(2), &
+ CALL stats_2dfld (ng, tile, iNLM, v2dvar, Stats(2), 0, &
& LBi, UBi, LBj, UBj, vbar(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idVbar))//': '// &
@@ -209,7 +211,7 @@
!
! Report statistics.
!
- CALL stats_2dfld (ng, tile, iNLM, r2dvar, Stats(3), &
+ CALL stats_2dfld (ng, tile, iNLM, r2dvar, Stats(3), 0, &
& LBi, UBi, LBj, UBj, zeta(:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idFsur))//': '// &
@@ -238,14 +240,14 @@
!
! Report statistics.
!
- CALL stats_3dfld (ng, tile, iNLM, u3dvar, Stats(4), &
+ CALL stats_3dfld (ng, tile, iNLM, u3dvar, Stats(4), 0, &
& LBi, UBi, LBj, UBj, 1, N(ng), u(:,:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idUvel))//': '// &
& TRIM(Vname(1,idUvel)), &
& ng, Stats(4)%min, Stats(4)%max
END IF
- CALL stats_3dfld (ng, tile, iNLM, v3dvar, Stats(5), &
+ CALL stats_3dfld (ng, tile, iNLM, v3dvar, Stats(5), 0, &
& LBi, UBi, LBj, UBj, 1, N(ng), v(:,:,:,1))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idVvel))//': '// &
@@ -296,7 +298,7 @@
! Report statistics.
!
DO itrc=1,NAT
- CALL stats_3dfld (ng, tile, iNLM, u3dvar, Stats(itrc+5), &
+ CALL stats_3dfld (ng, tile, iNLM, r3dvar, Stats(itrc+5), 0, &
& LBi, UBi, LBj, UBj, 1, N(ng), t(:,:,:,1,itrc))
IF (DOMAIN(ng)%NorthEast_Corner(tile)) THEN
WRITE (stdout,10) TRIM(Vname(2,idTvar(itrc)))//': '// &
diff --git a/upwelling/ana_pair.h b/upwelling/ana_pair.h
index 5bc8ab1d..89652897 100644
--- a/upwelling/ana_pair.h
+++ b/upwelling/ana_pair.h
@@ -1,3 +1,4 @@
+!
SUBROUTINE ana_pair (ng, tile, model)
!
!! git $Id$
diff --git a/upwelling/ana_winds.h b/upwelling/ana_winds.h
index af61a64f..de591ffa 100644
--- a/upwelling/ana_winds.h
+++ b/upwelling/ana_winds.h
@@ -1,3 +1,4 @@
+!
SUBROUTINE ana_winds (ng, tile, model)
!
!! git $Id$
diff --git a/upwelling/upwelling.h b/upwelling/upwelling.h
index d9881969..f183a301 100644
--- a/upwelling/upwelling.h
+++ b/upwelling/upwelling.h
@@ -39,7 +39,7 @@
#if defined BIO_FENNEL || defined ECOSIM || \
defined NEMURO || defined NPZD_FRANKS || \
- defined NPZD_IRON || defined NPZD_POWELL
+ defined NPZD_IRON || defined NPZD_POWELL
# define ANA_BIOLOGY
# define ANA_SPFLUX
# define ANA_BPFLUX