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

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

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


Revision 1.10 - (hide annotations) (download)
Mon Oct 18 16:04:20 2004 UTC (19 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint55h_post
Changes since 1.9: +2 -4 lines
 o remove all the *_ioinc flags and replace them with the single global
   outputTypesInclusive flag

1 edhill 1.10 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_readparms.F,v 1.9 2004/10/17 23:06:52 jmc Exp $
2 dimitri 1.2 C $Name: $
3 adcroft 1.1
4     #include "PTRACERS_OPTIONS.h"
5    
6 edhill 1.6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 adcroft 1.1 CBOP
8 edhill 1.6 C !ROUTINE: PTRACERS_READPARMS
9    
10     C !INTERFACE:
11 adcroft 1.1 SUBROUTINE PTRACERS_READPARMS( myThid )
12 edhill 1.6
13     C !DESCRIPTION:
14 adcroft 1.1 C Initialize PTRACERS parameters, read in data.ptracers
15    
16 edhill 1.6 C !USES:
17 adcroft 1.1 IMPLICIT NONE
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20 jmc 1.5 #include "PTRACERS_SIZE.h"
21 adcroft 1.1 #include "PTRACERS.h"
22 dimitri 1.2 #include "PARAMS.h"
23 edhill 1.7
24 edhill 1.6 C !INPUT PARAMETERS:
25 adcroft 1.1 INTEGER myThid
26 edhill 1.6 CEOP
27 adcroft 1.1
28     #ifdef ALLOW_PTRACERS
29    
30 edhill 1.6 C !LOCAL VARIABLES:
31     C iTracer :: loop indices
32     C iUnit :: unit number for I/O
33     C msgBuf :: message buffer
34 adcroft 1.1 INTEGER iTracer
35     INTEGER iUnit
36 edhill 1.6 INTEGER ic
37 adcroft 1.1 CHARACTER*(MAX_LEN_MBUF) msgBuf
38    
39 jmc 1.5 C PTRACERS_taveFreq :: Frequency with which time-averaged PTRACERS
40     C are written to post-processing files.
41     NAMELIST /PTRACERS_PARM01/
42 edhill 1.6 & PTRACERS_taveFreq,
43     & PTRACERS_advScheme,
44     & PTRACERS_diffKh,
45     & PTRACERS_diffK4,
46     & PTRACERS_diffKr,
47     & PTRACERS_useGMRedi,
48     & PTRACERS_useKPP,
49     & PTRACERS_numInUse,
50     & PTRACERS_initialFile,
51     & PTRACERS_useRecords,
52     & PTRACERS_names,
53     & PTRACERS_long_names,
54     & PTRACERS_units,
55 edhill 1.7 & PTRACERS_read_mnc,
56     & PTRACERS_write_mnc
57 jmc 1.5
58 edhill 1.6 C This routine has been called by the main model so we set our
59     C internal flag to indicate we are in business
60 adcroft 1.1 PTRACERSisON=.TRUE.
61    
62 edhill 1.6 C Set defaults values for parameters in PTRACERS.h
63 dimitri 1.4 PTRACERS_taveFreq=taveFreq
64 adcroft 1.1 PTRACERS_numInUse=-1
65     DO iTracer=1,PTRACERS_num
66 edhill 1.6 PTRACERS_advScheme(iTracer)=saltAdvScheme
67     PTRACERS_diffKh(iTracer)=diffKhS
68     PTRACERS_diffK4(iTracer)=diffK4S
69 jmc 1.9 PTRACERS_diffKr(iTracer)=diffKrNrS(1)
70 edhill 1.6 PTRACERS_useGMRedi(iTracer)=useGMRedi
71     PTRACERS_useKPP(iTracer)=useKPP
72     PTRACERS_initialFile(iTracer)=' '
73     DO ic = 1,MAX_LEN_FNAM
74     PTRACERS_names(iTracer)(ic:ic) = ' '
75     PTRACERS_long_names(iTracer)(ic:ic) = ' '
76     PTRACERS_units(iTracer)(ic:ic) = ' '
77     ENDDO
78 adcroft 1.1 ENDDO
79 edhill 1.7 PTRACERS_useRecords = .FALSE.
80     PTRACERS_read_mdsio = .TRUE.
81     PTRACERS_read_mnc = .FALSE.
82     PTRACERS_write_mdsio = .TRUE.
83     PTRACERS_write_mnc = .FALSE.
84 adcroft 1.1
85 edhill 1.6 C Open and read the data.ptracers file
86 adcroft 1.1 _BEGIN_MASTER(myThid)
87     WRITE(msgBuf,'(A)') ' PTRACERS_READPARMS: opening data.ptracers'
88     CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,
89     & SQUEEZE_RIGHT , 1)
90     CALL OPEN_COPY_DATA_FILE(
91     I 'data.ptracers', 'PTRACERS_READPARMS',
92     O iUnit,
93     I myThid )
94     READ(UNIT=iUnit,NML=PTRACERS_PARM01)
95     WRITE(msgBuf,'(A)')
96     & ' PTRACERS_READPARMS: finished reading data.ptracers'
97     CALL PRINT_MESSAGE(msgBuf, standardMessageUnit,
98     & SQUEEZE_RIGHT , 1)
99    
100 edhill 1.6 C Close the open data file
101 adcroft 1.1 CLOSE(iUnit)
102     _END_MASTER(myThid)
103    
104 edhill 1.6 C Everyone else must wait for the parameters to be loaded
105 adcroft 1.1 _BARRIER
106    
107 edhill 1.6 C Now set-up any remaining parameters that result from the input
108     C parameters
109 adcroft 1.1
110 edhill 1.6 C If PTRACERS_numInUse was not set in data.ptracers then we can
111     C assume that all PTRACERS fields will be in use
112 adcroft 1.1 IF (PTRACERS_numInUse.LT.0) THEN
113 edhill 1.6 PTRACERS_numInUse=PTRACERS_num
114 adcroft 1.1 ENDIF
115 edhill 1.6 C Check we are not trying to use more tracers than allowed
116 adcroft 1.1 IF (PTRACERS_numInUse.GT.PTRACERS_num) THEN
117 edhill 1.6 WRITE(msgBuf,'(A,I2,A,I2,A)')
118     & ' PTRACERS_READPARMS: You requested ',PTRACERS_numInUse,
119     & ' tracers at run time when only ',PTRACERS_num,
120     & ' were specified at compile time. Naughty! '
121     CALL PRINT_ERROR(msgBuf, 1)
122     STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
123 adcroft 1.1 ENDIF
124 edhill 1.6 C Check that enough parameters were specified
125 adcroft 1.1 DO iTracer=1,PTRACERS_numInUse
126 edhill 1.6 IF (PTRACERS_advScheme(iTracer).EQ.0) THEN
127     WRITE(msgBuf,'(A,A,I2)')
128     & ' PTRACERS_READPARMS: ',
129     & 'No advect. scheme specified for tracer #',
130     & iTracer
131     CALL PRINT_ERROR(msgBuf, 1)
132     STOP 'ABNORMAL END: S/R PTRACERS_READPARMS'
133     ENDIF
134 adcroft 1.1 ENDDO
135    
136 edhill 1.6 #ifdef ALLOW_MNC
137     IF (useMNC) THEN
138 edhill 1.7 C Set the default I/O Types
139     IF (PTRACERS_read_mnc) PTRACERS_read_mdsio = .FALSE.
140 edhill 1.10 IF ( (.NOT. outputTypesInclusive)
141 edhill 1.7 & .AND. PTRACERS_write_mnc ) pickup_write_mdsio = .FALSE.
142    
143     C Initialize the MNC variable types for PTRACERS
144 edhill 1.6 CALL PTRACERS_MNC_INIT( myThid )
145     ENDIF
146     #endif /* ALLOW_MNC */
147    
148 adcroft 1.1 #endif /* ALLOW_PTRACERS */
149    
150     RETURN
151     END
152 edhill 1.6

  ViewVC Help
Powered by ViewVC 1.1.22