/[MITgcm]/manual/s_phys_pkgs/text/exf.tex
ViewVC logotype

Contents of /manual/s_phys_pkgs/text/exf.tex

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


Revision 1.8 - (show annotations) (download) (as text)
Tue Jun 27 20:00:18 2006 UTC (17 years, 10 months ago) by heimbach
Branch: MAIN
Changes since 1.7: +55 -46 lines
File MIME type: application/x-tex
Update to reflect latest changes.

1 \subsection{EXF: The external forcing package
2 \label{sec:pkg:exf}}
3 \begin{rawhtml}
4 <!-- CMIREDIR:sectionexf: -->
5 \end{rawhtml}
6
7 Authors: Patrick Heimbach and Dimitris Menemenlis
8
9 \subsubsection{Introduction
10 \label{sec:pkg:exf:intro}}
11
12 The external forcing package, in conjunction with the
13 calendar package (cal), enables the handling of real-time
14 (or ``model-time'') forcing
15 fields of differing temporal forcing patterns.
16 It comprises climatological restoring and relaxation.
17 Bulk formulae are implemented to convert atmospheric fields
18 to surface fluxes.
19 An interpolation routine provides on-the-fly interpolation of
20 forcing fields an arbitrary grid onto the model grid.
21
22 CPP options enable or disable different aspects of the package
23 (Section \ref{sec:pkg:exf:config}).
24 Runtime options, flags, filenames and field-related dates/times are
25 set in \texttt{data.exf} and \texttt{data.exf\_clim}
26 (Section \ref{sec:pkg:exf:runtime}).
27 A description of key subroutines is given in Section
28 \ref{sec:pkg:exf:subroutines}.
29 Input fields, units and sign conventions are summarized in
30 Section \ref{sec:pkg:exf:fields_units}, and available diagnostics
31 output is listed in Section \ref{sec:pkg:exf:fields_diagnostics}.
32
33 %----------------------------------------------------------------------
34
35 \subsubsection{EXF configuration, compiling \& running}
36
37 \paragraph{Compile-time options
38 \label{sec:pkg:exf:config}}
39 ~
40
41 As with all MITgcm packages, EXF can be turned on or off at compile time
42 %
43 \begin{itemize}
44 %
45 \item
46 using the \texttt{packages.conf} file by adding \texttt{exf} to it,
47 %
48 \item
49 or using \texttt{genmake2} adding
50 \texttt{-enable=exf} or \texttt{-disable=exf} switches
51 %
52 \item
53 \textit{required packages and CPP options}: \\
54 EXF requires the calendar package \texttt{cal} to be enabled;
55 no additional CPP options are required.
56 %
57 \end{itemize}
58 (see Section \ref{sect:buildingCode}).
59
60 Parts of the EXF code can be enabled or disabled at compile time
61 via CPP preprocessor flags. These options are set in either
62 \texttt{EXF\_OPTIONS.h} or in \texttt{ECCO\_CPPOPTIONS.h}.
63 Table \ref{tab:pkg:exf:cpp} summarizes these options.
64
65 \begin{table}[b!]
66 \centering
67 \label{tab:pkg:exf:cpp}
68 {\footnotesize
69 \begin{tabular}{|l|l|}
70 \hline
71 \textbf{CPP option} & \textbf{Description} \\
72 \hline \hline
73 \texttt{EXF\_VERBOSE} &
74 verbose mode (recommended only for testing) \\
75 \texttt{ALLOW\_ATM\_TEMP} &
76 compute heat/freshwater fluxes from atmos. state input \\
77 \texttt{ALLOW\_ATM\_WIND} &
78 compute wind stress from wind speed input\\
79 \texttt{ALLOW\_BULKFORMULAE} &
80 is used if \texttt{ALLOW\_ATM\_TEMP} or
81 \texttt{ALLOW\_ATM\_WIND} is enabled \\
82 \texttt{EXF\_READ\_EVAP} & read evaporation instead of computing it \\
83 \texttt{ALLOW\_RUNOFF} & read time-constant river/glacier run-off field \\
84 \texttt{ALLOW\_DOWNWARD\_RADIATION} & compute net from downward or downward from net radiation \\
85 \texttt{USE\_EXF\_INTERPOLATION} & enable on-the-fly bilinear or bicubic interpolation of input fields \\
86 \hline
87 \multicolumn{2}{|c|}{\textit{used in conjunction with relaxation to prescribed (climatological) fields}} \\
88 \hline
89 \texttt{ALLOW\_CLIMSST\_RELAXATION} &
90 relaxation to 2-D SST climatology \\
91 \texttt{ALLOW\_CLIMSSS\_RELAXATION} &
92 relaxation to 2-D SSS climatology \\
93 \hline
94 \multicolumn{2}{|c|}{\textit{these are set outside of EXF in} \texttt{CPP\_OPTIONS.h}} \\
95 \hline
96 \texttt{SHORTWAVE\_HEATING} & enable shortwave radiation \\
97 \texttt{ATMOSPHERIC\_LOADING} & enable surface pressure forcing \\
98 \hline
99 \end{tabular}
100 }
101 \caption{~}
102 \end{table}
103
104
105 %----------------------------------------------------------------------
106
107 \subsubsection{Run-time parameters
108 \label{sec:pkg:exf:runtime}}
109
110 Run-time parameters are set in files
111 \texttt{data.pkg}, \texttt{data.exf}, and
112 \texttt{data.exf\_clim} (for relaxation/climatological fields)
113 which are read in \texttt{exf\_readparms.F}.
114 Run-time parameters may be broken into 3 categories:
115 (i) switching on/off the package at runtime,
116 (ii) general flags and parameters, and
117 (iii) attributes for each forcing and climatological field.
118
119 \paragraph{Enabling the package}
120 ~ \\
121 %
122 A package is usually switched on/off at runtime by setting
123 (e.g. for EXF) \texttt{useEXF = .TRUE.} in \texttt{data.pkg}.
124 For EXF this flag is omitted, i.e. EXF is always ON if it is compiled.
125
126 \paragraph{General flags and parameters}
127 ~ \\
128 %
129 \begin{table}[h!]
130 \centering
131 \label{tab:pkg:exf:runtime_flags}
132 {\footnotesize
133 \begin{tabular}{|l|c|l|}
134 \hline
135 \textbf{Flag/parameter} & \textbf{default} & \textbf{Description} \\
136 \hline \hline
137 useExfCheckRange & \texttt{.TRUE.} &
138 check range of input fields and stop if out of range \\
139 useExfYearlyFields & \texttt{.FALSE.} &
140 append current year postfix of form \texttt{\_YYYY} on filename \\
141 twoDigitYear & \texttt{.FALSE.} &
142 instead of appending \texttt{\_YYYY} append \texttt{YY} \\
143 repeatPeriod & \texttt{0.0} & $ > 0 $ :
144 cycle through all input fields at the same period (in seconds) \\
145 ~ & ~ & $ = 0 $ :
146 use period assigned to each field \\
147 exf\_offset\_atemp & \texttt{0.0} & set to 273.16 to convert from deg. Kelvin (assumed input) to Celsius \\
148 windstressmax & \texttt{2.0} &
149 max. allowed wind stress $N/m^2$ \\
150 exf\_albedo & \texttt{0.1} &
151 surface albedo used to compute downward vs. net radiative fluxes \\
152 exf\_iprec & \texttt{32} &
153 precision of input fields (32-bit or 64-bit) \\
154 exf\_yftype & \texttt{'RL'} &
155 precision of arrays ('RL' vs. 'RS') \\
156 \hline
157 \end{tabular}
158 }
159 \caption{~}
160 \end{table}
161
162
163 \paragraph{Field attributes}
164 ~ \\
165 %
166 All EXF fields are listed in Section \ref{sec:pkg:exf:fields_units}.
167 Each field has a number of attributes which can be customized.
168 They are summarized in
169 Table \ref{tab:pkg:exf:runtime_attributes}.
170 To obtain an attribute for a specific field, e.g. \texttt{uwind}
171 prepend the field name to the listed attribute, e.g. for attribute
172 \texttt{period} this yields \texttt{uwindperiod}:
173 %
174 \begin{eqnarray*}
175 \begin{array}{cccccc}
176 ~ & \texttt{field} & \& & \texttt{attribute} & \longrightarrow & \texttt{parameter} \\
177 \text{e.g.} & \text{uwind} & \& & \text{period} & \longrightarrow & \text{uwindperiod} \\
178 \end{array}
179 \end{eqnarray*}
180 %
181
182 \begin{table}[h!]
183 \centering
184 \label{tab:pkg:exf:runtime_attributes}
185 {\footnotesize
186 \begin{tabular}{|l|c|l|}
187 \hline
188 \textbf{attribute} & \textbf{Default} & \textbf{Description} \\
189 \hline \hline
190 \textit{field}\texttt{file} & ' ' &
191 filename; if left empty no file will be read; \texttt{const} will be used instead \\
192 \textit{field}\texttt{const} & 0. &
193 constant that will be used if no file is read \\
194 \textit{field}\texttt{startdate1} & 0. &
195 format: \texttt{YYYYMMDD}; start year (YYYY), month (MM), day (YY) \\
196 ~&~& of field to determine record number \\
197 \textit{field}\texttt{startdate2} & 0. &
198 format: \texttt{HHMMSS}; start hour (HH), minute (MM), second(SS) \\
199 ~&~& of field to determine record number\\
200 \textit{field}\texttt{period} & 0. &
201 interval in seconds between two records \\
202 \texttt{exf\_inscal\_}\textit{field}& ~ &
203 optional rescaling of input fields to comply with EXF units \\
204 \texttt{exf\_outscal\_}\textit{field}& ~ &
205 optional rescaling of EXF fields when mapped onto MITgcm fields \\
206 \hline
207 \multicolumn{3}{|c|}{\textit{used in conjunction with}
208 \texttt{EXF\_USE\_INTERPOLATION}} \\
209 \hline
210 \textit{field}\texttt{\_lon0} & $thetaMin+delX/2$ &
211 starting longitude of input \\
212 \textit{field}\texttt{\_lon\_inc} & $delX$ &
213 increment in longitude of input \\
214 \textit{field}\texttt{\_lat0} & $phiMin+delY/2$ &
215 starting latitude of input \\
216 \textit{field}\texttt{\_lat\_inc} & $delY$ &
217 increment in latitude of input \\
218 \textit{field}\texttt{\_nlon} & $Nx$ &
219 number of grid points in longitude of input \\
220 \textit{field}\texttt{\_nlat} & $Ny$ &
221 number of grid points in longitude of input \\
222 \hline
223 \end{tabular}
224 }
225 \caption{\newline
226 Note one exception for the default of
227 \texttt{atempconst} = celsius2K = 273.16}
228 \end{table}
229
230 \paragraph{Example configuration} ~ \\
231 %
232 The following block is taken from the \texttt{data.exf} file
233 of the veification experiment \texttt{global\_with\_exf/}.
234 It defines attributes for the heat flux variable \texttt{hflux}:
235
236 \begin{verbatim}
237 hfluxfile = 'ncep_qnet.bin',
238 hfluxstartdate1 = 19920101,
239 hfluxstartdate2 = 000000,
240 hfluxperiod = 2592000.0,
241 hflux_lon0 = 2
242 hflux_lon_inc = 4
243 hflux_lat0 = -78
244 hflux_lat_inc = 39*4
245 hflux_nlon = 90
246 hflux_nlat = 40
247 \end{verbatim}
248
249 EXF will read a file of name 'ncep\_qnet.bin'.
250 Its first record represents January 1st, 1991 at 00:00 UTC.
251 Next record is 2592000 seconds (or 30 days) later.
252 Interpolation on-the-fly is used (in the present case trivially
253 on the same grid, but included nevertheless for illustration),
254 and input field grid starting coordinates and increments are
255 supplied as well.
256
257 %----------------------------------------------------------------------
258
259 \subsubsection{EXF input fields and units
260 \label{sec:pkg:exf:fields_units}}
261
262 The following list is taken from the header file \texttt{exf\_fields.h}.
263 It comprises all EXF input fields.
264
265 Output fields which EXF provides to the MITgcm are fields
266 \textbf{fu}, \textbf{fv}, \textbf{Qnet}, \textbf{Qsw}, \textbf{EmPmR},
267 and \textbf{pload}. They are defined in \texttt{FFIELDS.h}.
268
269 {\footnotesize
270 \begin{verbatim}
271
272 c----------------------------------------------------------------------
273 c |
274 c field :: Description
275 c |
276 c----------------------------------------------------------------------
277 c ustress :: Zonal surface wind stress in N/m^2
278 c | > 0 for increase in uVel, which is west to
279 c | east for cartesian and spherical polar grids
280 c | Typical range: -0.5 < ustress < 0.5
281 c | Southwest C-grid U point
282 c | Input field
283 c----------------------------------------------------------------------
284 c vstress :: Meridional surface wind stress in N/m^2
285 c | > 0 for increase in vVel, which is south to
286 c | north for cartesian and spherical polar grids
287 c | Typical range: -0.5 < vstress < 0.5
288 c | Southwest C-grid V point
289 c | Input field
290 c----------------------------------------------------------------------
291 c hs :: sensible heat flux into ocean in W/m^2
292 c | > 0 for increase in theta (ocean warming)
293 c----------------------------------------------------------------------
294 c hl :: latent heat flux into ocean in W/m^2
295 c | > 0 for increase in theta (ocean warming)
296 c----------------------------------------------------------------------
297 c hflux :: Net upward surface heat flux in W/m^2
298 c | excluding shortwave (on input)
299 c | hflux = latent + sensible + lwflux
300 c | > 0 for decrease in theta (ocean cooling)
301 c | Typical range: -250 < hflux < 600
302 c | Southwest C-grid tracer point
303 c | Input field
304 c----------------------------------------------------------------------
305 c sflux :: Net upward freshwater flux in m/s
306 c | sflux = evap - precip - runoff
307 c | > 0 for increase in salt (ocean salinity)
308 c | Typical range: -1e-7 < sflux < 1e-7
309 c | Southwest C-grid tracer point
310 c | Input field
311 c----------------------------------------------------------------------
312 c swflux :: Net upward shortwave radiation in W/m^2
313 c | swflux = - ( swdown - ice and snow absorption - reflected )
314 c | > 0 for decrease in theta (ocean cooling)
315 c | Typical range: -350 < swflux < 0
316 c | Southwest C-grid tracer point
317 c | Input field
318 c----------------------------------------------------------------------
319 c uwind :: Surface (10-m) zonal wind velocity in m/s
320 c | > 0 for increase in uVel, which is west to
321 c | east for cartesian and spherical polar grids
322 c | Typical range: -10 < uwind < 10
323 c | Southwest C-grid U point
324 c | Input or input/output field
325 c----------------------------------------------------------------------
326 c vwind :: Surface (10-m) meridional wind velocity in m/s
327 c | > 0 for increase in vVel, which is south to
328 c | north for cartesian and spherical polar grids
329 c | Typical range: -10 < vwind < 10
330 c | Southwest C-grid V point
331 c | Input or input/output field
332 c----------------------------------------------------------------------
333 c wspeed :: Surface (10-m) wind speed in m/s
334 c | >= 0 sqrt(u^2+v^2)
335 c | Typical range: 0 < wspeed < 10
336 c | Input or input/output field
337 c----------------------------------------------------------------------
338 c atemp :: Surface (2-m) air temperature in deg K
339 c | Typical range: 200 < atemp < 300
340 c | Southwest C-grid tracer point
341 c | Input or input/output field
342 c----------------------------------------------------------------------
343 c aqh :: Surface (2m) specific humidity in kg/kg
344 c | Typical range: 0 < aqh < 0.02
345 c | Southwest C-grid tracer point
346 c | Input or input/output field
347 c----------------------------------------------------------------------
348 c lwflux :: Net upward longwave radiation in W/m^2
349 c | lwflux = - ( lwdown - ice and snow absorption - emitted )
350 c | > 0 for decrease in theta (ocean cooling)
351 c | Typical range: -20 < lwflux < 170
352 c | Southwest C-grid tracer point
353 c | Input field
354 c----------------------------------------------------------------------
355 c evap :: Evaporation in m/s
356 c | > 0 for increase in salt (ocean salinity)
357 c | Typical range: 0 < evap < 2.5e-7
358 c | Southwest C-grid tracer point
359 c | Input, input/output, or output field
360 c----------------------------------------------------------------------
361 c precip :: Precipitation in m/s
362 c | > 0 for decrease in salt (ocean salinity)
363 c | Typical range: 0 < precip < 5e-7
364 c | Southwest C-grid tracer point
365 c | Input or input/output field
366 c----------------------------------------------------------------------
367 c snowprecip :: snow in m/s
368 c | > 0 for decrease in salt (ocean salinity)
369 c | Typical range: 0 < precip < 5e-7
370 c | Input or input/output field
371 c----------------------------------------------------------------------
372 c runoff :: River and glacier runoff in m/s
373 c | > 0 for decrease in salt (ocean salinity)
374 c | Typical range: 0 < runoff < ????
375 c | Southwest C-grid tracer point
376 c | Input or input/output field
377 c | !!! WATCH OUT: Default exf_inscal_runoff !!!
378 c | !!! in exf_readparms.F is not 1.0 !!!
379 c----------------------------------------------------------------------
380 c swdown :: Downward shortwave radiation in W/m^2
381 c | > 0 for increase in theta (ocean warming)
382 c | Typical range: 0 < swdown < 450
383 c | Southwest C-grid tracer point
384 c | Input/output field
385 c----------------------------------------------------------------------
386 c lwdown :: Downward longwave radiation in W/m^2
387 c | > 0 for increase in theta (ocean warming)
388 c | Typical range: 50 < lwdown < 450
389 c | Southwest C-grid tracer point
390 c | Input/output field
391 c----------------------------------------------------------------------
392 c apressure :: Atmospheric pressure field in N/m^2
393 c | > 0 for ????
394 c | Typical range: ???? < apressure < ????
395 c | Southwest C-grid tracer point
396 c | Input field
397 c----------------------------------------------------------------------
398
399 \end{verbatim}
400 }
401
402 %----------------------------------------------------------------------
403
404 \subsubsection{Key subroutines
405 \label{sec:pkg:exf:subroutines}}
406
407 Top-level routine: \texttt{exf\_getforcing.F}
408
409 {\footnotesize
410 \begin{verbatim}
411
412 C !CALLING SEQUENCE:
413 c ...
414 c exf_getforcing (TOP LEVEL ROUTINE)
415 c |
416 c |-- exf_getclim (get climatological fields used e.g. for relax.)
417 c | |--- exf_set_climsst (relax. to 2-D SST field)
418 c | |--- exf_set_climsss (relax. to 2-D SSS field)
419 c | o
420 c |
421 c |-- exf_getffields <- this one does almost everything
422 c | | 1. reads in fields, either flux or atmos. state,
423 c | | depending on CPP options (for each variable two fields
424 c | | consecutive in time are read in and interpolated onto
425 c | | current time step).
426 c | | 2. If forcing is atmos. state and control is atmos. state,
427 c | | then the control variable anomalies are read here via ctrl_get_gen
428 c | | (atemp, aqh, precip, swflux, swdown, uwind, vwind).
429 c | | If forcing and control are fluxes, then
430 c | | controls are added later.
431 c | o
432 c |
433 c |-- exf_radiation
434 c | | Compute net or downwelling radiative fluxes via
435 c | | Stefan-Boltzmann law in case only one is known.
436 c | o
437 c |-- exf_wind
438 c | | Computes wind speed and stresses, if required.
439 c | o
440 c |
441 c |-- exf_bulkformulae
442 c | | Compute air-sea buoyancy fluxes from
443 c | | atmospheric state following Large and Pond, JPO, 1981/82
444 c | o
445 c |
446 c |-- < hflux is sum of sensible, latent, longwave rad. >
447 c |-- < sflux is sum of evap. minus precip. minus runoff >
448 c |
449 c |-- exf_getsurfacefluxes
450 c | If forcing and control is flux, then the
451 c | control vector anomalies are read here via ctrl_get_gen
452 c | (hflux, sflux, ustress, vstress)
453 c |
454 c |-- < update tile edges here >
455 c |
456 c |-- exf_check_range
457 c | | Check whether read fields are within assumed range
458 c | | (may capture mismatches in units)
459 c | o
460 c |
461 c |-- < add shortwave to hflux for diagnostics >
462 c |
463 c |-- exf_diagnostics_fill
464 c | | Do EXF-related diagnostics output here.
465 c | o
466 c |
467 c |-- exf_mapfields
468 c | | Forcing fields from exf package are mapped onto
469 c | | mitgcm forcing arrays.
470 c | | Mapping enables a runtime rescaling of fields
471 c | o
472 C o
473 \end{verbatim}
474 }
475
476 Radiation calculation: \texttt{exf\_radiation.F}
477
478 Wind speed and stress calculation: \texttt{exf\_wind.F}
479
480 Bulk formula: \texttt{exf\_bulkformulae.F}
481
482 Generic I/O: \texttt{exf\_set\_gen.F}
483
484 Interpolation: \texttt{exf\_interp.F}
485
486 Header routines
487
488 %----------------------------------------------------------------------
489
490 \subsubsection{EXF diagnostics
491 \label{sec:pkg:exf:diagnostics}}
492
493 Diagnostics output is available via the diagnostics package
494 (see Section \ref{sec:pkg:diagnostics}).
495 Available output fields are summarized in
496 Table \ref{tab:pkg:exf:diagnostics}.
497
498 \begin{table}[h!]
499 \centering
500 \label{tab:pkg:exf:diagnostics}
501 {\footnotesize
502 \begin{verbatim}
503 ------------------------------------------------------
504 <-Name->|Levs|grid|<-- Units -->|<- Tile (max=80c)
505 ------------------------------------------------------
506 EXFhs | 1 | SM | W/m^2 | Sensible heat flux into ocean, >0 increases theta
507 EXFhl | 1 | SM | W/m^2 | Latent heat flux into ocean, >0 increases theta
508 EXFlwnet| 1 | SM | W/m^2 | Net upward longwave radiation, >0 decreases theta
509 EXFswnet| 1 | SM | W/m^2 | Net upward shortwave radiation, >0 decreases theta
510 EXFlwdn | 1 | SM | W/m^2 | Downward longwave radiation, >0 increases theta
511 EXFswdn | 1 | SM | W/m^2 | Downward shortwave radiation, >0 increases theta
512 EXFqnet | 1 | SM | W/m^2 | Net upward heat flux (turb+rad), >0 decreases theta
513 EXFtaux | 1 | SU | N/m^2 | zonal surface wind stress, >0 increases uVel
514 EXFtauy | 1 | SV | N/m^2 | meridional surface wind stress, >0 increases vVel
515 EXFuwind| 1 | SM | m/s | zonal 10-m wind speed, >0 increases uVel
516 EXFvwind| 1 | SM | m/s | meridional 10-m wind speed, >0 increases uVel
517 EXFwspee| 1 | SM | m/s | 10-m wind speed modulus ( >= 0 )
518 EXFatemp| 1 | SM | degK | surface (2-m) air temperature
519 EXFaqh | 1 | SM | kg/kg | surface (2-m) specific humidity
520 EXFevap | 1 | SM | m/s | evaporation, > 0 increases salinity
521 EXFpreci| 1 | SM | m/s | evaporation, > 0 decreases salinity
522 EXFsnow | 1 | SM | m/s | snow precipitation, > 0 decreases salinity
523 EXFempmr| 1 | SM | m/s | net upward freshwater flux, > 0 increases salinity
524 EXFpress| 1 | SM | N/m^2 | atmospheric pressure field
525 \end{verbatim}
526 }
527 \caption{~}
528 \end{table}
529
530 %----------------------------------------------------------------------
531
532 \subsubsection{Reference experiments}
533
534 global\_with\_exf:
535
536 lab\_sea:
537
538 %----------------------------------------------------------------------
539
540 \subsubsection{References}

  ViewVC Help
Powered by ViewVC 1.1.22