source: LMDZ6/trunk/libf/phylmd/surf_ocean_mod.F90 @ 4440

Last change on this file since 4440 was 4370, checked in by lguez, 2 years ago

Merge branch Ocean_skin back into trunk

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 14.6 KB
Line 
1!
2! $Id: surf_ocean_mod.F90 4370 2022-12-06 15:23:49Z fhourdin $
3!
4MODULE surf_ocean_mod
5
6  IMPLICIT NONE
7
8CONTAINS
9  !
10  !******************************************************************************
11  !
12  SUBROUTINE surf_ocean(rlon, rlat, swnet, lwnet, alb1, &
13       windsp, rmu0, fder, tsurf_in, &
14       itime, dtime, jour, knon, knindex, &
15       p1lay, z1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
16       AcoefH, AcoefQ, BcoefH, BcoefQ, &
17       AcoefU, AcoefV, BcoefU, BcoefV, &
18       ps, u1, v1, gustiness, rugoro, pctsrf, &
19       snow, qsurf, agesno, &
20       z0m, z0h, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, &
21       tsurf_new, dflux_s, dflux_l, lmt_bils, &
22       flux_u1, flux_v1, delta_sst, delta_sal, ds_ns, dt_ns, dter, dser, &
23       dt_ds, tkt, tks, taur, sss)
24
25    use albedo, only: alboc, alboc_cd
26    use bulk_flux_m, only: bulk_flux
27    USE dimphy, ONLY: klon, zmasq
28    USE surface_data, ONLY     : type_ocean
29    USE ocean_forced_mod, ONLY : ocean_forced_noice
30    USE ocean_slab_mod, ONLY   : ocean_slab_noice
31    USE ocean_cpl_mod, ONLY    : ocean_cpl_noice
32    USE indice_sol_mod, ONLY : nbsrf, is_oce
33    USE limit_read_mod
34    use config_ocean_skin_m, only: activate_ocean_skin
35    !
36    ! This subroutine will make a call to ocean_XXX_noice according to the ocean mode (force,
37    ! slab or couple). The calculations of albedo and rugosity for the ocean surface are
38    ! done in here because they are identical for the different modes of ocean.
39
40
41    INCLUDE "YOMCST.h"
42
43    include "clesphys.h"
44    ! for cycle_diurne and for iflag_z0_oce==-1 (prescribed z0)
45
46    ! Input variables
47    !******************************************************************************
48    INTEGER, INTENT(IN)                      :: itime, jour, knon
49    INTEGER, DIMENSION(klon), INTENT(IN)     :: knindex
50    REAL, INTENT(IN)                         :: dtime
51    REAL, DIMENSION(klon), INTENT(IN)        :: rlon, rlat
52    REAL, DIMENSION(klon), INTENT(IN)        :: swnet  ! net shortwave radiation at surface 
53    REAL, DIMENSION(klon), INTENT(IN)        :: lwnet  ! net longwave radiation at surface 
54    REAL, DIMENSION(klon), INTENT(IN)        :: alb1   ! albedo in visible SW interval
55    REAL, DIMENSION(klon), INTENT(IN)        :: windsp ! wind at 10 m, in m s-1
56    REAL, DIMENSION(klon), INTENT(IN)        :: rmu0 
57    REAL, DIMENSION(klon), INTENT(IN)        :: fder
58    REAL, DIMENSION(klon), INTENT(IN)        :: tsurf_in     ! defined only for subscripts 1:knon
59    REAL, DIMENSION(klon), INTENT(IN)        :: p1lay,z1lay ! pression (Pa) et altitude (m) du premier niveau
60    REAL, DIMENSION(klon), INTENT(IN)        :: cdragh
61    REAL, DIMENSION(klon), INTENT(IN)        :: cdragm
62    REAL, DIMENSION(klon), INTENT(IN)        :: precip_rain, precip_snow
63    REAL, DIMENSION(klon), INTENT(IN)        :: temp_air, spechum
64    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefH, AcoefQ, BcoefH, BcoefQ
65    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefU, AcoefV, BcoefU, BcoefV
66    REAL, DIMENSION(klon), INTENT(IN)        :: ps
67    REAL, DIMENSION(klon), INTENT(IN)        :: u1, v1, gustiness
68    REAL, DIMENSION(klon), INTENT(IN)        :: rugoro
69    REAL, DIMENSION(klon,nbsrf), INTENT(IN)  :: pctsrf
70
71    ! In/Output variables
72    !******************************************************************************
73    REAL, DIMENSION(klon), INTENT(INOUT)     :: snow
74    REAL, DIMENSION(klon), INTENT(INOUT)     :: qsurf
75    REAL, DIMENSION(klon), INTENT(INOUT)     :: agesno
76    REAL, DIMENSION(klon), INTENT(inOUT)     :: z0h
77
78    REAL, intent(inout):: delta_sst(:) ! (knon)
79    ! Ocean-air interface temperature minus bulk SST, in K. Defined
80    ! only if activate_ocean_skin >= 1.
81
82    real, intent(inout):: delta_sal(:) ! (knon)
83    ! Ocean-air interface salinity minus bulk salinity, in ppt. Defined
84    ! only if activate_ocean_skin >= 1.
85
86    REAL, intent(inout):: ds_ns(:) ! (knon)
87    ! "delta salinity near surface". Salinity variation in the
88    ! near-surface turbulent layer. That is subskin salinity minus
89    ! foundation salinity. In ppt.
90
91    REAL, intent(inout):: dt_ns(:) ! (knon)
92    ! "delta temperature near surface". Temperature variation in the
93    ! near-surface turbulent layer. That is subskin temperature
94    ! minus foundation temperature. (Can be negative.) In K.
95
96    REAL, intent(inout):: dter(:) ! (knon)
97    ! Temperature variation in the diffusive microlayer, that is
98    ! ocean-air interface temperature minus subskin temperature. In
99    ! K.
100
101    REAL, intent(inout):: dser(:) ! (knon)
102    ! Salinity variation in the diffusive microlayer, that is
103    ! ocean-air interface salinity minus subskin salinity. In ppt.
104
105    real, intent(inout):: dt_ds(:) ! (knon)
106    ! (tks / tkt) * dTer, in K
107
108    ! Output variables
109    !**************************************************************************
110    REAL, DIMENSION(klon), INTENT(OUT)       :: z0m
111    !albedo SB >>>
112    !    REAL, DIMENSION(klon), INTENT(OUT)  :: alb1_new  ! new albedo in visible SW interval
113    !    REAL, DIMENSION(klon), INTENT(OUT)  :: alb2_new  ! new albedo in near IR interval
114    REAL, DIMENSION(6), INTENT(IN)           :: SFRWL
115    REAL, DIMENSION(klon,nsw), INTENT(OUT)   :: alb_dir_new,alb_dif_new
116    !albedo SB <<<     
117    REAL, DIMENSION(klon), INTENT(OUT)       :: evap, fluxsens, fluxlat
118    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new    ! sea surface temperature, in K
119    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
120    REAL, DIMENSION(klon), INTENT(OUT)       :: lmt_bils
121    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1
122
123    REAL, intent(out):: tkt(:) ! (knon)
124    ! épaisseur (m) de la couche de diffusion thermique (microlayer)
125    ! cool skin thickness
126
127    REAL, intent(out):: tks(:) ! (knon)
128    ! épaisseur (m) de la couche de diffusion de masse (microlayer)
129
130    REAL, intent(out):: taur(:) ! (knon)
131    ! momentum flux due to rain, in Pa
132
133    real, intent(out):: sss(:) ! (klon)
134    ! Bulk salinity of the surface layer of the ocean, in ppt. (Only
135    ! defined for subscripts 1:knon, but we have to declare it with
136    ! size klon because of the coupling machinery.)
137
138    ! Local variables
139    !*************************************************************************
140    INTEGER               :: i, k
141    REAL                  :: tmp
142    REAL, PARAMETER       :: cepdu2=(0.1)**2
143    REAL, DIMENSION(klon) :: alb_eau, z0_lim
144    REAL, DIMENSION(klon) :: radsol
145    REAL, DIMENSION(klon) :: cdragq ! Cdrag pour l'evaporation
146    CHARACTER(len=20),PARAMETER :: modname="surf_ocean"
147    real rhoa(knon) ! density of moist air  (kg / m3)
148    REAL sens_prec_liq(knon)
149
150    REAL t_int(knon) ! ocean-air interface temperature, in K
151    real s_int(knon) ! ocean-air interface salinity, in ppt
152
153    !**************************************************************************
154
155
156    !******************************************************************************
157    ! Calculate total net radiance at surface
158    !
159    !******************************************************************************
160    radsol(1:klon) = 0.0 ! initialisation a priori inutile
161    radsol(1:knon) = swnet(1:knon) + lwnet(1:knon)
162
163    !******************************************************************************
164    ! Cdragq computed from cdrag
165    ! The difference comes only from a factor (f_z0qh_oce) on z0, so that
166    ! it can be computed inside surf_ocean
167    ! More complicated appraches may require the propagation through
168    ! pbl_surface of an independant cdragq variable.
169    !******************************************************************************
170
171    IF ( f_z0qh_oce .ne. 1.) THEN
172       ! Si on suit les formulations par exemple de Tessel, on
173       ! a z0h=0.4*nu/u*, z0q=0.62*nu/u*, d'ou f_z0qh_oce=0.62/0.4=1.55
174       cdragq(1:knon)=cdragh(1:knon)*                                      &
175            log(z1lay(1:knon)/z0h(1:knon))/log(z1lay(1:knon)/(f_z0qh_oce*z0h(1:knon)))
176    ELSE
177       cdragq(1:knon)=cdragh(1:knon)
178    ENDIF
179
180    rhoa = PS(:KNON) / (Rd * temp_air(:knon) * (1. + retv * spechum(:knon)))
181    !******************************************************************************
182    ! Switch according to type of ocean (couple, slab or forced)
183    !******************************************************************************
184    SELECT CASE(type_ocean)
185    CASE('couple')
186       CALL ocean_cpl_noice( &
187            swnet, lwnet, alb1, &
188            windsp, fder, &
189            itime, dtime, knon, knindex, &
190            p1lay, cdragh, cdragq, cdragm, precip_rain, precip_snow,temp_air,spechum,&
191            AcoefH, AcoefQ, BcoefH, BcoefQ, &
192            AcoefU, AcoefV, BcoefU, BcoefV, &
193            ps, u1, v1, gustiness, tsurf_in, &
194            radsol, snow, agesno, &
195            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
196            tsurf_new, dflux_s, dflux_l, sens_prec_liq, sss, delta_sal, rhoa, &
197            delta_sst, dTer, dSer, dt_ds)
198
199    CASE('slab')
200       CALL ocean_slab_noice( &
201            itime, dtime, jour, knon, knindex, &
202            p1lay, cdragh, cdragq, cdragm, precip_rain, precip_snow, temp_air, spechum,&
203            AcoefH, AcoefQ, BcoefH, BcoefQ, &
204            AcoefU, AcoefV, BcoefU, BcoefV, &
205            ps, u1, v1, gustiness, tsurf_in, &
206            radsol, snow, &
207            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
208            tsurf_new, dflux_s, dflux_l, lmt_bils)
209
210    CASE('force')
211       CALL ocean_forced_noice( &
212            itime, dtime, jour, knon, knindex, &
213            p1lay, cdragh, cdragq, cdragm, precip_rain, precip_snow, &
214            temp_air, spechum, &
215            AcoefH, AcoefQ, BcoefH, BcoefQ, &
216            AcoefU, AcoefV, BcoefU, BcoefV, &
217            ps, u1, v1, gustiness, tsurf_in, &
218            radsol, snow, agesno, &
219            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
220            tsurf_new, dflux_s, dflux_l, sens_prec_liq, rhoa)
221    END SELECT
222
223    !******************************************************************************
224    ! fcodron: compute lmt_bils  forced case (same as wfbils_oce / 1.-contfracatm)
225    !******************************************************************************
226    IF (type_ocean.NE.'slab') THEN
227       lmt_bils(1:klon)=0.
228       DO i=1,knon
229          lmt_bils(knindex(i))=(swnet(i)+lwnet(i)+fluxsens(i)+fluxlat(i)) &
230               *pctsrf(knindex(i),is_oce)/(1.-zmasq(knindex(i)))
231       END DO
232    END IF
233
234    !******************************************************************************
235    ! Calculate ocean surface albedo
236    !******************************************************************************
237    !albedo SB >>>
238    IF (iflag_albedo==0) THEN
239       !--old parametrizations of ocean surface albedo
240       !
241       IF (iflag_cycle_diurne.GE.1) THEN
242          !
243          CALL alboc_cd(rmu0,alb_eau)
244          !
245          !--ad-hoc correction for model radiative balance tuning
246          !--now outside alboc_cd routine
247          alb_eau(1:klon) = fmagic*alb_eau(1:klon) + pmagic
248          alb_eau(1:klon)=MIN(MAX(alb_eau(1:klon),0.0),1.0)
249          !
250       ELSE
251          !
252          CALL alboc(REAL(jour),rlat,alb_eau)
253          !--ad-hoc correction for model radiative balance tuning
254          !--now outside alboc routine
255          alb_eau(1:klon) = fmagic*alb_eau(1:klon) + pmagic
256          alb_eau(1:klon)=MIN(MAX(alb_eau(1:klon),0.04),0.60)
257          !
258       ENDIF
259       !
260       DO i =1, knon
261          DO  k=1,nsw
262             alb_dir_new(i,k) = alb_eau(knindex(i))
263          ENDDO
264       ENDDO
265       !IM 09122015 next line corresponds to the old way of doing in LMDZ5A/IPSLCM5A versions
266       !albedo for diffuse radiation is taken the same as for direct radiation
267       alb_dif_new(1:knon,:)=alb_dir_new(1:knon,:)
268       !IM 09122015 end
269       !
270    ELSE IF (iflag_albedo==1) THEN
271       !--new parametrization of ocean surface albedo by Sunghye Baek
272       !--albedo for direct and diffuse radiation are different
273       !
274       CALL ocean_albedo(knon,rmu0,knindex,windsp,SFRWL,alb_dir_new,alb_dif_new)
275       !
276       !--ad-hoc correction for model radiative balance tuning
277       alb_dir_new(1:knon,:) = fmagic*alb_dir_new(1:knon,:) + pmagic
278       alb_dif_new(1:knon,:) = fmagic*alb_dif_new(1:knon,:) + pmagic
279       alb_dir_new(1:knon,:)=MIN(MAX(alb_dir_new(1:knon,:),0.0),1.0)
280       alb_dif_new(1:knon,:)=MIN(MAX(alb_dif_new(1:knon,:),0.0),1.0)
281       !
282    ELSE IF (iflag_albedo==2) THEN
283       ! F. Codron albedo read from limit.nc
284       CALL limit_read_rug_alb(itime, dtime, jour,&
285            knon, knindex, z0_lim, alb_eau)
286       DO i =1, knon
287          DO  k=1,nsw
288             alb_dir_new(i,k) = alb_eau(i)
289          ENDDO
290       ENDDO
291       alb_dif_new=alb_dir_new
292    ENDIF
293    !albedo SB <<<
294
295    !******************************************************************************
296    ! Calculate the rugosity
297    !******************************************************************************
298    IF (iflag_z0_oce==0) THEN
299       DO i = 1, knon
300          tmp = MAX(cepdu2,gustiness(i)+u1(i)**2+v1(i)**2)
301          z0m(i) = 0.018*cdragm(i) * (gustiness(i)+u1(i)**2+v1(i)**2)/RG  &
302               +  0.11*14e-6 / SQRT(cdragm(i) * tmp)
303          z0m(i) = MAX(1.5e-05,z0m(i))
304       ENDDO
305       z0h(1:knon)=z0m(1:knon) ! En attendant mieux
306
307    ELSE IF (iflag_z0_oce==1) THEN
308       DO i = 1, knon
309          tmp = MAX(cepdu2,gustiness(i)+u1(i)**2+v1(i)**2)
310          z0m(i) = 0.018*cdragm(i) * (gustiness(i)+u1(i)**2+v1(i)**2)/RG  &
311               + 0.11*14e-6 / SQRT(cdragm(i) * tmp)
312          z0m(i) = MAX(1.5e-05,z0m(i))
313          z0h(i)=0.4*14e-6 / SQRT(cdragm(i) * tmp)
314       ENDDO
315    ELSE IF (iflag_z0_oce==-1) THEN
316       DO i = 1, knon
317          z0m(i) = z0min
318          z0h(i) = z0min
319       ENDDO
320    ELSE
321       CALL abort_physic(modname,'version non prevue',1)
322    ENDIF
323
324    if (activate_ocean_skin >= 1) then
325       if (type_ocean /= 'couple') sss(:knon) = 35.
326       call bulk_flux(tkt, tks, taur, dter, dser, t_int, s_int, ds_ns, dt_ns, &
327            u = windsp(:knon), t_ocean_1 = tsurf_new(:knon), s1 = sss(:knon), &
328            rain = precip_rain(:knon) + precip_snow(:knon), &
329            hf = - fluxsens(:knon), hlb = - fluxlat(:knon), &
330            rnl = - lwnet(:knon), &
331            tau = sqrt(flux_u1(:knon)**2 + flux_v1(:knon)**2), rhoa = rhoa, &
332            xlv = [(rlvtt, i = 1, knon)], rf = - sens_prec_liq, dtime = dtime, &
333            rns = swnet(:knon))
334       delta_sst = t_int - tsurf_new(:knon)
335       delta_sal = s_int - sss(:knon)
336
337       if (activate_ocean_skin == 2) then
338          tsurf_new(:knon) = t_int
339          if (type_ocean == 'couple') dt_ds = (tks / tkt) * dter
340       end if
341    end if
342   
343  END SUBROUTINE surf_ocean
344  !****************************************************************************
345  !
346END MODULE surf_ocean_mod
Note: See TracBrowser for help on using the repository browser.