source: LMDZ5/branches/testing/libf/phylmd/surf_ocean_mod.F90 @ 2337

Last change on this file since 2337 was 2298, checked in by Laurent Fairhead, 9 years ago

Merged trunk changes -r2237:2291 into testing branch

  • 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:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 9.0 KB
RevLine 
[781]1!
2MODULE surf_ocean_mod
3
4  IMPLICIT NONE
5
6CONTAINS
7!
[2298]8!******************************************************************************
[781]9!
[888]10  SUBROUTINE surf_ocean(rlon, rlat, swnet, lwnet, alb1, &
[2298]11       windsp, rmu0, fder, tsurf_in, &
[781]12       itime, dtime, jour, knon, knindex, &
[2298]13       p1lay, z1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
[1067]14       AcoefH, AcoefQ, BcoefH, BcoefQ, &
15       AcoefU, AcoefV, BcoefU, BcoefV, &
[2298]16       ps, u1, v1, gustiness, rugoro, pctsrf, &
[888]17       snow, qsurf, agesno, &
[2298]18       z0m, z0h, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, &
[1067]19       tsurf_new, dflux_s, dflux_l, lmt_bils, &
20       flux_u1, flux_v1)
21
22  USE dimphy
23  USE surface_data, ONLY     : type_ocean
24  USE ocean_forced_mod, ONLY : ocean_forced_noice
25  USE ocean_slab_mod, ONLY   : ocean_slab_noice
26  USE ocean_cpl_mod, ONLY    : ocean_cpl_noice
[1795]27  USE indice_sol_mod
[781]28!
29! This subroutine will make a call to ocean_XXX_noice according to the ocean mode (force,
30! slab or couple). The calculations of albedo and rugosity for the ocean surface are
31! done in here because they are identical for the different modes of ocean.
[1795]32
33
[793]34    INCLUDE "YOMCST.h"
[781]35
[2187]36    include "clesphys.h"
37    ! for cycle_diurne
38
[781]39! Input variables
[2298]40!******************************************************************************
[781]41    INTEGER, INTENT(IN)                      :: itime, jour, knon
42    INTEGER, DIMENSION(klon), INTENT(IN)     :: knindex
43    REAL, INTENT(IN)                         :: dtime
44    REAL, DIMENSION(klon), INTENT(IN)        :: rlon, rlat
[888]45    REAL, DIMENSION(klon), INTENT(IN)        :: swnet  ! net shortwave radiation at surface 
46    REAL, DIMENSION(klon), INTENT(IN)        :: lwnet  ! net longwave radiation at surface 
47    REAL, DIMENSION(klon), INTENT(IN)        :: alb1   ! albedo in visible SW interval
[781]48    REAL, DIMENSION(klon), INTENT(IN)        :: windsp
49    REAL, DIMENSION(klon), INTENT(IN)        :: rmu0 
50    REAL, DIMENSION(klon), INTENT(IN)        :: fder
[996]51    REAL, DIMENSION(klon), INTENT(IN)        :: tsurf_in
[2298]52    REAL, DIMENSION(klon), INTENT(IN)        :: p1lay,z1lay ! pression (Pa) et altitude (m) du premier niveau
[1067]53    REAL, DIMENSION(klon), INTENT(IN)        :: cdragh
54    REAL, DIMENSION(klon), INTENT(IN)        :: cdragm
[781]55    REAL, DIMENSION(klon), INTENT(IN)        :: precip_rain, precip_snow
56    REAL, DIMENSION(klon), INTENT(IN)        :: temp_air, spechum
[1067]57    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefH, AcoefQ, BcoefH, BcoefQ
58    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefU, AcoefV, BcoefU, BcoefV
[781]59    REAL, DIMENSION(klon), INTENT(IN)        :: ps
[2298]60    REAL, DIMENSION(klon), INTENT(IN)        :: u1, v1, gustiness
[781]61    REAL, DIMENSION(klon), INTENT(IN)        :: rugoro
62    REAL, DIMENSION(klon,nbsrf), INTENT(IN)  :: pctsrf
63
64! In/Output variables
[2298]65!******************************************************************************
[888]66    REAL, DIMENSION(klon), INTENT(INOUT)     :: snow
67    REAL, DIMENSION(klon), INTENT(INOUT)     :: qsurf
[781]68    REAL, DIMENSION(klon), INTENT(INOUT)     :: agesno
69
70! Output variables
[2298]71!******************************************************************************
72    REAL, DIMENSION(klon), INTENT(OUT)       :: z0m, z0h
[2258]73!albedo SB >>>
74!    REAL, DIMENSION(klon), INTENT(OUT)       :: alb1_new  ! new albedo in visible SW interval
75!    REAL, DIMENSION(klon), INTENT(OUT)       :: alb2_new  ! new albedo in near IR interval
76    REAL, DIMENSION(6), INTENT(IN)          :: SFRWL
77    REAL, DIMENSION(klon,nsw), INTENT(OUT)       :: alb_dir_new,alb_dif_new
78!albedo SB <<<     
[781]79    REAL, DIMENSION(klon), INTENT(OUT)       :: evap, fluxsens, fluxlat
[888]80    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
[781]81    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
[996]82    REAL, DIMENSION(klon), INTENT(OUT)       :: lmt_bils
[1067]83    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1
[781]84
85! Local variables
[2298]86!******************************************************************************
[2258]87    INTEGER               :: i, k
[1146]88    REAL                  :: tmp
89    REAL, PARAMETER       :: cepdu2=(0.1)**2
[781]90    REAL, DIMENSION(klon) :: alb_eau
[888]91    REAL, DIMENSION(klon) :: radsol
[2298]92    REAL, DIMENSION(klon) :: cdragq ! Cdrag pour l'evaporation
[781]93
94! End definition
[2298]95!******************************************************************************
[888]96
97
[2298]98!******************************************************************************
[888]99! Calculate total net radiance at surface
100!
[2298]101!******************************************************************************
[888]102    radsol(:) = 0.0
103    radsol(1:knon) = swnet(1:knon) + lwnet(1:knon)
104
[2298]105!******************************************************************************
106! Cdragq computed from cdrag
107! The difference comes only from a factor (f_z0qh_oce) on z0, so that
108! it can be computed inside surf_ocean
109! More complicated appraches may require the propagation through
110! pbl_surface of an independant cdragq variable.
111!******************************************************************************
112
113    IF ( f_z0qh_oce .ne. 1.) THEN
114! Si on suit les formulations par exemple de Tessel, on
115! a z0h=0.4*nu/u*, z0q=0.62*nu/u*, d'ou f_z0qh_oce=0.62/0.4=1.55
116       cdragq(:)=cdragh(:)*                                      &
117       log(z1lay(:)/z0h(:))/log(z1lay(:)/(f_z0qh_oce*z0h(:)))
118    ELSE
119       cdragq(:)=cdragh(:)
120    ENDIF
121
122!******************************************************************************
[781]123! Switch according to type of ocean (couple, slab or forced)
[2298]124!******************************************************************************
[996]125    SELECT CASE(type_ocean)
[781]126    CASE('couple')
[888]127       CALL ocean_cpl_noice( &
128            swnet, lwnet, alb1, &
[1067]129            windsp, fder, &
[781]130            itime, dtime, knon, knindex, &
[2298]131            p1lay, cdragh, cdragq, cdragm, precip_rain, precip_snow,temp_air,spechum,&
[1067]132            AcoefH, AcoefQ, BcoefH, BcoefQ, &
133            AcoefU, AcoefV, BcoefU, BcoefV, &
[2298]134            ps, u1, v1, gustiness, &
[888]135            radsol, snow, agesno, &
[1067]136            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
[996]137            tsurf_new, dflux_s, dflux_l)
[781]138
139    CASE('slab')
[888]140       CALL ocean_slab_noice( &
[996]141            itime, dtime, jour, knon, knindex, &
[2298]142            p1lay, cdragh, cdragq, cdragm, precip_rain, precip_snow, temp_air, spechum,&
[1067]143            AcoefH, AcoefQ, BcoefH, BcoefQ, &
144            AcoefU, AcoefV, BcoefU, BcoefV, &
[2298]145            ps, u1, v1, gustiness, tsurf_in, &
[2220]146            radsol, snow, &
[1067]147            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
[996]148            tsurf_new, dflux_s, dflux_l, lmt_bils)
[781]149       
150    CASE('force')
[888]151       CALL ocean_forced_noice( &
152            itime, dtime, jour, knon, knindex, &
[2298]153            p1lay, cdragh, cdragq, cdragm, precip_rain, precip_snow, &
[781]154            temp_air, spechum, &
[1067]155            AcoefH, AcoefQ, BcoefH, BcoefQ, &
156            AcoefU, AcoefV, BcoefU, BcoefV, &
[2298]157            ps, u1, v1, gustiness, &
[888]158            radsol, snow, agesno, &
[1067]159            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
[996]160            tsurf_new, dflux_s, dflux_l)
[781]161    END SELECT
162
[2298]163!******************************************************************************
[2073]164! fcodron: compute lmt_bils  forced case (same as wfbils_oce / 1.-contfracatm)
[2298]165!******************************************************************************
[2073]166    IF (type_ocean.NE.'slab') THEN
167        lmt_bils(:)=0.
168        DO i=1,knon
169           lmt_bils(knindex(i))=(swnet(i)+lwnet(i)+fluxsens(i)+fluxlat(i)) &
170           *pctsrf(knindex(i),is_oce)/(1.-zmasq(knindex(i)))
171        END DO
172    END IF
173
[2298]174!******************************************************************************
[781]175! Calculate albedo
[2298]176!******************************************************************************
[2258]177!albedo SB >>>
178  if(iflag_albedo==1)then
179    call ocean_albedo(knon,rmu0,knindex,windsp,SFRWL,alb_dir_new,alb_dif_new)
180  else
[2187]181    IF (cycle_diurne) THEN
182       CALL alboc_cd(rmu0,alb_eau)
183    ELSE
[1403]184       CALL alboc(REAL(jour),rlat,alb_eau)
[781]185    ENDIF
186
187    DO i =1, knon
[2258]188      do  k=1,nsw
189       alb_dir_new(i,k) = alb_eau(knindex(i))
190      enddo
[781]191    ENDDO
[2258]192     alb_dif_new=0.05 !alb_dir_new
193endif
[781]194
[2258]195!albedo SB <<<
196
[2298]197!******************************************************************************
[781]198! Calculate the rugosity
[2298]199!******************************************************************************
200IF (iflag_z0_oce==0) THEN
[781]201    DO i = 1, knon
[2298]202       tmp = MAX(cepdu2,gustiness(i)+u1(i)**2+v1(i)**2)
203       z0m(i) = 0.018*cdragm(i) * (gustiness(i)+u1(i)**2+v1(i)**2)/RG  &
[1146]204            +  0.11*14e-6 / SQRT(cdragm(i) * tmp)
[2298]205       z0m(i) = MAX(1.5e-05,z0m(i))
[1146]206    ENDDO   
[2298]207    z0h(1:knon)=z0m(1:knon) ! En attendant mieux
208
209ELSE IF (iflag_z0_oce==1) THEN
210    DO i = 1, knon
211       tmp = MAX(cepdu2,gustiness(i)+u1(i)**2+v1(i)**2)
212       z0m(i) = 0.018*cdragm(i) * (gustiness(i)+u1(i)**2+v1(i)**2)/RG  &
213            + 0.11*14e-6 / SQRT(cdragm(i) * tmp)
214       z0m(i) = MAX(1.5e-05,z0m(i))
215       z0h(i)=0.4*14e-6 / SQRT(cdragm(i) * tmp)
216    ENDDO
217ELSE
218       STOP'version non prevue'
219ENDIF
[781]220!
[2298]221!******************************************************************************
[781]222  END SUBROUTINE surf_ocean
[2298]223!******************************************************************************
[781]224!
225END MODULE surf_ocean_mod
Note: See TracBrowser for help on using the repository browser.