1 |
C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_readparms.F,v 1.17 2008/05/30 02:50:16 gforget Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GMREDI_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GMREDI_READPARMS |
8 |
C !INTERFACE: |
9 |
SUBROUTINE GMREDI_READPARMS( myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
13 |
C | SUBROUTINE GMREDI_READPARMS |
14 |
C | o Routine to initialize GM/Redi variables and constants. |
15 |
C *==========================================================* |
16 |
C | Initialize GM/Redi parameters, read in data.gmredi |
17 |
C *==========================================================* |
18 |
C \ev |
19 |
|
20 |
C !USES: |
21 |
IMPLICIT NONE |
22 |
|
23 |
C === Global variables === |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
#include "GMREDI.h" |
29 |
|
30 |
C !INPUT/OUTPUT PARAMETERS: |
31 |
C === Routine arguments === |
32 |
INTEGER myThid |
33 |
|
34 |
#ifdef ALLOW_GMREDI |
35 |
C !LOCAL VARIABLES: |
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 |
CEOP |
42 |
|
43 |
C-- GM/Redi parameter |
44 |
C GM_Small_Number :: epsilon used in computing the slope |
45 |
C GM_slopeSqCutoff :: slope^2 cut-off value |
46 |
NAMELIST /GM_PARM01/ |
47 |
& GM_AdvForm, GM_AdvSeparate, |
48 |
& GM_InMomAsStress, |
49 |
& GM_isopycK, |
50 |
& GM_background_K, |
51 |
& GM_taper_scheme, |
52 |
& GM_maxSlope, |
53 |
& GM_Kmin_horiz, |
54 |
& GM_Small_Number, GM_slopeSqCutoff, |
55 |
& GM_Visbeck_alpha, |
56 |
& GM_Visbeck_length, |
57 |
& GM_Visbeck_depth, |
58 |
& GM_Visbeck_maxval_K, |
59 |
& GM_facTrL2dz, GM_facTrL2ML, GM_maxTransLay, |
60 |
& GM_Scrit, GM_Sd, |
61 |
& GM_MNC |
62 |
|
63 |
_BEGIN_MASTER(myThid) |
64 |
|
65 |
C-- GMREDI_READPARMS has been called so we know that the package is active. |
66 |
C note: cannot test for GMRediIsOn outside GM-redi S/R (since is in GMREDI.h) |
67 |
C + is not initialized (if useGMRedi=F) => useless => removed |
68 |
c GMRediIsOn = .TRUE. |
69 |
|
70 |
C-- Default values GM/Redi |
71 |
GM_AdvForm = .FALSE. |
72 |
GM_AdvSeparate = .FALSE. |
73 |
GM_InMomAsStress = .FALSE. |
74 |
GM_isopycK = -999. |
75 |
GM_background_K = 0. _d 0 |
76 |
GM_maxslope = 1. _d -2 |
77 |
GM_Kmin_horiz = 0. _d 0 |
78 |
GM_Small_Number = 1. _d -20 |
79 |
GM_slopeSqCutoff = 1. _d +48 |
80 |
GM_taper_scheme = ' ' |
81 |
GM_facTrL2dz = 1. |
82 |
GM_facTrL2ML = 5. |
83 |
GM_maxTransLay = 500. |
84 |
GM_Scrit = 0.004 _d 0 |
85 |
GM_Sd = 0.001 _d 0 |
86 |
GM_MNC = useMNC |
87 |
|
88 |
C-- Default values GM/Redi I/O control |
89 |
c GM_dumpFreq = -1. |
90 |
c GM_taveFreq = -1. |
91 |
|
92 |
C-- Default values Visbeck |
93 |
GM_Visbeck_alpha = 0. _d 0 |
94 |
GM_Visbeck_length = 200. _d 3 |
95 |
GM_Visbeck_depth = 1000. _d 0 |
96 |
GM_Visbeck_maxval_K = 2500. _d 0 |
97 |
|
98 |
WRITE(msgBuf,'(A)') ' GM_READPARMS: opening data.gmredi' |
99 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
100 |
& SQUEEZE_RIGHT , 1) |
101 |
CALL OPEN_COPY_DATA_FILE( |
102 |
I 'data.gmredi', 'GM_READPARMS', |
103 |
O iUnit, |
104 |
I myThid ) |
105 |
|
106 |
C Read parameters from open data file |
107 |
READ(UNIT=iUnit,NML=GM_PARM01) |
108 |
WRITE(msgBuf,'(A)') ' GM_READPARMS: finished reading data.gmredi' |
109 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
110 |
& SQUEEZE_RIGHT , 1) |
111 |
C Close the open data file |
112 |
CLOSE(iUnit) |
113 |
|
114 |
C Default value for GM_isopycK is equal to GM_background_K : |
115 |
IF (GM_isopycK.EQ.-999.) GM_isopycK = GM_background_K |
116 |
|
117 |
C Some constants |
118 |
GM_rMaxSlope = 0. |
119 |
if (GM_maxSlope.NE.0.) GM_rMaxSlope = 1. _d 0 / GM_maxSlope |
120 |
|
121 |
IF (GM_AdvForm) THEN |
122 |
GM_skewflx = 0. |
123 |
GM_advect = 1. |
124 |
GM_ExtraDiag = GM_Visbeck_alpha.NE.0. .OR. GM_isopycK.NE.0. |
125 |
ELSE |
126 |
GM_skewflx = 1. |
127 |
GM_advect = 0. |
128 |
GM_ExtraDiag = GM_isopycK.NE.GM_background_K |
129 |
ENDIF |
130 |
|
131 |
C Make sure that we locally honor the global MNC on/off flag |
132 |
GM_MNC = GM_MNC .AND. useMNC |
133 |
#ifndef ALLOW_MNC |
134 |
C Fix to avoid running without getting any output: |
135 |
GM_MNC = .FALSE. |
136 |
#endif |
137 |
GM_MDSIO = (.NOT. GM_MNC) .OR. outputTypesInclusive |
138 |
|
139 |
_END_MASTER(myThid) |
140 |
|
141 |
C-- Everyone else must wait for the parameters to be loaded |
142 |
_BARRIER |
143 |
|
144 |
#endif /* ALLOW_GMREDI */ |
145 |
|
146 |
RETURN |
147 |
END |