36 |
|
|
37 |
#include "SIZE.h" |
#include "SIZE.h" |
38 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
|
c#include "EESUPPORT.h" |
|
39 |
#include "W2_EXCH2_SIZE.h" |
#include "W2_EXCH2_SIZE.h" |
40 |
#include "W2_EXCH2_TOPOLOGY.h" |
#include "W2_EXCH2_TOPOLOGY.h" |
41 |
|
|
68 |
negOne = 1. |
negOne = 1. |
69 |
IF (withSigns) negOne = -1. |
IF (withSigns) negOne = -1. |
70 |
|
|
|
IF ( useCubedSphereExchange ) THEN |
|
|
C--- using CubedSphereExchange: |
|
|
|
|
71 |
C-- First call the exchanges for the two components, ignoring the Sign |
C-- First call the exchanges for the two components, ignoring the Sign |
72 |
C note the order: vPhi,uPhi on D-grid are co-located with (u,v)_Cgrid |
C note the order: vPhi,uPhi on D-grid are co-located with (u,v)_Cgrid |
73 |
|
|
74 |
c CALL EXCH2_RX2_CUBE( vPhi, uPhi, .FALSE., 'UV', |
c CALL EXCH2_RX2_CUBE( vPhi, uPhi, .FALSE., 'Cg', |
75 |
c I OLw, OLe, OLs, OLn, myNz, |
c I OLw, OLe, OLs, OLn, myNz, |
76 |
c I exchWidthX, exchWidthY, |
c I exchWidthX, exchWidthY, |
77 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
c I EXCH_UPDATE_CORNERS, myThid ) |
78 |
c CALL EXCH2_RX2_CUBE( vPhi, uPhi, .FALSE., 'UV', |
c CALL EXCH2_RX2_CUBE( vPhi, uPhi, .FALSE., 'Cg', |
79 |
c I OLw, OLe, OLs, OLn, myNz, |
c I OLw, OLe, OLs, OLn, myNz, |
80 |
c I exchWidthX, exchWidthY, |
c I exchWidthX, exchWidthY, |
81 |
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
c I EXCH_UPDATE_CORNERS, myThid ) |
|
c CALL EXCH2_RX2_CUBE( vPhi, uPhi, .FALSE., 'UV', |
|
|
c I OLw, OLe, OLs, OLn, myNz, |
|
|
c I exchWidthX, exchWidthY, |
|
|
c I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
|
82 |
|
|
83 |
C- note: can substitute the low-level S/R calls above with: |
C- note: can substitute the low-level S/R calls above with: |
84 |
#ifdef W2_USE_R1_ONLY |
#ifdef W2_USE_R1_ONLY |
91 |
I .FALSE., myNz, myThid ) |
I .FALSE., myNz, myThid ) |
92 |
#endif |
#endif |
93 |
|
|
94 |
|
IF ( useCubedSphereExchange ) THEN |
95 |
|
C--- using CubedSphereExchange: |
96 |
|
|
97 |
C-- Then we may need to switch the signs depending on which cube face |
C-- Then we may need to switch the signs depending on which cube face |
98 |
C we are located. |
C we are located. |
99 |
|
|
101 |
DO bj = myByLo(myThid), myByHi(myThid) |
DO bj = myByLo(myThid), myByHi(myThid) |
102 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
DO bi = myBxLo(myThid), myBxHi(myThid) |
103 |
|
|
104 |
C- Now choose what to do at each edge of the halo based on which face |
C- Choose what to do at each edge of the halo based on which face we are |
105 |
C (we assume that bj is always=1) |
myTile = W2_myTileList(bi,bj) |
|
myTile = W2_myTileList(bi) |
|
106 |
myFace = exch2_myFace(myTile) |
myFace = exch2_myFace(myTile) |
107 |
|
|
108 |
C-- Loops on level index: |
C-- Loops on level index: |
195 |
ENDDO |
ENDDO |
196 |
ENDDO |
ENDDO |
197 |
|
|
|
ELSE |
|
|
C--- not using CubedSphereExchange: |
|
|
|
|
|
#ifndef AUTODIFF_EXCH2 |
|
|
CALL EXCH_RX( uPhi, |
|
|
I OLw, OLe, OLs, OLn, myNz, |
|
|
I exchWidthX, exchWidthY, |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
|
|
CALL EXCH_RX( vPhi, |
|
|
I OLw, OLe, OLs, OLn, myNz, |
|
|
I exchWidthX, exchWidthY, |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
|
|
#endif |
|
|
|
|
198 |
C--- using or not using CubedSphereExchange: end |
C--- using or not using CubedSphereExchange: end |
199 |
ENDIF |
ENDIF |
200 |
|
|