source: lmdz_wrf/WRFV3/lmdz/surf_ocean_mod.F90 @ 1

Last change on this file since 1 was 1, checked in by lfita, 10 years ago
  • -- --- Opening of the WRF+LMDZ coupling repository --- -- -

WRF: version v3.3
LMDZ: version v1818

More details in:

  • Property svn:executable set to *
File size: 7.4 KB
Line 
1!
2MODULE surf_ocean_mod
3
4  IMPLICIT NONE
5
6CONTAINS
7!
8!****************************************************************************************
9!
10  SUBROUTINE surf_ocean(rlon, rlat, swnet, lwnet, alb1, &
11       rugos, windsp, rmu0, fder, tsurf_in, &
12       itime, dtime, jour, knon, knindex, &
13       p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
14       AcoefH, AcoefQ, BcoefH, BcoefQ, &
15       AcoefU, AcoefV, BcoefU, BcoefV, &
16       ps, u1, v1, rugoro, pctsrf, &
17       snow, qsurf, agesno, &
18       z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, &
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
27  USE indice_sol_mod
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.
32
33
34    INCLUDE "YOMCST.h"
35
36! Input variables
37!****************************************************************************************
38    INTEGER, INTENT(IN)                      :: itime, jour, knon
39    INTEGER, DIMENSION(klon), INTENT(IN)     :: knindex
40    REAL, INTENT(IN)                         :: dtime
41    REAL, DIMENSION(klon), INTENT(IN)        :: rlon, rlat
42    REAL, DIMENSION(klon), INTENT(IN)        :: swnet  ! net shortwave radiation at surface 
43    REAL, DIMENSION(klon), INTENT(IN)        :: lwnet  ! net longwave radiation at surface 
44    REAL, DIMENSION(klon), INTENT(IN)        :: alb1   ! albedo in visible SW interval
45    REAL, DIMENSION(klon), INTENT(IN)        :: rugos
46    REAL, DIMENSION(klon), INTENT(IN)        :: windsp
47    REAL, DIMENSION(klon), INTENT(IN)        :: rmu0 
48    REAL, DIMENSION(klon), INTENT(IN)        :: fder
49    REAL, DIMENSION(klon), INTENT(IN)        :: tsurf_in
50    REAL, DIMENSION(klon), INTENT(IN)        :: p1lay
51    REAL, DIMENSION(klon), INTENT(IN)        :: cdragh
52    REAL, DIMENSION(klon), INTENT(IN)        :: cdragm
53    REAL, DIMENSION(klon), INTENT(IN)        :: precip_rain, precip_snow
54    REAL, DIMENSION(klon), INTENT(IN)        :: temp_air, spechum
55    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefH, AcoefQ, BcoefH, BcoefQ
56    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefU, AcoefV, BcoefU, BcoefV
57    REAL, DIMENSION(klon), INTENT(IN)        :: ps
58    REAL, DIMENSION(klon), INTENT(IN)        :: u1, v1
59    REAL, DIMENSION(klon), INTENT(IN)        :: rugoro
60    REAL, DIMENSION(klon,nbsrf), INTENT(IN)  :: pctsrf
61
62! In/Output variables
63!****************************************************************************************
64    REAL, DIMENSION(klon), INTENT(INOUT)     :: snow
65    REAL, DIMENSION(klon), INTENT(INOUT)     :: qsurf
66    REAL, DIMENSION(klon), INTENT(INOUT)     :: agesno
67
68! Output variables
69!****************************************************************************************
70    REAL, DIMENSION(klon), INTENT(OUT)       :: z0_new
71    REAL, DIMENSION(klon), INTENT(OUT)       :: alb1_new  ! new albedo in visible SW interval
72    REAL, DIMENSION(klon), INTENT(OUT)       :: alb2_new  ! new albedo in near IR interval
73    REAL, DIMENSION(klon), INTENT(OUT)       :: evap, fluxsens, fluxlat
74    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
75    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
76    REAL, DIMENSION(klon), INTENT(OUT)       :: lmt_bils
77    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1
78
79! Local variables
80!****************************************************************************************
81    INTEGER               :: i
82    REAL                  :: tmp
83    REAL, PARAMETER       :: cepdu2=(0.1)**2
84    REAL, DIMENSION(klon) :: alb_eau
85    REAL, DIMENSION(klon) :: radsol
86
87! Lluis
88    INTEGER                                              :: lp
89
90    lp = 498
91
92! End definition
93!****************************************************************************************
94
95    PRINT *,'  Lluis in surf_ocean_mod lp: ',lp,' type_ocean: ',type_ocean,          &
96      ' tsurf_in: ',tsurf_in(lp)
97
98!****************************************************************************************
99! Calculate total net radiance at surface
100!
101!****************************************************************************************
102    radsol(:) = 0.0
103    radsol(1:knon) = swnet(1:knon) + lwnet(1:knon)
104
105!****************************************************************************************
106! Switch according to type of ocean (couple, slab or forced)
107!****************************************************************************************
108    SELECT CASE(type_ocean)
109    CASE('couple')
110       CALL ocean_cpl_noice( &
111            swnet, lwnet, alb1, &
112            windsp, fder, &
113            itime, dtime, knon, knindex, &
114            p1lay, cdragh, cdragm, precip_rain, precip_snow,temp_air,spechum,&
115            AcoefH, AcoefQ, BcoefH, BcoefQ, &
116            AcoefU, AcoefV, BcoefU, BcoefV, &
117            ps, u1, v1, &
118            radsol, snow, agesno, &
119            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
120            tsurf_new, dflux_s, dflux_l)
121
122    CASE('slab')
123       CALL ocean_slab_noice( &
124            itime, dtime, jour, knon, knindex, &
125            p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum,&
126            AcoefH, AcoefQ, BcoefH, BcoefQ, &
127            AcoefU, AcoefV, BcoefU, BcoefV, &
128            ps, u1, v1, tsurf_in, &
129            radsol, snow, agesno, &
130            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
131            tsurf_new, dflux_s, dflux_l, lmt_bils)
132       
133    CASE('force')
134
135       PRINT *,'  Lluis before ocean_forced_noice tsurf_new: ',tsurf_new(lp)
136       CALL ocean_forced_noice( &
137            itime, dtime, jour, knon, knindex, &
138            p1lay, cdragh, cdragm, precip_rain, precip_snow, &
139            temp_air, spechum, &
140            AcoefH, AcoefQ, BcoefH, BcoefQ, &
141            AcoefU, AcoefV, BcoefU, BcoefV, &
142            ps, u1, v1, &
143            radsol, snow, agesno, &
144            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
145            tsurf_new, dflux_s, dflux_l)
146       PRINT *,'  Lluis after ocean_forced_noice tsurf_new: ',tsurf_new(lp)
147    END SELECT
148
149!****************************************************************************************
150! Calculate albedo
151!
152!****************************************************************************************
153    IF ( MINVAL(rmu0) == MAXVAL(rmu0) .AND. MINVAL(rmu0) == -999.999 ) THEN
154       CALL alboc(REAL(jour),rlat,alb_eau)
155    ELSE  ! diurnal cycle
156       CALL alboc_cd(rmu0,alb_eau)
157    ENDIF
158
159    DO i =1, knon
160       alb1_new(i) = alb_eau(knindex(i))
161    ENDDO
162    alb2_new(1:knon) = alb1_new(1:knon)
163
164!****************************************************************************************
165! Calculate the rugosity
166!
167!****************************************************************************************
168    DO i = 1, knon
169       tmp = MAX(cepdu2,u1(i)**2+v1(i)**2)
170       z0_new(i) = 0.018*cdragm(i) * (u1(i)**2+v1(i)**2)/RG  &
171            +  0.11*14e-6 / SQRT(cdragm(i) * tmp)
172       z0_new(i) = MAX(1.5e-05,z0_new(i))
173    ENDDO   
174!
175!****************************************************************************************
176!   
177  END SUBROUTINE surf_ocean
178!
179!****************************************************************************************
180!
181END MODULE surf_ocean_mod
Note: See TracBrowser for help on using the repository browser.