← Back to Documentation Home
CCPP SciDoc v8.0.0  v8.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
module_nst_water_prop.f90
1
3
6
9 use machine , only : kind_phys
10 use module_nst_parameters , only : t0k, zero, one, half
11
12 implicit none
13 !
14 private
16
17 !
18 interface sw_ps_9b
19 module procedure sw_ps_9b
20 end interface sw_ps_9b
21 interface sw_ps_9b_aw
22 module procedure sw_ps_9b_aw
23 end interface sw_ps_9b_aw
24 !
25 interface sw_rad
26 module procedure sw_fairall_6exp_v1 ! sw_wick_v1
27 end interface sw_rad
28 interface sw_rad_aw
29 module procedure sw_fairall_6exp_v1_aw
30 end interface sw_rad_aw
31 interface sw_rad_sum
32 module procedure sw_fairall_6exp_v1_sum
33 end interface sw_rad_sum
34 interface sw_rad_upper
35 module procedure sw_soloviev_3exp_v2
36 end interface sw_rad_upper
37 interface sw_rad_upper_aw
38 module procedure sw_soloviev_3exp_v2_aw
39 end interface sw_rad_upper_aw
40 interface sw_rad_skin
41 module procedure sw_ohlmann_v1
42 end interface sw_rad_skin
43contains
44 ! ------------------------------------------------------
48 subroutine rhocoef(t, s, rhoref, alpha, beta)
49 ! ------------------------------------------------------
50
51 ! compute thermal expansion coefficient (alpha)
52 ! and saline contraction coefficient (beta) using
53 ! the international equation of state of sea water
54 ! (1980). ref: pond and pickard, introduction to
55 ! dynamical oceanography, pp310.
56 ! note: compression effects are not included
57
58 real(kind=kind_phys), intent(in) :: t, s, rhoref
59 real(kind=kind_phys), intent(out) :: alpha, beta
60 real(kind=kind_phys) :: tc
61
62 tc = t - t0k
63
64 alpha = &
65 6.793952e-2 &
66 - 2.0 * 9.095290e-3 * tc + 3.0 * 1.001685e-4 * tc**2 &
67 - 4.0 * 1.120083e-6 * tc**3 + 5.0 * 6.536332e-9 * tc**4 &
68 - 4.0899e-3 * s &
69 + 2.0 * 7.6438e-5 * tc * s - 3.0 * 8.2467e-7 * tc**2 * s &
70 + 4.0 * 5.3875e-9 * tc**3 * s &
71 + 1.0227e-4 * s**1.5 - 2.0 * 1.6546e-6 * tc * s**1.5
72
73 ! note: rhoref - specify
74 !
75 alpha = -alpha/rhoref
76
77 beta = &
78 8.24493e-1 - 4.0899e-3 * tc &
79 + 7.6438e-5 * tc**2 - 8.2467e-7 * tc**3 &
80 + 5.3875e-9 * tc**4 - 1.5 * 5.72466e-3 * s**.5 &
81 + 1.5 * 1.0227e-4 * tc * s**.5 &
82 - 1.5 * 1.6546e-6 * tc**2 * s**.5 &
83 + 2.0 * 4.8314e-4 * s
84
85 beta = beta / rhoref
86
87 end subroutine rhocoef
88 ! ----------------------------------------
91 subroutine density(t, s, rho)
92 ! ----------------------------------------
93
94 ! input
95 real(kind=kind_phys), intent(in) :: t !unit, k
96 real(kind=kind_phys), intent(in) :: s !unit, 1/1000
97 ! output
98 real(kind=kind_phys), intent(out) :: rho !unit, kg/m^3
99 ! local
100 real(kind=kind_phys) :: tc
101
102 ! compute density using the international equation
103 ! of state of sea water 1980, (pond and pickard,
104 ! introduction to dynamical oceanography, pp310).
105 ! compression effects are not included
106
107 rho = zero
108 tc = t - t0k
109
110 ! effect of temperature on density (lines 1-3)
111 ! effect of temperature and salinity on density (lines 4-8)
112 rho = &
113 999.842594 + 6.793952e-2 * tc &
114 - 9.095290e-3 * tc**2 + 1.001685e-4 * tc**3 &
115 - 1.120083e-6 * tc**4 + 6.536332e-9 * tc**5 &
116 + 8.24493e-1 * s - 4.0899e-3 * tc * s &
117 + 7.6438e-5 * tc**2 * s - 8.2467e-7 * tc**3 * s &
118 + 5.3875e-9 * tc**4 * s - 5.72466e-3 * s**1.5 &
119 + 1.0227e-4 * tc * s**1.5 - 1.6546e-6 * tc**2 * s**1.5 &
120 + 4.8314e-4 * s**2
121
122 end subroutine density
123 !
124 !======================
125 !
129 elemental subroutine sw_ps_9b(z,fxp)
130 !
131 ! fraction of the solar radiation absorbed by the ocean at the depth z
132 ! following paulson and simpson, 1981
133 !
134 ! input:
135 ! z: depth (m)
136 !
137 ! output:
138 ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2)
139 !
140 real(kind=kind_phys), intent(in) :: z
141 real(kind=kind_phys), intent(out) :: fxp
142 real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/)
143 real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/)
144 !
145 if(z>zero) then
146 fxp=one-(f(1)*exp(-z/gamma(1))+f(2)*exp(-z/gamma(2))+f(3)*exp(-z/gamma(3))+ &
147 f(4)*exp(-z/gamma(4))+f(5)*exp(-z/gamma(5))+f(6)*exp(-z/gamma(6))+ &
148 f(7)*exp(-z/gamma(7))+f(8)*exp(-z/gamma(8))+f(9)*exp(-z/gamma(9)))
149 else
150 fxp=zero
151 endif
152 !
153 end subroutine sw_ps_9b
154 !
155 !======================
156 !
157 !
158 !======================
159 !
162 elemental subroutine sw_ps_9b_aw(z,aw)
163 !
164 ! d(fw)/d(z) for 9-band
165 !
166 ! input:
167 ! z: depth (m)
168 !
169 ! output:
170 ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2)
171 !
172 real(kind=kind_phys), intent(in) :: z
173 real(kind=kind_phys), intent(out) :: aw
174 real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/)
175 real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/)
176 !
177 if(z>zero) then
178 aw=(f(1)/gamma(1))*exp(-z/gamma(1))+(f(2)/gamma(2))*exp(-z/gamma(2))+(f(3)/gamma(3))*exp(-z/gamma(3))+ &
179 (f(1)/gamma(4))*exp(-z/gamma(4))+(f(2)/gamma(5))*exp(-z/gamma(5))+(f(6)/gamma(6))*exp(-z/gamma(6))+ &
180 (f(1)/gamma(7))*exp(-z/gamma(7))+(f(2)/gamma(8))*exp(-z/gamma(8))+(f(9)/gamma(9))*exp(-z/gamma(9))
181 else
182 aw=zero
183 endif
184 !
185 end subroutine sw_ps_9b_aw
186 !
187 !======================
192 elemental subroutine sw_fairall_6exp_v1(z,fxp)
193 !
194 ! fraction of the solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298)
195 ! following paulson and simpson, 1981
196 !
197 ! input:
198 ! z: depth (m)
199 !
200 ! output:
201 ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2)
202 !
203 real(kind=kind_phys), intent(in) :: z
204 real(kind=kind_phys), intent(out) :: fxp
205
206 real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/)
207 real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/)
208 real(kind=kind_phys), dimension(9) :: zgamma
209 real(kind=kind_phys), dimension(9) :: f_c
210 !
211 if(z>zero) then
212 zgamma=z/gamma
213 f_c=f*(one-one/zgamma*(one-exp(-zgamma)))
214 fxp=sum(f_c)
215 else
216 fxp=zero
217 endif
218 !
219 end subroutine sw_fairall_6exp_v1
220 !
221 !======================
222 !
223 !
228 elemental subroutine sw_fairall_6exp_v1_aw(z,aw)
229 !
230 ! fraction of the solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298)
231 ! following paulson and simpson, 1981
232 !
233 ! input:
234 ! z: depth (m)
235 !
236 ! output:
237 ! aw: d(fxp)/d(z)
238 !
239 ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2)
240 !
241 real(kind=kind_phys), intent(in) :: z
242 real(kind=kind_phys), intent(out) :: aw
243
244 real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/)
245 real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/)
246 real(kind=kind_phys), dimension(9) :: zgamma
247 real(kind=kind_phys), dimension(9) :: f_aw
248 !
249 if(z>zero) then
250 zgamma=z/gamma
251 f_aw=(f/z)*((gamma/z)*(one-exp(-zgamma))-exp(-zgamma))
252 aw=sum(f_aw)
253 ! write(*,'(a,f6.2,f12.6,9f10.4)') 'z,aw in sw_rad_aw : ',z,aw,f_aw
254 else
255 aw=zero
256 endif
257 !
258 end subroutine sw_fairall_6exp_v1_aw
259 !
266 elemental subroutine sw_fairall_6exp_v1_sum(z,sum)
267 !
268 ! fraction of the solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298)
269 ! following paulson and simpson, 1981
270 !
271 ! input:
272 ! z: depth (m)
273 !
274 ! output:
275 ! sum: for convection depth calculation
276 !
277 !
278 real(kind=kind_phys), intent(in) :: z
279 real(kind=kind_phys), intent(out) :: sum
280
281 real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/)
282 real(kind=kind_phys), dimension(9) :: zgamma
283 real(kind=kind_phys), dimension(9) :: f_sum
284 !
285 ! zgamma=z/gamma
286 ! f_sum=(zgamma/z)*exp(-zgamma)
287 ! sum=sum(f_sum)
288
289 sum=( one/gamma(1))*exp(-z/gamma(1))+(one/gamma(2))*exp(-z/gamma(2))+(one/gamma(3))*exp(-z/gamma(3))+ &
290 (one/gamma(4))*exp(-z/gamma(4))+(one/gamma(5))*exp(-z/gamma(5))+(one/gamma(6))*exp(-z/gamma(6))+ &
291 (one/gamma(7))*exp(-z/gamma(7))+(one/gamma(8))*exp(-z/gamma(8))+(one/gamma(9))*exp(-z/gamma(9))
292 !
293 end subroutine sw_fairall_6exp_v1_sum
294 !
295 !======================
302 elemental subroutine sw_fairall_simple_v1(f_sol_0,z,df_sol_z)
303 !
304 ! solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298)
305 !
306 ! input:
307 ! f_sol_0: solar radiation at the ocean surface (w/m^2)
308 ! z: depth (m)
309 !
310 ! output:
311 ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2)
312 !
313 real(kind=kind_phys), intent(in) :: z,f_sol_0
314 real(kind=kind_phys), intent(out) :: df_sol_z
315 !
316 if(z>zero) then
317 df_sol_z=f_sol_0*(0.137+11.0*z-6.6e-6/z*(one-exp(-z/8.e-4)))
318 else
319 df_sol_z=zero
320 endif
321 !
322 end subroutine sw_fairall_simple_v1
323 !
324 !======================
325 !
332 elemental subroutine sw_wick_v1(f_sol_0,z,df_sol_z)
333 !
334 ! solar radiation absorbed by the ocean at the depth z (zeng and beljaars, 2005, p.5)
335 !
336 ! input:
337 ! f_sol_0: solar radiation at the ocean surface (w/m^2)
338 ! z: depth (m)
339 !
340 ! output:
341 ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2)
342 !
343 real(kind=kind_phys), intent(in) :: z,f_sol_0
344 real(kind=kind_phys), intent(out) :: df_sol_z
345 !
346 if(z>zero) then
347 df_sol_z=f_sol_0*(0.065+11.0*z-6.6e-5/z*(one-exp(-z/8.e-4)))
348 else
349 df_sol_z=zero
350 endif
351 !
352 end subroutine sw_wick_v1
353 !
354 !======================
355 !
363 elemental subroutine sw_soloviev_3exp_v1(f_sol_0,z,df_sol_z)
364 !
365 ! solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1301)
366 ! following soloviev, 1982
367 !
368 ! input:
369 ! f_sol_0: solar radiation at the ocean surface (w/m^2)
370 ! z: depth (m)
371 !
372 ! output:
373 ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2)
374 !
375 real(kind=kind_phys), intent(in) :: z,f_sol_0
376 real(kind=kind_phys), intent(out) :: df_sol_z
377 real(kind=kind_phys), dimension(3) :: f_c
378 real(kind=kind_phys), dimension(3), parameter :: f=(/0.45,0.27,0.28/)
379 real(kind=kind_phys), dimension(3), parameter :: gamma=(/12.82,0.357,0.014/)
380 !
381 if(z>zero) then
382 f_c = f*gamma(int(one-exp(-z/gamma)))
383 df_sol_z = f_sol_0*(one-sum(f_c)/z)
384 else
385 df_sol_z = zero
386 endif
387 !
388 end subroutine sw_soloviev_3exp_v1
389 !
390 !======================
391 !
393 elemental subroutine sw_soloviev_3exp_v2(f_sol_0,z,df_sol_z)
394 !
395 ! solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1301)
396 ! following soloviev, 1982
397 !
398 ! input:
399 ! f_sol_0: solar radiation at the ocean surface (w/m^2)
400 ! z: depth (m)
401 !
402 ! output:
403 ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2)
404 !
405 real(kind=kind_phys), intent(in) :: z,f_sol_0
406 real(kind=kind_phys), intent(out) :: df_sol_z
407 !
408 if(z>zero) then
409 df_sol_z=f_sol_0*(one &
410 -(0.28*0.014*(one-exp(-z/0.014)) &
411 + 0.27*0.357*(one-exp(-z/0.357)) &
412 + 0.45*12.82*(one-exp(-z/12.82)))/z &
413 )
414 else
415 df_sol_z=zero
416 endif
417 !
418 end subroutine sw_soloviev_3exp_v2
419
421 elemental subroutine sw_soloviev_3exp_v2_aw(z,aw)
422 !
423 ! aw = d(fxp)/d(z)
424 ! following soloviev, 1982
425 !
426 ! input:
427 ! z: depth (m)
428 !
429 ! output:
430 ! aw: d(fxp)/d(z)
431 !
432 real(kind=kind_phys), intent(in) :: z
433 real(kind=kind_phys), intent(out) :: aw
434 real(kind=kind_phys) :: fxp
435 !
436 if(z>zero) then
437 fxp=(one &
438 -(0.28*0.014*(one-exp(-z/0.014)) &
439 + 0.27*0.357*(one-exp(-z/0.357)) &
440 + 0.45*12.82*(one-exp(-z/12.82)))/z &
441 )
442 aw=one-fxp-(0.28*exp(-z/0.014)+0.27*exp(-z/0.357)+0.45*exp(-z/12.82))
443 else
444 aw=zero
445 endif
446 end subroutine sw_soloviev_3exp_v2_aw
447 !
448 !
449 !======================
450 !
452 elemental subroutine sw_ohlmann_v1(z,fxp)
453 !
454 ! fraction of the solar radiation absorbed by the ocean at the depth z
455 !
456 ! input:
457 ! z: depth (m)
458 !
459 ! output:
460 ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2)
461 !
462 real(kind=kind_phys), intent(in) :: z
463 real(kind=kind_phys), intent(out) :: fxp
464 !
465 if(z>zero) then
466 fxp=.065+11.*z-6.6e-5/z*(one-exp(-z/8.0e-4))
467 else
468 fxp=zero
469 endif
470 !
471 end subroutine sw_ohlmann_v1
472 !
473
475 real(kind_phys) function grv(x)
476 real(kind=kind_phys) :: x
477 real(kind=kind_phys) :: gamma,c1,c2,c3,c4
478 gamma=9.7803267715
479 c1=0.0052790414
480 c2=0.0000232718
481 c3=0.0000001262
482 c4=0.0000000007
483
484 grv=gamma*(one+(c1*x**2)+(c2*x**4)+(c3*x**6)+(c4*x**8))
485 end function grv
486
489 subroutine solar_time_from_julian(jday,xlon,soltim)
490 !
491 ! calculate solar time from the julian date
492 !
493 real(kind=kind_phys), intent(in) :: jday
494 real(kind=kind_phys), intent(in) :: xlon
495 real(kind=kind_phys), intent(out) :: soltim
496 real(kind=kind_phys) :: fjd,xhr,xmin,xsec,intime
497 !
498 fjd=jday-floor(jday)
499 fjd=jday
500 xhr=floor(fjd*24.0)-sign(12.0,fjd-half)
501 xmin=nint(fjd*1440.0)-(xhr+sign(12.0,fjd-half))*60.0
502 xsec=zero
503 intime=xhr+xmin/60.0+xsec/3600.0+24.0
504 soltim=mod(xlon/15.0+intime,24.0)*3600.0
505 end subroutine solar_time_from_julian
506
507 !
508 !***********************************************************************
509 !
513 subroutine compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd)
514 !fpp$ noconcur r
515 !$$$ subprogram documentation block
516 ! . . . .
517 ! subprogram: compjd computes julian day and fraction
518 ! prgmmr: kenneth campana org: w/nmc23 date: 89-07-07
519 !
520 ! abstract: computes julian day and fraction
521 ! from year, month, day and time utc.
522 !
523 ! program history log:
524 ! 77-05-06 ray orzol,gfdl
525 ! 98-05-15 iredell y2k compliance
526 !
527 ! usage: call compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd)
528 ! input argument list:
529 ! jyr - year (4 digits)
530 ! jmnth - month
531 ! jday - day
532 ! jhr - hour
533 ! jmn - minutes
534 ! output argument list:
535 ! jd - julian day.
536 ! fjd - fraction of the julian day.
537 !
538 ! subprograms called:
539 ! iw3jdn compute julian day number
540 !
541 ! attributes:
542 ! language: fortran.
543 !
544 !$$$
545 !
546 integer :: jyr,jmnth,jday,jhr,jmn,jd
547 integer :: iw3jdn
548 real (kind=kind_phys) fjd
549 jd=iw3jdn(jyr,jmnth,jday)
550 if(jhr.lt.12) then
551 jd=jd-1
552 fjd=half+jhr/24.+jmn/1440.
553 else
554 fjd=(jhr-12)/24.+jmn/1440.
555 endif
556 end subroutine compjd
557
560 subroutine get_dtzm_point(xt,xz,dt_cool,zc,z1,z2,dtm)
561 ! ===================================================================== !
562 ! !
563 ! description: get dtm = mean of dT(z) (z1 - z2) with NSST dT(z) !
564 ! dT(z) = (1-z/xz)*dt_warm - (1-z/zc)*dt_cool !
565 ! !
566 ! usage: !
567 ! !
568 ! call get_dtm12 !
569 ! !
570 ! inputs: !
571 ! (xt,xz,dt_cool,zc,z1,z2, !
572 ! outputs: !
573 ! dtm) !
574 ! !
575 ! program history log: !
576 ! !
577 ! 2015 -- xu li createad original code !
578 ! inputs: !
579 ! xt - real, heat content in dtl 1 !
580 ! xz - real, dtl thickness 1 !
581 ! dt_cool - real, sub-layer cooling amount 1 !
582 ! zc - sub-layer cooling thickness 1 !
583 ! z1 - lower bound of depth of sea temperature 1 !
584 ! z2 - upper bound of depth of sea temperature 1 !
585 ! outputs: !
586 ! dtm - mean of dT(z) (z1 to z2) 1 !
587 !
588 real (kind=kind_phys), intent(in) :: xt,xz,dt_cool,zc,z1,z2
589 real (kind=kind_phys), intent(out) :: dtm
590 ! Local variables
591 real (kind=kind_phys) :: dt_warm,dtw,dtc
592
593 !
594 ! get the mean warming in the range of z=z1 to z=z2
595 !
596 dtw = zero
597 if ( xt > zero ) then
598 dt_warm = (xt+xt)/xz ! Tw(0)
599 if ( z1 < z2) then
600 if ( z2 < xz ) then
601 dtw = dt_warm*(one-(z1+z2)/(xz+xz))
602 elseif ( z1 < xz .and. z2 >= xz ) then
603 dtw = half*(one-z1/xz)*dt_warm*(xz-z1)/(z2-z1)
604 endif
605 elseif ( z1 == z2 ) then
606 if ( z1 < xz ) then
607 dtw = dt_warm*(one-z1/xz)
608 endif
609 endif
610 endif
611 !
612 ! get the mean cooling in the range of z=z1 to z=z2
613 !
614 dtc = zero
615 if ( zc > zero ) then
616 if ( z1 < z2) then
617 if ( z2 < zc ) then
618 dtc = dt_cool*(one-(z1+z2)/(zc+zc))
619 elseif ( z1 < zc .and. z2 >= zc ) then
620 dtc = half*(one-z1/zc)*dt_cool*(zc-z1)/(z2-z1)
621 endif
622 elseif ( z1 == z2 ) then
623 if ( z1 < zc ) then
624 dtc = dt_cool*(one-z1/zc)
625 endif
626 endif
627 endif
628
629 !
630 ! get the mean T departure from Tf in the range of z=z1 to z=z2
631 !
632 dtm = dtw - dtc
633
634 end subroutine get_dtzm_point
635
637 subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm)
638 !subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,icy,z1,z2,nx,ny,dtm)
639 ! ===================================================================== !
640 ! !
641 ! description: get dtm = mean of dT(z) (z1 - z2) with NSST dT(z) !
642 ! dT(z) = (1-z/xz)*dt_warm - (1-z/zc)*dt_cool !
643 ! !
644 ! usage: !
645 ! !
646 ! call get_dtzm_2d !
647 ! !
648 ! inputs: !
649 ! (xt,xz,dt_cool,zc,z1,z2, !
650 ! outputs: !
651 ! dtm) !
652 ! !
653 ! program history log: !
654 ! !
655 ! 2015 -- xu li createad original code !
656 ! inputs: !
657 ! xt - real, heat content in dtl 1 !
658 ! xz - real, dtl thickness 1 !
659 ! dt_cool - real, sub-layer cooling amount 1 !
660 ! zc - sub-layer cooling thickness 1 !
661 ! wet - logical, flag for wet point (ocean or lake) 1 !
662 ! icy - logical, flag for ice point (ocean or lake) 1 !
663 ! nx - integer, dimension in x-direction (zonal) 1 !
664 ! ny - integer, dimension in y-direction (meridional) 1 !
665 ! z1 - lower bound of depth of sea temperature 1 !
666 ! z2 - upper bound of depth of sea temperature 1 !
667 ! nth - integer, num of openmp thread 1 !
668 ! outputs: !
669 ! dtm - mean of dT(z) (z1 to z2) 1 !
670 !
671 integer, intent(in) :: nx,ny, nth
672 real (kind=kind_phys), dimension(nx,ny), intent(in) :: xt,xz,dt_cool,zc
673 logical, dimension(nx,ny), intent(in) :: wet
674 ! logical, dimension(nx,ny), intent(in) :: wet,icy
675 real (kind=kind_phys), intent(in) :: z1,z2
676 real (kind=kind_phys), dimension(nx,ny), intent(out) :: dtm
677 ! Local variables
678 integer :: i,j
679 real (kind=kind_phys) :: dt_warm, dtw, dtc, xzi
680
681
682 !$omp parallel do num_threads (nth) private(j,i,dtw,dtc,xzi)
683 do j = 1, ny
684 do i= 1, nx
685
686 dtm(i,j) = zero ! initialize dtm
687
688 if ( wet(i,j) ) then
689 !
690 ! get the mean warming in the range of z=z1 to z=z2
691 !
692 dtw = zero
693 if ( xt(i,j) > zero ) then
694 xzi = one / xz(i,j)
695 dt_warm = (xt(i,j)+xt(i,j)) * xzi ! Tw(0)
696 if (z1 < z2) then
697 if ( z2 < xz(i,j) ) then
698 dtw = dt_warm * (one-half*(z1+z2)*xzi)
699 elseif (z1 < xz(i,j) .and. z2 >= xz(i,j) ) then
700 dtw = half*(one-z1*xzi)*dt_warm*(xz(i,j)-z1)/(z2-z1)
701 endif
702 elseif (z1 == z2 ) then
703 if (z1 < xz(i,j) ) then
704 dtw = dt_warm * (one-z1*xzi)
705 endif
706 endif
707 endif
708 !
709 ! get the mean cooling in the range of z=0 to z=zsea
710 !
711 dtc = zero
712 if ( zc(i,j) > zero ) then
713 if ( z1 < z2) then
714 if ( z2 < zc(i,j) ) then
715 dtc = dt_cool(i,j) * (one-(z1+z2)/(zc(i,j)+zc(i,j)))
716 elseif ( z1 < zc(i,j) .and. z2 >= zc(i,j) ) then
717 dtc = half*(one-z1/zc(i,j))*dt_cool(i,j)*(zc(i,j)-z1)/(z2-z1)
718 endif
719 elseif ( z1 == z2 ) then
720 if ( z1 < zc(i,j) ) then
721 dtc = dt_cool(i,j) * (one-z1/zc(i,j))
722 endif
723 endif
724 endif
725 ! get the mean T departure from Tf in the range of z=z1 to z=z2
726 dtm(i,j) = dtw - dtc
727 endif ! if ( wet(i,j)) then
728 enddo
729 enddo
730 !
731
732 end subroutine get_dtzm_2d
733
734end module module_nst_water_prop
subroutine, public density(t, s, rho)
This subroutine computes sea water density.
subroutine, public get_dtzm_point(xt, xz, dt_cool, zc, z1, z2, dtm)
This subroutine computes dtm (the mean of ).
subroutine, public rhocoef(t, s, rhoref, alpha, beta)
This subroutine computes thermal expansion coefficient (alpha) and saline contraction coefficient (be...
real(kind_phys) function, public grv(x)
This module contains constants and parameters used in GFS near surface sea temperature scheme.
This module contains GFS NSST water property subroutines.