forked from altMITgcm/MITgcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
icefront_readparms.F
157 lines (131 loc) · 4.99 KB
/
icefront_readparms.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
C $Header: /u/gcmpack/MITgcm/pkg/icefront/icefront_readparms.F,v 1.16 2017/02/07 00:18:59 jmc Exp $
C $Name: $
#include "ICEFRONT_OPTIONS.h"
CBOP
C !ROUTINE: ICEFRONT_READPARMS
C !INTERFACE: ==========================================================
SUBROUTINE ICEFRONT_READPARMS( myThid )
C !DESCRIPTION:
C Initialize ICEFRONT parameters, read in data.icefront
C !USES: ===============================================================
IMPLICIT NONE
#include "SIZE.h"
#include "EEPARAMS.h"
#include "ICEFRONT.h"
#include "PARAMS.h"
#ifdef ALLOW_SHELFICE
# include "SHELFICE.h"
#endif
C !INPUT PARAMETERS: ===================================================
C myThid :: my thread Id number
INTEGER myThid
C !OUTPUT PARAMETERS: ==================================================
C none
#ifdef ALLOW_ICEFRONT
C !LOCAL VARIABLES: ====================================================
C iUnit :: unit number for I/O
C msgBuf :: message buffer
INTEGER iUnit
CHARACTER*(MAX_LEN_MBUF) msgBuf
CEOP
NAMELIST /ICEFRONT_PARM01/
& rhoIcefront, ICEFRONTkappa,
& ICEFRONTlatentHeat, ICEFRONTHeatCapacity_Cp,
& ICEFRONTthetaSurface,
& applyIcefrontTendT,applyIcefrontTendS,
& ICEFRONTdepthFile, ICEFRONTlengthFile
#ifdef ALLOW_EXF
NAMELIST /ICEFRONT_EXF_PARM02/
& SGRunOffFile, SGRunOffperiod, SGRunOffStartTime,
& SGRunOffstartdate1, SGRunOffstartdate2,
& SGRunOffconst, SGRunOff_inscal,
& SGRunOff_remov_intercept, SGRunOff_remov_slope
#endif /* ALLOW_EXF */
IF ( .NOT.useICEFRONT ) THEN
C- pkg ICEFRONT is not used
_BEGIN_MASTER(myThid)
C- Track pkg activation status:
ICEFRONTisON = .FALSE.
C print a (weak) warning if data.icefront is found
CALL PACKAGES_UNUSED_MSG( 'useICEFRONT', ' ', ' ' )
_END_MASTER(myThid)
RETURN
ENDIF
_BEGIN_MASTER(myThid)
C This routine has been called by the main model so we set our
C internal flag to indicate we are in business
ICEFRONTisON = .TRUE.
C Set defaults values for parameters in ICEFRONT.h
#ifdef ALLOW_SHELFICE
IF (useShelfice) THEN
C Use the same values as in SHELFICE
ICEFRONTlatentHeat = SHELFICElatentHeat
ICEFRONTHeatCapacity_Cp = SHELFICEHeatCapacity_Cp
rhoIcefront = rhoShelfice
ICEFRONTkappa = SHELFICEkappa
ICEFRONTthetaSurface = SHELFICEthetaSurface
ELSE
#else /* ifndef ALLOW_SHELFICE */
IF (.TRUE.) THEN
#endif /* ALLOW_SHELFICE */
C Default values when SHELFICE is not used
ICEFRONTlatentHeat = 334.0 _d 3
ICEFRONTHeatCapacity_Cp = 2000.0 _d 0
rhoIcefront = 917.0 _d 0
ICEFRONTkappa = 1.54 _d -06
ICEFRONTthetaSurface = - 20.0 _d 0
ENDIF
recip_ICEFRONTlatentHeat = 0.0 _d 0
ICEFRONTlengthFile = ' '
ICEFRONTdepthFile = ' '
applyIcefrontTendS = .TRUE.
applyIcefrontTendT = .TRUE.
#ifdef ALLOW_EXF
SGRunOffstartdate1 = 0
SGRunOffstartdate2 = 0
SGRunOffStartTime = UNSET_RL
SGRunOffperiod = 0.0 _d 0
SGRunOffconst = 0.0 _d 0
SGRunOff_remov_intercept = 0.0 _d 0
SGRunOff_remov_slope = 0.0 _d 0
SGRunOff_inscal = 1.0 _d 0
SGRunOffFile = ' '
C- internal parameters (not in namelist):
SGRunOffmask = 'c'
#endif /* ALLOW_EXF */
C Open and read the data.icefront file
WRITE(msgBuf,'(A)') ' ICEFRONT_READPARMS: opening data.icefront'
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
& SQUEEZE_RIGHT, myThid )
CALL OPEN_COPY_DATA_FILE(
I 'data.icefront', 'ICEFRONT_READPARMS',
O iUnit,
I myThid )
WRITE(msgBuf,'(A)') ' ICEFRONT_READPARMS: reading ICEFRONT_PARM01'
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
& SQUEEZE_RIGHT, myThid )
READ(UNIT=iUnit,NML=ICEFRONT_PARM01)
#ifdef ALLOW_EXF
IF ( useEXF ) THEN
WRITE(msgBuf,'(A)')
& ' ICEFRONT_READPARMS: reading ICEFRONT_EXF_PARM02'
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
& SQUEEZE_RIGHT, myThid )
READ( UNIT=iUnit, NML=ICEFRONT_EXF_PARM02 )
ENDIF
#endif /* ALLOW_EXF */
WRITE(msgBuf,'(A)')
& ' ICEFRONT_READPARMS: finished reading data.icefront'
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
& SQUEEZE_RIGHT, myThid )
C Close the open data file
CLOSE(iUnit)
C Now set-up any remaining parameters that result from the input parameters
IF ( ICEFRONTlatentHeat .NE. 0. _d 0 )
& recip_ICEFRONTlatentHeat = 1. _d 0/ICEFRONTlatentHeat
_END_MASTER(myThid)
C Everyone else must wait for the parameters to be loaded
_BARRIER
#endif /* ALLOW_ICEFRONT */
RETURN
END