source: LMDZ6/branches/Ocean_skin/libf/phylmd/surf_ocean_mod.F90 @ 3628

Last change on this file since 3628 was 3628, checked in by lguez, 4 years ago

If the ocean skin parameterization is working actively
(activate_ocean_skin == 2) and we are coupled to the ocean then send
ocean-air interface salinity to the ocean. New dummy argument s_int
of procedures ocean_cpl_noice and cpl_send_ocean_fields. We can
only send interface salinity from the previous time-step since
communication with the ocean is before the call to bulk_flux. So make
s_int a state variable: move s_int from phys_output_var_mod to
phys_state_var_mod. Still, we only read s_int from startphy,
define it before the call to surf_ocean and write it to restartphy
if activate_ocean_skin == 2 and type_ocean == 'couple'. In
procedure pbl_surface, for clarity, move the definition of output
variables t_int, dter, dser, tkt, tks, rf, taur to missing_val to
after the call to surf_ocean, with the definition of s_int,
ds_ns, dt_ns to missing_val. This does not change anything for
t_int, dter, dser, tkt, tks, rf, taur. In pbl_surface_newfrac, we
choose to set s_int to 35 for an appearing ocean point, this is
questionable. In surf_ocean, change the intent of s_int from out
to inout.

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