/[MITgcm]/MITgcm/pkg/gchem/gchem_readparms.F
ViewVC logotype

Diff of /MITgcm/pkg/gchem/gchem_readparms.F

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

revision 1.2 by stephd, Wed Jul 9 19:59:52 2003 UTC revision 1.15 by jmc, Wed Apr 9 17:55:12 2008 UTC
# Line 1  Line 1 
1  #include "PTRACERS_OPTIONS.h"  C $Header$
2    C $Name$
3    
4  #include "GCHEM_OPTIONS.h"  #include "GCHEM_OPTIONS.h"
5    
6  CBOP  CBOP
# Line 8  C !INTERFACE: ========================== Line 10  C !INTERFACE: ==========================
10        SUBROUTINE GCHEM_READPARMS( myThid )        SUBROUTINE GCHEM_READPARMS( myThid )
11    
12  C !DESCRIPTION:  C !DESCRIPTION:
13  C     Initialize PTRACERS parameters, read in data.gchem  C     Initialize GCHEM parameters, read in data.gchem
14    
15  C !USES: ===============================================================  C !USES: ===============================================================
16        IMPLICIT NONE        IMPLICIT NONE
17  #include "SIZE.h"  #include "SIZE.h"
18  #include "EEPARAMS.h"  #include "EEPARAMS.h"
19    #include "PARAMS.h"
20  #include "GCHEM.h"  #include "GCHEM.h"
21    
22  C !INPUT PARAMETERS: ===================================================  C !INPUT PARAMETERS: ===================================================
# Line 23  C  myThid               :: thread number Line 26  C  myThid               :: thread number
26  C !OUTPUT PARAMETERS: ==================================================  C !OUTPUT PARAMETERS: ==================================================
27  C  none  C  none
28    
29  #ifdef ALLOW_PTRACERS  #ifdef ALLOW_GCHEM
30    
31  C !LOCAL VARIABLES: ====================================================  C !LOCAL VARIABLES: ====================================================
32    C  tIter0               :: retired parameter
33  C  iTracer              :: loop indices  C  iTracer              :: loop indices
34  C  iUnit                :: unit number for I/O  C  iUnit                :: unit number for I/O
35  C  msgBuf               :: message buffer  C  msgBuf               :: message buffer
36          INTEGER tIter0
37        INTEGER iTracer        INTEGER iTracer
38        INTEGER iUnit        INTEGER iUnit
39        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
40    c     PARAMETER ( UNSET_I      = 123456789  )
41  CEOP  CEOP
42    
43  C Set defaults values for parameters in GCHEM.h        NAMELIST /GCHEM_PARM01/
44         tIter0=0       &                   tIter0,
45         nsubtime=1       &                   Filename1,
46         windFile=' '       &                   Filename2,
47         atmospFile=' '       &                   Filename3,
48         IceFile=' '       &                   Filename4,
49         IronFile=' '       &                   Filename5,
50         SilicaFile=' '       &                   nsubtime,
51         &           gchem_int1, gchem_int2, gchem_int3,
52         &           gchem_int4, gchem_int5,
53         &           gchem_rl1, gchem_rl2, gchem_rl3,
54         &           gchem_rl4, gchem_rl5,
55         &           gchem_ForcingPeriod, gchem_ForcingCycle
56    
57    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
58    
 C Open and read the data.ptracers file  
59        _BEGIN_MASTER(myThid)        _BEGIN_MASTER(myThid)
60    
61    C Set defaults values for parameters in GCHEM.h
62           useDIC = .FALSE.
63           useCFC = .FALSE.
64           tIter0 = UNSET_I
65           nsubtime=1
66           Filename1=' '
67           Filename2=' '
68           Filename3=' '
69           Filename4=' '
70           Filename5=' '
71           gchem_int1=0
72           gchem_int2=0
73           gchem_int3=0
74           gchem_int4=0
75           gchem_int5=0
76           gchem_rl1=0. _d 0
77           gchem_rl2=0. _d 0
78           gchem_rl3=0. _d 0
79           gchem_rl4=0. _d 0
80           gchem_rl5=0. _d 0
81    c default periodic forcing to same as for physics
82           gchem_ForcingPeriod=externForcingPeriod
83           gchem_ForcingCycle=externForcingCycle
84    C Open and read the data.gchem file
85        WRITE(msgBuf,'(A)') ' GCHEM_READPARMS: opening data.gchem'        WRITE(msgBuf,'(A)') ' GCHEM_READPARMS: opening data.gchem'
86        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,
87       &                   SQUEEZE_RIGHT , 1)       &                   SQUEEZE_RIGHT , 1)
# Line 61  C Open and read the data.ptracers file Line 97  C Open and read the data.ptracers file
97    
98  C Close the open data file  C Close the open data file
99        CLOSE(iUnit)        CLOSE(iUnit)
100    
101    C- Sub-package on/off flags: until fully implemented, which requires
102    C   a) to read the flag value from data.gchem
103    C   b) to test the flag before any corresponding pkg S/R call
104    C- (for now) just it turned on when the corresponding pkg is compliled
105    #ifdef ALLOW_DIC
106           useDIC = .TRUE.
107    #endif
108    #ifdef ALLOW_CFC
109           useCFC = .TRUE.
110    #endif
111    
112    C- Check for retired parameters:
113          IF ( tIter0 .NE. UNSET_I ) THEN
114    c      nRetired = nRetired+1
115           WRITE(msgBuf,'(A,A)')
116         &  'S/R GCHEM_READPARMS: Paramater "tIter0" is',
117         &  ' no longer allowed in file "data.gchem"'
118           CALL PRINT_ERROR( msgBuf , myThid)
119           WRITE(msgBuf,'(A,A)')
120         &  'S/R GCHEM_READPARMS: "tIter0" has been moved to',
121         &  ' PTRACERS_Iter0 in file "data.ptracers".'
122           CALL PRINT_ERROR( msgBuf , myThid)
123           STOP 'ABNORMAL END: S/R GCHEM_READPARMS'
124          ENDIF
125    
126        _END_MASTER(myThid)        _END_MASTER(myThid)
127    
128  C Everyone else must wait for the parameters to be loaded  C Everyone else must wait for the parameters to be loaded
129        _BARRIER        _BARRIER
130    
131  #endif /* ALLOW_PTRACERS */  #ifdef ALLOW_DIC
132          IF ( useDIC ) THEN
133            CALL DIC_READPARMS(myThid)
134          ENDIF
135    #endif
136    
137    #ifdef ALLOW_CFC
138          IF ( useCFC ) THEN
139            CALL CFC_READPARMS(myThid)
140          ENDIF
141    #endif
142    
143    #endif /* ALLOW_GCHEM */
144    
145        RETURN        RETURN
146        END        END

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22