/[MITgcm]/MITgcm/pkg/mypackage/mypackage_readparms.F
ViewVC logotype

Annotation of /MITgcm/pkg/mypackage/mypackage_readparms.F

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


Revision 1.5 - (hide annotations) (download)
Tue May 27 23:41:31 2014 UTC (10 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64z, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e
Changes since 1.4: +11 -1 lines
add a call to S/R packages_unused_msg.F to print a weak warning
when parameter file "data.this_pkg" exist but  but useTHIS_PKG=F

1 jmc 1.5 C $Header: /u/gcmpack/MITgcm/pkg/mypackage/mypackage_readparms.F,v 1.4 2009/12/27 23:40:03 jmc Exp $
2 heimbach 1.1 C $Name: $
3    
4     #include "MYPACKAGE_OPTIONS.h"
5    
6 edhill 1.2 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7     CBOP 0
8     C !ROUTINE: MYPACKAGE_READPARMS
9    
10     C !INTERFACE:
11 heimbach 1.1 SUBROUTINE MYPACKAGE_READPARMS( myThid )
12 edhill 1.2
13     C !DESCRIPTION:
14     C Initialize MYPACKAGE variables and constants.
15    
16     C !USES:
17 heimbach 1.1 IMPLICIT NONE
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20     #include "PARAMS.h"
21     #include "MYPACKAGE.h"
22    
23 edhill 1.2 C !INPUT PARAMETERS:
24 heimbach 1.1 INTEGER myThid
25 edhill 1.2 CEOP
26 heimbach 1.1
27     #ifdef ALLOW_MYPACKAGE
28    
29 jmc 1.4 C !LOCAL VARIABLES:
30     C msgBuf :: Informational/error message buffer
31     C iUnit :: Work variable for IO unit number
32     CHARACTER*(MAX_LEN_MBUF) msgBuf
33     INTEGER iUnit
34    
35 heimbach 1.1 NAMELIST /MYPACKAGE_PARM01/
36 jmc 1.3 & myPa_MNC,
37     & myPa_StaV_Cgrid, myPa_Tend_Cgrid,
38     & myPa_applyTendT, myPa_applyTendS,
39     & myPa_applyTendU, myPa_applyTendV,
40     & myPa_doSwitch1, myPa_doSwitch2,
41     & myPa_index1, myPa_index2,
42     & myPa_param1, myPa_param2,
43     & myPa_string1, myPa_string2,
44     & myPa_Scal1File, myPa_Scal2File,
45     & myPa_VelUFile, myPa_VelVFile,
46     & myPa_Surf1File, myPa_Surf2File
47 heimbach 1.1
48 jmc 1.5 IF ( .NOT.useMYPACKAGE ) THEN
49     C- pkg MYPACKAGE is not used
50     _BEGIN_MASTER(myThid)
51     C- Track pkg activation status:
52     C print a (weak) warning if data.mypackage is found
53     CALL PACKAGES_UNUSED_MSG( 'useMYPACKAGE', ' ', ' ' )
54     _END_MASTER(myThid)
55     RETURN
56     ENDIF
57    
58 heimbach 1.1 _BEGIN_MASTER(myThid)
59    
60     C-- Default values for MYPACKAGE
61 jmc 1.3 myPa_MNC = useMNC
62     myPa_StaV_Cgrid = .TRUE.
63     myPa_Tend_Cgrid = .TRUE.
64     myPa_applyTendT = .FALSE.
65     myPa_applyTendS = .FALSE.
66     myPa_applyTendU = .FALSE.
67     myPa_applyTendV = .FALSE.
68     C- additional parameters:
69     myPa_doSwitch1 = .FALSE.
70     myPa_doSwitch2 = .FALSE.
71     myPa_index1 = 0
72     myPa_index2 = 0
73     myPa_param1 = 0. _d 0
74     myPa_param2 = 0. _d 0
75     myPa_string1 = ' '
76     myPa_string2 = ' '
77     C- file names for initial conditions:
78     myPa_Scal1File = ' '
79     myPa_Scal2File = ' '
80     myPa_VelUFile = ' '
81     myPa_VelVFile = ' '
82     myPa_Surf1File = ' '
83     myPa_Surf2File = ' '
84    
85 heimbach 1.1 WRITE(msgBuf,'(A)') 'MYPACKAGE_READPARMS: opening data.mypackage'
86     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
87     & SQUEEZE_RIGHT , 1)
88     CALL OPEN_COPY_DATA_FILE(
89     I 'data.mypackage', 'MYPACKAGE_READPARMS',
90     O iUnit,
91     I myThid )
92    
93     C Read parameters from open data file
94     READ(UNIT=iUnit,NML=MYPACKAGE_PARM01)
95 jmc 1.3 WRITE(msgBuf,'(A)')
96 heimbach 1.1 & 'MYPACKAGE_READPARMS: finished reading data.mypackage'
97     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
98     & SQUEEZE_RIGHT , 1)
99     C Close the open data file
100     CLOSE(iUnit)
101    
102     C Make sure that we locally honor the global MNC on/off flag
103 jmc 1.3 myPa_MNC = myPa_MNC .AND. useMNC
104 heimbach 1.1 #ifndef ALLOW_MNC
105     C Fix to avoid running without getting any output:
106 jmc 1.3 myPa_MNC = .FALSE.
107 heimbach 1.1 #endif
108 jmc 1.3 myPa_MDSIO = (.NOT. myPa_MNC) .OR. outputTypesInclusive
109 heimbach 1.1
110     _END_MASTER(myThid)
111    
112     C-- Everyone else must wait for the parameters to be loaded
113     _BARRIER
114    
115     #endif /* ALLOW_MYPACKAGE */
116    
117     RETURN
118     END

  ViewVC Help
Powered by ViewVC 1.1.22