source: lmdz_wrf/trunk/WRFV3/lmdz/ocean_slab_mod.F90 @ 1939

Last change on this file since 1939 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: 6.5 KB
Line 
1!
2MODULE ocean_slab_mod
3!
4! This module is used for both surface ocean and sea-ice when using the slab ocean,
5! "ocean=slab".
6!
7  IMPLICIT NONE
8  PRIVATE
9  PUBLIC :: ocean_slab_frac, ocean_slab_noice
10
11CONTAINS
12!
13!****************************************************************************************
14!
15  SUBROUTINE ocean_slab_frac(itime, dtime, jour, pctsrf, is_modified)
16
17    USE dimphy
18    USE limit_read_mod
19    USE surface_data
20    USE indice_sol_mod
21
22!    INCLUDE "clesphys.h"
23
24! Arguments
25!****************************************************************************************
26    INTEGER, INTENT(IN)                        :: itime   ! numero du pas de temps courant
27    INTEGER, INTENT(IN)                        :: jour    ! jour a lire dans l'annee
28    REAL   , INTENT(IN)                        :: dtime   ! pas de temps de la physique (en s)
29    REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: pctsrf  ! sub-surface fraction
30    LOGICAL, INTENT(OUT)                       :: is_modified ! true if pctsrf is modified at this time step
31
32! Local variables
33!****************************************************************************************
34    CHARACTER (len = 80)   :: abort_message
35    CHARACTER (len = 20)   :: modname = 'ocean_slab_frac'
36
37
38    IF (version_ocean == 'sicOBS') THEN   
39! L. Fita, LMD. Ovember 2013. Removing reading from 'limit.nc'
40!!       CALL limit_read_frac(itime, dtime, jour, pctsrf, is_modified)
41      PRINT *,'  L. Fita. LMDZ+WRF: Already loaded, no limit.nc !'
42    ELSE
43       abort_message='Ocean slab model without forced sea-ice fractions has to be rewritten!!!'
44       CALL abort_gcm(modname,abort_message,1)
45! Here should sea-ice/ocean fraction either be calculated or returned if saved as a module varaiable
46! (in the case the new fractions are calculated in ocean_slab_ice or ocean_slab_noice subroutines). 
47    END IF
48
49  END SUBROUTINE ocean_slab_frac
50!
51!****************************************************************************************
52!
53  SUBROUTINE ocean_slab_noice( &
54       itime, dtime, jour, knon, knindex, &
55       p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
56       AcoefH, AcoefQ, BcoefH, BcoefQ, &
57       AcoefU, AcoefV, BcoefU, BcoefV, &
58       ps, u1, v1, tsurf_in, &
59       radsol, snow, agesno, &
60       qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
61       tsurf_new, dflux_s, dflux_l, lmt_bils)
62   
63    USE dimphy
64    USE calcul_fluxs_mod
65    USE indice_sol_mod
66
67    INCLUDE "iniprint.h"
68
69! Input arguments
70!****************************************************************************************
71    INTEGER, INTENT(IN)                  :: itime
72    INTEGER, INTENT(IN)                  :: jour
73    INTEGER, INTENT(IN)                  :: knon
74    INTEGER, DIMENSION(klon), INTENT(IN) :: knindex
75    REAL, INTENT(IN)                     :: dtime
76    REAL, DIMENSION(klon), INTENT(IN)    :: p1lay
77    REAL, DIMENSION(klon), INTENT(IN)    :: cdragh, cdragm
78    REAL, DIMENSION(klon), INTENT(IN)    :: precip_rain, precip_snow
79    REAL, DIMENSION(klon), INTENT(IN)    :: temp_air, spechum
80    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefH, AcoefQ, BcoefH, BcoefQ
81    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefU, AcoefV, BcoefU, BcoefV
82    REAL, DIMENSION(klon), INTENT(IN)    :: ps
83    REAL, DIMENSION(klon), INTENT(IN)    :: u1, v1
84    REAL, DIMENSION(klon), INTENT(IN)    :: tsurf_in
85
86! In/Output arguments
87!****************************************************************************************
88    REAL, DIMENSION(klon), INTENT(INOUT) :: radsol
89    REAL, DIMENSION(klon), INTENT(INOUT) :: snow
90    REAL, DIMENSION(klon), INTENT(INOUT) :: agesno
91   
92! Output arguments
93!****************************************************************************************
94    REAL, DIMENSION(klon), INTENT(OUT)   :: qsurf
95    REAL, DIMENSION(klon), INTENT(OUT)   :: evap, fluxsens, fluxlat
96    REAL, DIMENSION(klon), INTENT(OUT)   :: flux_u1, flux_v1
97    REAL, DIMENSION(klon), INTENT(OUT)   :: tsurf_new
98    REAL, DIMENSION(klon), INTENT(OUT)   :: dflux_s, dflux_l     
99    REAL, DIMENSION(klon), INTENT(OUT)   :: lmt_bils
100
101! Local variables
102!****************************************************************************************
103    INTEGER               :: i
104    REAL, DIMENSION(klon) :: cal, beta, dif_grnd
105    REAL, DIMENSION(klon) :: lmt_bils_oce, lmt_foce, diff_sst
106    REAL, DIMENSION(klon) :: u0, v0
107    REAL, DIMENSION(klon) :: u1_lay, v1_lay
108    REAL                  :: calc_bils_oce, deltat
109    REAL, PARAMETER       :: cyang=50.0 * 4.228e+06 ! capacite calorifique volumetrique de l'eau J/(m2 K)
110
111!****************************************************************************************
112! 1) Flux calculation
113!
114!****************************************************************************************
115    cal(:)      = 0.
116    beta(:)     = 1.
117    dif_grnd(:) = 0.
118    agesno(:)   = 0.
119   
120! Suppose zero surface speed
121    u0(:)=0.0
122    v0(:)=0.0
123    u1_lay(:) = u1(:) - u0(:)
124    v1_lay(:) = v1(:) - v0(:)
125
126    CALL calcul_fluxs(knon, is_oce, dtime, &
127         tsurf_in, p1lay, cal, beta, cdragh, ps, &
128         precip_rain, precip_snow, snow, qsurf,  &
129         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
130         AcoefH, AcoefQ, BcoefH, BcoefQ, &
131         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
132
133! - Flux calculation at first modele level for U and V
134    CALL calcul_flux_wind(knon, dtime, &
135         u0, v0, u1, v1, cdragm, &
136         AcoefU, AcoefV, BcoefU, BcoefV, &
137         p1lay, temp_air, &
138         flux_u1, flux_v1) 
139
140!****************************************************************************************
141! 2) Get global variables lmt_bils and lmt_foce from file limit_slab.nc
142!
143!****************************************************************************************
144    CALL limit_slab(itime, dtime, jour, lmt_bils, lmt_foce, diff_sst)  ! global pour un processus
145
146    lmt_bils_oce(:) = 0.
147    WHERE (lmt_foce > 0.)
148       lmt_bils_oce = lmt_bils / lmt_foce ! global
149    END WHERE
150
151!****************************************************************************************
152! 3) Recalculate new temperature
153!
154!****************************************************************************************
155    DO i = 1, knon
156       calc_bils_oce = radsol(i) + fluxsens(i) + fluxlat(i)
157       deltat        = (calc_bils_oce - lmt_bils_oce(knindex(i)))*dtime/cyang +diff_sst(knindex(i))
158       tsurf_new(i)  = tsurf_in(i) + deltat
159    END DO
160
161  END SUBROUTINE ocean_slab_noice
162!
163!****************************************************************************************
164!
165END MODULE ocean_slab_mod
Note: See TracBrowser for help on using the repository browser.