/[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.2 - (hide annotations) (download)
Fri May 30 22:13:42 2008 UTC (17 years, 1 month ago) by dimitri
Branch: MAIN
Changes since 1.1: +20 -2 lines
Initial code submitted by Baylor on May 19, 2008.  See:
http://forge.csail.mit.edu/pipermail/mitgcm-devel/2008-May/003392.html

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

  ViewVC Help
Powered by ViewVC 1.1.22