00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 module shr_flux_mod
00019
00020
00021
00022 use shr_kind_mod
00023 use shr_const_mod
00024 use shr_sys_mod
00025 use shr_log_mod, only: s_loglev => shr_log_Level
00026 use shr_log_mod, only: s_logunit => shr_log_Unit
00027
00028 implicit none
00029
00030 private
00031
00032
00033
00034
00035
00036
00037
00038 public :: shr_flux_atmOcn
00039 public :: shr_flux_atmIce
00040 public :: shr_flux_MOstability
00041
00042
00043
00044 integer(SHR_KIND_IN),parameter,public :: shr_flux_MOwScales = 1
00045 integer(SHR_KIND_IN),parameter,public :: shr_flux_MOfunctions = 2
00046 real (SHR_KIND_R8),parameter,public :: shr_flux_MOgammaM = 3.59_SHR_KIND_R8
00047 real (SHR_KIND_R8),parameter,public :: shr_flux_MOgammaS = 7.86_SHR_KIND_R8
00048
00049
00050
00051
00052 integer,parameter :: R8 = SHR_KIND_R8
00053 integer,parameter :: IN = SHR_KIND_IN
00054
00055 integer,parameter :: debug = 0
00056
00057
00058 contains
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , &
00078 & qbot ,rbot ,tbot ,us ,vs , &
00079 & ts ,mask ,sen ,lat ,lwup , &
00080 & evap ,taux ,tauy ,tref ,qref , &
00081 & duu10n, ustar_sv ,re_sv ,ssq_sv )
00082
00083
00084
00085 implicit none
00086
00087
00088
00089
00090 integer(IN),intent(in) :: nMax
00091 integer(IN),intent(in) :: mask (nMax)
00092 real(R8) ,intent(in) :: zbot (nMax)
00093 real(R8) ,intent(in) :: ubot (nMax)
00094 real(R8) ,intent(in) :: vbot (nMax)
00095 real(R8) ,intent(in) :: thbot(nMax)
00096 real(R8) ,intent(in) :: qbot (nMax)
00097 real(R8) ,intent(in) :: rbot (nMax)
00098 real(R8) ,intent(in) :: tbot (nMax)
00099 real(R8) ,intent(in) :: us (nMax)
00100 real(R8) ,intent(in) :: vs (nMax)
00101 real(R8) ,intent(in) :: ts (nMax)
00102
00103
00104 real(R8),intent(out) :: sen (nMax)
00105 real(R8),intent(out) :: lat (nMax)
00106 real(R8),intent(out) :: lwup (nMax)
00107 real(R8),intent(out) :: evap (nMax)
00108 real(R8),intent(out) :: taux (nMax)
00109 real(R8),intent(out) :: tauy (nMax)
00110 real(R8),intent(out) :: tref (nMax)
00111 real(R8),intent(out) :: qref (nMax)
00112 real(R8),intent(out) :: duu10n(nMax)
00113
00114 real(R8),intent(out),optional :: ustar_sv(nMax)
00115 real(R8),intent(out),optional :: re_sv (nMax)
00116 real(R8),intent(out),optional :: ssq_sv (nMax)
00117
00118
00119
00120
00121 real(R8),parameter :: umin = 0.5_R8
00122 real(R8),parameter :: zref = 10.0_R8
00123 real(R8),parameter :: ztref = 2.0_R8
00124
00125
00126 integer(IN) :: n
00127 real(R8) :: vmag
00128 real(R8) :: thvbot
00129 real(R8) :: ssq
00130 real(R8) :: delt
00131 real(R8) :: delq
00132 real(R8) :: stable
00133 real(R8) :: rdn
00134 real(R8) :: rhn
00135 real(R8) :: ren
00136 real(R8) :: rd
00137 real(R8) :: rh
00138 real(R8) :: re
00139 real(R8) :: ustar
00140 real(R8) :: qstar
00141 real(R8) :: tstar
00142 real(R8) :: hol
00143 real(R8) :: xsq
00144 real(R8) :: xqq
00145 real(R8) :: psimh
00146 real(R8) :: psixh
00147 real(R8) :: psix2
00148 real(R8) :: alz
00149 real(R8) :: al2
00150 real(R8) :: u10n
00151 real(R8) :: tau
00152 real(R8) :: cp
00153 real(R8) :: bn
00154 real(R8) :: bh
00155 real(R8) :: fac
00156
00157
00158 real(R8) :: qsat
00159 real(R8) :: cdn
00160 real(R8) :: psimhu
00161 real(R8) :: psixhu
00162 real(R8) :: Umps
00163 real(R8) :: Tk
00164 real(R8) :: xd
00165
00166 qsat(Tk) = 640380.0_R8 / exp(5107.4_R8/Tk)
00167 cdn(Umps) = 0.0027_R8 / Umps + 0.000142_R8 + 0.0000764_R8 * Umps
00168 psimhu(xd) = log((1.0_R8+xd*(2.0_R8+xd))*(1.0_R8+xd*xd)/8.0_R8) - 2.0_R8*atan(xd) + 1.571_R8
00169 psixhu(xd) = 2.0_R8 * log((1.0_R8 + xd*xd)/2.0_R8)
00170
00171
00172 character(*),parameter :: subName = '(shr_flux_atmOcn) '
00173 character(*),parameter :: F00 = "('(shr_flux_atmOcn) ',4a)"
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 if (debug > 0 .and. s_loglev > 0) write(s_logunit,F00) "enter"
00194
00195 al2 = log(zref/ztref)
00196
00197 DO n=1,nMax
00198 if (mask(n) /= 0) then
00199
00200
00201 vmag = max(umin, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) )
00202 thvbot = thbot(n) * (1.0_R8 + shr_const_zvir * qbot(n))
00203 ssq = 0.98_R8 * qsat(ts(n)) / rbot(n)
00204 delt = thbot(n) - ts(n)
00205 delq = qbot(n) - ssq
00206 alz = log(zbot(n)/zref)
00207 cp = shr_const_cpdair*(1.0_R8 + shr_const_cpvir*ssq)
00208
00209
00210
00211
00212
00213
00214 stable = 0.5_R8 + sign(0.5_R8 , delt)
00215 rdn = sqrt(cdn(vmag))
00216 rhn = (1.0_R8-stable) * 0.0327_R8 + stable * 0.018_R8
00217 ren = 0.0346_R8
00218
00219
00220 ustar = rdn * vmag
00221 tstar = rhn * delt
00222 qstar = ren * delq
00223
00224
00225 hol = shr_const_karman*shr_const_g*zbot(n)* &
00226 (tstar/thbot(n)+qstar/(1.0_R8/shr_const_zvir+qbot(n)))/ustar**2
00227 hol = sign( min(abs(hol),10.0_R8), hol )
00228 stable = 0.5_R8 + sign(0.5_R8 , hol)
00229 xsq = max(sqrt(abs(1.0_R8 - 16.0_R8*hol)) , 1.0_R8)
00230 xqq = sqrt(xsq)
00231 psimh = -5.0_R8*hol*stable + (1.0_R8-stable)*psimhu(xqq)
00232 psixh = -5.0_R8*hol*stable + (1.0_R8-stable)*psixhu(xqq)
00233
00234
00235 rd = rdn / (1.0_R8 + rdn/shr_const_karman*(alz-psimh))
00236 u10n = vmag * rd / rdn
00237
00238
00239 rdn = sqrt(cdn(u10n))
00240 ren = 0.0346_R8
00241 rhn = (1.0_R8-stable)*0.0327_R8 + stable * 0.018_R8
00242
00243
00244 rd = rdn / (1.0_R8 + rdn/shr_const_karman*(alz-psimh))
00245 rh = rhn / (1.0_R8 + rhn/shr_const_karman*(alz-psixh))
00246 re = ren / (1.0_R8 + ren/shr_const_karman*(alz-psixh))
00247
00248
00249 ustar = rd * vmag
00250 tstar = rh * delt
00251 qstar = re * delq
00252
00253
00254
00255
00256
00257
00258 hol = shr_const_karman*shr_const_g*zbot(n)* &
00259 (tstar/thbot(n)+qstar/(1.0_R8/shr_const_zvir+qbot(n)))/ustar**2
00260 hol = sign( min(abs(hol),10.0_R8), hol )
00261 stable = 0.5_R8 + sign(0.5_R8 , hol)
00262 xsq = max(sqrt(abs(1.0_R8 - 16.0_R8*hol)) , 1.0_R8)
00263 xqq = sqrt(xsq)
00264 psimh = -5.0_R8*hol*stable + (1.0_R8-stable)*psimhu(xqq)
00265 psixh = -5.0_R8*hol*stable + (1.0_R8-stable)*psixhu(xqq)
00266
00267
00268 rd = rdn / (1.0_R8 + rdn/shr_const_karman*(alz-psimh))
00269 u10n = vmag * rd/rdn
00270
00271
00272 rdn = sqrt(cdn(u10n))
00273 ren = 0.0346_R8
00274 rhn = (1.0_R8 - stable)*0.0327_R8 + stable * 0.018_R8
00275
00276
00277 rd = rdn / (1.0_R8 + rdn/shr_const_karman*(alz-psimh))
00278 rh = rhn / (1.0_R8 + rhn/shr_const_karman*(alz-psixh))
00279 re = ren / (1.0_R8 + ren/shr_const_karman*(alz-psixh))
00280
00281
00282 ustar = rd * vmag
00283 tstar = rh * delt
00284 qstar = re * delq
00285
00286
00287
00288
00289
00290 tau = rbot(n) * ustar * ustar
00291
00292
00293 taux(n) = tau * (ubot(n)-us(n)) / vmag
00294 tauy(n) = tau * (vbot(n)-vs(n)) / vmag
00295
00296
00297 sen (n) = cp * tau * tstar / ustar
00298 lat (n) = shr_const_latvap * tau * qstar / ustar
00299 lwup(n) = -shr_const_stebol * ts(n)**4
00300
00301
00302 evap(n) = lat(n)/shr_const_latvap
00303
00304
00305
00306
00307 hol = hol*ztref/zbot(n)
00308 xsq = max( 1.0_R8, sqrt(abs(1.0_R8-16.0_R8*hol)) )
00309 xqq = sqrt(xsq)
00310 psix2 = -5.0_R8*hol*stable + (1.0_R8-stable)*psixhu(xqq)
00311 fac = (rh/shr_const_karman) * (alz + al2 - psixh + psix2 )
00312 tref(n) = thbot(n) - delt*fac
00313 tref(n) = tref(n) - 0.01_R8*ztref
00314 fac = (re/shr_const_karman) * (alz + al2 - psixh + psix2 )
00315 qref(n) = qbot(n) - delq*fac
00316
00317 duu10n(n) = u10n*u10n
00318
00319
00320
00321
00322 if (present(ustar_sv)) ustar_sv(n) = ustar
00323 if (present(re_sv )) re_sv(n) = re
00324 if (present(ssq_sv )) ssq_sv(n) = ssq
00325
00326 else
00327
00328
00329
00330 sen (n) = shr_const_spval
00331 lat (n) = shr_const_spval
00332 lwup (n) = shr_const_spval
00333 evap (n) = shr_const_spval
00334 taux (n) = shr_const_spval
00335 tauy (n) = shr_const_spval
00336 tref (n) = shr_const_spval
00337 qref (n) = shr_const_spval
00338 duu10n(n) = shr_const_spval
00339
00340 if (present(ustar_sv)) ustar_sv(n) = shr_const_spval
00341 if (present(re_sv )) re_sv (n) = shr_const_spval
00342 if (present(ssq_sv )) ssq_sv (n) = shr_const_spval
00343 endif
00344 ENDDO
00345
00346 END subroutine shr_flux_atmOcn
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360 subroutine shr_flux_atmIce(mask ,zbot ,ubot ,vbot ,thbot &
00361 & ,qbot ,rbot ,tbot ,ts ,sen &
00362 & ,lat ,lwup ,evap ,taux ,tauy &
00363 & ,tref ,qref )
00364
00365 implicit none
00366
00367
00368
00369
00370 integer(IN),intent(in) :: mask (:)
00371 real(R8) ,intent(in) :: zbot (:)
00372 real(R8) ,intent(in) :: ubot (:)
00373 real(R8) ,intent(in) :: vbot (:)
00374 real(R8) ,intent(in) :: thbot(:)
00375 real(R8) ,intent(in) :: qbot (:)
00376 real(R8) ,intent(in) :: rbot (:)
00377 real(R8) ,intent(in) :: tbot (:)
00378 real(R8) ,intent(in) :: ts (:)
00379
00380
00381 real(R8) ,intent(out) :: sen (:)
00382 real(R8) ,intent(out) :: lat (:)
00383 real(R8) ,intent(out) :: lwup (:)
00384 real(R8) ,intent(out) :: evap (:)
00385 real(R8) ,intent(out) :: taux (:)
00386 real(R8) ,intent(out) :: tauy (:)
00387 real(R8) ,intent(out) :: tref (:)
00388 real(R8) ,intent(out) :: qref (:)
00389
00390
00391
00392
00393 real(R8),parameter :: umin = 1.0_R8
00394 real(R8),parameter :: zref = 10.0_R8
00395 real(R8),parameter :: ztref = 2.0_R8
00396 real(R8),parameter :: spval = shr_const_spval
00397 real(R8),parameter :: g = shr_const_g
00398 real(R8),parameter :: cpdair = shr_const_cpdair
00399 real(R8),parameter :: cpvir = shr_const_cpvir
00400 real(R8),parameter :: zvir = shr_const_zvir
00401 real(R8),parameter :: latvap = shr_const_latvap
00402 real(R8),parameter :: latice = shr_const_latice
00403 real(R8),parameter :: stebol = shr_const_stebol
00404 real(R8),parameter :: karman = shr_const_karman
00405 real(R8),parameter :: zzsice = 0.0005_R8
00406
00407
00408 integer(IN) :: lsize
00409 integer(IN) :: n
00410 real(R8) :: vmag
00411 real(R8) :: thvbot
00412 real(R8) :: ssq
00413 real(R8) :: dssqdt
00414 real(R8) :: delt
00415 real(R8) :: delq
00416 real(R8) :: stable
00417 real(R8) :: rdn
00418 real(R8) :: rhn
00419 real(R8) :: ren
00420 real(R8) :: rd
00421 real(R8) :: rh
00422 real(R8) :: re
00423 real(R8) :: ustar
00424 real(R8) :: qstar
00425 real(R8) :: tstar
00426 real(R8) :: hol
00427 real(R8) :: xsq
00428 real(R8) :: xqq
00429 real(R8) :: psimh
00430 real(R8) :: psixh
00431 real(R8) :: alz
00432 real(R8) :: ltheat
00433 real(R8) :: tau
00434 real(R8) :: cp
00435
00436 real(R8) :: bn
00437 real(R8) :: bh
00438 real(R8) :: fac
00439 real(R8) :: ln0
00440 real(R8) :: ln3
00441
00442
00443 real(R8) :: Tk
00444 real(R8) :: qsat
00445 real(R8) :: dqsatdt
00446 real(R8) :: xd
00447 real(R8) :: psimhu
00448 real(R8) :: psixhu
00449
00450 qsat(Tk) = 627572.4_R8 / exp(5107.4_R8/Tk)
00451 dqsatdt(Tk) = (5107.4_R8 / Tk**2) * 627572.4_R8 / exp(5107.4_R8/Tk)
00452 psimhu(xd) = log((1.0_R8+xd*(2.0_R8+xd))*(1.0_R8+xd*xd)/8.0_R8) - 2.0_R8*atan(xd) + 1.571_R8
00453 psixhu(xd) = 2.0_R8 * log((1.0_R8 + xd*xd)/2.0_R8)
00454
00455
00456 character(*),parameter :: subName = "(shr_flux_atmIce) "
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473 lsize = size(tbot)
00474
00475 do n = 1,lsize
00476
00477 if (mask(n) == 0) then
00478 sen (n) = spval
00479 lat (n) = spval
00480 lwup (n) = spval
00481 evap (n) = spval
00482 taux (n) = spval
00483 tauy (n) = spval
00484 tref (n) = spval
00485 qref (n) = spval
00486 else
00487
00488 vmag = max(umin, sqrt(ubot(n)**2+vbot(n)**2))
00489 thvbot = thbot(n)*(1.0_R8 + zvir * qbot(n))
00490 ssq = qsat (ts(n)) / rbot(n)
00491 dssqdt = dqsatdt(ts(n)) / rbot(n)
00492 delt = thbot(n) - ts(n)
00493 delq = qbot(n) - ssq
00494 alz = log(zbot(n)/zref)
00495 cp = cpdair*(1.0_R8 + cpvir*ssq)
00496 ltheat = latvap + latice
00497
00498
00499
00500
00501
00502
00503 rdn = karman/log(zref/zzsice)
00504 rhn = rdn
00505 ren = rdn
00506
00507
00508 ustar = rdn * vmag
00509 tstar = rhn * delt
00510 qstar = ren * delq
00511
00512
00513 hol = karman * g * zbot(n) &
00514 & * (tstar/thvbot+qstar/(1.0_R8/zvir+qbot(n))) / ustar**2
00515 hol = sign( min(abs(hol),10.0_R8), hol )
00516 stable = 0.5_R8 + sign(0.5_R8 , hol)
00517 xsq = max(sqrt(abs(1.0_R8 - 16.0_R8*hol)) , 1.0_R8)
00518 xqq = sqrt(xsq)
00519 psimh = -5.0_R8*hol*stable + (1.0_R8-stable)*psimhu(xqq)
00520 psixh = -5.0_R8*hol*stable + (1.0_R8-stable)*psixhu(xqq)
00521
00522
00523 rd = rdn / (1.0_R8+rdn/karman*(alz-psimh))
00524 rh = rhn / (1.0_R8+rhn/karman*(alz-psixh))
00525 re = ren / (1.0_R8+ren/karman*(alz-psixh))
00526
00527
00528 ustar = rd * vmag
00529 tstar = rh * delt
00530 qstar = re * delq
00531
00532
00533
00534
00535
00536
00537 hol = karman * g * zbot(n) &
00538 & * (tstar/thvbot+qstar/(1.0_R8/zvir+qbot(n))) / ustar**2
00539 hol = sign( min(abs(hol),10.0_R8), hol )
00540 stable = 0.5_R8 + sign(0.5_R8 , hol)
00541 xsq = max(sqrt(abs(1.0_R8 - 16.0_R8*hol)) , 1.0_R8)
00542 xqq = sqrt(xsq)
00543 psimh = -5.0_R8*hol*stable + (1.0_R8-stable)*psimhu(xqq)
00544 psixh = -5.0_R8*hol*stable + (1.0_R8-stable)*psixhu(xqq)
00545
00546
00547 rd = rdn / (1.0_R8+rdn/karman*(alz-psimh))
00548 rh = rhn / (1.0_R8+rhn/karman*(alz-psixh))
00549 re = ren / (1.0_R8+ren/karman*(alz-psixh))
00550
00551
00552 ustar = rd * vmag
00553 tstar = rh * delt
00554 qstar = re * delq
00555
00556
00557
00558
00559
00560 tau = rbot(n) * ustar * ustar
00561
00562
00563 taux(n) = tau * ubot(n) / vmag
00564 tauy(n) = tau * vbot(n) / vmag
00565
00566
00567 sen (n) = cp * tau * tstar / ustar
00568 lat (n) = ltheat * tau * qstar / ustar
00569 lwup(n) = -stebol * ts(n)**4
00570
00571
00572 evap(n) = lat(n)/ltheat
00573
00574
00575
00576
00577
00578
00579
00580
00581 bn = karman/rdn
00582 bh = karman/rh
00583
00584
00585 ln0 = log(1.0_R8 + (ztref/zbot(n))*(exp(bn) - 1.0_R8))
00586 ln3 = log(1.0_R8 + (ztref/zbot(n))*(exp(bn - bh) - 1.0_R8))
00587 fac = (ln0 - ztref/zbot(n)*(bn - bh))/bh * stable &
00588 & + (ln0 - ln3)/bh * (1.0_R8-stable)
00589 fac = min(max(fac,0.0_R8),1.0_R8)
00590
00591
00592 tref(n) = ts(n) + (tbot(n) - ts(n))*fac
00593 qref(n) = qbot(n) - delq*fac
00594
00595 endif
00596 enddo
00597
00598 end subroutine shr_flux_atmIce
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616 subroutine shr_flux_MOstability(option,arg1,arg2,arg3,arg4,arg5)
00617
00618
00619
00620 implicit none
00621
00622
00623
00624 integer(IN),intent(in) :: option
00625 real(R8) ,intent(in) :: arg1
00626 real(R8) ,intent(inout) :: arg2
00627 real(R8) ,intent(out) :: arg3
00628 real(R8) ,intent(out) :: arg4
00629 real(R8) ,intent(out),optional :: arg5
00630
00631
00632
00633
00634 real(R8) :: zeta
00635 real(R8) :: uStar
00636 real(R8) :: zkB
00637 real(R8) :: phim
00638 real(R8) :: phis
00639 real(R8) :: psim
00640 real(R8) :: psis
00641 real(R8) :: temp
00642
00643
00644 real(R8),parameter :: uStarMin = 0.001_R8
00645 real(R8),parameter :: a = 1.000_R8
00646 real(R8),parameter :: b = 0.667_R8
00647 real(R8),parameter :: c = 5.000_R8
00648 real(R8),parameter :: d = 0.350_R8
00649
00650
00651 real(R8),parameter :: a2 = 3.0_R8
00652
00653
00654 character(*),parameter :: subName = '(shr_flux_MOstability) '
00655 character(*),parameter :: F00 = "('(shr_flux_MOstability) ',4a)"
00656 character(*),parameter :: F01 = "('(shr_flux_MOstability) ',a,i5)"
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672 if (debug > 1 .and. s_loglev > 0) then
00673 if (debug > 2) write(s_logunit,F01) "enter, option = ",option
00674 if ( option == shr_flux_MOwScales .and. present(arg5) ) then
00675 write(s_logunit,F01) "ERROR: option1 must have four arguments"
00676 call shr_sys_abort(subName//"option inconsistant with arguments")
00677 else if ( option == shr_flux_MOfunctions .and. .not. present(arg5) ) then
00678 write(s_logunit,F01) "ERROR: option2 must have five arguments"
00679 call shr_sys_abort(subName//"option inconsistant with arguments")
00680 else
00681 write(s_logunit,F01) "invalid option = ",option
00682 call shr_sys_abort(subName//"invalid option")
00683 end if
00684 end if
00685
00686
00687 if (option == shr_flux_MOwScales) then
00688
00689
00690 uStar = arg1
00691 zkB = arg2
00692
00693 if (zkB >= 0.0_R8) then
00694 zeta = zkB/(max(uStar,uStarMin)**3)
00695 temp = exp(-d*zeta)
00696 phim = uStar/(1.0_R8 + zeta*(a + b*(1.0_R8 + c - d*zeta)*temp))
00697 phis = phim
00698 else
00699 temp = (zkB*zkB)**(1.0_R8/a2)
00700 phim = sqrt(uStar**2 + shr_flux_MOgammaM*temp)
00701 phis = sqrt(uStar**2 + shr_flux_MOgammaS*temp)
00702 end if
00703
00704
00705 arg3 = phim
00706 arg4 = phis
00707
00708
00709
00710 else if (option == shr_flux_MOfunctions) then
00711
00712
00713 zeta = arg1
00714
00715 if (zeta >= 0.0_R8) then
00716 temp = exp(-d*zeta)
00717 phim = 1.0_R8 + zeta*(a + b*(1.0_R8 + c - d*zeta)*temp)
00718 phis = phim
00719 psim = -a*zeta - b*(zeta - c/d)*temp - b*c/d
00720 psis = psim
00721 else
00722 temp = (zeta*zeta)**(1.0_R8/a2)
00723 phim = 1.0_R8/sqrt(1.0_R8 + shr_flux_MOgammaM*temp)
00724 phis = 1.0_R8/sqrt(1.0_R8 + shr_flux_MOgammaS*temp)
00725 psim = a2*log(0.5_R8 + 0.5_R8/phim)
00726 psis = a2*log(0.5_R8 + 0.5_R8/phis)
00727 end if
00728
00729
00730 arg2 = phim
00731 arg3 = phis
00732 arg4 = psim
00733 arg5 = psis
00734
00735 else
00736 write(s_logunit,F01) "invalid option = ",option
00737 call shr_sys_abort(subName//"invalid option")
00738 endif
00739
00740 end subroutine shr_flux_MOstability
00741
00742
00743
00744
00745 end module shr_flux_mod