/[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.3 - (hide annotations) (download)
Sun Jan 27 20:52:11 2008 UTC (16 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint62, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59o, checkpoint59n, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.2: +40 -33 lines
re-arrange myPackage:
- more standard variable names
- add example of read/write pickup for state-var (+ add call)
- add option to disable un-used array (MYPACKAGE_OPTIONS.h, MYPACKAGE.h)
- rename S/R MYPACKAGE_DIAGNOSTICS_FILL to MYPACKAGE_DIAGNOSTICS_STATE
 and call it from do_statevars_diags.F

1 jmc 1.3 C $Header: /u/gcmpack/MITgcm/pkg/mypackage/mypackage_readparms.F,v 1.2 2006/08/07 21:13:52 edhill 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     NAMELIST /MYPACKAGE_PARM01/
30 jmc 1.3 & myPa_MNC,
31     & myPa_StaV_Cgrid, myPa_Tend_Cgrid,
32     & myPa_applyTendT, myPa_applyTendS,
33     & myPa_applyTendU, myPa_applyTendV,
34     & myPa_doSwitch1, myPa_doSwitch2,
35     & myPa_index1, myPa_index2,
36     & myPa_param1, myPa_param2,
37     & myPa_string1, myPa_string2,
38     & myPa_Scal1File, myPa_Scal2File,
39     & myPa_VelUFile, myPa_VelVFile,
40     & myPa_Surf1File, myPa_Surf2File
41 heimbach 1.1
42     C === Local variables ===
43     C msgBuf - Informational/error meesage buffer
44     C iUnit - Work variable for IO unit number
45     CHARACTER*(MAX_LEN_MBUF) msgBuf
46     INTEGER iUnit
47    
48     _BEGIN_MASTER(myThid)
49    
50     C-- Default values for MYPACKAGE
51 jmc 1.3 myPa_MNC = useMNC
52     myPa_StaV_Cgrid = .TRUE.
53     myPa_Tend_Cgrid = .TRUE.
54     myPa_applyTendT = .FALSE.
55     myPa_applyTendS = .FALSE.
56     myPa_applyTendU = .FALSE.
57     myPa_applyTendV = .FALSE.
58     C- additional parameters:
59     myPa_doSwitch1 = .FALSE.
60     myPa_doSwitch2 = .FALSE.
61     myPa_index1 = 0
62     myPa_index2 = 0
63     myPa_param1 = 0. _d 0
64     myPa_param2 = 0. _d 0
65     myPa_string1 = ' '
66     myPa_string2 = ' '
67     C- file names for initial conditions:
68     myPa_Scal1File = ' '
69     myPa_Scal2File = ' '
70     myPa_VelUFile = ' '
71     myPa_VelVFile = ' '
72     myPa_Surf1File = ' '
73     myPa_Surf2File = ' '
74    
75 heimbach 1.1 WRITE(msgBuf,'(A)') 'MYPACKAGE_READPARMS: opening data.mypackage'
76     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
77     & SQUEEZE_RIGHT , 1)
78     CALL OPEN_COPY_DATA_FILE(
79     I 'data.mypackage', 'MYPACKAGE_READPARMS',
80     O iUnit,
81     I myThid )
82    
83     C Read parameters from open data file
84     READ(UNIT=iUnit,NML=MYPACKAGE_PARM01)
85 jmc 1.3 WRITE(msgBuf,'(A)')
86 heimbach 1.1 & 'MYPACKAGE_READPARMS: finished reading data.mypackage'
87     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
88     & SQUEEZE_RIGHT , 1)
89     C Close the open data file
90     CLOSE(iUnit)
91    
92     C Make sure that we locally honor the global MNC on/off flag
93 jmc 1.3 myPa_MNC = myPa_MNC .AND. useMNC
94 heimbach 1.1 #ifndef ALLOW_MNC
95     C Fix to avoid running without getting any output:
96 jmc 1.3 myPa_MNC = .FALSE.
97 heimbach 1.1 #endif
98 jmc 1.3 myPa_MDSIO = (.NOT. myPa_MNC) .OR. outputTypesInclusive
99 heimbach 1.1
100     _END_MASTER(myThid)
101    
102     C-- Everyone else must wait for the parameters to be loaded
103     _BARRIER
104    
105     #endif /* ALLOW_MYPACKAGE */
106    
107     RETURN
108     END

  ViewVC Help
Powered by ViewVC 1.1.22