/[MITgcm]/MITgcm/pkg/dic/dic_surfforcing_init.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/dic_surfforcing_init.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Oct 6 20:11:10 2003 UTC (20 years, 7 months ago) by stephd
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint51o_pre, checkpoint51n_pre, checkpoint51l_post, checkpoint51q_post, checkpoint51j_post, checkpoint51o_post, checkpoint51p_post, checkpoint51i_post, checkpoint51f_post, checkpoint51h_pre, checkpoint51l_pre, checkpoint51n_post, checkpoint51i_pre, checkpoint51m_post
Branch point for: tg2-branch, checkpoint51n_branch
changes to keep current with gchem pkg, and to be adjointable

1 #include "CPP_OPTIONS.h"
2 #include "PTRACERS_OPTIONS.h"
3 #include "GCHEM_OPTIONS.h"
4
5 CStartOfInterFace
6 SUBROUTINE DIC_SURFFORCING_INIT(
7 I myThid)
8
9 C /==========================================================\
10 C | SUBROUTINE DIC_SURFFORCING |
11 C | o Calculate first guess of pH |
12 C |==========================================================|
13 IMPLICIT NONE
14
15 C == GLobal variables ==
16 #include "SIZE.h"
17 #include "DYNVARS.h"
18 #include "EEPARAMS.h"
19 #include "PARAMS.h"
20 #include "GRID.h"
21 #include "FFIELDS.h"
22 #include "DIC_ABIOTIC.h"
23 #ifdef DIC_BIOTIC
24 #include "PTRACERS.h"
25 #endif
26
27 C == Routine arguments ==
28 INTEGER myThid
29
30 #ifdef ALLOW_PTRACERS
31 C == Local variables ==
32 INTEGER I,J, kLev, it
33 C Number of iterations for pCO2 solvers...
34 C Solubility relation coefficients
35 C local variables for carbon chem
36 _RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
37 INTEGER iMin,iMax,jMin,jMax, bi, bj
38 _RL surfalk(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39 _RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
40 _RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
41
42 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
43
44 kLev=1
45
46 C =================================================================
47 DO bj=myByLo(myThid),myByHi(myThid)
48 DO bi=myBxLo(myThid),myBxHi(myThid)
49
50 jMin=1-OLy
51 jMax=sNy+OLy
52 iMin=1-OLx
53 iMax=sNx+OLx
54
55 C determine inorganic carbon chem coefficients
56 DO j=1-OLy,sNy+OLy
57 DO i=1-OLx,sNx+OLx
58
59 #ifdef DIC_BIOTIC
60 cQQQQ check ptracer numbers
61 surfalk(i,j) = PTRACER(i,j,klev,bi,bj,2)
62 & * maskC(i,j,kLev,bi,bj)
63 surfphos(i,j) = PTRACER(i,j,klev,bi,bj,3)
64 & * maskC(i,j,kLev,bi,bj)
65 #else
66 surfalk(i,j) = 2.366595 * salt(i,j,kLev,bi,bj)/gsm_s
67 & * maskC(i,j,kLev,bi,bj)
68 surfphos(i,j) = 5.1225e-4 * maskC(i,j,kLev,bi,bj)
69 #endif
70 C FOR NON-INTERACTIVE Si
71 surfsi(i,j) = 7.6838e-3 * maskC(i,j,kLev,bi,bj)
72 PTR_CO2(i,j,kLev) = PTRACER(i,j,klev,bi,bj,1)
73 & * maskC(i,j,kLev,bi,bj)
74 ENDDO
75 ENDDO
76
77 CALL CARBON_COEFFS(
78 I theta,salt,
79 I bi,bj,iMin,iMax,jMin,jMax)
80 C====================================================================
81
82 c set number of iterations for [H+] solvers
83 C set guess of pH for first step here
84
85 DO j=1-OLy,sNy+OLy
86 DO i=1-OLx,sNx+OLx
87 pH(i,j,bi,bj) = 8.0
88 ENDDO
89 ENDDO
90 print*,'QQ: pCO2 approximation method'
91 c first approxmation
92 C$TAF LOOP = parallel
93 DO j=1-OLy,sNy+OLy
94 C$TAF LOOP = parallel
95 DO i=1-OLx,sNx+OLx
96 IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN
97 C$TAF init dic_surf = static, 10
98 do it=1,10
99 C$TAF STORE pH(i,j,bi,bj), PTR_CO2(i,j,kLev) = dic_surf
100 C$TAF STORE surfalk(i,j), surfphos(i,j), surfsi(i,j) = dic_surf
101 CALL CALC_PCO2_APPROX(
102 I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj),
103 I PTR_CO2(i,j,kLev), surfphos(i,j),
104 I surfsi(i,j),surfalk(i,j),
105 I ak1(i,j,bi,bj),ak2(i,j,bi,bj),
106 I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj),
107 I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
108 I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj),
109 I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
110 U pH(i,j,bi,bj),pCO2(i,j,bi,bj) )
111 enddo
112 ENDIF
113 ENDDO
114 ENDDO
115
116 ENDDO
117 ENDDO
118 print*,'QQ first guess pH', pH(20,20,1,1), theta(20,20,1,1,1),
119 & salt(20,20,1,1,1),
120 & PTR_CO2(20,20,1), surfphos(20,20),
121 & surfsi(20,20),surfalk(20,20)
122 #endif
123 RETURN
124 END

  ViewVC Help
Powered by ViewVC 1.1.22