/[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.25 by jmc, Tue Aug 8 21:20:26 2006 UTC revision 1.33 by jmc, Thu Aug 21 15:16:01 2008 UTC
# Line 18  C     !USES: Line 18  C     !USES:
18  #include "SIZE.h"  #include "SIZE.h"
19  #include "EEPARAMS.h"  #include "EEPARAMS.h"
20  #include "PTRACERS_SIZE.h"  #include "PTRACERS_SIZE.h"
21  #include "PTRACERS.h"  #include "PTRACERS_PARAMS.h"
22  #include "PARAMS.h"  #include "PARAMS.h"
23  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
24  #include "MNC_PARAMS.h"  #include "MNC_PARAMS.h"
# Line 39  C     msgBuf     :: message buffer Line 39  C     msgBuf     :: message buffer
39        INTEGER ic        INTEGER ic
40        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
41        _RL PTRACERS_diffKr(PTRACERS_num)        _RL PTRACERS_diffKr(PTRACERS_num)
42          _RL tauTr1ClimRelax
43    
44  C     PTRACERS_taveFreq :: Frequency with which time-averaged PTRACERS  C     PTRACERS_taveFreq :: Frequency with which time-averaged PTRACERS
45  C                          are written to post-processing files.  C                          are written to post-processing files.
46    C     tauTr1ClimRelax :: old parameter (will be removed 1 day)
47        NAMELIST /PTRACERS_PARM01/        NAMELIST /PTRACERS_PARM01/
48         &     tauTr1ClimRelax,
49       &     PTRACERS_dumpFreq,       &     PTRACERS_dumpFreq,
50       &     PTRACERS_taveFreq,       &     PTRACERS_taveFreq,
51       &     PTRACERS_monitorFreq,       &     PTRACERS_monitorFreq,
# Line 55  C                          are written t Line 58  C                          are written t
58       &     PTRACERS_ref,       &     PTRACERS_ref,
59       &     PTRACERS_EvPrRn,       &     PTRACERS_EvPrRn,
60       &     PTRACERS_useGMRedi,       &     PTRACERS_useGMRedi,
61         &     PTRACERS_useDWNSLP,
62       &     PTRACERS_useKPP,       &     PTRACERS_useKPP,
63       &     PTRACERS_Iter0,       &     PTRACERS_Iter0,
64       &     PTRACERS_numInUse,       &     PTRACERS_numInUse,
# Line 73  C                          are written t Line 77  C                          are written t
77    
78  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
79  C     internal flag to indicate we are in business  C     internal flag to indicate we are in business
80        PTRACERSisON=.TRUE.  c     PTRACERSisON=.TRUE.
81    C Note(jmc): remove this flag which is not really usefull (not set properly
82    C            when usePTRACERS=F and always TRUE otherwise);
83    C            much better to use "usePTRACERS" flag instead.
84    
85    C     Set ptracer IO & diagnostics labels (2 characters long)
86          CALL PTRACERS_SET_IOLABEL(
87         O                           PTRACERS_ioLabel,
88         I                           PTRACERS_num, myThid )
89    
90  C     Set defaults values for parameters in PTRACERS.h  C     Set defaults values for parameters in PTRACERS.h
91        PTRACERS_dumpFreq    = dumpFreq        PTRACERS_dumpFreq    = dumpFreq
# Line 93  C     Set defaults values for parameters Line 105  C     Set defaults values for parameters
105          ENDDO          ENDDO
106          PTRACERS_EvPrRn(iTracer)=UNSET_RL          PTRACERS_EvPrRn(iTracer)=UNSET_RL
107          PTRACERS_useGMRedi(iTracer)=useGMRedi          PTRACERS_useGMRedi(iTracer)=useGMRedi
108          PTRACERS_useKPP(iTracer)=useKPP          PTRACERS_useDWNSLP(iTracer)=useDOWN_SLOPE
109            PTRACERS_useKPP(iTracer)   =useKPP
110          PTRACERS_initialFile(iTracer)=' '          PTRACERS_initialFile(iTracer)=' '
111          DO ic = 1,MAX_LEN_FNAM          DO ic = 1,MAX_LEN_FNAM
112            PTRACERS_names(iTracer)(ic:ic) = ' '            PTRACERS_names(iTracer)(ic:ic) = ' '
# Line 115  C     Set defaults values for parameters Line 128  C     Set defaults values for parameters
128        PTRACERS_pickup_write_mnc = .FALSE.        PTRACERS_pickup_write_mnc = .FALSE.
129        PTRACERS_pickup_read_mnc  = .FALSE.        PTRACERS_pickup_read_mnc  = .FALSE.
130  #endif  #endif
131          tauTr1ClimRelax = 0.
132    
133  C     Open and read the data.ptracers file  C     Open and read the data.ptracers file
134        WRITE(msgBuf,'(A)') ' PTRACERS_READPARMS: opening data.ptracers'        WRITE(msgBuf,'(A)') ' PTRACERS_READPARMS: opening data.ptracers'
# Line 136  C     Close the open data file Line 150  C     Close the open data file
150  C     Now set-up any remaining parameters that result from the input  C     Now set-up any remaining parameters that result from the input
151  C     parameters  C     parameters
152    
153    C     Tracer 1 climatology relaxation time scale (<- but the code is gone !)
154          IF ( tauTr1ClimRelax .EQ. 0. ) THEN
155           lambdaTr1ClimRelax = 0.
156          ELSE
157           lambdaTr1ClimRelax = 1./tauTr1ClimRelax
158          ENDIF
159    
160  C     If PTRACERS_numInUse was not set in data.ptracers then we can  C     If PTRACERS_numInUse was not set in data.ptracers then we can
161  C     assume that all PTRACERS fields will be in use  C     assume that all PTRACERS fields will be in use
162        IF (PTRACERS_numInUse.LT.0) THEN        IF (PTRACERS_numInUse.LT.0) THEN
# Line 143  C     assume that all PTRACERS fields wi Line 164  C     assume that all PTRACERS fields wi
164        ENDIF        ENDIF
165  C     Check we are not trying to use more tracers than allowed  C     Check we are not trying to use more tracers than allowed
166        IF (PTRACERS_numInUse.GT.PTRACERS_num) THEN        IF (PTRACERS_numInUse.GT.PTRACERS_num) THEN
167          WRITE(msgBuf,'(A,I2,A,I2,A)')          WRITE(msgBuf,'(A,I4,A,I4,A)')
168       &       ' PTRACERS_READPARMS: You requested ',PTRACERS_numInUse,       &       ' PTRACERS_READPARMS: You requested',PTRACERS_numInUse,
169       &       ' tracers at run time when only ',PTRACERS_num,       &       ' tracers at run time when only',PTRACERS_num,
170       &       ' were specified at compile time. Naughty! '       &       ' were specified at compile time. Naughty! '
171          CALL PRINT_ERROR( msgBuf, myThid )          CALL PRINT_ERROR( msgBuf, myThid )
172          STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'          STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
# Line 153  C     Check we are not trying to use mor Line 174  C     Check we are not trying to use mor
174  C     Check that enough parameters were specified  C     Check that enough parameters were specified
175        DO iTracer=1,PTRACERS_numInUse        DO iTracer=1,PTRACERS_numInUse
176          IF (PTRACERS_advScheme(iTracer).EQ.0) THEN          IF (PTRACERS_advScheme(iTracer).EQ.0) THEN
177            WRITE(msgBuf,'(A,A,I2)')            WRITE(msgBuf,'(A,A,I3)')
178       &         ' PTRACERS_READPARMS: ',       &         ' PTRACERS_READPARMS: ',
179       &         'No advect. scheme specified for tracer #',       &         'No advect. scheme specified for tracer #',
180       &         iTracer       &         iTracer
# Line 167  C     Check that enough parameters were Line 188  C     Check that enough parameters were
188          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
189       &   'PTRACERS_READPARMS: #undef INCLUDE_IMPLVERTADV_CODE'       &   'PTRACERS_READPARMS: #undef INCLUDE_IMPLVERTADV_CODE'
190          CALL PRINT_ERROR( msgBuf, myThid )          CALL PRINT_ERROR( msgBuf, myThid )
191          WRITE(msgBuf,'(2A,I2,A)') 'PTRACERS_READPARMS:',          WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_READPARMS:',
192       &   ' but pTracers_ImplVertAdv(',iTracer,' ) is TRUE'       &   ' but pTracers_ImplVertAdv(',iTracer,' ) is TRUE'
193          CALL PRINT_ERROR( msgBuf, myThid )          CALL PRINT_ERROR( msgBuf, myThid )
194          STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'          STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
# Line 175  C     Check that enough parameters were Line 196  C     Check that enough parameters were
196        ENDDO        ENDDO
197  #endif  #endif
198        DO iTracer=1,PTRACERS_numInUse        DO iTracer=1,PTRACERS_numInUse
199          PTRACERS_useGMRedi(iTracer) = PTRACERS_useGMRedi(iTracer)          IF ( PTRACERS_useGMRedi(iTracer) .AND. .NOT.useGMRedi ) THEN
200       &                           .AND.useGMRedi            WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_READPARMS:',
201          PTRACERS_useKPP(iTracer) = PTRACERS_useKPP(iTracer)       &     ' pTracers_useGMRedi(',iTracer,' ) is TRUE'
202       &                        .AND.useKPP            CALL PRINT_ERROR( msgBuf, myThid )
203              WRITE(msgBuf,'(A,L5,A)')
204         &     'PTRACERS_READPARMS: But not useGMRedi (=',useGMRedi,')'
205              CALL PRINT_ERROR( msgBuf, myThid )
206              STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
207            ENDIF
208            IF ( PTRACERS_useDWNSLP(iTracer) .AND. .NOT.useDOWN_SLOPE ) THEN
209              WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_READPARMS:',
210         &     ' pTracers_useDWNSLP(',iTracer,' ) is TRUE'
211              CALL PRINT_ERROR( msgBuf, myThid )
212              WRITE(msgBuf,'(2A,L5,A)') 'PTRACERS_READPARMS:',
213         &     ' But not useDOWN_SLOPE (=', useDOWN_SLOPE, ')'
214              CALL PRINT_ERROR( msgBuf, myThid )
215              STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
216            ENDIF
217            IF ( PTRACERS_useKPP(iTracer) .AND. .NOT.useKPP ) THEN
218              WRITE(msgBuf,'(2A,I3,A)') 'PTRACERS_READPARMS:',
219         &     ' pTracers_useKPP(',iTracer,' ) is TRUE'
220              CALL PRINT_ERROR( msgBuf, myThid )
221              WRITE(msgBuf,'(A,L5,A)')
222         &     'PTRACERS_READPARMS: But not useKPP (=',useKPP,')'
223              CALL PRINT_ERROR( msgBuf, myThid )
224              STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
225            ENDIF
226          IF ( PTRACERS_diffKr(iTracer).NE.UNSET_RL ) THEN          IF ( PTRACERS_diffKr(iTracer).NE.UNSET_RL ) THEN
227           DO k=1,Nr           DO k=1,Nr
228            PTRACERS_diffKrNr(k,iTracer)=PTRACERS_diffKr(iTracer)            PTRACERS_diffKrNr(k,iTracer)=PTRACERS_diffKr(iTracer)
# Line 257  C--   Print a summary of pTracer paramet Line 301  C--   Print a summary of pTracer paramet
301          CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )          CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
302          WRITE(msgBuf,'(A,I4)') ' tracer number : ',iTracer          WRITE(msgBuf,'(A,I4)') ' tracer number : ',iTracer
303          CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )          CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
304            CALL WRITE_0D_C( PTRACERS_ioLabel(iTracer), 0, INDEX_NONE,
305         &     'PTRACERS_ioLabel =', ' /* tracer IO Label */')
306          CALL WRITE_0D_I( PTRACERS_advScheme(iTracer), INDEX_NONE,          CALL WRITE_0D_I( PTRACERS_advScheme(iTracer), INDEX_NONE,
307       &     'PTRACERS_advScheme =', ' /* Advection Scheme */')       &     'PTRACERS_advScheme =', ' /* Advection Scheme */')
308          CALL WRITE_0D_L( PTRACERS_ImplVertAdv(iTracer), INDEX_NONE,          CALL WRITE_0D_L( PTRACERS_ImplVertAdv(iTracer), INDEX_NONE,
# Line 270  C--   Print a summary of pTracer paramet Line 316  C--   Print a summary of pTracer paramet
316       &     'PTRACERS_diffKrNr =', ' /* Vertical Diffusivity */')       &     'PTRACERS_diffKrNr =', ' /* Vertical Diffusivity */')
317          CALL WRITE_0D_L( PTRACERS_useGMRedi(iTracer), INDEX_NONE,          CALL WRITE_0D_L( PTRACERS_useGMRedi(iTracer), INDEX_NONE,
318       &     'PTRACERS_useGMRedi =', ' /* apply GM-Redi */')       &     'PTRACERS_useGMRedi =', ' /* apply GM-Redi */')
319            CALL WRITE_0D_L( PTRACERS_useDWNSLP(iTracer), INDEX_NONE,
320         &     'PTRACERS_useDWNSLP =', ' /* apply DOWN-SLOPE Flow */')
321          CALL WRITE_0D_L( PTRACERS_useKPP(iTracer), INDEX_NONE,          CALL WRITE_0D_L( PTRACERS_useKPP(iTracer), INDEX_NONE,
322       &     'PTRACERS_useKPP =', ' /* apply KPP scheme */')       &     'PTRACERS_useKPP =', ' /* apply KPP scheme */')
323          CALL WRITE_1D_R8( PTRACERS_ref(1,iTracer), Nr, INDEX_K,          CALL WRITE_1D_R8( PTRACERS_ref(1,iTracer), Nr, INDEX_K,

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.22