Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit 7fe51dd4 on 2025-03-14 19:25:07 UTC
d8c5b89513 Ivan*0001 Labrador Sea Region with Sea-Ice
                0002 =========================================
                0003 
7fe51dd492 Jean*0004 ### Primary test Overview:
d8c5b89513 Ivan*0005 This example sets up a small (20x16x23) Labrador Sea experiment
                0006 coupled to a dynamic thermodynamic sea-ice model (MITgcm Documentation 8.6.2).
                0007 
                0008 The domain of integration spans $`[280, 320]^\circ`$E and $`[46, 78]^\circ`$N.
                0009 Horizontal grid spacing is 2 degrees.
                0010 The 23 vertical levels and the bathymetry file
                0011 
                0012 ```
                0013   bathyFile      = 'bathy.labsea1979'
                0014 ```
                0015 are obtained from the the 2$`^\circ`$ ECCO configuration.
                0016 
                0017 Integration is initialized from annual-mean Levitus climatology
                0018 
                0019 ```
                0020  hydrogThetaFile = 'LevCli_temp.labsea1979'
                0021  hydrogSaltFile  = 'LevCli_salt.labsea1979'
                0022 ```
                0023 
                0024 Surface salinity relaxation is to the monthly mean Levitus climatology
                0025 
                0026 ```
                0027  saltClimFile    = 'SSS.labsea1979'
                0028 ```
                0029 
                0030 Forcing files are a 1979-1999 monthly climatology computed from the
