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

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

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


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

  ViewVC Help
Powered by ViewVC 1.1.22