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

Annotation of /MITgcm/pkg/cfc/cfc_atmos.F

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


Revision 1.5 - (hide annotations) (download)
Mon Jun 10 02:51:47 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.4: +90 -45 lines
- more flexible reading of Atmos CFC (number of records no longer hard-coded)
- move in separated header file (CFC_ATMOS.h) time-serie arrays of Atmos CFC

1 jmc 1.5 C $Header: /u/gcmpack/MITgcm/pkg/cfc/cfc_atmos.F,v 1.4 2006/08/02 22:51:24 jmc Exp $
2 jmc 1.4 C $Name: $
3 stephd 1.1
4     #include "GCHEM_OPTIONS.h"
5    
6 jmc 1.5 CBOP
7     C !ROUTINE: CFC_ATMOS
8     C !INTERFACE:
9 stephd 1.1 SUBROUTINE CFC_ATMOS( myThid )
10 jmc 1.5
11     C !DESCRIPTION: \bv
12 jmc 1.4 C *==========================================================*
13     C | SUBROUTINE CFC_ATMOS
14 jmc 1.5 C | o read in time-series of atmoshperic CFC
15 jmc 1.4 C *==========================================================*
16 jmc 1.5
17     C !USES:
18 stephd 1.1 IMPLICIT NONE
19    
20     C === Global variables ===
21     #include "SIZE.h"
22     #include "EEPARAMS.h"
23     #include "PARAMS.h"
24     #include "CFC.h"
25 jmc 1.5 #include "CFC_ATMOS.h"
26 stephd 1.1
27 jmc 1.5 C !INPUT/OUTPUT PARAMETERS:
28     C === Routine arguments ===
29     C myThid :: My Thread Id. number
30 stephd 1.1 INTEGER myThid
31 jmc 1.5 CEOP
32 stephd 1.1
33 jmc 1.4 #ifdef ALLOW_CFC
34 jmc 1.5 C !FUNCTIONS:
35     INTEGER ILNBLNK
36     EXTERNAL ILNBLNK
37 jmc 1.4
38 jmc 1.5 C !LOCAL VARIABLES:
39 mlosch 1.2 C msgBuf :: message buffer
40 jmc 1.5 INTEGER iUnit, i, it, iL
41     LOGICAL exst
42     _RL tmpVar(5)
43 mlosch 1.2 CHARACTER*(MAX_LEN_MBUF) msgBuf
44 stephd 1.1
45 jmc 1.5 _BEGIN_MASTER( myThid )
46 jmc 1.4
47 jmc 1.5 C read in CFC atmospheric timeseries data
48     iL = ILNBLNK(atmCFC_inpFile)
49     IF ( iL.EQ.0 ) THEN
50     WRITE(msgBuf,'(A)')
51     & 'CFC_ATMOS: File-name missing for atmos CFC time-series'
52     CALL PRINT_ERROR( msgBuf, myThid )
53     STOP 'ABNORMAL END: S/R CFC_ATMOS'
54     ENDIF
55     INQUIRE( FILE=atmCFC_inpFile(1:iL), EXIST=exst )
56     IF (exst) THEN
57     WRITE(msgBuf,'(3A)')
58     & 'CFC_ATMOS: opening file "', atmCFC_inpFile(1:iL), '"'
59     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
60     & SQUEEZE_RIGHT, myThid )
61     ELSE
62     WRITE(msgBuf,'(3A)')
63     & 'CFC_ATMOS: File "', atmCFC_inpFile(1:iL),'" does not exist!'
64     CALL PRINT_ERROR( msgBuf, myThid )
65     STOP 'ABNORMAL END: S/R CFC_ATMOS'
66     ENDIF
67 jmc 1.4
68     C assign a free unit number as the I/O channel for this subroutine
69 jmc 1.5 CALL MDSFINDUNIT( iUnit, myThid )
70     OPEN(iUnit,FILE=atmCFC_inpFile(1:iL),STATUS='old')
71 stephd 1.1 C skip 6 descriptor lines
72     DO i =1,6
73 jmc 1.5 READ(iUnit,*)
74 stephd 1.1 ENDDO
75     C Read in CFC11 and CFC12, N and S Hemisphere time histories
76 jmc 1.5 it = 0
77     DO WHILE ( it.LE.ACFCrecSize )
78     READ(iUnit,*,END=1001) (tmpVar(i),i=1,5)
79     it = it + 1
80     IF ( it .LE. ACFCrecSize ) THEN
81     ACFCyear(it) = tmpVar(1)
82     ACFC11(it,1) = tmpVar(2)
83     ACFC12(it,1) = tmpVar(3)
84     ACFC11(it,2) = tmpVar(4)
85     ACFC12(it,2) = tmpVar(5)
86     ENDIF
87     ENDDO
88     IF ( it.GT.ACFCrecSize ) THEN
89     CLOSE(iUnit)
90     WRITE(msgBuf,'(3A)')
91     & 'CFC_ATMOS: length of file "',atmCFC_inpFile(1:iL),'"'
92     CALL PRINT_ERROR( msgBuf, myThid )
93     WRITE(msgBuf,'(2A,I9)') 'CFC_ATMOS: exceeds max num',
94     & ' of records: ACFCrecSize=', ACFCrecSize
95     CALL PRINT_ERROR( msgBuf, myThid )
96     STOP 'ABNORMAL END: S/R CFC_ATMOS'
97     ENDIF
98     1001 CONTINUE
99     CLOSE(iUnit)
100     ACFCnRec = it
101 stephd 1.1
102 jmc 1.5 C-- Print values to check:
103     WRITE(msgBuf,'(A,I8,A)')
104     & 'CFC_ATMOS: read', ACFCnRec, ' (=ACFCnRec) time records :'
105     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
106     & SQUEEZE_RIGHT, myThid )
107     WRITE(msgBuf,'(A)')
108     & ' year , cfc11_N, cfc12_N, cfc11_S, cfc12_S'
109     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
110     & SQUEEZE_RIGHT, myThid )
111     DO it = 1,ACFCnRec
112     WRITE(msgBuf,'(F7.1,4F9.2)')
113     & ACFCyear(it), ACFC11(it,1),ACFC12(it,1),
114     & ACFC11(it,2),ACFC12(it,2)
115     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
116     & SQUEEZE_RIGHT, myThid )
117 stephd 1.1 ENDDO
118 jmc 1.5
119     WRITE(msgBuf,'(A)')
120     & 'CFC_ATMOS: Setting atmos CFC time series: done'
121     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
122     & SQUEEZE_RIGHT, myThid )
123 jmc 1.4
124 stephd 1.1 _END_MASTER(myThid)
125    
126 jmc 1.4 C-- Everyone else must wait for the parameters to be loaded
127     _BARRIER
128 stephd 1.1
129 jmc 1.4 #endif /* ALLOW_CFC */
130 stephd 1.1
131     RETURN
132     END

  ViewVC Help
Powered by ViewVC 1.1.22