/[MITgcm]/MITgcm/pkg/cfc/cfc12_forcing.F
ViewVC logotype

Contents of /MITgcm/pkg/cfc/cfc12_forcing.F

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


Revision 1.12 - (show annotations) (download)
Mon Jun 10 02:52:57 2013 UTC (10 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.11: +105 -72 lines
update of pkg/cfc:
- put arguments in standard order: myTime, myIter, myThid
- use standard S/R GET_PERIODIC_INTERVAL for time interpolation of
  atmospheric CFC ; fix for the case myIter < PTRACERS_iter0.
- improve report of atmospheric CFC values.
- fix calculation of surface tendencies for partial-cell and/or Non-Lin Free-Surf

1 C $Header: /u/gcmpack/MITgcm/pkg/cfc/cfc12_forcing.F,v 1.11 2013/06/07 15:43:31 jmc Exp $
2 C $Name: $
3
4 C modified for external_forcing_DIC.F August 1999
5 C
6 C modified swd Oct 01 and Feb 02, for use as package for c40_patch1
7 C modified to use with c44 and ptracers: swd May 2002
8 C modified to have carbonate and biological influences: swd June 2002
9 C modified for cfc: swd Sep 2003
10
11 #include "GCHEM_OPTIONS.h"
12 #define OCMIP_GRAD
13 #undef STEPH_GRAD
14
15 CBOP
16 C !ROUTINE: CFC12_FORCING
17 C !INTERFACE:
18 SUBROUTINE CFC12_FORCING(
19 I pTr_CFC12,
20 U gCFC12,
21 I bi, bj, iMin, iMax, jMin, jMax,
22 I myTime, myIter, myThid )
23
24 C !DESCRIPTION:
25 C *==========================================================*
26 C | SUBROUTINE CFC12_FORCING
27 C | o Calculate the changes to CFC12 through air-sea fluxes
28 C *==========================================================*
29
30 C !USES:
31 IMPLICIT NONE
32
33 C == GLobal variables ==
34 #include "SIZE.h"
35 #include "EEPARAMS.h"
36 #include "PARAMS.h"
37 #include "GRID.h"
38 #include "CFC.h"
39 #include "CFC_ATMOS.h"
40
41 C !INPUT/OUTPUT PARAMETERS:
42 C pTr_CFC12 :: ocean CFC12 concentration
43 C gCFC12 :: CFC12 tendency
44 C bi, bj :: current tile indices
45 C iMin,iMax :: computation domain, 1rst index bounds
46 C jMin,jMax :: computation domain, 2nd index bounds
47 C myTime :: current time in simulation
48 C myIter :: current iteration number
49 C myThid :: my Thread Id number
50 _RL pTr_CFC12(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
51 _RL gCFC12(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
52 INTEGER bi, bj
53 INTEGER iMin, iMax, jMin, jMax
54 _RL myTime
55 INTEGER myIter
56 INTEGER myThid
57 CEOP
58
59 #ifdef ALLOW_PTRACERS
60 #ifdef ALLOW_CFC
61 C !FUNCTIONS:
62 LOGICAL DIFFERENT_MULTIPLE
63 EXTERNAL DIFFERENT_MULTIPLE
64
65 C !LOCAL VARIABLES:
66 C AtmosCFC12 :: atmospheric CFC12 field
67 C fluxCFC12 :: air-sea CFC12 fluxes
68 C msgBuf :: message buffer
69 _RL fluxCFC12(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
70 _RL AtmosCFC12(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
71 INTEGER i, j
72 INTEGER intimeP, intime0, intime1, iRec0, iRec1
73 _RL cfcTime, aWght, bWght
74 _RL ACFC12north, ACFC12south
75 _RL recip_dLat, weight
76 CHARACTER*(MAX_LEN_MBUF) msgBuf
77 #ifdef STEPH_GRAD
78 _RL a1, a2
79 #endif
80
81 C-- Find atmospheric CFC :
82 C assume that cfcTime=0 corresponds to the beginning of the 1rst record
83 C time-period. This is consistent with 1rst record value = time-averaged
84 C atmos-CFC over time period: cfcTime= 0 to cfcTime= 1 x atmCFC_recSepTime
85 C---------------------------
86 cfcTime = myTime + atmCFC_timeOffset
87 CALL GET_PERIODIC_INTERVAL(
88 O intimeP, intime0, intime1, bWght, aWght,
89 I zeroRL, atmCFC_recSepTime,
90 I deltaTclock, cfcTime, myThid )
91 iRec0 = MAX( 1, MIN( ACFCnRec, intime0 ) )
92 iRec1 = MAX( 1, MIN( ACFCnRec, intime1 ) )
93 ACFC12north = ACFC12( iRec0, 1 )*bWght
94 & + ACFC12( iRec1, 1 )*aWght
95 ACFC12south = ACFC12( iRec0, 2 )*bWght
96 & + ACFC12( iRec1, 2 )*aWght
97
98 C- Print to check:
99 IF ( DIFFERENT_MULTIPLE( CFC_monFreq, myTime, deltaTClock )
100 & .AND. bi*bj.EQ.1 ) THEN
101 WRITE(msgBuf,'(A,6X,I10,I6,F9.4,F7.1)')
102 & 'CFC12_FORCING: iter,rec0,w0,yr0 =', myIter,
103 & intime0, bWght, ACFCyear(iRec0)
104 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
105 & SQUEEZE_RIGHT, myThid )
106 WRITE(msgBuf,'(A,1PE16.7,I6,0PF9.4,F7.1)')
107 & 'CFC12_FORCING: cfcT,rec1,w1,yr1 =', cfcTime,
108 & intime1, aWght, ACFCyear(iRec1)
109 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
110 & SQUEEZE_RIGHT, myThid )
111 WRITE(msgBuf,'(2(A,F14.6))')
112 & 'CFC12_FORCING: aCFC12_N =', ACFC12north,
113 & ' , aCFC12_S =', ACFC12south
114 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
115 & SQUEEZE_RIGHT, myThid )
116 ENDIF
117
118 C-- Provide gradient between N and S values
119 #ifdef STEPH_GRAD
120 C STEPH S INITIAL VERSION
121 DO j=1-OLy,sNy+OLy
122 DO i=1-OLx,sNx+OLx
123 if ((j.gt.int(sNy/2)+3.and.j.le.sNy).or.j.lt.1) then
124 AtmosCFC12(i,j)=ACFC12north
125 endif
126 if (j.ge.int(sNy/2)-3.and.j.le.int(sNy/2)+3) then
127 a1=(float(j-int(sNy/2)+3)+.5)/7
128 a2=1.d0-a1
129 AtmosCFC12(i,j)=a1*ACFC12south +
130 & a2*ACFC12north
131 endif
132 if ((j.lt.int(sNy/2)-3.and.j.gt.0).or.j.gt.sNy) then
133 AtmosCFC12(i,j)=ACFC12south
134 endif
135 ENDDO
136 ENDDO
137 #endif
138 #ifdef OCMIP_GRAD
139 C- OCMIP VERSION
140 C between N & S lat boundaries, do linear interpolation ; and
141 C beyond N or S lat boundaries, just take the hemispheric value
142 recip_dLat = 1. _d 0 / ( atmCFC_yNorthBnd - atmCFC_ySouthBnd )
143 DO j=1-OLy,sNy+OLy
144 DO i=1-OLx,sNx+OLx
145 weight = ( yC(i,j,bi,bj) - atmCFC_ySouthBnd )*recip_dLat
146 weight = MAX( zeroRL, MIN( oneRL, weight ) )
147 AtmosCFC12(i,j)= weight * ACFC12north
148 & + ( oneRL - weight )*ACFC12south
149
150 ENDDO
151 c print*,'QQ cfc12', j, ATMOSCFC12(1,j,bi,bj)
152 ENDDO
153 #endif
154 C-- cfc12 air-sea fluxes
155 CALL CFC12_SURFFORCING(
156 I pTr_CFC12, AtmosCFC12,
157 O fluxCFC12,
158 I bi, bj, iMin, iMax, jMin, jMax,
159 I myTime, myIter, myThid )
160
161 C-- update surface tendencies
162 DO j=jMin,jMax
163 DO i=iMin,iMax
164 gCFC12(i,j,1) = gCFC12(i,j,1)
165 c & + fluxCFC12(i,j)*recip_drF(1)*maskC(i,j,1,bi,bj)
166 & + fluxCFC12(i,j)*recip_drF(1)*recip_hFacC(i,j,1,bi,bj)
167 ENDDO
168 ENDDO
169
170 #endif /* ALLOW_CFC */
171 #endif /* ALLOW_PTRACERS */
172
173 RETURN
174 END

  ViewVC Help
Powered by ViewVC 1.1.22