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

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

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


Revision 1.1 - (show annotations) (download)
Wed Jun 28 21:26:21 2006 UTC (17 years, 11 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint58k_post, checkpoint58m_post
Adding template package MYPACKAGE to serve as reference. Does nothing.

1 C $Header: /u/gcmpack/MITgcm/pkg/mypackage/mypackage_readparms.F,v 1.13 2005/07/30 23:53:48 jmc Exp $
2 C $Name: $
3
4 #include "MYPACKAGE_OPTIONS.h"
5
6 SUBROUTINE MYPACKAGE_READPARMS( myThid )
7 C /==========================================================\
8 C | SUBROUTINE MYPACKAGE_READPARMS |
9 C | o Routine to initialize MYPACKAGE variables and constants. |
10 C |==========================================================|
11 C | Initialize MYPACKAGE parameters, read in data.mypackage |
12 C \==========================================================/
13 IMPLICIT NONE
14
15 C === Global variables ===
16 #include "SIZE.h"
17 #include "EEPARAMS.h"
18 #include "PARAMS.h"
19 #include "GRID.h"
20 #include "MYPACKAGE.h"
21
22 C === Routine arguments ===
23 INTEGER myThid
24
25 #ifdef ALLOW_MYPACKAGE
26
27 NAMELIST /MYPACKAGE_PARM01/
28 & MYPA_MNC,
29 & MYPA_index1, MYPA_index2,
30 & MYPA_param1, MYPA_param2,
31 & MYPA_string1, MYPA_string2,
32 & mypaStatScal1File, mypaStatScal2File,
33 & mypaStatUvelFile, mypaStatVvelFile,
34 & mypaSurf1File, mypaSurf2File
35
36 C === Local variables ===
37 C msgBuf - Informational/error meesage buffer
38 C iUnit - Work variable for IO unit number
39 CHARACTER*(MAX_LEN_MBUF) msgBuf
40 INTEGER iUnit
41
42 C-- MYPACKAGE_READPARMS has been called so we know that
43 C the package is active.
44 MYPAisOn = .TRUE.
45
46 _BEGIN_MASTER(myThid)
47
48 C-- Default values for MYPACKAGE
49 MYPA_MNC = useMNC
50 MYPA_doSwitch1 = .FALSE.
51 MYPA_doSwitch2 = .FALSE.
52 MYPA_index1 = 0
53 MYPA_index2 = 0
54 MYPA_param1 = 0. _d 0
55 MYPA_param2 = 0. _d 0
56 MYPA_string1 = ' '
57 MYPA_string2 = ' '
58 mypaStatScal1File = ' '
59 mypaStatScal2File = ' '
60 mypaStatUvelFile = ' '
61 mypaStatVvelFile = ' '
62 mypaSurf1File = ' '
63 mypaSurf2File = ' '
64
65 WRITE(msgBuf,'(A)') 'MYPACKAGE_READPARMS: opening data.mypackage'
66 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
67 & SQUEEZE_RIGHT , 1)
68 CALL OPEN_COPY_DATA_FILE(
69 I 'data.mypackage', 'MYPACKAGE_READPARMS',
70 O iUnit,
71 I myThid )
72
73 C Read parameters from open data file
74 READ(UNIT=iUnit,NML=MYPACKAGE_PARM01)
75 WRITE(msgBuf,'(A)')
76 & 'MYPACKAGE_READPARMS: finished reading data.mypackage'
77 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
78 & SQUEEZE_RIGHT , 1)
79 C Close the open data file
80 CLOSE(iUnit)
81
82 C Make sure that we locally honor the global MNC on/off flag
83 MYPA_MNC = MYPA_MNC .AND. useMNC
84 #ifndef ALLOW_MNC
85 C Fix to avoid running without getting any output:
86 MYPA_MNC = .FALSE.
87 #endif
88 MYPA_MDSIO = (.NOT. MYPA_MNC) .OR. outputTypesInclusive
89
90 _END_MASTER(myThid)
91
92 C-- Everyone else must wait for the parameters to be loaded
93 _BARRIER
94
95 #endif /* ALLOW_MYPACKAGE */
96
97 RETURN
98 END

  ViewVC Help
Powered by ViewVC 1.1.22