3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
5 |
|
|
6 |
|
CBOP |
7 |
|
C !ROUTINE: INI_CG2D |
8 |
|
C !INTERFACE: |
9 |
SUBROUTINE INI_CG2D( myThid ) |
SUBROUTINE INI_CG2D( myThid ) |
|
C /==========================================================\ |
|
|
C | SUBROUTINE INI_CG2D | |
|
|
C | o Initialise 2d conjugate gradient solver operators. | |
|
|
C |==========================================================| |
|
|
C | These arrays are purely a function of the basin geom. | |
|
|
C | We set then here once and them use then repeatedly. | |
|
|
C \==========================================================/ |
|
|
IMPLICIT NONE |
|
10 |
|
|
11 |
|
C !DESCRIPTION: \bv |
12 |
|
C *==========================================================* |
13 |
|
C | SUBROUTINE INI_CG2D |
14 |
|
C | o Initialise 2d conjugate gradient solver operators. |
15 |
|
C *==========================================================* |
16 |
|
C | These arrays are purely a function of the basin geom. |
17 |
|
C | We set then here once and them use then repeatedly. |
18 |
|
C *==========================================================* |
19 |
|
C \ev |
20 |
|
|
21 |
|
C !USES: |
22 |
|
IMPLICIT NONE |
23 |
C === Global variables === |
C === Global variables === |
24 |
#include "SIZE.h" |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
32 |
#include "OBCS.h" |
#include "OBCS.h" |
33 |
#endif |
#endif |
34 |
|
|
35 |
|
C !INPUT/OUTPUT PARAMETERS: |
36 |
C === Routine arguments === |
C === Routine arguments === |
37 |
C myThid - Thread no. that called this routine. |
C myThid - Thread no. that called this routine. |
38 |
INTEGER myThid |
INTEGER myThid |
39 |
|
|
40 |
|
C !LOCAL VARIABLES: |
41 |
C === Local variables === |
C === Local variables === |
42 |
C xG, yG - Global coordinate location. |
C xG, yG - Global coordinate location. |
43 |
C zG |
C zG |
54 |
_RS myNorm |
_RS myNorm |
55 |
_RL sumArea |
_RL sumArea |
56 |
_RL aC, aCw, aCs |
_RL aC, aCw, aCs |
57 |
|
CEOP |
58 |
|
|
59 |
C-- Initialise -Boyancy at surface level : Bo_surf |
C-- Initialize arrays in common blocs (CG2D.h) ; not really necessary |
60 |
C Bo_surf is defined as d/dr(Phi_surf) and set to g/rtoz (linear free surface) |
C but safer when EXCH do not fill all the overlap regions. |
61 |
C with rtoz = conversion factor from r-unit to z-unit (=horiVertRatio) |
DO bj=myByLo(myThid),myByHi(myThid) |
62 |
C an acurate formulation will include P_surf and T,S_surf effects on rho_surf: |
DO bi=myBxLo(myThid),myBxHi(myThid) |
63 |
C z-ocean (rtoz=1) : Bo_surf = - Boyancy = gravity * rho_surf/rho_0 |
DO J=1-OLy,sNy+OLy |
64 |
C p-atmos (rtoz=rho_c*g) : Bo_surf = (1/rho)_surf |
DO I=1-OLx,sNx+OLx |
65 |
C-- |
aW2d(I,J,bi,bj) = 0. _d 0 |
66 |
IF ( buoyancyRelation .EQ. 'ATMOSPHERIC' ) THEN |
aS2d(I,J,bi,bj) = 0. _d 0 |
67 |
DO bj=myByLo(myThid),myByHi(myThid) |
pW(I,J,bi,bj) = 0. _d 0 |
68 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
pS(I,J,bi,bj) = 0. _d 0 |
69 |
DO J=1-Oly,sNy+Oly |
pC(I,J,bi,bj) = 0. _d 0 |
70 |
DO I=1-Olx,sNx+Olx |
cg2d_q(I,J,bi,bj) = 0. _d 0 |
|
Bo_surf(I,J,bi,bj) = recip_rhoConst |
|
|
recip_Bo(I,J,bi,bj) = rhoConst |
|
|
ENDDO |
|
|
ENDDO |
|
71 |
ENDDO |
ENDDO |
72 |
ENDDO |
ENDDO |
73 |
ELSE |
DO J=1-1,sNy+1 |
74 |
C- gBaro = gravity (except for External mode test with reduced gravity) |
DO I=1-1,sNx+1 |
75 |
DO bj=myByLo(myThid),myByHi(myThid) |
cg2d_r(I,J,bi,bj) = 0. _d 0 |
76 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
cg2d_s(I,J,bi,bj) = 0. _d 0 |
|
DO J=1-Oly,sNy+Oly |
|
|
DO I=1-Olx,sNx+Olx |
|
|
Bo_surf(I,J,bi,bj) = gBaro |
|
|
recip_Bo(I,J,bi,bj) = 1. _d 0 / gBaro |
|
|
ENDDO |
|
|
ENDDO |
|
77 |
ENDDO |
ENDDO |
78 |
ENDDO |
ENDDO |
79 |
ENDIF |
ENDDO |
80 |
|
ENDDO |
|
C-- Update overlap regions |
|
|
_EXCH_XY_R8(Bo_surf, myThid) |
|
|
_EXCH_XY_R8(recip_Bo, myThid) |
|
81 |
|
|
82 |
C-- Initialise laplace operator |
C-- Initialise laplace operator |
83 |
C aW2d: integral in Z Ax/dX |
C aW2d: integral in Z Ax/dX |
190 |
ENDDO |
ENDDO |
191 |
ENDDO |
ENDDO |
192 |
ENDDO |
ENDDO |
193 |
c WRITE(0,*) ' mythid, sumArea = ', mythid, sumArea |
c WRITE(*,*) ' mythid, sumArea = ', mythid, sumArea |
194 |
_GLOBAL_SUM_R8( sumArea, myThid ) |
_GLOBAL_SUM_R8( sumArea, myThid ) |
195 |
C- convert Target-Residual (in W unit) to cg2d-solver residual unit [m^2/s^2] |
C- convert Target-Residual (in W unit) to cg2d-solver residual unit [m^2/s^2] |
196 |
cg2dTolerance = cg2dNorm * cg2dTargetResWunit |
cg2dTolerance = cg2dNorm * cg2dTargetResWunit |
197 |
& * sumArea / deltaTMom |
& * sumArea / deltaTMom |
198 |
WRITE(0,'(2A,1P2E22.14)') ' ini_cg2d: ', |
WRITE(*,'(2A,1P2E22.14)') ' ini_cg2d: ', |
199 |
& 'sumArea,cg2dTolerance =', sumArea,cg2dTolerance |
& 'sumArea,cg2dTolerance =', sumArea,cg2dTolerance |
200 |
ENDIF |
ENDIF |
201 |
|
|