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

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

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

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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22