Back to home page

MITgcm

 
 

    


Warning, /verification/front_relax/README.md is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit 5b172de0 on 2022-11-28 18:04:11 UTC
5b172de0d2 Jean*0001 # Relaxation of a front in a channel : simplest example that uses GM-Redi parameterization
                0002 
                0003 
                0004 A 2-D, y-z set-up is used to mimic a zonally symmetric, reentrant channel with
                0005 a baroclinicly unstable initial density front.<br>
                0006 As meso-scale eddies are not resolved in this 2-D set-up, the GM-Redi
                0007 parameterization is used to represent their effects.
                0008 
                0009 ### Overview:
                0010 This experiment contains 5 set-ups (with corresponding `input[.*]/` dir) that
                0011 can be run with the same executable (built from `build/` dir using customized
                0012 code from `code/`); binary input files have been generated using matlab script
                0013 `gendata.m` from the corresponding `input` dir. All five set-ups use a
                0014 simple EOS ( $\rho' = -\rho_0 ~ \alpha_T ~ \theta'$ ) and treat salt as a
                0015 passive tracer ; without any surface forcing, the density front is expected to
                0016 flatten (GM effect) while salinity spread along isopycnal (Redi diffusion).
                0017 
                0018 The **primary** test, using input files from `input/` dir, is the simplest
                0019 one, with flat bottom, non-uniform resolution in both direction (15 levels
                0020 from 50 m to 400 m thick near the bottom and, in Y-direction, 32 grid-points
                0021 with about 10 km spacing) and stratified every-where (background
                0022 $N = 2\times 10^{-3} ~s^{-1}$, see matlab script `input/gendata.m`),
                0023 avoiding the need for tapering or clipping.<br>
                0024 It uses the skew-flux formulation of GM with same Redi and GM diffusivity (
                0025 `GM_background_K` = 1000 $m^2/s$, see: `input/data.gmredi`). Note that 10 dead
                0026 levels were added (below the bottom) to allow to use the same executable
                0027 (compiled with `Nr = 25`) for all 5 set-ups.
                0028 
                0029 The **secondary** test `input.in_p/` dir is the same as the primary test but
                0030 converted to use P-coordinates instead of height coordinates. For the purpose
                0031 of comparing P and Z coordinates, gravity and reference density `rhoNil` are
                0032 set to round number (respectively 10 and 1000) to facilitate conversions. It
                0033 uses the advective form of GM with same Redi and GM diffusivity (see:
                0034 `input.in_p/data.gmredi`).
                0035 
                0036 The **next two secondary** set-ups, `input.mxl/` and `input.bvp/` are very
                0037 similar, sharing the same binary input files from `input.mxl/` dir ; they use
                0038 the full 25 level model to represent a 10 level, 200 m thick mixed layer on
                0039 top of a stratified warm bowl of water.  The `input.mxl/` illustrates the use
                0040 of the transition-layer tapering scheme 'fm07' with the skew-flux formulation
                0041 of GM with same Redi and GM diffusivity ( `GM_background_K` = 1000 $m^2/s$,
                0042 see: `input.mxl/data.gmredi`) and a flat bottom while the secondary test
                0043 `input.bvp/` has a sloping bottom and uses the Boundary-Value Problem
                0044 (`GM_useBVP=T,` with 5 modes: `GM_BVP_modeNumber=5,`) of the GM advective form
                0045 with same Redi and GM diffusivity (see: `input.bvp/data.gmredi`). In addition,
                0046 in this later test, the sub-meso parameterization is activated
                0047 (`GM_useSubMeso=T`).
                0048 
                0049 The **last secondary** test `input.top/` shares some similarity with the previous
                0050 one (similar warm bowl, use BVP with GM advective form) except that the model
                0051 top is depressed by 50 m near the center, as it would under, e.g., a floating
                0052 ice-shelf. Also the mixed layer is thinner (60 m only) and very weakly
                0053 stratified ( $N = 10^{-6} ~s^{-1}$ ) and vertical resolution is slightly
                0054 different, reaching a maximum depth of 2.5 km (vs only 2 km in the previous 2
                0055 set-ups).
                0056 
                0057 ### Instructions:
                0058 Configure and compile the code:
                0059 
                0060 ```
                0061   cd build
                0062   ../../../tools/genmake2 -mods ../code [-of my_platform_optionFile]
                0063   make depend
                0064   make
                0065   cd ..
                0066 ```
                0067 
                0068 To run primary test:
                0069 
                0070 ```
                0071   cd run
                0072   ln -s ../input/* .
                0073   ../build/mitgcmuv > output.txt
                0074 ```
                0075 
                0076 There is comparison output in the directory:
                0077 
                0078   `results/output.txt`
                0079 
                0080 To run any of secondary `$sc` test (`$sc` in: `in_p`, `mxl`, `bvp`, `top`):
                0081 
                0082 ```
                0083   cd run
                0084   rm *
                0085   ln -s ../input.$sc/* .
                0086   ln -s ../input/* .
                0087   ./prepare_run          #- only for "bvp" test
                0088   ../build/mitgcmuv > output.txt
                0089 ```
                0090 Note that the "prepare_run" step is only needed for `bvp` test.
                0091 
                0092 There is comparison output in the directory:
                0093 
                0094   `results/output.$sc.txt`
                0095 
                0096 ### Notes:
                0097 1. **Comparison between P and Z coordinates**:
                0098 
                0099     The results from the secondary set-up `input.in_p/`, using Pressure
                0100     coordinate, can be compared to the Z-coordinate, primary set-up `input/`,
                0101     providing one uses the same `pkg/gmredi` parameters (same 'data.gmredi'),
                0102     e.g.:
                0103 
                0104     - Using GM advective form, with 'data.gmredi' from `input.in_p/` for both
                0105       runs.
                0106 
                0107     - Using the GM skew-flux form, with 'data.gmredi' from `input/` for both
                0108       runs.
                0109 
                0110     Note that, when comparing output, the vertical index `k` of 3-D variables
                0111     needs to be flipped ; the SSH (in m) comparison is between output variable
                0112     'Eta' (in-Z) and 'PHL' (in-P) divided by 10 (=gravity); and the bottom
                0113     pressure (in Pa) is between 'PHL' (in-Z) multiplied by $1000 = \rho_0$ and
                0114     'Eta' (in-P).<br>
                0115     Most of the differences (e.g., after 20 time-steps, T,S max-diff are:
                0116     $1.4\times 10^{-4}$, $2.3 \times 10^{-5}$ and RMS: $6.6 \times 10^{-5}$,
                0117     $9.6 \times 10^{-6}$ ) come from the dynamics and not from GM since without
                0118     dynamics (un-commenting line 34: `momStepping=.FALSE.,` in both set-up
                0119     `data` files) the differences are down to machine precision (RMS of T,S
                0120     diff: $1.5 \times 10^{-14}, ~ 1. \times 10^{-15}$ ).
                0121 
                0122 2. **Testing GM or Redi diffusion alone** in either of the 2 set-ups above:
                0123 
                0124     To test GM alone, without isopycnal diffusion, just un-comment:
                0125     `GM_isopycK = 0.,` in `data.gmredi`.<br>
                0126     And to test Redi diffusion alone, without GM, just set: `GM_isopycK =
                0127     1000.,` and comment out `GM_background_K` setting in `data.gmredi`. Also
                0128     changing the initial salinity to a centered patch (using file
                0129     `Sini_Patch.bin` instead of `Sini_Ydir.bin`) better illustrates the Redi
                0130     effects on a passive tracer.
                0131 
                0132 3. **Switching from a Y-Z to X-Z set-up**
                0133 
                0134     Since none of the 5 set-up use any feature specific to Y-direction, all
                0135     using 'f-plane' (`f0 = 1.E-4, beta=0`), the same set of input files could
                0136     be used by the X-Z model instead of the current Y-Z model (simply
                0137     switching `sNx,nSx,nPx` <-> `sNy,nSy,nPy` in `SIZE.h`) to produce similar
                0138     results (flipping U & V with 1 minus sign). The only minor adjustment to
                0139     input files is related to the setting of delX, delY in the parameter file
                0140     `data`, which also need to be switched, e.g., for the primary set-up:
                0141 
                0142     ```
                0143      delXfile='dy.bin',
                0144      delY=1*10.E3,
                0145     ```
                0146     instead of:
                0147 
                0148     ```
                0149      delX=1*10.E3,
                0150      delYfile='dy.bin',
                0151     ```
                0152     This may be used to verify implementation of X-fluxes versus Y-fluxes.