source: LMDZ4/trunk/libf/phylmd/ocean_forced_mod.F90 @ 5447

Last change on this file since 5447 was 1067, checked in by Laurent Fairhead, 16 years ago
  • Modifications lie au premier niveau du modele pour la diffusion turbulent

du vent.

  • Preparation pour un couplage des courrant oceaniques.

JG

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 10.4 KB
RevLine 
[781]1!
2MODULE ocean_forced_mod
3!
4! This module is used for both the sub-surfaces ocean and sea-ice for the case of a
5! forced ocean,  "ocean=force".
6!
7  IMPLICIT NONE
8
9CONTAINS
10!
11!****************************************************************************************
12!
[1067]13  SUBROUTINE ocean_forced_noice( &
14       itime, dtime, jour, knon, knindex, &
15       p1lay, cdragh, cdragm, precip_rain, precip_snow, &
[781]16       temp_air, spechum, &
[1067]17       AcoefH, AcoefQ, BcoefH, BcoefQ, &
18       AcoefU, AcoefV, BcoefU, BcoefV, &
19       ps, u1, v1, &
[888]20       radsol, snow, agesno, &
[1067]21       qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
[996]22       tsurf_new, dflux_s, dflux_l)
[781]23!
24! This subroutine treats the "open ocean", all grid points that are not entierly covered
25! by ice.
[996]26! The routine receives data from climatologie file limit.nc and does some calculations at the
[781]27! surface.
28!
[1067]29    USE dimphy
30    USE calcul_fluxs_mod
[996]31    USE limit_read_mod
[793]32    INCLUDE "indicesol.h"
33    INCLUDE "YOMCST.h"
[781]34
35! Input arguments
36!****************************************************************************************
37    INTEGER, INTENT(IN)                      :: itime, jour, knon
38    INTEGER, DIMENSION(klon), INTENT(IN)     :: knindex
39    REAL, INTENT(IN)                         :: dtime
40    REAL, DIMENSION(klon), INTENT(IN)        :: p1lay
[1067]41    REAL, DIMENSION(klon), INTENT(IN)        :: cdragh, cdragm
[781]42    REAL, DIMENSION(klon), INTENT(IN)        :: precip_rain, precip_snow
43    REAL, DIMENSION(klon), INTENT(IN)        :: temp_air, spechum
[1067]44    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefH, AcoefQ, BcoefH, BcoefQ
45    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefU, AcoefV, BcoefU, BcoefV
[781]46    REAL, DIMENSION(klon), INTENT(IN)        :: ps
[1067]47    REAL, DIMENSION(klon), INTENT(IN)        :: u1, v1
[781]48
49! In/Output arguments
50!****************************************************************************************
51    REAL, DIMENSION(klon), INTENT(INOUT)     :: radsol
52    REAL, DIMENSION(klon), INTENT(INOUT)     :: snow
53    REAL, DIMENSION(klon), INTENT(INOUT)     :: agesno !? put to 0 in ocean
54 
55! Output arguments
56!****************************************************************************************
57    REAL, DIMENSION(klon), INTENT(OUT)       :: qsurf
58    REAL, DIMENSION(klon), INTENT(OUT)       :: evap, fluxsens, fluxlat
[1067]59    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1
[781]60    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
61    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l
62
63! Local variables
64!****************************************************************************************
65    INTEGER                     :: i
66    REAL, DIMENSION(klon)       :: cal, beta, dif_grnd
67    REAL, DIMENSION(klon)       :: alb_neig, tsurf_lim, zx_sl
[1067]68    REAL, DIMENSION(klon)       :: u0, v0
69    REAL, DIMENSION(klon)       :: u1_lay, v1_lay
[781]70    LOGICAL                     :: check=.FALSE.
71
72!****************************************************************************************
73! Start calculation
74!****************************************************************************************
75    IF (check) WRITE(*,*)' Entering ocean_forced_noice'
[1067]76   
[781]77!****************************************************************************************
78! 1)   
[996]79! Read sea-surface temperature from file limit.nc
[781]80!
81!****************************************************************************************
[996]82    CALL limit_read_sst(knon,knindex,tsurf_lim)
83
[781]84!****************************************************************************************
85! 2)
86! Flux calculation
87!
88!****************************************************************************************
89! Set some variables for calcul_fluxs
90    cal = 0.
91    beta = 1.
92    dif_grnd = 0.
93    alb_neig(:) = 0.
94    agesno(:) = 0.
[1067]95! Suppose zero surface speed
96    u0(:)=0.0
97    v0(:)=0.0
98    u1_lay(:) = u1(:) - u0(:)
99    v1_lay(:) = v1(:) - v0(:)
100
[781]101! Calcul de tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l and qsurf
102    CALL calcul_fluxs(knon, is_oce, dtime, &
[1067]103         tsurf_lim, p1lay, cal, beta, cdragh, ps, &
[781]104         precip_rain, precip_snow, snow, qsurf,  &
105         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
[1067]106         AcoefH, AcoefQ, BcoefH, BcoefQ, &
[781]107         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
108
[1067]109! - Flux calculation at first modele level for U and V
110    CALL calcul_flux_wind(knon, dtime, &
111         u0, v0, u1, v1, cdragm, &
112         AcoefU, AcoefV, BcoefU, BcoefV, &
113         p1lay, temp_air, &
114         flux_u1, flux_v1) 
[781]115
116  END SUBROUTINE ocean_forced_noice
117!
[1067]118!***************************************************************************************
[781]119!
[1067]120  SUBROUTINE ocean_forced_ice( &
121       itime, dtime, jour, knon, knindex, &
122       tsurf_in, p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
123       AcoefH, AcoefQ, BcoefH, BcoefQ, &
124       AcoefU, AcoefV, BcoefU, BcoefV, &
125       ps, u1, v1, &
[888]126       radsol, snow, qsol, agesno, tsoil, &
[1067]127       qsurf, alb1_new, alb2_new, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
[996]128       tsurf_new, dflux_s, dflux_l)
[781]129!
130! This subroutine treats the ocean where there is ice.
131! The routine reads data from climatologie file and does flux calculations at the
132! surface.
[996]133!
[1067]134    USE dimphy
135    USE calcul_fluxs_mod
136    USE surface_data,     ONLY : calice, calsno, tau_gl
[996]137    USE limit_read_mod
[1067]138    USE fonte_neige_mod,  ONLY : fonte_neige
[996]139
[793]140    INCLUDE "indicesol.h"
[781]141    INCLUDE "dimsoil.h"
[793]142    INCLUDE "YOMCST.h"
143    INCLUDE "clesphys.h"
[781]144
145! Input arguments
146!****************************************************************************************
147    INTEGER, INTENT(IN)                  :: itime, jour, knon
148    INTEGER, DIMENSION(klon), INTENT(IN) :: knindex
149    REAL, INTENT(IN)                     :: dtime
150    REAL, DIMENSION(klon), INTENT(IN)    :: tsurf_in
151    REAL, DIMENSION(klon), INTENT(IN)    :: p1lay
[1067]152    REAL, DIMENSION(klon), INTENT(IN)    :: cdragh, cdragm
[781]153    REAL, DIMENSION(klon), INTENT(IN)    :: precip_rain, precip_snow
154    REAL, DIMENSION(klon), INTENT(IN)    :: temp_air, spechum
[1067]155    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefH, AcoefQ, BcoefH, BcoefQ
156    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefU, AcoefV, BcoefU, BcoefV
[781]157    REAL, DIMENSION(klon), INTENT(IN)    :: ps
[1067]158    REAL, DIMENSION(klon), INTENT(IN)    :: u1, v1
[781]159
160! In/Output arguments
161!****************************************************************************************
162    REAL, DIMENSION(klon), INTENT(INOUT)          :: radsol
163    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
164    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
165    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
166
167! Output arguments
168!****************************************************************************************
169    REAL, DIMENSION(klon), INTENT(OUT)            :: qsurf
[888]170    REAL, DIMENSION(klon), INTENT(OUT)            :: alb1_new  ! new albedo in visible SW interval
171    REAL, DIMENSION(klon), INTENT(OUT)            :: alb2_new  ! new albedo in near IR interval
[781]172    REAL, DIMENSION(klon), INTENT(OUT)            :: evap, fluxsens, fluxlat
[1067]173    REAL, DIMENSION(klon), INTENT(OUT)            :: flux_u1, flux_v1
[888]174    REAL, DIMENSION(klon), INTENT(OUT)            :: tsurf_new
[781]175    REAL, DIMENSION(klon), INTENT(OUT)            :: dflux_s, dflux_l     
176
177! Local variables
178!****************************************************************************************
179    LOGICAL                     :: check=.FALSE.
180    INTEGER                     :: i
181    REAL                        :: zfra
182    REAL, PARAMETER             :: t_grnd=271.35
183    REAL, DIMENSION(klon)       :: cal, beta, dif_grnd, capsol
184    REAL, DIMENSION(klon)       :: alb_neig, tsurf_tmp
185    REAL, DIMENSION(klon)       :: soilcap, soilflux
[1067]186    REAL, DIMENSION(klon)       :: u0, v0
187    REAL, DIMENSION(klon)       :: u1_lay, v1_lay
[781]188
189!****************************************************************************************
190! Start calculation
191!****************************************************************************************
192    IF (check) WRITE(*,*)'Entering surface_seaice, knon=',knon
193
194!****************************************************************************************
[996]195! 1)
[1067]196! Flux calculation : tsurf_new, evap, fluxlat, fluxsens, flux_u1, flux_v1
[781]197!                    dflux_s, dflux_l and qsurf
198!****************************************************************************************
[996]199    tsurf_tmp(:) = tsurf_in(:)
[781]200
201! calculate the parameters cal, beta, capsol and dif_grnd
[996]202    CALL calbeta(dtime, is_sic, knon, snow, qsol, beta, capsol, dif_grnd)
[781]203
204   
205    IF (soil_model) THEN
206! update tsoil and calculate soilcap and soilflux
[996]207       CALL soil(dtime, is_sic, knon, snow, tsurf_tmp, tsoil,soilcap, soilflux)
[781]208       cal(1:knon) = RCPD / soilcap(1:knon)
209       radsol(1:knon) = radsol(1:knon)  + soilflux(1:knon)
210       dif_grnd = 1.0 / tau_gl
211    ELSE
212       dif_grnd = 1.0 / tau_gl
213       cal = RCPD * calice
214       WHERE (snow > 0.0) cal = RCPD * calsno
215    ENDIF
216
217    beta = 1.0
[1067]218! Suppose zero surface speed
219    u0(:)=0.0
220    v0(:)=0.0
221    u1_lay(:) = u1(:) - u0(:)
222    v1_lay(:) = v1(:) - v0(:)
[781]223    CALL calcul_fluxs(knon, is_sic, dtime, &
[1067]224         tsurf_tmp, p1lay, cal, beta, cdragh, ps, &
[781]225         precip_rain, precip_snow, snow, qsurf,  &
226         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
[1067]227         AcoefH, AcoefQ, BcoefH, BcoefQ, &
[781]228         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
229
[1067]230! - Flux calculation at first modele level for U and V
231    CALL calcul_flux_wind(knon, dtime, &
232         u0, v0, u1, v1, cdragm, &
233         AcoefU, AcoefV, BcoefU, BcoefV, &
234         p1lay, temp_air, &
235         flux_u1, flux_v1) 
236
[781]237!****************************************************************************************
[996]238! 2)
[781]239! Calculations due to snow and runoff
240!
241!****************************************************************************************
242    CALL fonte_neige( knon, is_sic, knindex, dtime, &
243         tsurf_tmp, precip_rain, precip_snow, &
244         snow, qsol, tsurf_new, evap)
245   
246! Calculation of albedo at snow (alb_neig) and update the age of snow (agesno)
247!
248    CALL albsno(klon, knon, dtime, agesno(:), alb_neig(:), precip_snow(:)) 
249
250    WHERE (snow(1:knon) .LT. 0.0001) agesno(1:knon) = 0.
251
[888]252    alb1_new(:) = 0.0
[781]253    DO i=1, knon
254       zfra = MAX(0.0,MIN(1.0,snow(i)/(snow(i)+10.0)))
[888]255       alb1_new(i) = alb_neig(i) * zfra +  0.6 * (1.0-zfra)
[781]256    ENDDO
257
[888]258    alb2_new(:) = alb1_new(:)
259
[781]260  END SUBROUTINE ocean_forced_ice
261!
262!****************************************************************************************
263!
264END MODULE ocean_forced_mod
265
266
267
268
269
270
Note: See TracBrowser for help on using the repository browser.