116 | | The routines used to store and restore a state are all in `schwarz.F90` which is a new subroutine. |
117 | | |
118 | | The storing is done just before the schwarz looping is done: inside `iswloop` loop, before `kswr` loop. |
119 | | Like this we are sure to store the initial condition of a schwarz loop. |
120 | | |
| 116 | The routines used to store and restore a state are all in `schwarz.F90` which is a new module. |
| 117 | |
| 118 | The storing is done just before the schwarz looping is done: inside the `iswloop` loop, before the `kswr` loop. |
| 119 | |
| 120 | Like this we are certain to store the initial condition for a Schwarz loop. |
| 121 | |
| 122 | The restoring is done at the beginning of the `kswr` loop before the `istp` loop. |
| 123 | If we are not in the first iteration the variables state is restored: |
| 124 | {{{ |
| 125 | IF ( kswr > 1 ) CALL swz_reinit(istp) ! reset Ocean state to first time step for new schwarz iteration |
| 126 | }}} |
| 127 | |
| 128 | `Unfortunately this is not the only place variables are stored and restored!` |
| 129 | |
| 130 | Because NEMO is modular some implementation details are repeated in the modules some modules have their own storing and restoring details. |
| 131 | |
| 132 | The files concerned are: |
| 133 | {{{ |
| 134 | sbcmod.F90 |
| 135 | sbcrnf.F90 |
| 136 | traqsr.F90 |
| 137 | trasbc.F90 |
| 138 | }}} |
| 139 | |
| 140 | == Coding details: modification of other files == |
| 141 | |
| 142 | The routines: |
| 143 | {{{ |
| 144 | iom.F90 |
| 145 | step.F90 |
| 146 | }}} |
| 147 | have been modified to output only one time serie for a set of Schwarz loops. The parameter `ksout` selects which Schwarz loop is given for outputs. |
| 148 | |
| 149 | Some routines have a particular behavior when `istp=nit000` or/and `istp=nitend`. They where modified to behave correctly when doing Schwarz iterations: |
| 150 | {{{ |
| 151 | closea.F90 |
| 152 | diaar5.F90 |
| 153 | diafwb.F90 |
| 154 | diahth.F90 |
| 155 | dynspg_ts.F90 |
| 156 | dynvor.F90 |
| 157 | fldread.F90 |
| 158 | limdyn.F90 |
| 159 | limitd_me.F90 |
| 160 | limrst.F90 |
| 161 | limthd.F90 |
| 162 | limtrp.F90 |
| 163 | limupdate1.F90 |
| 164 | limupdate2.F90 |
| 165 | restart.F90 |
| 166 | sbcblk_core.F90 |
| 167 | sbcice_lim.F90 |
| 168 | sbcssm.F90 |
| 169 | stpctl.F90 |
| 170 | traadv_eiv.F90 |
| 171 | traadv_tvd.F90 |
| 172 | trazdf_imp.F90 |
| 173 | zdftke.F90 |
| 174 | zdftmx.F90 |
| 175 | }}} |
| 176 | |
| 177 | Some other routines which are not compiled have also been modified for the sake of consistency. These are the routines relative to PISCES present in `ORCA1_LIM3_PISCES/MY_SRC` which get copied in `ORCA2_LIM3_PISCES`. |
| 178 | |
| 179 | They are: |
| 180 | {{{ |
| 181 | p4zflx.F90 |
| 182 | p4zsed.F90 |
| 183 | p4zsms.F90 |
| 184 | trcrst.F90 |
| 185 | trcsms_age.F90 |
| 186 | trcsms_cfc.F90 |
| 187 | trcstp.F90 |
| 188 | trcwri.F90 |
| 189 | }}} |
| 190 | |
| 191 | You will need these updates if you want to add PISCES support to the Schwarz algorithm. |
| 192 | |
| 193 | Lastly, but much more important, some files have been modified to declare the variables needed to store the parameters of the Schwarz algorithm and the storing/restoring variables. |
| 194 | |
| 195 | The parameters are in: |
| 196 | {{{ |
| 197 | in_out_manager.F90 |
| 198 | }}} |
| 199 | and read in |
| 200 | {{{ |
| 201 | domain.F90 |
| 202 | }}} |
| 203 | |
| 204 | |
| 205 | The "Schwarz fields" named with `_s` appended at the end of the original variable name are defined in these subroutines: |
| 206 | {{{ |
| 207 | dom_oce.F90 |
| 208 | dynspg_oce.F90 |
| 209 | ice.F90 |
| 210 | limdiahsb.F90 |
| 211 | oce.F90 |
| 212 | sbc_oce.F90 |
| 213 | sbcrnf.F90 |
| 214 | zdf_oce.F90 |
| 215 | zdftke.F90 |
| 216 | }}} |