Line data Source code
1 : !=======================================================================
2 :
3 : ! Flux variable declarations; these include fields sent from the coupler
4 : ! ("in"), sent to the coupler ("out"), written to diagnostic history files
5 : ! ("diagnostic"), and used internally ("internal").
6 : !
7 : ! author Elizabeth C. Hunke, LANL
8 : !
9 : module icedrv_flux
10 :
11 : use icedrv_kinds
12 : use icedrv_domain_size, only: ncat, nilyr, nx
13 : use icedrv_constants, only: c0, c1, c5, c10, c20, c180
14 : use icedrv_constants, only: nu_diag
15 : use icepack_intfc, only: icepack_max_iso, icepack_max_aero
16 : use icepack_intfc, only: icepack_max_nbtrcr, icepack_max_fe
17 : use icepack_intfc, only: icepack_max_algae, icepack_max_doc, icepack_max_don
18 : use icepack_intfc, only: icepack_max_dic
19 : use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
20 : use icepack_intfc, only: icepack_query_parameters
21 : use icepack_intfc, only: icepack_query_tracer_flags, icepack_query_tracer_indices
22 : use icepack_intfc, only: icepack_query_parameters
23 : use icedrv_system, only: icedrv_system_abort
24 :
25 : implicit none
26 : private
27 : public :: init_coupler_flux, init_history_therm, init_history_dyn, &
28 : init_flux_atm_ocn, init_history_bgc
29 :
30 : character (char_len), public :: &
31 : default_season ! seasonal default values for forcing
32 :
33 : !-----------------------------------------------------------------
34 : ! Dynamics component
35 : !-----------------------------------------------------------------
36 :
37 : real (kind=dbl_kind), dimension (nx), public :: &
38 :
39 : ! in from atmos (if .not.calc_strair)
40 : strax , & ! wind stress components (N/m^2)
41 : stray , & !
42 :
43 : ! in from ocean
44 : uocn , & ! ocean current, x-direction (m/s)
45 : vocn , & ! ocean current, y-direction (m/s)
46 :
47 : ! out to atmosphere
48 : strairxT, & ! stress on ice by air, x-direction
49 : strairyT, & ! stress on ice by air, y-direction
50 :
51 : ! out to ocean T-cell (kg/m s^2)
52 : strocnxT, & ! ice-ocean stress, x-direction
53 : strocnyT ! ice-ocean stress, y-direction
54 :
55 : ! diagnostic
56 :
57 : real (kind=dbl_kind), dimension (nx), public :: &
58 : strairx , & ! stress on ice by air, x-direction
59 : strairy , & ! stress on ice by air, y-direction
60 : daidtd , & ! ice area tendency due to transport (1/s)
61 : dvidtd , & ! ice volume tendency due to transport (m/s)
62 : dagedtd , & ! ice age tendency due to transport (s/s)
63 : dardg1dt, & ! rate of area loss by ridging ice (1/s)
64 : dardg2dt, & ! rate of area gain by new ridges (1/s)
65 : dvirdgdt, & ! rate of ice volume ridged (m/s)
66 : closing, & ! rate of closing due to divergence/shear (1/s)
67 : opening ! rate of opening due to divergence/shear (1/s)
68 :
69 : real (kind=dbl_kind), &
70 : dimension (nx,ncat), public :: &
71 : ! ridging diagnostics in categories
72 : dardg1ndt, & ! rate of area loss by ridging ice (1/s)
73 : dardg2ndt, & ! rate of area gain by new ridges (1/s)
74 : dvirdgndt, & ! rate of ice volume ridged (m/s)
75 : aparticn, & ! participation function
76 : krdgn, & ! mean ridge thickness/thickness of ridging ice
77 : ardgn, & ! fractional area of ridged ice
78 : vrdgn, & ! volume of ridged ice
79 : araftn, & ! rafting ice area
80 : vraftn, & ! rafting ice volume
81 : aredistn, & ! redistribution function: fraction of new ridge area
82 : vredistn ! redistribution function: fraction of new ridge volume
83 :
84 : !-----------------------------------------------------------------
85 : ! Thermodynamic component
86 : !-----------------------------------------------------------------
87 :
88 : ! in from atmosphere (if calc_Tsfc)
89 :
90 : real (kind=dbl_kind), dimension (nx), public :: &
91 : zlvl , & ! atm level height (m)
92 : uatm , & ! wind velocity components (m/s)
93 : vatm , &
94 : wind , & ! wind speed (m/s)
95 : potT , & ! air potential temperature (K)
96 : Tair , & ! air temperature (K)
97 : Qa , & ! specific humidity (kg/kg)
98 : rhoa , & ! air density (kg/m^3)
99 : swvdr , & ! sw down, visible, direct (W/m^2)
100 : swvdf , & ! sw down, visible, diffuse (W/m^2)
101 : swidr , & ! sw down, near IR, direct (W/m^2)
102 : swidf , & ! sw down, near IR, diffuse (W/m^2)
103 : flw ! incoming longwave radiation (W/m^2)
104 :
105 : ! in from atmosphere (if .not. calc_Tsfc)
106 : ! These are per ice area
107 :
108 : real (kind=dbl_kind), &
109 : dimension (nx,ncat), public :: &
110 : fsurfn_f , & ! net flux to top surface, excluding fcondtop
111 : fcondtopn_f, & ! downward cond flux at top surface (W m-2)
112 : fsensn_f , & ! sensible heat flux (W m-2)
113 : flatn_f ! latent heat flux (W m-2)
114 :
115 : ! in from atmosphere
116 :
117 : real (kind=dbl_kind), dimension (nx), public :: &
118 : frain , & ! rainfall rate (kg/m^2 s)
119 : fsnow ! snowfall rate (kg/m^2 s)
120 :
121 : ! in from ocean
122 :
123 : real (kind=dbl_kind), dimension (nx), public :: &
124 : sss , & ! sea surface salinity (ppt)
125 : sst , & ! sea surface temperature (C)
126 : sstdat , & ! sea surface temperature (C) saved for restoring
127 : frzmlt , & ! freezing/melting potential (W/m^2)
128 : frzmlt_init, & ! frzmlt used in current time step (W/m^2)
129 : Tf , & ! freezing temperature (C)
130 : qdp , & ! deep ocean heat flux (W/m^2), negative upward
131 : hmix ! mixed layer depth (m)
132 :
133 : ! water isotopes
134 : real (kind=dbl_kind), dimension (nx), public :: &
135 : HDO_ocn , & ! seawater concentration of HDO (kg/kg)
136 : H2_16O_ocn , & ! seawater concentration of H2_16O (kg/kg)
137 : H2_18O_ocn ! seawater concentration of H2_18O (kg/kg)
138 :
139 : real (kind=dbl_kind), dimension (nx), public :: &
140 : fsens , & ! sensible heat flux (W/m^2)
141 : flat , & ! latent heat flux (W/m^2)
142 : fswabs , & ! shortwave flux absorbed in ice and ocean (W/m^2)
143 : fswint_ai,& ! SW absorbed in ice interior below surface (W/m^2)
144 : flwout , & ! outgoing longwave radiation (W/m^2)
145 : Tref , & ! 2m atm reference temperature (K)
146 : Qref , & ! 2m atm reference spec humidity (kg/kg)
147 : Uref , & ! 10m atm reference wind speed (m/s)
148 : evap , & ! evaporative water flux (kg/m^2/s)
149 : evaps , & ! evaporative water flux over snow (kg/m^2/s)
150 : evapi ! evaporative water flux over ice (kg/m^2/s)
151 :
152 : ! albedos aggregated over categories (if calc_Tsfc)
153 : real (kind=dbl_kind), dimension(nx), public :: &
154 : alvdr , & ! visible, direct (fraction)
155 : alidr , & ! near-ir, direct (fraction)
156 : alvdf , & ! visible, diffuse (fraction)
157 : alidf , & ! near-ir, diffuse (fraction)
158 : ! grid-box-mean versions
159 : alvdr_ai, & ! visible, direct (fraction)
160 : alidr_ai, & ! near-ir, direct (fraction)
161 : alvdf_ai, & ! visible, diffuse (fraction)
162 : alidf_ai, & ! near-ir, diffuse (fraction)
163 : ! components for history
164 : albice , & ! bare ice albedo
165 : albsno , & ! snow albedo
166 : albpnd , & ! melt pond albedo
167 : apeff_ai , & ! effective pond area used for radiation calculation
168 : snowfrac , & ! snow fraction used in radiation
169 : ! components for diagnostic
170 : alvdr_init, & ! visible, direct (fraction)
171 : alidr_init, & ! near-ir, direct (fraction)
172 : alvdf_init, & ! visible, diffuse (fraction)
173 : alidf_init ! near-ir, diffuse (fraction)
174 :
175 : ! out to ocean
176 : real (kind=dbl_kind), dimension (nx), public :: &
177 : fpond , & ! fresh water flux to ponds (kg/m^2/s)
178 : fresh , & ! fresh water flux to ocean (kg/m^2/s)
179 : fsalt , & ! salt flux to ocean (kg/m^2/s)
180 : fhocn , & ! net heat flux to ocean (W/m^2)
181 : fswthru ! shortwave penetrating to ocean (W/m^2)
182 :
183 : ! internal
184 :
185 : real (kind=dbl_kind), &
186 : dimension (nx), public :: &
187 : fswfac , & ! for history
188 : scale_factor! scaling factor for shortwave components
189 :
190 : logical (kind=log_kind), public :: &
191 : update_ocn_f, & ! if true, update fresh water and salt fluxes
192 : l_mpond_fresh ! if true, include freshwater feedback from meltponds
193 : ! when running in ice-ocean or coupled configuration
194 :
195 : real (kind=dbl_kind), dimension (nx,ncat), public :: &
196 : meltsn , & ! snow melt in category n (m)
197 : melttn , & ! top melt in category n (m)
198 : meltbn , & ! bottom melt in category n (m)
199 : congeln , & ! congelation ice formation in category n (m)
200 : snoicen ! snow-ice formation in category n (m)
201 :
202 : real (kind=dbl_kind), dimension (nx,ncat), public :: &
203 : keffn_top ! effective thermal conductivity of the top ice layer
204 : ! on categories (W/m^2/K)
205 :
206 : ! quantities passed from ocean mixed layer to atmosphere
207 :
208 : real (kind=dbl_kind), dimension (nx), public :: &
209 : strairx_ocn , & ! stress on ocean by air, x-direction
210 : strairy_ocn , & ! stress on ocean by air, y-direction
211 : fsens_ocn , & ! sensible heat flux (W/m^2)
212 : flat_ocn , & ! latent heat flux (W/m^2)
213 : flwout_ocn , & ! outgoing longwave radiation (W/m^2)
214 : evap_ocn , & ! evaporative water flux (kg/m^2/s)
215 : alvdr_ocn , & ! visible, direct (fraction)
216 : alidr_ocn , & ! near-ir, direct (fraction)
217 : alvdf_ocn , & ! visible, diffuse (fraction)
218 : alidf_ocn , & ! near-ir, diffuse (fraction)
219 : Tref_ocn , & ! 2m atm reference temperature (K)
220 : Qref_ocn ! 2m atm reference spec humidity (kg/kg)
221 :
222 : ! diagnostic
223 :
224 : real (kind=dbl_kind), dimension (nx), public :: &
225 : fsurf , & ! net surface heat flux (excluding fcondtop)(W/m^2)
226 : fcondtop,&! top surface conductive flux (W/m^2)
227 : fcondbot,&! bottom surface conductive flux (W/m^2)
228 : fbot, & ! heat flux at bottom surface of ice (excluding excess) (W/m^2)
229 : Tbot, & ! Temperature at bottom surface of ice (deg C)
230 : Tsnice, & ! Temperature at snow ice interface (deg C)
231 : congel, & ! basal ice growth (m/step-->cm/day)
232 : frazil, & ! frazil ice growth (m/step-->cm/day)
233 : snoice, & ! snow-ice formation (m/step-->cm/day)
234 : meltt , & ! top ice melt (m/step-->cm/day)
235 : melts , & ! snow melt (m/step-->cm/day)
236 : meltb , & ! basal ice melt (m/step-->cm/day)
237 : meltl , & ! lateral ice melt (m/step-->cm/day)
238 : dsnow, & ! change in snow thickness (m/step-->cm/day)
239 : daidtt, & ! ice area tendency thermo. (s^-1)
240 : dvidtt, & ! ice volume tendency thermo. (m/s)
241 : dagedtt,& ! ice age tendency thermo. (s/s)
242 : mlt_onset, &! day of year that sfc melting begins
243 : frz_onset, &! day of year that freezing begins (congel or frazil)
244 : frazil_diag ! frazil ice growth diagnostic (m/step-->cm/day)
245 :
246 : real (kind=dbl_kind), &
247 : dimension (nx,ncat), public :: &
248 : fsurfn, & ! category fsurf
249 : fcondtopn,& ! category fcondtop
250 : fcondbotn,& ! category fcondbot
251 : fsensn, & ! category sensible heat flux
252 : flatn ! category latent heat flux
253 :
254 : ! As above but these remain grid box mean values i.e. they are not
255 : ! divided by aice at end of ice_dynamics.
256 : ! These are used for generating
257 : ! ice diagnostics as these are more accurate.
258 : ! (The others suffer from problem of incorrect values at grid boxes
259 : ! that change from an ice free state to an icy state.)
260 :
261 : real (kind=dbl_kind), dimension (nx), public :: &
262 : fresh_ai, & ! fresh water flux to ocean (kg/m^2/s)
263 : fsalt_ai, & ! salt flux to ocean (kg/m^2/s)
264 : fhocn_ai, & ! net heat flux to ocean (W/m^2)
265 : fswthru_ai ! shortwave penetrating to ocean (W/m^2)
266 :
267 : !-----------------------------------------------------------------
268 : ! internal
269 : !-----------------------------------------------------------------
270 :
271 : real (kind=dbl_kind), dimension (nx), public :: &
272 : rside , & ! fraction of ice that melts laterally
273 : fside , & ! lateral heat flux (W/m^2)
274 : fsw , & ! incoming shortwave radiation (W/m^2)
275 : coszen , & ! cosine solar zenith angle, < 0 for sun below horizon
276 : rdg_conv, & ! convergence term for ridging (1/s)
277 : rdg_shear ! shear term for ridging (1/s)
278 :
279 : real (kind=dbl_kind), dimension(nx,nilyr+1), public :: &
280 : salinz , & ! initial salinity profile (ppt)
281 : Tmltz ! initial melting temperature (C)
282 :
283 : !-----------------------------------------------------------------
284 : ! biogeochemistry
285 : !-----------------------------------------------------------------
286 :
287 : ! in from atmosphere
288 :
289 : real (kind=dbl_kind), & ! coupling variable for both tr_aero and tr_zaero
290 : dimension (nx,icepack_max_aero), public :: &
291 : faero_atm ! aerosol deposition rate (kg/m^2 s)
292 :
293 : real (kind=dbl_kind), & ! coupling variable for tr_iso
294 : dimension (nx,icepack_max_iso), public :: &
295 : fiso_atm , & ! isotope deposition rate (kg/m^2 s)
296 : fiso_evap ! isotope evaporation rate (kg/m^2 s)
297 :
298 : real (kind=dbl_kind), &
299 : dimension (nx,icepack_max_nbtrcr), public :: &
300 : flux_bio_atm ! all bio fluxes to ice from atmosphere
301 :
302 : real (kind=dbl_kind), dimension (nx,icepack_max_iso), public :: &
303 : Qa_iso , & ! isotope specific humidity (kg/kg)
304 : Qref_iso ! 2m atm reference isotope spec humidity (kg/kg)
305 :
306 : ! out to ocean
307 :
308 : real (kind=dbl_kind), &
309 : dimension (nx,icepack_max_aero), public :: &
310 : faero_ocn ! aerosol flux to ocean (kg/m^2/s)
311 :
312 : real (kind=dbl_kind), &
313 : dimension (nx,icepack_max_iso), public :: &
314 : fiso_ocn ! isotope flux to ocean (kg/m^2/s)
315 :
316 : real (kind=dbl_kind), &
317 : dimension (nx,icepack_max_nbtrcr), public :: &
318 : flux_bio , & ! all bio fluxes to ocean
319 : flux_bio_ai ! all bio fluxes to ocean, averaged over grid cell
320 :
321 : real (kind=dbl_kind), dimension (nx), public :: &
322 : fzsal_ai, & ! salt flux to ocean from zsalinity (kg/m^2/s)
323 : fzsal_g_ai ! gravity drainage salt flux to ocean (kg/m^2/s)
324 :
325 : ! internal
326 :
327 : logical (kind=log_kind), public :: &
328 : cpl_bgc ! switch to couple BGC via drivers
329 :
330 : real (kind=dbl_kind), dimension (nx,ncat), public :: &
331 : hin_old , & ! old ice thickness
332 : dsnown ! change in snow thickness in category n (m)
333 :
334 : real (kind=dbl_kind), dimension (nx), public :: &
335 : nit , & ! ocean nitrate (mmol/m^3)
336 : amm , & ! ammonia/um (mmol/m^3)
337 : sil , & ! silicate (mmol/m^3)
338 : dmsp , & ! dmsp (mmol/m^3)
339 : dms , & ! dms (mmol/m^3)
340 : hum , & ! humic material carbon (mmol/m^3)
341 : fnit , & ! ice-ocean nitrate flux (mmol/m^2/s), positive to ocean
342 : famm , & ! ice-ocean ammonia/um flux (mmol/m^2/s), positive to ocean
343 : fsil , & ! ice-ocean silicate flux (mmol/m^2/s), positive to ocean
344 : fdmsp , & ! ice-ocean dmsp (mmol/m^2/s), positive to ocean
345 : fdms , & ! ice-ocean dms (mmol/m^2/s), positive to ocean
346 : fhum , & ! ice-ocean humic material carbon (mmol/m^2/s), positive to ocean
347 : fdust ! ice-ocean dust flux (kg/m^2/s), positive to ocean
348 :
349 : real (kind=dbl_kind), dimension (nx,icepack_max_algae), public :: &
350 : algalN , & ! ocean algal nitrogen (mmol/m^3) (diatoms, pico, phaeo)
351 : falgalN ! ice-ocean algal nitrogen flux (mmol/m^2/s) (diatoms, pico, phaeo)
352 :
353 : real (kind=dbl_kind), dimension (nx,icepack_max_doc), public :: &
354 : doc , & ! ocean doc (mmol/m^3) (saccharids, lipids, tbd )
355 : fdoc ! ice-ocean doc flux (mmol/m^2/s) (saccharids, lipids, tbd)
356 :
357 : real (kind=dbl_kind), dimension (nx,icepack_max_don), public :: &
358 : don , & ! ocean don (mmol/m^3) (proteins and amino acids)
359 : fdon ! ice-ocean don flux (mmol/m^2/s) (proteins and amino acids)
360 :
361 : real (kind=dbl_kind), dimension (nx,icepack_max_dic), public :: &
362 : dic , & ! ocean dic (mmol/m^3)
363 : fdic ! ice-ocean dic flux (mmol/m^2/s)
364 :
365 : real (kind=dbl_kind), dimension (nx,icepack_max_fe), public :: &
366 : fed, fep , & ! ocean dissolved and particulate fe (nM)
367 : ffed, ffep ! ice-ocean dissolved and particulate fe flux (umol/m^2/s)
368 :
369 : real (kind=dbl_kind), dimension (nx,icepack_max_aero), public :: &
370 : zaeros ! ocean aerosols (mmol/m^3)
371 :
372 : !=======================================================================
373 :
374 : contains
375 :
376 : !=======================================================================
377 :
378 : ! Initialize all fluxes exchanged with flux coupler
379 : ! and some data-derived fields
380 : !
381 : ! author Elizabeth C. Hunke, LANL
382 :
383 42 : subroutine init_coupler_flux
384 :
385 : use icedrv_arrays_column, only: Cdn_atm
386 : use icepack_intfc, only: icepack_liquidus_temperature
387 :
388 : integer (kind=int_kind) :: n
389 :
390 : real (kind=dbl_kind) :: fcondtopn_d(6), fsurfn_d(6)
391 15 : real (kind=dbl_kind) :: stefan_boltzmann, Tffresh
392 30 : real (kind=dbl_kind) :: vonkar, zref, iceruf
393 :
394 : integer :: i
395 :
396 : data fcondtopn_d / -50.0_dbl_kind,-17.0_dbl_kind,-12.0_dbl_kind, &
397 : -9.0_dbl_kind, -7.0_dbl_kind, -3.0_dbl_kind /
398 : data fsurfn_d / 0.20_dbl_kind, 0.15_dbl_kind, 0.10_dbl_kind, &
399 : 0.05_dbl_kind, 0.01_dbl_kind, 0.01_dbl_kind /
400 :
401 : character(len=*), parameter :: subname='(init_coupler_flux)'
402 :
403 : !-----------------------------------------------------------------
404 : ! query Icepack values
405 : !-----------------------------------------------------------------
406 :
407 : call icepack_query_parameters(stefan_boltzmann_out=stefan_boltzmann, &
408 42 : Tffresh_out=Tffresh, vonkar_out=vonkar, zref_out=zref, iceruf_out=iceruf)
409 42 : call icepack_warnings_flush(nu_diag)
410 42 : if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
411 0 : file=__FILE__,line= __LINE__)
412 :
413 : !-----------------------------------------------------------------
414 : ! fluxes received from atmosphere
415 : !-----------------------------------------------------------------
416 210 : zlvl (:) = c10 ! atm level height (m)
417 210 : rhoa (:) = 1.3_dbl_kind ! air density (kg/m^3)
418 210 : uatm (:) = c5 ! wind velocity (m/s)
419 210 : vatm (:) = c5
420 210 : strax (:) = 0.05_dbl_kind
421 210 : stray (:) = 0.05_dbl_kind
422 42 : fsnow (:) = c0 ! snowfall rate (kg/m2/s)
423 : ! fsnow must be 0 for exact restarts
424 42 : if (trim(default_season) == 'winter') then
425 : ! typical winter values
426 15 : potT (:) = 253.0_dbl_kind ! air potential temp (K)
427 15 : Tair (:) = 253.0_dbl_kind ! air temperature (K)
428 15 : Qa (:) = 0.0006_dbl_kind ! specific humidity (kg/kg)
429 3 : swvdr (:) = c0 ! shortwave radiation (W/m^2)
430 3 : swvdf (:) = c0 ! shortwave radiation (W/m^2)
431 3 : swidr (:) = c0 ! shortwave radiation (W/m^2)
432 3 : swidf (:) = c0 ! shortwave radiation (W/m^2)
433 15 : flw (:) = c180 ! incoming longwave rad (W/m^2)
434 3 : frain (:) = c0 ! rainfall rate (kg/m2/s)
435 6 : do n = 1, ncat ! conductive heat flux (W/m^2)
436 18 : fcondtopn_f(:,n) = fcondtopn_d(n)
437 : enddo
438 3 : fsurfn_f = fcondtopn_f ! surface heat flux (W/m^2)
439 3 : flatn_f (:,:) = c0 ! latent heat flux (kg/m2/s)
440 3 : fsensn_f(:,:) = c0 ! sensible heat flux (W/m^2)
441 39 : elseif (trim(default_season) == 'summer') then
442 : ! typical summer values
443 15 : potT (:) = 273.0_dbl_kind ! air potential temp (K)
444 15 : Tair (:) = 273.0_dbl_kind ! air temperature (K)
445 15 : Qa (:) = 0.0035_dbl_kind ! specific humidity (kg/kg)
446 15 : swvdr (:) = 50._dbl_kind ! shortwave radiation (W/m^2)
447 15 : swvdf (:) = 50._dbl_kind ! shortwave radiation (W/m^2)
448 15 : swidr (:) = 50._dbl_kind ! shortwave radiation (W/m^2)
449 15 : swidf (:) = 50._dbl_kind ! shortwave radiation (W/m^2)
450 15 : flw (:) = 280.0_dbl_kind ! incoming longwave rad (W/m^2)
451 3 : frain (:) = c0 ! rainfall rate (kg/m2/s)
452 18 : do n = 1, ncat ! surface heat flux (W/m^2)
453 78 : fsurfn_f(:,n) = fsurfn_d(n)
454 : enddo
455 3 : fcondtopn_f(:,:) = 0.0_dbl_kind ! conductive heat flux (W/m^2)
456 78 : flatn_f (:,:) = -2.0_dbl_kind ! latent heat flux (W/m^2)
457 3 : fsensn_f (:,:) = c0 ! sensible heat flux (W/m^2)
458 : else
459 : ! typical spring values
460 180 : potT (:) = 263.15_dbl_kind ! air potential temp (K)
461 180 : Tair (:) = 263.15_dbl_kind ! air temperature (K)
462 180 : Qa (:) = 0.001_dbl_kind ! specific humidity (kg/kg)
463 180 : swvdr (:) = 25._dbl_kind ! shortwave radiation (W/m^2)
464 180 : swvdf (:) = 25._dbl_kind ! shortwave radiation (W/m^2)
465 180 : swidr (:) = 25._dbl_kind ! shortwave radiation (W/m^2)
466 180 : swidf (:) = 25._dbl_kind ! shortwave radiation (W/m^2)
467 180 : flw (:) = 230.0_dbl_kind ! incoming longwave rad (W/m^2)
468 36 : frain (:) = c0 ! rainfall rate (kg/m2/s)
469 216 : do n = 1, ncat ! surface heat flux (W/m^2)
470 936 : fsurfn_f(:,n) = fsurfn_d(n)
471 : enddo
472 36 : fcondtopn_f(:,:) = c0 ! conductive heat flux (W/m^2)
473 936 : flatn_f (:,:) = -1.0_dbl_kind ! latent heat flux (W/m^2)
474 36 : fsensn_f (:,:) = c0 ! sensible heat flux (W/m^2)
475 : endif ! l_winter
476 :
477 42 : fiso_atm (:,:) = c0 ! isotope deposition rate (kg/m2/s)
478 42 : fiso_evap (:,:) = c0 ! isotope evaporation rate (kg/m2/s)
479 42 : faero_atm (:,:) = c0 ! aerosol deposition rate (kg/m2/s)
480 42 : flux_bio_atm (:,:) = c0 ! zaero and bio deposition rate (kg/m2/s)
481 :
482 : !-----------------------------------------------------------------
483 : ! fluxes received from ocean
484 : !-----------------------------------------------------------------
485 :
486 42 : uocn (:) = c0 ! surface ocean currents (m/s)
487 42 : vocn (:) = c0
488 42 : frzmlt (:) = c0 ! freezing/melting potential (W/m^2)
489 210 : sss (:) = 34.0_dbl_kind ! sea surface salinity (ppt)
490 210 : sst (:) = -1.8_dbl_kind ! sea surface temperature (C)
491 42 : sstdat (:) = sst(:) ! sea surface temperature (C)
492 :
493 : ! water isotopes from ocean
494 42 : HDO_ocn (:) = c0
495 42 : H2_16O_ocn(:) = c0
496 42 : H2_18O_ocn(:) = c0
497 :
498 210 : do i = 1, nx
499 210 : Tf (i) = icepack_liquidus_temperature(sss(i)) ! freezing temp (C)
500 : enddo
501 42 : call icepack_warnings_flush(nu_diag)
502 42 : if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
503 0 : file=__FILE__,line= __LINE__)
504 :
505 42 : qdp (:) = c0 ! deep ocean heat flux (W/m^2)
506 210 : hmix (:) = c20 ! ocean mixed layer depth
507 :
508 : !-----------------------------------------------------------------
509 : ! fluxes sent to atmosphere
510 : !-----------------------------------------------------------------
511 :
512 42 : strairxT(:) = c0 ! wind stress, T grid
513 42 : strairyT(:) = c0
514 :
515 42 : fsens (:) = c0
516 42 : flat (:) = c0
517 42 : fswabs (:) = c0
518 210 : flwout (:) = -stefan_boltzmann*Tffresh**4
519 : ! in case atm model diagnoses Tsfc from flwout
520 42 : evap (:) = c0
521 42 : evaps (:) = c0
522 42 : evapi (:) = c0
523 42 : Tref (:) = c0
524 42 : Qref (:) = c0
525 42 : Uref (:) = c0
526 42 : alvdr (:) = c0
527 42 : alidr (:) = c0
528 42 : alvdf (:) = c0
529 42 : alidf (:) = c0
530 :
531 : !-----------------------------------------------------------------
532 : ! fluxes sent to ocean
533 : !-----------------------------------------------------------------
534 :
535 42 : strocnxT(:) = c0 ! ice-ocean stress, x-direction (T-cell)
536 42 : strocnyT(:) = c0 ! ice-ocean stress, y-direction (T-cell)
537 42 : fresh (:) = c0
538 42 : fsalt (:) = c0
539 42 : fhocn (:) = c0
540 42 : fswthru (:) = c0
541 42 : flux_bio(:,:) = c0 ! bgc
542 42 : fnit (:) = c0
543 42 : fsil (:) = c0
544 42 : famm (:) = c0
545 42 : fdmsp (:) = c0
546 42 : fdms (:) = c0
547 42 : fhum (:) = c0
548 42 : fdust (:) = c0
549 42 : falgalN(:,:)= c0
550 42 : fdoc (:,:)= c0
551 42 : fdic (:,:)= c0
552 42 : fdon (:,:)= c0
553 42 : ffep (:,:)= c0
554 42 : ffed (:,:)= c0
555 :
556 : !-----------------------------------------------------------------
557 : ! derived or computed fields
558 : !-----------------------------------------------------------------
559 :
560 42 : coszen (:) = c0 ! Cosine of the zenith angle
561 : ! fsw (:) = c0 ! shortwave radiation (W/m^2)
562 210 : fsw (:) = swvdr(:) + swvdf(:) + swidr(:) + swidf(:)
563 210 : scale_factor(:) = c1 ! shortwave scaling factor
564 210 : wind (:) = sqrt(uatm(:)**2 + vatm(:)**2) ! wind speed, (m/s)
565 : Cdn_atm(:) = (vonkar/log(zref/iceruf)) &
566 210 : * (vonkar/log(zref/iceruf)) ! atmo drag for RASM
567 :
568 42 : end subroutine init_coupler_flux
569 :
570 : !=======================================================================
571 :
572 : ! Initialize some fluxes sent to coupler for use by the atm and ocean models
573 : !
574 : ! author: Elizabeth C. Hunke, LANL
575 :
576 318408 : subroutine init_flux_atm_ocn
577 : character(len=*), parameter :: subname='(init_flux_atm_ocn)'
578 :
579 : !-----------------------------------------------------------------
580 : ! initialize albedo and atmosphere fluxes
581 : !-----------------------------------------------------------------
582 :
583 318408 : strairxT(:) = c0 ! wind stress, T grid
584 318408 : strairyT(:) = c0
585 318408 : fsens (:) = c0
586 318408 : flat (:) = c0
587 318408 : fswabs (:) = c0
588 318408 : flwout (:) = c0
589 318408 : evap (:) = c0
590 318408 : evaps (:) = c0
591 318408 : evapi (:) = c0
592 318408 : Tref (:) = c0
593 318408 : Qref (:) = c0
594 318408 : Uref (:) = c0
595 318408 : fiso_evap(:,:) = c0 ! isotope evaporation rate (kg/m2/s)
596 :
597 : !-----------------------------------------------------------------
598 : ! fluxes sent to ocean
599 : !-----------------------------------------------------------------
600 :
601 318408 : fresh (:) = c0
602 318408 : fsalt (:) = c0
603 318408 : fhocn (:) = c0
604 318408 : fswthru (:) = c0
605 318408 : fiso_ocn (:,:) = c0
606 318408 : faero_ocn(:,:) = c0
607 :
608 318408 : end subroutine init_flux_atm_ocn
609 :
610 : !=======================================================================
611 :
612 : ! Initialize thermodynamic fields written to history files.
613 : !
614 : ! authors: William H. Lipscomb, LANL
615 : ! Elizabeth C. Hunke, LANL
616 :
617 318450 : subroutine init_history_therm
618 :
619 : use icedrv_state, only: aice, vice, trcr
620 : use icedrv_arrays_column, only: hfreebd, hdraft, hridge, distrdg
621 : use icedrv_arrays_column, only: hkeel, dkeel, lfloe, dfloe
622 : use icedrv_arrays_column, only: Cdn_atm_skin, Cdn_atm_floe
623 : use icedrv_arrays_column, only: Cdn_atm_pond, Cdn_atm_rdg
624 : use icedrv_arrays_column, only: Cdn_ocn_skin, Cdn_ocn_floe
625 : use icedrv_arrays_column, only: Cdn_ocn_keel, Cdn_atm_ratio
626 : use icedrv_arrays_column, only: Cdn_atm, Cdn_ocn
627 :
628 : logical (kind=log_kind) :: formdrag, tr_iage
629 : integer (kind=int_kind) :: nt_iage
630 109827 : real (kind=dbl_kind) :: vonkar, zref, iceruf
631 109827 : real (kind=dbl_kind) :: dragio
632 : character(len=*), parameter :: subname='(init_history_therm)'
633 :
634 : !-----------------------------------------------------------------
635 : ! query Icepack values
636 : !-----------------------------------------------------------------
637 :
638 318450 : call icepack_query_parameters(formdrag_out=formdrag)
639 318450 : call icepack_query_tracer_flags(tr_iage_out=tr_iage)
640 318450 : call icepack_query_tracer_indices(nt_iage_out=nt_iage)
641 : call icepack_query_parameters(dragio_out=dragio, &
642 318450 : vonkar_out=vonkar, zref_out=zref, iceruf_out=iceruf)
643 :
644 318450 : call icepack_warnings_flush(nu_diag)
645 318450 : if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
646 0 : file=__FILE__,line= __LINE__)
647 :
648 : !-----------------------------------------------------------------
649 :
650 318450 : fsurf (:) = c0
651 318450 : fcondtop(:)= c0
652 318450 : fcondbot(:)= c0
653 318450 : congel (:) = c0
654 318450 : frazil (:) = c0
655 318450 : snoice (:) = c0
656 318450 : dsnow (:) = c0
657 318450 : meltt (:) = c0
658 318450 : melts (:) = c0
659 318450 : meltb (:) = c0
660 318450 : meltl (:) = c0
661 318450 : daidtt (:) = aice(:) ! temporary initial area
662 318450 : dvidtt (:) = vice(:) ! temporary initial volume
663 318450 : if (tr_iage) then
664 76870 : dagedtt(:) = trcr(:,nt_iage) ! temporary initial age
665 : else
666 303076 : dagedtt(:) = c0
667 : endif
668 318450 : fsurfn (:,:) = c0
669 318450 : fcondtopn (:,:) = c0
670 318450 : fcondbotn (:,:) = c0
671 318450 : flatn (:,:) = c0
672 318450 : fsensn (:,:) = c0
673 318450 : fpond (:) = c0
674 318450 : fresh_ai (:) = c0
675 318450 : fsalt_ai (:) = c0
676 318450 : fhocn_ai (:) = c0
677 318450 : fswthru_ai(:) = c0
678 318450 : albice (:) = c0
679 318450 : albsno (:) = c0
680 318450 : albpnd (:) = c0
681 318450 : apeff_ai (:) = c0
682 318450 : snowfrac (:) = c0
683 318450 : frazil_diag (:) = c0
684 :
685 : ! drag coefficients are computed prior to the atmo_boundary call,
686 : ! during the thermodynamics section
687 1592250 : Cdn_ocn(:) = dragio
688 : Cdn_atm(:) = (vonkar/log(zref/iceruf)) &
689 1592250 : * (vonkar/log(zref/iceruf)) ! atmo drag for RASM
690 :
691 318450 : if (formdrag) then
692 24135 : Cdn_atm_rdg (:) = c0
693 24135 : Cdn_atm_ratio(:)= c0
694 24135 : Cdn_atm_floe(:) = c0
695 24135 : Cdn_atm_pond(:) = c0
696 24135 : Cdn_atm_skin(:) = c0
697 24135 : Cdn_ocn_skin(:) = c0
698 24135 : Cdn_ocn_keel(:) = c0
699 24135 : Cdn_ocn_floe(:) = c0
700 24135 : hfreebd (:) = c0
701 24135 : hdraft (:) = c0
702 24135 : hridge (:) = c0
703 24135 : distrdg (:) = c0
704 24135 : hkeel (:) = c0
705 24135 : dkeel (:) = c0
706 24135 : lfloe (:) = c0
707 24135 : dfloe (:) = c0
708 : endif
709 :
710 318450 : end subroutine init_history_therm
711 :
712 : !=======================================================================
713 :
714 : ! Initialize dynamic fields written to history files.
715 : !
716 : ! authors: William H. Lipscomb, LANL
717 : ! Elizabeth C. Hunke, LANL
718 :
719 318408 : subroutine init_history_dyn
720 :
721 : use icedrv_state, only: aice, vice, trcr
722 : logical (kind=log_kind) :: tr_iage
723 : integer (kind=int_kind) :: nt_iage
724 : character(len=*), parameter :: subname='(init_history_dyn)'
725 :
726 : !-----------------------------------------------------------------
727 : ! query Icepack values
728 : !-----------------------------------------------------------------
729 :
730 318408 : call icepack_query_tracer_flags(tr_iage_out=tr_iage)
731 318408 : call icepack_query_tracer_indices(nt_iage_out=nt_iage)
732 318408 : call icepack_warnings_flush(nu_diag)
733 318408 : if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
734 0 : file=__FILE__,line= __LINE__)
735 :
736 : !-----------------------------------------------------------------
737 :
738 318408 : dardg1dt(:) = c0
739 318408 : dardg2dt(:) = c0
740 318408 : dvirdgdt(:) = c0
741 318408 : daidtd (:) = aice(:) ! temporary initial area
742 318408 : dvidtd (:) = vice(:) ! temporary initial volume
743 318408 : if (tr_iage) &
744 76860 : dagedtd (:) = trcr(:,nt_iage) ! temporary initial age
745 318408 : ardgn (:,:) = c0
746 318408 : vrdgn (:,:) = c0
747 7795968 : krdgn (:,:) = c1
748 318408 : aparticn(:,:) = c0
749 318408 : aredistn(:,:) = c0
750 318408 : vredistn(:,:) = c0
751 318408 : dardg1ndt(:,:) = c0
752 318408 : dardg2ndt(:,:) = c0
753 318408 : dvirdgndt(:,:) = c0
754 318408 : araftn (:,:) = c0
755 318408 : vraftn (:,:) = c0
756 318408 : aredistn (:,:) = c0
757 318408 : vredistn (:,:) = c0
758 :
759 318408 : end subroutine init_history_dyn
760 :
761 : !=======================================================================
762 :
763 : ! Initialize bgc fields written to history files
764 : !
765 : ! authors: Nicole Jeffery, LANL
766 :
767 318408 : subroutine init_history_bgc
768 :
769 : use icedrv_arrays_column, only: PP_net, grow_net, hbri
770 : use icedrv_arrays_column, only: ice_bio_net, snow_bio_net, fbio_snoice, fbio_atmice
771 : use icedrv_arrays_column, only: fzsal, fzsal_g, zfswin
772 : character(len=*), parameter :: subname='(init_history_bgc)'
773 :
774 318408 : PP_net (:) = c0
775 318408 : grow_net (:) = c0
776 318408 : hbri (:) = c0
777 318408 : flux_bio (:,:) = c0
778 318408 : flux_bio_ai (:,:) = c0
779 318408 : ice_bio_net (:,:) = c0
780 318408 : snow_bio_net(:,:) = c0
781 318408 : fbio_snoice (:,:) = c0
782 318408 : fbio_atmice (:,:) = c0
783 318408 : fzsal (:) = c0
784 318408 : fzsal_g (:) = c0
785 318408 : zfswin (:,:,:) = c0
786 318408 : fnit (:) = c0
787 318408 : fsil (:) = c0
788 318408 : famm (:) = c0
789 318408 : fdmsp (:) = c0
790 318408 : fdms (:) = c0
791 318408 : fhum (:) = c0
792 318408 : fdust (:) = c0
793 318408 : falgalN (:,:) = c0
794 318408 : fdoc (:,:) = c0
795 318408 : fdic (:,:) = c0
796 318408 : fdon (:,:) = c0
797 318408 : ffep (:,:) = c0
798 318408 : ffed (:,:) = c0
799 :
800 318408 : end subroutine init_history_bgc
801 :
802 : !=======================================================================
803 :
804 : end module icedrv_flux
805 :
806 : !=======================================================================
|