*ID ORH0F406
*/ U.M. 4.6 unix / source code change form / header   version 06/01/99
*/ CODE WRITERS MUST READ THE ACCOMPANYING INSTRUCTIONS FOR THIS BUILD:
*/  - See http://fr0800/umdoc/hegui/t3e4.6.html#chgfinst
*/ 
*/SOC:-> Correct the unconditional use of ice model code
*/->: Protect calls to SWAPBOUNDS which are only relevant
*/    when the ice model is switched on AND certain diagnostics
*/    are requested. Also dimenstion associated array CARYSALT 
*/    conditionally to avoid wasting memory.
*/-> applicable to UM version 4.5
*/
*/ Has an entry been lodged in the Problem Reporting System? [Y|N]      
*/
*/ THIS CODE IS INTENDED FOR INCLUSION IN THE 4.6 BUILD      [Y]
*/ .....................................................................
*/   Author[s]:-> E-mail:-> rshill@meto.gov.uk 
*/ Reviewer[s]:-> E-mail:-> @meto.gov.uk
*/
*/    "I have checked this change. When provided, the advance design 
*/  specification was agreed and adequate, and the new code conforms to
*/  Unified Model standards."
*/
*/  DESIGN SPEC. WAS REVIEWED ON: ......      REVIEWER[S] SIGNATURES
*/                                            ----------------------
*/    DATE CODE REVIEWED: ......
*/  .....................................................................
*/
*/  WILL CHANGES AFFECT ANCILLARY FILES?         [N]
*/  ARE ANY CHANGES TO STASHMASTER FILES NEEDED? [N] 
*/  USER INTERFACE ACTION REQUIRED?              [N]
*/ 
*/  TESTED IN CONFIGURATIONS:-> Ocean (LAM atlantic)
*/  TESTS RUN BY [PERSON]:->
*/ 
*/  WILL THE CHANGES SLOW DOWN THE MODEL?        [N]
*/  -> Will speed up very slightly or at worst remain the same
*/     depending on presence of ice model.
*/  CHANGES WILL INCREASE MEMORY CONSUMPTION?    [N]   
*/  -> Will reduce memory consumption in the routine OSWAPDIAGS
*/     if no ice model.
*/
*/ | Re-start dumps bit compare with those created without the change 
*/ V MARK [Y| ] BELOW; leave rest of lines untouched.
*/
*/   Control Code    loses bit comparison
*/   Atmosphere (assuming same science options chosen)   loses b.c.
*/   Ocean       loses bit comparison
*/   Wave        loses bit comparison
*/   Reconfiguration   loses bit comparison
*/   Diagnostics      lose bit comparison
*/ For Y2K compliance checking:  
*/ DOES THIS CHANGE INTERACT WITH DATE CALCULATIONS IN ANY WAY? [N]   
*/ 
*/  SECTIONS (TO BE) CHANGED:
*/
*/  SECTIONS (TO BE) DELETED? 
*/
*/  NEW SECTIONS?  Fill in form http://www-hc/~hadmk/STASHmaster_change.html,
*/  and give section numbers below:
*/  
*/  *DEFS ADDED OR REMOVED: 
*/
*/  **Existing** decks being changed [with *I, *D, *B directives]
*/ -> OSWAPDIA
*/
*/  Decks being created or purged [with *DECK, *COMDECK, *PURGEDK]
*/ *......K  Deck name   Section#.vr
*/ -> 
*/ ......................................................................
*/ ANY REFERENCES TO EXTERNAL DOCUMENTS-> instead of design spec.
*/  ...OR ... ADVANCE DESIGN SPECIFICATION (optional) 
*/ ->    
*//////////////////////////////////////////////////////////////////////// 
*/
*/ Move unprotected ice model related SWAPBOUNDS calls to 
*/ a more appropriate position to ensure they are only
*/ called when needed. Also conditionally dimension
*/ CARYSALT which is only fully dimensioned when ice model
*/ is included.
*/ The net effect of all this is that timing figures
*/ from runs which dont need any of the diagnostics in
*/ OSWAPDIAG are not distorted by needless barriers
*/ and unwanted subroutine calls plus we save
*/ a bit of memory.
*/
*/ R. Hill   March 1999.
*/
*DECLARE OSWAPDIA
*D OOM1F405.718 
      REAL CARYSALT(IMT_ICE,JMT_ICE)
     &    ,OCEANHEATFLUX(IMT,JMT)
*D OOM1F405.741,OOM1F405.742
*I OSWAPDIA.250
         CALL SWAPBOUNDS(CARYSALT,IMT,JMT,O_EW_HALO,O_NS_HALO,1)             
         CALL SWAPBOUNDS(OCEANHEATFLUX,IMT,JMT,O_EW_HALO,O_NS_HALO,1)     
