CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
sfc_cice.f
1
3
8
10 module sfc_cice
11
12 contains
13
18
19!! use physcons, only : hvap => con_hvap, cp => con_cp, &
20!! & rvrdm1 => con_fvirt, rd => con_rd
21!
22!-----------------------------------
23 subroutine sfc_cice_run &
24! --- inputs:
25 & ( im, cplflx, hvap, cp, rvrdm1, rd, &
26 & t1, q1, cm, ch, prsl1, &
27 & wind, flag_cice, flag_iter, dqsfc, dtsfc, &
28 & dusfc, dvsfc, snowd, &
29! --- outputs:
30 & qsurf, cmm, chh, evap, hflx, stress, weasd, snwdph, ep, &
31 & errmsg, errflg
32 & )
33
34! ===================================================================== !
35! description: !
36! Sep 2015 -- Xingren Wu created from sfc_sice for coupling to CICE !
37! !
38! usage: !
39! !
40! call sfc_cice !
41! inputs: !
42! ( im, cplflx, hvap, cp, rvrdm1, rd, !
43! t1, q1, cm, ch, prsl1, !
44! wind, flag_cice, flag_iter, dqsfc, dtsfc, !
45! dusfc, dvsfc, snowd, !
46! outputs: !
47! qsurf, cmm, chh, evap, hflx, stress, weasd, snwdph, ep) !
48! !
49! ==================== defination of variables ==================== !
50! !
51! inputs:
52! im, - integer, horiz dimension
53!! u1, v1 - real, u/v component of surface layer wind
54! t1 - real, surface layer mean temperature ( k )
55! q1 - real, surface layer mean specific humidity
56! cm - real, surface exchange coeff for momentum (m/s)
57! ch - real, surface exchange coeff heat & moisture(m/s)
58! prsl1 - real, surface layer mean pressure
59! wind - real, wind speed (m/s)
60! flag_iter- logical
61! dqsfc - real, latent heat flux
62! dtsfc - real, sensible heat flux
63! dusfc - real, zonal momentum stress
64! dvsfc - real, meridional momentum stress
65! snowd - real, snow depth from cice
66! outputs:
67! qsurf - real, specific humidity at sfc
68! cmm - real, ?
69! chh - real, ?
70! evap - real, evaperation from latent heat
71! hflx - real, sensible heat
72! stress - real, surface stress
73! weasd - real, water equivalent accumulated snow depth (mm)
74! snwdph - real, water equivalent snow depth (mm)
75! ep - real, potential evaporation
76! ==================== end of description ===================== !
77!
78!
79 use machine , only : kind_phys
80 implicit none
81
82 real(kind=kind_phys), parameter :: one = 1.0_kind_phys
83 real(kind=kind_phys), parameter :: dsi = one/0.33_kind_phys
84 real(kind=kind_phys), intent(in) :: hvap, cp, rvrdm1, rd
85
86! --- inputs:
87 integer, intent(in) :: im
88 logical, intent(in) :: cplflx
89
90! real (kind=kind_phys), dimension(im), intent(in) :: u1, v1, &
91 real (kind=kind_phys), dimension(:), intent(in) :: &
92 & t1, q1, cm, ch, prsl1, wind, snowd
93
94 real (kind=kind_phys), dimension(:), intent(in), optional :: &
95 & dqsfc, dtsfc, dusfc, dvsfc
96 logical, dimension(:), intent(in) :: flag_cice, flag_iter
97
98! --- outputs:
99 real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, &
100 & cmm, chh, evap, hflx, stress
101 &, weasd, snwdph, ep
102!
103 character(len=*), intent(out) :: errmsg
104 integer, intent(out) :: errflg
105
106! --- locals:
107
108 real (kind=kind_phys) :: rho, tem
109
110 real(kind=kind_phys) :: cpinv, hvapi, elocp
111
112 integer :: i
113
114 ! Initialize CCPP error handling variables
115 errmsg = ''
116 errflg = 0
117!
118 if (.not. cplflx) return
119!
120 cpinv = one / cp
121 hvapi = one / hvap
122 elocp = hvap/cp
123!
124 do i = 1, im
125 if (flag_cice(i) .and. flag_iter(i)) then
126
127 rho = prsl1(i) &
128 & / (rd * t1(i) * (one + rvrdm1*max(q1(i), 1.0e-8_kind_phys)))
129
130 cmm(i) = wind(i) * cm(i)
131 chh(i) = wind(i) * ch(i) * rho
132
133 qsurf(i) = q1(i) + dqsfc(i) / (hvap*chh(i))
134 tem = one / rho
135 hflx(i) = dtsfc(i) * tem * cpinv
136 evap(i) = dqsfc(i) * tem * hvapi
137 stress(i) = sqrt(dusfc(i)*dusfc(i) + dvsfc(i)*dvsfc(i)) * tem
138
139 snwdph(i) = snowd(i) * 1000.0_kind_phys
140 weasd(i) = snwdph(i) * 0.33_kind_phys
141
142! weasd(i) = snowd(i) * 1000.0_kind_phys
143! snwdph(i) = weasd(i) * dsi ! snow depth in mm
144
145 ep(i) = evap(i)
146 endif
147 enddo
148
149 return
150!-----------------------------------
151 end subroutine sfc_cice_run
152!-----------------------------------
153
154 end module sfc_cice
This module contains the CCPP-compliant GFS sea ice post interstitial codes, which returns updated ic...
Definition sfc_cice.f:10