1 |
dimitri |
1.1 |
C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_readparms.F,v 1.16 2007/06/20 22:11:10 jmc 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_isopycK, |
49 |
|
|
& GM_background_K, |
50 |
|
|
& GM_taper_scheme, |
51 |
|
|
& GM_maxSlope, |
52 |
|
|
& GM_Kmin_horiz, |
53 |
|
|
& GM_Small_Number, GM_slopeSqCutoff, |
54 |
|
|
& GM_Visbeck_alpha, |
55 |
|
|
& GM_Visbeck_length, |
56 |
|
|
& GM_Visbeck_depth, |
57 |
|
|
& GM_Visbeck_maxval_K, |
58 |
|
|
& GM_Scrit, |
59 |
|
|
& GM_Sd, |
60 |
|
|
& GM_MNC |
61 |
|
|
c & GM_dumpFreq, |
62 |
|
|
c & GM_taveFreq |
63 |
|
|
|
64 |
|
|
_BEGIN_MASTER(myThid) |
65 |
|
|
|
66 |
|
|
C-- GMREDI_READPARMS has been called so we know that |
67 |
|
|
C the package is active. |
68 |
|
|
GMRediIsOn = .TRUE. |
69 |
|
|
|
70 |
|
|
C-- Default values GM/Redi |
71 |
|
|
GM_AdvForm = .FALSE. |
72 |
|
|
GM_AdvSeparate = .FALSE. |
73 |
|
|
GM_isopycK = -999. |
74 |
|
|
GM_background_K = 0. _d 0 |
75 |
|
|
GM_maxslope = 1. _d -2 |
76 |
|
|
GM_Kmin_horiz = 0. _d 0 |
77 |
|
|
GM_Small_Number = 1. _d -20 |
78 |
|
|
GM_slopeSqCutoff = 1. _d +48 |
79 |
|
|
GM_taper_scheme = ' ' |
80 |
|
|
GM_Scrit = 0.004 _d 0 |
81 |
|
|
GM_Sd = 0.001 _d 0 |
82 |
|
|
GM_MNC = useMNC |
83 |
|
|
|
84 |
|
|
C-- Default values GM/Redi I/O control |
85 |
|
|
c GM_dumpFreq = -1. |
86 |
|
|
c GM_taveFreq = -1. |
87 |
|
|
|
88 |
|
|
C-- Default values Visbeck |
89 |
|
|
GM_Visbeck_alpha = 0. _d 0 |
90 |
|
|
GM_Visbeck_length = 200. _d 3 |
91 |
|
|
GM_Visbeck_depth = 1000. _d 0 |
92 |
|
|
GM_Visbeck_maxval_K = 2500. _d 0 |
93 |
|
|
|
94 |
|
|
WRITE(msgBuf,'(A)') ' GM_READPARMS: opening data.gmredi' |
95 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
96 |
|
|
& SQUEEZE_RIGHT , 1) |
97 |
|
|
CALL OPEN_COPY_DATA_FILE( |
98 |
|
|
I 'data.gmredi', 'GM_READPARMS', |
99 |
|
|
O iUnit, |
100 |
|
|
I myThid ) |
101 |
|
|
|
102 |
|
|
C Read parameters from open data file |
103 |
|
|
READ(UNIT=iUnit,NML=GM_PARM01) |
104 |
|
|
WRITE(msgBuf,'(A)') ' GM_READPARMS: finished reading data.gmredi' |
105 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
106 |
|
|
& SQUEEZE_RIGHT , 1) |
107 |
|
|
C Close the open data file |
108 |
|
|
CLOSE(iUnit) |
109 |
|
|
|
110 |
|
|
C Default value for GM_isopycK is equal to GM_background_K : |
111 |
|
|
IF (GM_isopycK.EQ.-999.) GM_isopycK = GM_background_K |
112 |
|
|
|
113 |
|
|
C Some constants |
114 |
|
|
GM_rMaxSlope=0. |
115 |
|
|
if (GM_maxSlope.ne.0.) GM_rMaxSlope=1. / GM_maxSlope |
116 |
|
|
|
117 |
|
|
IF (GM_AdvForm) THEN |
118 |
|
|
GM_skewflx = 0. |
119 |
|
|
GM_advect = 1. |
120 |
|
|
GM_ExtraDiag = GM_Visbeck_alpha.NE.0. .OR. GM_isopycK.NE.0. |
121 |
|
|
ELSE |
122 |
|
|
GM_skewflx = 1. |
123 |
|
|
GM_advect = 0. |
124 |
|
|
GM_ExtraDiag = GM_isopycK.NE.GM_background_K |
125 |
|
|
ENDIF |
126 |
|
|
|
127 |
|
|
C Make sure that we locally honor the global MNC on/off flag |
128 |
|
|
GM_MNC = GM_MNC .AND. useMNC |
129 |
|
|
#ifndef ALLOW_MNC |
130 |
|
|
C Fix to avoid running without getting any output: |
131 |
|
|
GM_MNC = .FALSE. |
132 |
|
|
#endif |
133 |
|
|
GM_MDSIO = (.NOT. GM_MNC) .OR. outputTypesInclusive |
134 |
|
|
|
135 |
|
|
_END_MASTER(myThid) |
136 |
|
|
|
137 |
|
|
C-- Everyone else must wait for the parameters to be loaded |
138 |
|
|
_BARRIER |
139 |
|
|
|
140 |
|
|
#endif /* ALLOW_GMREDI */ |
141 |
|
|
|
142 |
|
|
RETURN |
143 |
|
|
END |