/[MITgcm]/MITgcm/pkg/ptracers/ptracers_readparms.F
ViewVC logotype

Diff of /MITgcm/pkg/ptracers/ptracers_readparms.F

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

revision 1.8 by edhill, Sun Oct 10 06:08:50 2004 UTC revision 1.21 by jmc, Sat Jul 30 23:53:48 2005 UTC
# Line 20  C     !USES: Line 20  C     !USES:
20  #include "PTRACERS_SIZE.h"  #include "PTRACERS_SIZE.h"
21  #include "PTRACERS.h"  #include "PTRACERS.h"
22  #include "PARAMS.h"  #include "PARAMS.h"
23    #ifdef ALLOW_MNC
24    #include "MNC_PARAMS.h"
25    #endif
26    
27  C     !INPUT PARAMETERS:  C     !INPUT PARAMETERS:
28        INTEGER myThid        INTEGER myThid
# Line 28  CEOP Line 31  CEOP
31  #ifdef ALLOW_PTRACERS  #ifdef ALLOW_PTRACERS
32    
33  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
34  C     iTracer    :: loop indices  C     k,iTracer  :: loop indices
35  C     iUnit      :: unit number for I/O  C     iUnit      :: unit number for I/O
36  C     msgBuf     :: message buffer  C     msgBuf     :: message buffer
37        INTEGER iTracer        INTEGER k, iTracer
38        INTEGER iUnit        INTEGER iUnit
39        INTEGER ic        INTEGER ic
40        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
41          _RL PTRACERS_diffKr(PTRACERS_num)
42    
43  C     PTRACERS_taveFreq :: Frequency with which time-averaged PTRACERS  C     PTRACERS_taveFreq :: Frequency with which time-averaged PTRACERS
44  C                          are written to post-processing files.  C                          are written to post-processing files.
45        NAMELIST /PTRACERS_PARM01/        NAMELIST /PTRACERS_PARM01/
46         &     PTRACERS_dumpFreq,
47       &     PTRACERS_taveFreq,       &     PTRACERS_taveFreq,
48         &     PTRACERS_monitorFreq,
49       &     PTRACERS_advScheme,       &     PTRACERS_advScheme,
50         &     PTRACERS_ImplVertAdv,
51       &     PTRACERS_diffKh,       &     PTRACERS_diffKh,
52       &     PTRACERS_diffK4,       &     PTRACERS_diffK4,
53       &     PTRACERS_diffKr,       &     PTRACERS_diffKr,
54         &     PTRACERS_diffKrNr,
55       &     PTRACERS_useGMRedi,       &     PTRACERS_useGMRedi,
56       &     PTRACERS_useKPP,       &     PTRACERS_useKPP,
57         &     PTRACERS_Iter0,
58       &     PTRACERS_numInUse,       &     PTRACERS_numInUse,
59       &     PTRACERS_initialFile,       &     PTRACERS_initialFile,
60       &     PTRACERS_useRecords,       &     PTRACERS_useRecords,
61       &     PTRACERS_names,       &     PTRACERS_names,
62       &     PTRACERS_long_names,       &     PTRACERS_long_names,
63       &     PTRACERS_units,       &     PTRACERS_units,
64       &     PTRACERS_write_ioinc,       &     PTRACERS_timeave_mnc, PTRACERS_snapshot_mnc,
65       &     PTRACERS_read_mnc,       &     PTRACERS_pickup_write_mnc, PTRACERS_pickup_read_mnc
      &     PTRACERS_write_mnc  
