source: lmdz_wrf/WRFV3/lmdz/ocean_forced_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: 11.5 KB
Line 
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!
13  SUBROUTINE ocean_forced_noice( &
14       itime, dtime, jour, knon, knindex, &
15       p1lay, cdragh, cdragm, precip_rain, precip_snow, &
16       temp_air, spechum, &
17       AcoefH, AcoefQ, BcoefH, BcoefQ, &
18       AcoefU, AcoefV, BcoefU, BcoefV, &
19       ps, u1, v1, &
20       radsol, snow, agesno, &
21       qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
22       tsurf_new, dflux_s, dflux_l)
23!
24! This subroutine treats the "open ocean", all grid points that are not entierly covered
25! by ice.
26! The routine receives data from climatologie file limit.nc and does some calculations at the
27! surface.
28!
29    USE dimphy
30    USE calcul_fluxs_mod
31    USE limit_read_mod
32    USE indice_sol_mod
33
34!L. Fita, LMD. November, 2013
35    USE NOread_limit_sub_variables
36
37    INCLUDE "YOMCST.h"
38
39! Input arguments
40!****************************************************************************************
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)        :: p1lay
45    REAL, DIMENSION(klon), INTENT(IN)        :: cdragh, cdragm
46    REAL, DIMENSION(klon), INTENT(IN)        :: precip_rain, precip_snow
47    REAL, DIMENSION(klon), INTENT(IN)        :: temp_air, spechum
48    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefH, AcoefQ, BcoefH, BcoefQ
49    REAL, DIMENSION(klon), INTENT(IN)        :: AcoefU, AcoefV, BcoefU, BcoefV
50    REAL, DIMENSION(klon), INTENT(IN)        :: ps
51    REAL, DIMENSION(klon), INTENT(IN)        :: u1, v1
52
53! In/Output arguments
54!****************************************************************************************
55    REAL, DIMENSION(klon), INTENT(INOUT)     :: radsol
56    REAL, DIMENSION(klon), INTENT(INOUT)     :: snow
57    REAL, DIMENSION(klon), INTENT(INOUT)     :: agesno !? put to 0 in ocean
58 
59! Output arguments
60!****************************************************************************************
61    REAL, DIMENSION(klon), INTENT(OUT)       :: qsurf
62    REAL, DIMENSION(klon), INTENT(OUT)       :: evap, fluxsens, fluxlat
63    REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1
64    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
65    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l
66
67! Local variables
68!****************************************************************************************
69    INTEGER                     :: i
70    REAL, DIMENSION(klon)       :: cal, beta, dif_grnd
71    REAL, DIMENSION(klon)       :: alb_neig, tsurf_lim, zx_sl
72    REAL, DIMENSION(klon)       :: u0, v0
73    REAL, DIMENSION(klon)       :: u1_lay, v1_lay
74    LOGICAL                     :: check=.FALSE.
75! Lluis
76    INTEGER                                              :: lp, lpt
77
78    lp = 885
79    lpt = 765
80
81!****************************************************************************************
82! Start calculation
83!****************************************************************************************
84    IF (check) WRITE(*,*)' Entering ocean_forced_noice'
85   
86!****************************************************************************************
87! 1)   
88! Read sea-surface temperature from file limit.nc
89!
90!****************************************************************************************
91! L. Fita, LMD. November 2013
92! Not needed! Using wrfinput, wrfbdy and wrflowinput instead
93!    ALLOCATE(tsurf_lim(klon))
94!    CALL limit_read_sst(knon,knindex,tsurf_lim)
95!    tsurf_lim = sst(knindex(1:knon))
96!    tsurf_lim = 283.15
97
98    DO i=1,knon
99      tsurf_lim(i) = tsurf_limit(knindex(i))
100    END DO
101
102    PRINT *,'   Lluis pt tsurf_limit_check tsurf_lim_____'
103    DO i=-10,10
104      PRINT *,lp+i,tsurf_limit(lp+i),tsurf_lim(lpt+i)
105    END DO
106
107    PRINT *,'Lluis in ocean_surface_mod lp= ',lp,' tsurf_limit: ',tsurf_limit(lp),   &
108      ' lpt: ',lpt,' tsurf_lim: ',tsurf_lim(lpt),' knindex: ',knindex(lpt)
109
110!****************************************************************************************
111! 2)
112! Flux calculation
113!
114!****************************************************************************************
115! Set some variables for calcul_fluxs
116    cal = 0.
117    beta = 1.
118    dif_grnd = 0.
119    alb_neig(:) = 0.
120    agesno(:) = 0.
121! Suppose zero surface speed
122    u0(:)=0.0
123    v0(:)=0.0
124    u1_lay(:) = u1(:) - u0(:)
125    v1_lay(:) = v1(:) - v0(:)
126
127    PRINT *,'  Lluis before calcul_fluxs tsurf_lim:', tsurf_lim(lpt),                &
128      ' tsurf_new: ', tsurf_new(lpt)
129! Calcul de tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l and qsurf
130    CALL calcul_fluxs(knon, is_oce, dtime, &
131         tsurf_lim, p1lay, cal, beta, cdragh, ps, &
132         precip_rain, precip_snow, snow, qsurf,  &
133         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
134         AcoefH, AcoefQ, BcoefH, BcoefQ, &
135         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
136    PRINT *,'  Lluis after calcul_fluxs tsurf_lim: ', tsurf_lim(lp),' tsurf_new: ',  &
137      tsurf_new(lpt)
138    PRINT *,'    Lluis i knindex tsurf_limit tsurf_lim tsurf_new ___________'
139    DO i=1,knon
140      PRINT *,i,knindex(i),tsurf_limit(knindex(i)),tsurf_lim(i),tsurf_new(i)
141    END DO
142
143! - Flux calculation at first modele level for U and V
144    CALL calcul_flux_wind(knon, dtime, &
145         u0, v0, u1, v1, cdragm, &
146         AcoefU, AcoefV, BcoefU, BcoefV, &
147         p1lay, temp_air, &
148         flux_u1, flux_v1) 
149
150  END SUBROUTINE ocean_forced_noice
151!
152!***************************************************************************************
153!
154  SUBROUTINE ocean_forced_ice( &
155       itime, dtime, jour, knon, knindex, &
156       tsurf_in, p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
157       AcoefH, AcoefQ, BcoefH, BcoefQ, &
158       AcoefU, AcoefV, BcoefU, BcoefV, &
159       ps, u1, v1, &
160       radsol, snow, qsol, agesno, tsoil, &
161       qsurf, alb1_new, alb2_new, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
162       tsurf_new, dflux_s, dflux_l)
163!
164! This subroutine treats the ocean where there is ice.
165! The routine reads data from climatologie file and does flux calculations at the
166! surface.
167!
168    USE dimphy
169    USE calcul_fluxs_mod
170    USE surface_data,     ONLY : calice, calsno, tau_gl
171    USE limit_read_mod
172    USE fonte_neige_mod,  ONLY : fonte_neige
173    USE indice_sol_mod
174
175    INCLUDE "dimsoil.h"
176    INCLUDE "YOMCST.h"
177    INCLUDE "clesphys.h"
178
179! Input arguments
180!****************************************************************************************
181    INTEGER, INTENT(IN)                  :: itime, jour, knon
182    INTEGER, DIMENSION(klon), INTENT(IN) :: knindex
183    REAL, INTENT(IN)                     :: dtime
184    REAL, DIMENSION(klon), INTENT(IN)    :: tsurf_in
185    REAL, DIMENSION(klon), INTENT(IN)    :: p1lay
186    REAL, DIMENSION(klon), INTENT(IN)    :: cdragh, cdragm
187    REAL, DIMENSION(klon), INTENT(IN)    :: precip_rain, precip_snow
188    REAL, DIMENSION(klon), INTENT(IN)    :: temp_air, spechum
189    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefH, AcoefQ, BcoefH, BcoefQ
190    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefU, AcoefV, BcoefU, BcoefV
191    REAL, DIMENSION(klon), INTENT(IN)    :: ps
192    REAL, DIMENSION(klon), INTENT(IN)    :: u1, v1
193
194! In/Output arguments
195!****************************************************************************************
196    REAL, DIMENSION(klon), INTENT(INOUT)          :: radsol
197    REAL, DIMENSION(klon), INTENT(INOUT)          :: snow, qsol
198    REAL, DIMENSION(klon), INTENT(INOUT)          :: agesno
199    REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil
200
201! Output arguments
202!****************************************************************************************
203    REAL, DIMENSION(klon), INTENT(OUT)            :: qsurf
204    REAL, DIMENSION(klon), INTENT(OUT)            :: alb1_new  ! new albedo in visible SW interval
205    REAL, DIMENSION(klon), INTENT(OUT)            :: alb2_new  ! new albedo in near IR interval
206    REAL, DIMENSION(klon), INTENT(OUT)            :: evap, fluxsens, fluxlat
207    REAL, DIMENSION(klon), INTENT(OUT)            :: flux_u1, flux_v1
208    REAL, DIMENSION(klon), INTENT(OUT)            :: tsurf_new
209    REAL, DIMENSION(klon), INTENT(OUT)            :: dflux_s, dflux_l     
210
211! Local variables
212!****************************************************************************************
213    LOGICAL                     :: check=.FALSE.
214    INTEGER                     :: i
215    REAL                        :: zfra
216    REAL, PARAMETER             :: t_grnd=271.35
217    REAL, DIMENSION(klon)       :: cal, beta, dif_grnd, capsol
218    REAL, DIMENSION(klon)       :: alb_neig, tsurf_tmp
219    REAL, DIMENSION(klon)       :: soilcap, soilflux
220    REAL, DIMENSION(klon)       :: u0, v0
221    REAL, DIMENSION(klon)       :: u1_lay, v1_lay
222
223!****************************************************************************************
224! Start calculation
225!****************************************************************************************
226    IF (check) WRITE(*,*)'Entering surface_seaice, knon=',knon
227
228!****************************************************************************************
229! 1)
230! Flux calculation : tsurf_new, evap, fluxlat, fluxsens, flux_u1, flux_v1
231!                    dflux_s, dflux_l and qsurf
232!****************************************************************************************
233    tsurf_tmp(:) = tsurf_in(:)
234
235! calculate the parameters cal, beta, capsol and dif_grnd
236    CALL calbeta(dtime, is_sic, knon, snow, qsol, beta, capsol, dif_grnd)
237
238   
239    IF (soil_model) THEN
240! update tsoil and calculate soilcap and soilflux
241       CALL soil(dtime, is_sic, knon, snow, tsurf_tmp, tsoil,soilcap, soilflux)
242       cal(1:knon) = RCPD / soilcap(1:knon)
243       radsol(1:knon) = radsol(1:knon)  + soilflux(1:knon)
244       dif_grnd = 1.0 / tau_gl
245    ELSE
246       dif_grnd = 1.0 / tau_gl
247       cal = RCPD * calice
248       WHERE (snow > 0.0) cal = RCPD * calsno
249    ENDIF
250
251    beta = 1.0
252! Suppose zero surface speed
253    u0(:)=0.0
254    v0(:)=0.0
255    u1_lay(:) = u1(:) - u0(:)
256    v1_lay(:) = v1(:) - v0(:)
257    CALL calcul_fluxs(knon, is_sic, dtime, &
258         tsurf_tmp, p1lay, cal, beta, cdragh, ps, &
259         precip_rain, precip_snow, snow, qsurf,  &
260         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
261         AcoefH, AcoefQ, BcoefH, BcoefQ, &
262         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
263
264! - Flux calculation at first modele level for U and V
265    CALL calcul_flux_wind(knon, dtime, &
266         u0, v0, u1, v1, cdragm, &
267         AcoefU, AcoefV, BcoefU, BcoefV, &
268         p1lay, temp_air, &
269         flux_u1, flux_v1) 
270
271!****************************************************************************************
272! 2)
273! Calculations due to snow and runoff
274!
275!****************************************************************************************
276    CALL fonte_neige( knon, is_sic, knindex, dtime, &
277         tsurf_tmp, precip_rain, precip_snow, &
278         snow, qsol, tsurf_new, evap)
279   
280! Calculation of albedo at snow (alb_neig) and update the age of snow (agesno)
281!
282    CALL albsno(klon, knon, dtime, agesno(:), alb_neig(:), precip_snow(:)) 
283
284    WHERE (snow(1:knon) .LT. 0.0001) agesno(1:knon) = 0.
285
286    alb1_new(:) = 0.0
287    DO i=1, knon
288       zfra = MAX(0.0,MIN(1.0,snow(i)/(snow(i)+10.0)))
289       alb1_new(i) = alb_neig(i) * zfra +  0.6 * (1.0-zfra)
290    ENDDO
291
292    alb2_new(:) = alb1_new(:)
293
294  END SUBROUTINE ocean_forced_ice
295!
296!****************************************************************************************
297!
298END MODULE ocean_forced_mod
299
300
301
302
303
304
Note: See TracBrowser for help on using the repository browser.