1 |
C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_readparms.F,v 1.8 2003/01/13 19:02:45 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GMREDI_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE GMREDI_READPARMS( myThid ) |
7 |
C /==========================================================\ |
8 |
C | SUBROUTINE GMREDI_READPARMS | |
9 |
C | o Routine to initialize GM/Redi variables and constants. | |
10 |
C |==========================================================| |
11 |
C | Initialize GM/Redi parameters, read in data.gmredi | |
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 "GMREDI.h" |
21 |
#include "GMREDI_DIAGS.h" |
22 |
|
23 |
C === Routine arguments === |
24 |
INTEGER myThid |
25 |
|
26 |
#ifdef ALLOW_GMREDI |
27 |
|
28 |
C-- GM/Redi parameter |
29 |
C GM_Small_Number :: epsilon used in computing the slope |
30 |
C GM_slopeSqCutoff :: slope^2 cut-off value |
31 |
NAMELIST /GM_PARM01/ |
32 |
& GM_AdvForm, GM_AdvSeparate, |
33 |
& GM_isopycK, |
34 |
& GM_background_K, |
35 |
& GM_taper_scheme, |
36 |
& GM_maxSlope, |
37 |
& GM_Kmin_horiz, |
38 |
& GM_Small_Number, GM_slopeSqCutoff, |
39 |
& GM_Visbeck_alpha, |
40 |
& GM_Visbeck_length, |
41 |
& GM_Visbeck_depth, |
42 |
& GM_Visbeck_maxval_K, |
43 |
& GM_Scrit, |
44 |
& GM_Sd |
45 |
c & GM_dumpFreq, |
46 |
c & GM_taveFreq |
47 |
|
48 |
C === Local variables === |
49 |
C msgBuf - Informational/error meesage buffer |
50 |
C iUnit - Work variable for IO unit number |
51 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
52 |
INTEGER iUnit |
53 |
|
54 |
C-- GMREDI_READPARMS has been called so we know that |
55 |
C the package is active. |
56 |
GMRediIsOn=.TRUE. |
57 |
|
58 |
|
59 |
_BEGIN_MASTER(myThid) |
60 |
|
61 |
WRITE(msgBuf,'(A)') ' GM_READPARMS: opening data.gmredi' |
62 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
63 |
& SQUEEZE_RIGHT , 1) |
64 |
|
65 |
|
66 |
CALL OPEN_COPY_DATA_FILE( |
67 |
I 'data.gmredi', 'GM_READPARMS', |
68 |
O iUnit, |
69 |
I myThid ) |
70 |
|
71 |
C-- Default values GM/Redi |
72 |
GM_AdvForm = .FALSE. |
73 |
GM_AdvSeparate = .FALSE. |
74 |
GM_isopycK = -999. |
75 |
GM_background_K = 0. |
76 |
GM_maxslope = 1.0D-2 |
77 |
GM_Kmin_horiz = 0. |
78 |
GM_Small_Number = 1. _d -12 |
79 |
GM_slopeSqCutoff = 1. _d +48 |
80 |
GM_taper_scheme = ' ' |
81 |
GM_Scrit = 0.004 |
82 |
GM_Sd = 0.001 |
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. |
90 |
GM_Visbeck_length = 200.D3 |
91 |
GM_Visbeck_depth = 1000.D0 |
92 |
GM_Visbeck_maxval_K = 2500.D0 |
93 |
|
94 |
C-- Read parameters from open data file |
95 |
READ(UNIT=iUnit,NML=GM_PARM01) |
96 |
|
97 |
WRITE(msgBuf,'(A)') ' GM_READPARMS: finished reading data.gmredi' |
98 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
99 |
& SQUEEZE_RIGHT , 1) |
100 |
|
101 |
C-- Close the open data file |
102 |
CLOSE(iUnit) |
103 |
|
104 |
C Default value for GM_isopycK is equal to GM_background_K : |
105 |
IF (GM_isopycK.EQ.-999.) GM_isopycK = GM_background_K |
106 |
|
107 |
C Some constants |
108 |
GM_rMaxSlope=0. |
109 |
if (GM_maxSlope.ne.0.) GM_rMaxSlope=1. / GM_maxSlope |
110 |
|
111 |
IF (GM_AdvForm) THEN |
112 |
GM_skewflx = 0. |
113 |
GM_advect = 1. |
114 |
GM_ExtraDiag = GM_Visbeck_alpha.NE.0. .OR. GM_isopycK.NE.0. |
115 |
ELSE |
116 |
GM_skewflx = 1. |
117 |
GM_advect = 0. |
118 |
GM_ExtraDiag = GM_isopycK.NE.GM_background_K |
119 |
ENDIF |
120 |
|
121 |
_END_MASTER(myThid) |
122 |
|
123 |
C-- Everyone else must wait for the parameters to be loaded |
124 |
_BARRIER |
125 |
|
126 |
#endif /* ALLOW_GMREDI */ |
127 |
|
128 |
RETURN |
129 |
END |