7fe51dd492 Jean*0031 NCEP reanalysis (see [`SEAICE_PARAMS.h`](https://github.com/MITgcm/MITgcm/blob/master/pkg/seaice/SEAICE_PARAMS.h) for units and signs)
d8c5b89513 Ivan*0032 
                0033 ```
                0034   uwindFile      = 'u10m.labsea1979'  # 10-m zonal wind
                0035   vwindFile      = 'v10m.labsea1979'  # 10-m meridional wind
                0036   atempFile      = 'tair.labsea1979'  # 2-m air temperature
                0037   aqhFile        = 'qa.labsea1979'    # 2-m specific humidity
                0038   lwdownFile     = 'flo.labsea1979'   # downward longwave radiation
                0039   swdownFile     = 'fsh.labsea1979'   # downward shortwave radiation
                0040   precipFile     = 'prate.labsea1979' # precipitation
                0041 ```
                0042 
                0043 The experiment uses `pkg/gmredi`, `pkg/kpp`, `pkg/seaice`, and `pkg/exf`.
7fe51dd492 Jean*0044 The test is a 1-cpu, 10-hour integration. Both the atmospheric
d8c5b89513 Ivan*0045 state and the open-water surface fluxes are provided by `pkg/exf`.
                0046 
                0047 More `pkg/seaice` test experiments, configured for low and
                0048 high-resolution global cube-sphere domains are described
                0049 in `MITgcm_contrib/high_res_cube/README_ice`.
                0050 
7fe51dd492 Jean*0051 ### Lab Sea adjoint
d8c5b89513 Ivan*0052 The `code_ad` directory provides files required to compile the adjoint
                0053 version of this verification experiment.  This verification
                0054 experiment uses the 'divided adjoint'.
                0055 
                0056 To compile the adjoint, one must enable the divided adjoint with the
                0057 compile-time flag `USE_DIVA`, the location of which is specified in
                0058 the file `build/genmake_local`.
                0059 To wit,
                0060 
                0061 ```
                0062   USE_DIVA=1
                0063 ```
                0064 
                0065 To compile the adjoint without the divided adjoint, the compile-time
                0066 flag `ALLOW_DIVIDED_ADJOINT` in `code_ad/AUTODIFF_OPTIONS.h` should
                0067 be changed from
                0068 
                0069 ```
                0070   #define ALLOW_DIVIDED_ADJOINT
                0071 ```
                0072 to
                0073 
                0074 ```
                0075   #undef ALLOW_DIVIDED_ADJOINT
                0076 ```
                0077 
                0078 Note: `testreport` builds in the `lab_sea/build` directory which contains
                0079 this `genmake_local` file and so it knows to use the divided adjoint.
                0080 
                0081 ## Instructions
                0082 Navigate to experiment directory
                0083 
                0084 ```
                0085   cd MITgcm/verification/lab_sea
                0086 ```
                0087 
                0088 ### 1-CPU forward experiment
                0089 Configure and compile the code:
                0090 ```
                0091   cd build
                0092   ../../../tools/genmake2 -mods ../code [-of my_platform_optionFile]
7fe51dd492 Jean*0093  [make Clean]
d8c5b89513 Ivan*0094   make depend
                0095   make
                0096   cd ..
                0097 ```
                0098 
                0099 To run:
                0100 ```
                0101   cd run
                0102   ln -s ../input/* .
                0103   ln -s ../build/mitgcmuv .
                0104   ./mitgcmuv > output.txt
                0105   cd ..
                0106 ```
                0107 
                0108 There is comparison output in the directory:
                0109 ```
                0110   results/output.txt
                0111 ```
                0112 
                0113 Use matlab script `lookat_ice.m` to compare the output
                0114  with that from `checkpoint51f` sea-ice code:
                0115 ```
                0116   cd ../../../verification/lab_sea/matlab
                0117   matlab
                0118   lookat_ice
                0119 ```
                0120 
                0121 ### 2-CPU forward experiment
                0122 Configure and compile the code:
                0123 ```
                0124   cd build
                0125   ../../../tools/genmake2 -mpi -mods ../code [-of my_platform_optionFile]
                0126   ln -s ../code/SIZE.h_mpi SIZE.h
7fe51dd492 Jean*0127  [make Clean]
d8c5b89513 Ivan*0128   make depend
                0129   make
                0130   cd ..
                0131 ```
                0132 
                0133 To run:
                0134 ```
                0135   cd run
                0136   ln -s ../input/* .
                0137   mpirun -np 2 ../build/mitgcmuv
                0138   cd ..
                0139 ```
                0140 
                0141 ### 1-CPU adjoint experiment
                0142 Configure and compile the code:
                0143 ```
                0144   cd build
                0145   ../../../tools/genmake2 -mods ../code_ad [-of my_platform_optionFile]
                0146   make adall
                0147   cd ..
                0148 ```
                0149 
                0150 To run:
                0151 ```
                0152   cd run
                0153   ln -s ../input_ad/* .
7fe51dd492 Jean*0154   ../input_ad/prepare_run
d8c5b89513 Ivan*0155   ln -s ../build/mitgcmuv_ad .
                0156   ./do_run.sh
                0157   cd ..
                0158 ```
                0159 
7fe51dd492 Jean*0160 **Note:** `prepare_run` shell script is also used when running `testreport` (see below)
                0161 and could be replaced by these 2 commands:
                0162 ```
                0163   ln -s ../input/* .
                0164   ln -s ../../isomip/input_ad/ones_64b.bin .
                0165 ```
                0166 And the overly simple shell script "do_run.sh" just executes four times
d8c5b89513 Ivan*0167 (as specified in file "run_ADM_DIVA", `add_DIVA_runs = 4`) `mitgcmuv_ad`, saving
                0168 output in intermediate files "output_adm.txt.diva_0,1,2,3", plus a final time:
                0169 ```
                0170   mitgcmuv_ad > output_adm.txt
                0171 ```
                0172 where output file `output_adm.txt` can be compared with reference output:
                0173 ```
                0174   results/output_adm.txt
                0175 ```
                0176 
7fe51dd492 Jean*0177 ## Secondary tests
                0178 In addition to the primary tests described above, 5 secondary forward tests and
                0179 and 2 secondary adjoint tests can be run using the same executable as the corresponding
                0180 primary tests but with specific input parameter files (in `input.$st\` and `input_ad.$st\`).
                0181 The secondary forward tests include alternative seaice model formulations:
                0182 free-drift in `input.fd/`; using EVP and `useHB87stressCoupling` in `input.hb87/` ;
                0183 with `pkg/salt_plume` in `input.salt_plume/`;
                0184 and two other ice-free "North-Altlantic box" set-up (formerly in `verification/natl_box/`)
                0185 in `input.natl_box\` and with `pkg/longstep` in `input.longstep/`.
                0186 The secondary adjoint tests are simpler version of the primary adjoint test,
                0187 without seaice in `input_ad.noseaice/` and without seaice dynamics in `input_ad.noseaicedyn/`.
                0188 
                0189 ### Instruction to run secondary tests
d8c5b89513 Ivan*0190 Run the testscript _forward_ experiments:
                0191 
                0192 ```
                0193   cd MITgcm/verification
                0194   ./testreport -t lab_sea [-of my_platform_optionFile]
                0195 ```
                0196 
                0197 Standard testreport output, with all secondary tests:
                0198 ```
                0199 default 10  ----T-----  ----S-----  ----U-----  ----V-----  --PTR 01--  --PTR 02--  --PTR 03--  --PTR 04--  --PTR 05--
                0200 G D M    c        m  s        m  s        m  s        m  s        m  s        m  s        m  s        m  s        m  s
                0201 e p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
                0202 n n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
                0203 2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .
                0204 
7fe51dd492 Jean*0205 Y Y Y Y>11<13 16 16 16 16 16 16 14 13 13 13 16 16 16 12 14 22 16 16 16 22 16 16 16 pass  lab_sea
                0206 Y Y Y Y>12<16 16 16 16 16 16 16 16 16 13 13 16 14 16 13 16 22 16 16 16 22 16 16 16 pass  lab_sea.fd
                0207 Y Y Y Y> 4< 9 10  9  9 16 13 11  8  6  8  4  5  7  8  4  6 22  7  7  7 22  6  7  7 FAIL  lab_sea.hb87
                0208 Y Y Y Y 11 16 16 16 14 16 16 16 16 16 13 12 14 16 13 12 14 16 16 16>16<pass  lab_sea.longstep
                0209 Y Y Y Y>11<16 16 16 16 16 16 16 16 13 12 12 14 14 13 12 14 pass  lab_sea.natl_box
                0210 Y Y Y Y>13<16 16 16 16 16 16 16 14 16 14 13 14 16 14 13 16 22 16 16 16 22 16 16 16  pass  lab_sea.salt_plume
d8c5b89513 Ivan*0211 ```
                0212 
                0213 **Note:** Some differences in accuracy occur across different platforms as seen
                0214 here for secondary test "lab_sea.hb87".
                0215 
                0216 Run the testscript _adjoint_ experiments:
                0217 
                0218 ```
                0219   cd MITgcm/verification
                0220   ./testreport -t lab_sea -ad [-of my_platform_optionFile]
                0221 ```
                0222 
                0223 Standard adjoint testreport output, with all secondary tests:
                0224 ```
7fe51dd492 Jean*0225 Adjoint generated by TAF Version 6.5.1
d8c5b89513 Ivan*0226 
                0227 default    10     ----T-----  ----S-----  ----U-----  ----V-----
                0228 G D M    C  A  F        m  s        m  s        m  s        m  s
                0229 e p a R  o  d  D  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
                0230 n n k u  s  G  G  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
                0231 2 d e n  t  r  r  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .
                0232 
                0233 Y Y Y Y 16>16<16 16 14 16 16 16 16 16 16 16 16 16 14 14 16 16 16 pass  lab_sea  (e=0, w=0, lfd=1, dop=1, sm=1)
                0234 Y Y Y Y 14>15< 6 16 16 16 13 16 13 13 11 13 13 12 13 11 11 12 12 pass  lab_sea.noseaice
                0235 Y Y Y Y 16>13<16 16 16 14 16 16 13 13 16 16 16 16 14 14 16 14 16 pass  lab_sea.noseaicedyn
                0236 ```