1 |
jmc |
1.4 |
C $Header: $ |
2 |
|
|
C $Name: $ |
3 |
stephd |
1.1 |
|
4 |
|
|
#include "GCHEM_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CStartOfInterface |
7 |
|
|
SUBROUTINE CFC_ATMOS( myThid ) |
8 |
jmc |
1.4 |
C *==========================================================* |
9 |
|
|
C | SUBROUTINE CFC_ATMOS |
10 |
|
|
C | o read in timeseries of atmoshperic CFC |
11 |
|
|
C *==========================================================* |
12 |
|
|
C *==========================================================* |
13 |
stephd |
1.1 |
IMPLICIT NONE |
14 |
|
|
|
15 |
|
|
C === Global variables === |
16 |
|
|
#include "SIZE.h" |
17 |
|
|
#include "EEPARAMS.h" |
18 |
|
|
#include "PARAMS.h" |
19 |
|
|
#include "CFC.h" |
20 |
|
|
|
21 |
|
|
C == Routine arguments == |
22 |
jmc |
1.4 |
C myThid - Number of this instance of CFC_ATMOS |
23 |
stephd |
1.1 |
INTEGER myThid |
24 |
|
|
CEndOfInterface |
25 |
|
|
|
26 |
jmc |
1.4 |
#ifdef ALLOW_CFC |
27 |
|
|
|
28 |
stephd |
1.1 |
C == Local variables == |
29 |
jmc |
1.4 |
integer nTimePnts, iUnit, it |
30 |
|
|
integer i,j,bi,bj |
31 |
stephd |
1.1 |
_RL year(100) |
32 |
mlosch |
1.2 |
C msgBuf :: message buffer |
33 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
34 |
stephd |
1.1 |
|
35 |
jmc |
1.4 |
C jmc: a better place to initialise those arrays would be in GCHEM_INIT_VARI |
36 |
stephd |
1.1 |
DO bj = myByLo(myThid), myByHi(myThid) |
37 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
38 |
|
|
DO j=1-OLy,sNy+OLy |
39 |
|
|
DO i=1-OLx,sNx+OLx |
40 |
jmc |
1.4 |
AtmosCFC11(i,j,bi,bj)=0. _d 0 |
41 |
|
|
AtmosCFC12(i,j,bi,bj)=0. _d 0 |
42 |
stephd |
1.1 |
ENDDO |
43 |
|
|
ENDDO |
44 |
|
|
ENDDO |
45 |
|
|
ENDDO |
46 |
jmc |
1.4 |
|
47 |
|
|
_BEGIN_MASTER( mythid ) |
48 |
|
|
|
49 |
|
|
WRITE(msgBuf,'(A)') |
50 |
mlosch |
1.2 |
& 'S/R CFC_ATMOS: reading CFC atmospheric data' |
51 |
jmc |
1.4 |
CALL PRINT_MESSAGE(msgBuf, standardMessageUnit, |
52 |
|
|
& SQUEEZE_RIGHT , myThid) |
53 |
|
|
|
54 |
stephd |
1.1 |
C read in CFC atmospheric timeseries data |
55 |
|
|
cfc_yearbeg = 31 |
56 |
stephd |
1.3 |
cfc_yearend = 98 + 1 |
57 |
stephd |
1.1 |
nTimePnts=cfc_yearend-cfc_yearbeg |
58 |
jmc |
1.4 |
C assign a free unit number as the I/O channel for this subroutine |
59 |
|
|
CALL MDSFINDUNIT( iUnit, mythid ) |
60 |
|
|
OPEN(iUnit,FILE='cfc1112.atm',STATUS='old') |
61 |
stephd |
1.1 |
C skip 6 descriptor lines |
62 |
|
|
DO i =1,6 |
63 |
jmc |
1.4 |
READ(iUnit,*) |
64 |
stephd |
1.1 |
ENDDO |
65 |
|
|
C Read in CFC11 and CFC12, N and S Hemisphere time histories |
66 |
|
|
DO it = 1,nTimePnts |
67 |
jmc |
1.4 |
READ(iUnit,*) year(it),ACFC11(it,1),ACFC12(it,1), |
68 |
stephd |
1.1 |
& ACFC11(it,2),ACFC12(it,2) |
69 |
jmc |
1.4 |
WRITE(msgBuf,'(A,4F8.2)') |
70 |
mlosch |
1.2 |
& 'year,acfc11_n,acfc12_n,acfc11_s,acfc12_s =', |
71 |
stephd |
1.1 |
& ACFC11(it,1),ACFC12(it,1), |
72 |
|
|
& ACFC11(it,2),ACFC12(it,2) |
73 |
mlosch |
1.2 |
CALL PRINT_MESSAGE(msgBuf, standardMessageUnit, |
74 |
jmc |
1.4 |
& SQUEEZE_RIGHT , myThid) |
75 |
stephd |
1.1 |
|
76 |
|
|
ENDDO |
77 |
jmc |
1.4 |
CLOSE(iUnit) |
78 |
|
|
|
79 |
stephd |
1.1 |
_END_MASTER(myThid) |
80 |
|
|
|
81 |
jmc |
1.4 |
C-- Everyone else must wait for the parameters to be loaded |
82 |
|
|
_BARRIER |
83 |
stephd |
1.1 |
|
84 |
jmc |
1.4 |
#endif /* ALLOW_CFC */ |
85 |
stephd |
1.1 |
|
86 |
|
|
RETURN |
87 |
|
|
END |