74 | | In |
| 74 | In `PARAM` make a copy of `gcm.def_96x95_AP` to `gcm.def_96x95_AP_SWZ` and add the following lines at the end: |
| 75 | {{{ |
| 76 | ## Schwarz coupling parameters from config.card |
| 77 | ## number of schwarz iterations |
| 78 | mswr= 001 |
| 79 | ## write output at schwarz iteration number ksout |
| 80 | ksout= 001 |
| 81 | ## first all physics iteration |
| 82 | kall= 001 |
| 83 | ## frequency of coupling in seconds |
| 84 | ncplfrq= 86400 |
| 85 | }}} |
| 86 | |
| 87 | As a test, run the model with `mswr=1`, `ksout=1`, `kall=1` and `ncplfrq=<frequency of coupling of initial code>`. |
| 88 | |
| 89 | It should give you the same resultst with both Schwarz modifications in NEMO and LMDZ than with the initial code. |
| 90 | |
| 91 | == Additional modifications for better integration of config files and Schwarz iterations == |
| 92 | |
| 93 | Now that everything is fine you can make these changes to `config.card`, `namelist_ORCA2_cfg` and `gcm.def_96x95_AP_SWZ`. |
| 94 | |
| 95 | In `config.card` add these lines to the `[UserChoices]` section: |
| 96 | {{{ |
| 97 | ##D-- Schwarz iterations parameters - |
| 98 | ## number of schwarz iterations |
| 99 | mswr= 010 |
| 100 | ### write output at schwarz iteration number ksout |
| 101 | ksout= 010 |
| 102 | ### first all physics iteration |
| 103 | kall= 001 |
| 104 | ### frequency of coupling in seconds (maybe it could be read from oasis.card) |
| 105 | ncplfrq= 3600 |
| 106 | }}} |
| 107 | |
| 108 | The goal is to make these parameters global for NEMO and LMDZ. |
| 109 | |
| 110 | In `namelist_ORCA2_cfg` replace the values by `_AUTOBLOCKER_`: |
| 111 | {{{ |
| 112 | mswr = _AUTOBLOCKER_ ! number of scwharz iterations |
| 113 | ksout = _AUTOBLOCKER_ ! Schwarz iteration for output |
| 114 | kall = _AUTOBLOCKER_ ! first iteration with all physics |
| 115 | ncplfrq = _AUTOBLOCKER_ ! coupling frequency in seconds |
| 116 | }}} |
| 117 | |
| 118 | In `gcm.def_96x95_AP_SWZ` do the same: |
| 119 | {{{ |
| 120 | ## Schwarz coupling parameters from config.card |
| 121 | ## number of schwarz iterations |
| 122 | mswr= _AUTOBLOCKER_ |
| 123 | ## write output at schwarz iteration number ksout |
| 124 | ksout= _AUTOBLOCKER_ |
| 125 | ## first all physics iteration |
| 126 | kall= _AUTOBLOCKER_ |
| 127 | ## frequency of coupling in seconds |
| 128 | ncplfrq= _AUTOBLOCKER_ |
| 129 | }}} |
| 130 | |
| 131 | Now we will modify the NEMO and LMDZ driver files to set the values in both files with `config.card` values. |
| 132 | |
| 133 | In `DRIVER/opa9.card` add these lines for Schwarz in the Update function: |
| 134 | {{{ |
| 135 | IGCM_comp_modifyNamelist blocker namelist_cfg nn_leapy ${OPA_NLEAPY} |
| 136 | # Schwarz parameters from config.card |
| 137 | IGCM_comp_modifyNamelist blocker namelist_cfg mswr ${config_UserChoices_mswr} |
| 138 | IGCM_comp_modifyNamelist blocker namelist_cfg ksout ${config_UserChoices_ksout} |
| 139 | IGCM_comp_modifyNamelist blocker namelist_cfg kall ${config_UserChoices_kall} |
| 140 | IGCM_comp_modifyNamelist blocker namelist_cfg ncplfrq ${config_UserChoices_ncplfrq} |
| 141 | }}} |
| 142 | |
| 143 | In `DRIVERlmdz.card` add these lines in the Update function: |
| 144 | {{{ |
| 145 | # guide.def : Activate nudging if ok_guide=y set in lmdz.card |
| 146 | if [ ! X${lmdz_UserChoices_ok_guide} = X ] ; then |
| 147 | IGCM_comp_modifyDefFile nonblocker guide.def ok_guide ${lmdz_UserChoices_ok_guide} |
| 148 | else |
| 149 | IGCM_comp_modifyDefFile nonblocker guide.def ok_guide n |
| 150 | fi |
| 151 | |
| 152 | # gcm.def : set schwarz parameters from config.card |
| 153 | IGCM_comp_modifyNamelist blocker gcm.def mswr ${config_UserChoices_mswr} |
| 154 | IGCM_comp_modifyNamelist blocker gcm.def ksout ${config_UserChoices_ksout} |
| 155 | IGCM_comp_modifyNamelist blocker gcm.def kall ${config_UserChoices_kall} |
| 156 | IGCM_comp_modifyNamelist blocker gcm.def ncplfrq ${config_UserChoices_ncplfrq} |
| 157 | }}} |