/[MITgcm]/MITgcm_contrib/submesoscale/code/gmredi_readparms.F
ViewVC logotype

Annotation of /MITgcm_contrib/submesoscale/code/gmredi_readparms.F

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


Revision 1.3 - (hide annotations) (download)
Fri May 30 22:24:25 2008 UTC (17 years, 1 month ago) by dimitri
Branch: MAIN
Changes since 1.2: +3 -1 lines
Modifications to make it compatible with Gael's 30 May 2008 changes.

1 dimitri 1.3 C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_readparms.F,v 1.17 2008/05/30 02:50:16 gforget Exp $
2 dimitri 1.1 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 dimitri 1.2 & GM_ExtraDiag,
49 dimitri 1.3 & GM_InMomAsStress,
50 dimitri 1.1 & GM_isopycK,
51     & GM_background_K,
52     & GM_taper_scheme,
53     & GM_maxSlope,
54     & GM_Kmin_horiz,
55     & GM_Small_Number, GM_slopeSqCutoff,
56     & GM_Visbeck_alpha,
57     & GM_Visbeck_length,
58     & GM_Visbeck_depth,
59     & GM_Visbeck_maxval_K,
60     & GM_Scrit,
61     & GM_Sd,
62 dimitri 1.2 & GM_MNC,
63     & GM_SM_Ce,
64     & GM_SM_Lf,
65     & GM_SM_tau
66 dimitri 1.1 c & GM_dumpFreq,
67     c & GM_taveFreq
68    
69     _BEGIN_MASTER(myThid)
70    
71     C-- GMREDI_READPARMS has been called so we know that
72     C the package is active.
73     GMRediIsOn = .TRUE.
74    
75     C-- Default values GM/Redi
76     GM_AdvForm = .FALSE.
77 dimitri 1.2 GM_ExtraDiag = .FALSE.
78 dimitri 1.1 GM_AdvSeparate = .FALSE.
79 dimitri 1.3 GM_InMomAsStress = .FALSE.
80 dimitri 1.1 GM_isopycK = -999.
81     GM_background_K = 0. _d 0
82     GM_maxslope = 1. _d -2
83     GM_Kmin_horiz = 0. _d 0
84     GM_Small_Number = 1. _d -20
85     GM_slopeSqCutoff = 1. _d +48
86     GM_taper_scheme = ' '
87     GM_Scrit = 0.004 _d 0
88     GM_Sd = 0.001 _d 0
89     GM_MNC = useMNC
90 dimitri 1.2 CBFK Submesoscale Paramters
91     C GM_SM_Ce is the efficiency factor. Nondimensional, typically 0.06
92     C Will be converted to a dimensional factor later
93     C Set to zero to kill Submeso at runtime.
94     GM_SM_Ce = 0.06 _d 0
95     C GM_SM_Lf is the minimum Front Width scale. Typically 1-10km
96     GM_SM_Lf = 5.00 _d 3
97     C GM_SM_Lmax is the maximum upscale. Typically 100km
98     GM_SM_Lmax = 1.00 _d 5
99     C GM_SM_tau is the momentum mixing timescale: 1/d to 1/week
100     GM_SM_tau = 8.64 _d 4
101     C Will be converted to an inverse squared timescale later
102 dimitri 1.1
103     C-- Default values GM/Redi I/O control
104     c GM_dumpFreq = -1.
105     c GM_taveFreq = -1.
106    
107     C-- Default values Visbeck
108     GM_Visbeck_alpha = 0. _d 0
109     GM_Visbeck_length = 200. _d 3
110     GM_Visbeck_depth = 1000. _d 0
111     GM_Visbeck_maxval_K = 2500. _d 0
112    
113     WRITE(msgBuf,'(A)') ' GM_READPARMS: opening data.gmredi'
114     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
115     & SQUEEZE_RIGHT , 1)
116     CALL OPEN_COPY_DATA_FILE(
117     I 'data.gmredi', 'GM_READPARMS',
118     O iUnit,
119     I myThid )
120    
121     C Read parameters from open data file
122     READ(UNIT=iUnit,NML=GM_PARM01)
123     WRITE(msgBuf,'(A)') ' GM_READPARMS: finished reading data.gmredi'
124     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
125     & SQUEEZE_RIGHT , 1)
126     C Close the open data file
127     CLOSE(iUnit)
128    
129     C Default value for GM_isopycK is equal to GM_background_K :
130     IF (GM_isopycK.EQ.-999.) GM_isopycK = GM_background_K
131    
132     C Some constants
133     GM_rMaxSlope=0.
134     if (GM_maxSlope.ne.0.) GM_rMaxSlope=1. / GM_maxSlope
135    
136     IF (GM_AdvForm) THEN
137     GM_skewflx = 0.
138     GM_advect = 1.
139     GM_ExtraDiag = GM_Visbeck_alpha.NE.0. .OR. GM_isopycK.NE.0.
140     ELSE
141     GM_skewflx = 1.
142     GM_advect = 0.
143 dimitri 1.2 GM_ExtraDiag = (GM_isopycK.NE.GM_background_K)
144     & .or.(GM_SM_Ce.gt.0 _d 0)
145 dimitri 1.1 ENDIF
146    
147     C Make sure that we locally honor the global MNC on/off flag
148     GM_MNC = GM_MNC .AND. useMNC
149     #ifndef ALLOW_MNC
150     C Fix to avoid running without getting any output:
151     GM_MNC = .FALSE.
152     #endif
153     GM_MDSIO = (.NOT. GM_MNC) .OR. outputTypesInclusive
154    
155     _END_MASTER(myThid)
156    
157     C-- Everyone else must wait for the parameters to be loaded
158     _BARRIER
159    
160     #endif /* ALLOW_GMREDI */
161    
162     RETURN
163     END

  ViewVC Help
Powered by ViewVC 1.1.22