66    
67  C     This routine has been called by the main model so we set our  C     This routine has been called by the main model so we set our
68  C     internal flag to indicate we are in business  C     internal flag to indicate we are in business
69        PTRACERSisON=.TRUE.        PTRACERSisON=.TRUE.
70    
71  C     Set defaults values for parameters in PTRACERS.h  C     Set defaults values for parameters in PTRACERS.h
72        PTRACERS_taveFreq=taveFreq        PTRACERS_dumpFreq    = dumpFreq
73          PTRACERS_taveFreq    = taveFreq
74          PTRACERS_monitorFreq = monitorFreq
75          PTRACERS_Iter0   = 0
76        PTRACERS_numInUse=-1        PTRACERS_numInUse=-1
77        DO iTracer=1,PTRACERS_num        DO iTracer=1,PTRACERS_num
78          PTRACERS_advScheme(iTracer)=saltAdvScheme          PTRACERS_advScheme(iTracer)=saltAdvScheme
79            PTRACERS_ImplVertAdv(iTracer) = .FALSE.
80          PTRACERS_diffKh(iTracer)=diffKhS          PTRACERS_diffKh(iTracer)=diffKhS
81          PTRACERS_diffK4(iTracer)=diffK4S          PTRACERS_diffK4(iTracer)=diffK4S
82          PTRACERS_diffKr(iTracer)=diffKrS          PTRACERS_diffKr(iTracer)=UNSET_RL
83            DO k=1,Nr
84              PTRACERS_diffKrNr(k,iTracer)=diffKrNrS(k)
85            ENDDO
86          PTRACERS_useGMRedi(iTracer)=useGMRedi          PTRACERS_useGMRedi(iTracer)=useGMRedi
87          PTRACERS_useKPP(iTracer)=useKPP          PTRACERS_useKPP(iTracer)=useKPP
88          PTRACERS_initialFile(iTracer)=' '          PTRACERS_initialFile(iTracer)=' '
# Line 77  C     Set defaults values for parameters Line 92  C     Set defaults values for parameters
92            PTRACERS_units(iTracer)(ic:ic) = ' '            PTRACERS_units(iTracer)(ic:ic) = ' '
93          ENDDO          ENDDO
94        ENDDO        ENDDO
95        PTRACERS_useRecords  = .FALSE.        PTRACERS_useRecords       = .FALSE.
96        PTRACERS_read_mdsio  = .TRUE.  #ifdef ALLOW_MNC
97        PTRACERS_read_mnc    = .FALSE.        PTRACERS_timeave_mnc      = timeave_mnc .AND. useMNC
98        PTRACERS_write_mdsio = .TRUE.        PTRACERS_snapshot_mnc     = snapshot_mnc .AND. useMNC
99        PTRACERS_write_mnc   = .FALSE.        PTRACERS_pickup_write_mnc = pickup_write_mnc .AND. useMNC
100        PTRACERS_write_ioinc = .FALSE.        PTRACERS_pickup_read_mnc  = pickup_read_mnc .AND. useMNC
101    #else
102          PTRACERS_timeave_mnc      = .FALSE.
103          PTRACERS_snapshot_mnc     = .FALSE.
104          PTRACERS_pickup_write_mnc = .FALSE.
105          PTRACERS_pickup_read_mnc  = .FALSE.
106    #endif
107    
108  C     Open and read the data.ptracers file  C     Open and read the data.ptracers file
109        _BEGIN_MASTER(myThid)        _BEGIN_MASTER(myThid)
# Line 134  C     Check that enough parameters were Line 155  C     Check that enough parameters were
155            STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'            STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
156          ENDIF          ENDIF
157        ENDDO        ENDDO
158    #ifndef INCLUDE_IMPLVERTADV_CODE
159          DO iTracer=1,PTRACERS_numInUse
160           IF ( PTRACERS_ImplVertAdv(iTracer) ) THEN
161            WRITE(msgBuf,'(A)')
162         &   'PTRACERS_READPARMS: #undef INCLUDE_IMPLVERTADV_CODE'
163            CALL PRINT_ERROR( msgBuf , myThid)
164            WRITE(msgBuf,'(2A,I2,A)') 'PTRACERS_READPARMS:',
165         &   ' but pTracers_ImplVertAdv(',iTracer,' ) is TRUE'
166            CALL PRINT_ERROR( msgBuf , myThid)
167            STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
168           ENDIF
169          ENDDO
170    #endif
171          DO iTracer=1,PTRACERS_numInUse
172            PTRACERS_useGMRedi(iTracer) = PTRACERS_useGMRedi(iTracer)
173         &                           .AND.useGMRedi
174            PTRACERS_useKPP(iTracer) = PTRACERS_useKPP(iTracer)
175         &                        .AND.useKPP
176            IF ( PTRACERS_diffKr(iTracer).NE.UNSET_RL ) THEN
177             DO k=1,Nr
178              PTRACERS_diffKrNr(k,iTracer)=PTRACERS_diffKr(iTracer)
179             ENDDO
180            ENDIF
181          ENDDO
182    
183  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
184        IF (useMNC) THEN        PTRACERS_timeave_mnc      =
185  C       Set the default I/O Types       &     PTRACERS_timeave_mnc .AND. useMNC
186          IF (PTRACERS_read_mnc) PTRACERS_read_mdsio = .FALSE.        PTRACERS_snapshot_mnc     =
187          IF ( (.NOT. PTRACERS_write_ioinc)       &     PTRACERS_snapshot_mnc .AND. useMNC
188       &       .AND. PTRACERS_write_mnc ) pickup_write_mdsio = .FALSE.        PTRACERS_pickup_write_mnc =
189                 &     PTRACERS_pickup_write_mnc .AND. useMNC
190  C       Initialize the MNC variable types for PTRACERS        PTRACERS_pickup_read_mnc  =
191          CALL PTRACERS_MNC_INIT( myThid )       &     PTRACERS_pickup_read_mnc .AND. useMNC
192        ENDIF  
193  #endif /*  ALLOW_MNC  */        PTRACERS_timeave_mdsio      = (.NOT. PTRACERS_timeave_mnc)
194         &     .OR. outputTypesInclusive
195          PTRACERS_snapshot_mdsio     = (.NOT. PTRACERS_snapshot_mnc)
196         &     .OR. outputTypesInclusive
197          PTRACERS_pickup_write_mdsio = (.NOT. PTRACERS_pickup_write_mnc)
198         &     .OR. outputTypesInclusive
199          PTRACERS_pickup_read_mdsio  = (.NOT. PTRACERS_pickup_read_mnc)
200         &     .OR. outputTypesInclusive
201          
202    #else
203          PTRACERS_timeave_mnc        = .FALSE.
204          PTRACERS_snapshot_mnc       = .FALSE.
205          PTRACERS_pickup_write_mnc   = .FALSE.
206          PTRACERS_pickup_read_mnc    = .FALSE.
207          PTRACERS_timeave_mdsio      = .TRUE.
208          PTRACERS_snapshot_mdsio     = .TRUE.
209          PTRACERS_pickup_write_mdsio = .TRUE.
210          PTRACERS_pickup_read_mdsio  = .TRUE.
211    #endif
212          
213    C--   Print a summary of pTracer parameter values:
214          iUnit = standardMessageUnit
215          WRITE(msgBuf,'(A)') '// ==================================='
216          CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1)
217          WRITE(msgBuf,'(A)') '// PTRACERS parameters '
218          CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1)
219          WRITE(msgBuf,'(A)') '// ==================================='
220          CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1)
221          CALL WRITE_0D_I( PTRACERS_numInUse, INDEX_NONE,
222         &   'PTRACERS_numInUse =',
223         &   ' /* number of tracers */')
224          CALL WRITE_0D_I( PTRACERS_Iter0, INDEX_NONE,
225         &   'PTRACERS_Iter0 =',
226         &   ' /* timestep number when tracers are initialized */')
227          CALL WRITE_0D_R8(PTRACERS_dumpFreq, INDEX_NONE,
228         &   'PTRACERS_dumpFreq =',
229         &   ' /* Frequency^-1 for snapshot output (s) */')
230          CALL WRITE_0D_R8(PTRACERS_taveFreq, INDEX_NONE,
231         &   'PTRACERS_taveFreq =',
232         &   ' /* Frequency^-1 for time-Aver. output (s) */')
233          CALL WRITE_0D_L( PTRACERS_useRecords, INDEX_NONE,
234         &   'PTRACERS_useRecords =', ' /* all tracers in 1 file */')
235                
236          CALL WRITE_0D_L( PTRACERS_timeave_mnc, INDEX_NONE,
237         &     'PTRACERS_timeave_mnc =',
238         &     ' /* use MNC for Tave output */')
239          CALL WRITE_0D_L( PTRACERS_snapshot_mnc, INDEX_NONE,
240         &     'PTRACERS_snapshot_mnc =',
241         &     ' /* use MNC for snapshot output */')
242          CALL WRITE_0D_L( PTRACERS_pickup_write_mnc, INDEX_NONE,
243         &     'PTRACERS_pickup_write_mnc =',
244         &     ' /* use MNC for writing pickups */')
245          CALL WRITE_0D_L( PTRACERS_pickup_read_mnc, INDEX_NONE,
246         &     'PTRACERS_pickup_read_mnc =',
247         &     ' /* use MNC for reading pickups */')
248    
249          DO iTracer=1,PTRACERS_numInUse
250            WRITE(msgBuf,'(A)') ' -----------------------------------'
251            CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1)
252            WRITE(msgBuf,'(A,I4)') ' tracer number : ',iTracer
253            CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1)
254            CALL WRITE_0D_I( PTRACERS_advScheme(iTracer), INDEX_NONE,
255         &     'PTRACERS_advScheme =', ' /* Advection Scheme */')
256            CALL WRITE_0D_L( PTRACERS_ImplVertAdv(iTracer), INDEX_NONE,
257         &     'PTRACERS_ImplVertAdv =',
258         &     ' /* implicit vert. advection flag */')
259            CALL WRITE_0D_R8( PTRACERS_diffKh(iTracer), INDEX_NONE,
260         &     'PTRACERS_diffKh =', ' /* Laplacian Diffusivity */')
261            CALL WRITE_0D_R8( PTRACERS_diffK4(iTracer), INDEX_NONE,
262         &     'PTRACERS_diffK4 =', ' /* Biharmonic Diffusivity */')
263            CALL WRITE_1D_R8( PTRACERS_diffKrNr(1,iTracer), Nr, INDEX_K,
264         &     'PTRACERS_diffKrNr =', ' /* Vertical Diffusivity */')
265            CALL WRITE_0D_L( PTRACERS_useGMRedi(iTracer), INDEX_NONE,
266         &     'PTRACERS_useGMRedi =', ' /* apply GM-Redi */')
267            CALL WRITE_0D_L( PTRACERS_useKPP(iTracer), INDEX_NONE,
268         &     'PTRACERS_useKPP =', ' /* apply KPP scheme */')
269    
270          ENDDO
271            WRITE(msgBuf,'(A)') ' -----------------------------------'
272            CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT , 1)
273  #endif /* ALLOW_PTRACERS */  #endif /* ALLOW_PTRACERS */
274    
275        RETURN        RETURN

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.22