source: LMDZ5/branches/LMDZ5-DOFOCO/libf/phylmd/ocean_slab_mod.F90 @ 2904

Last change on this file since 2904 was 1785, checked in by Ehouarn Millour, 11 years ago

Transformation de l'include indicesol.h en un module indice_sol_mod et modification des appels dans tous les fichiers concernés.
Aucun changement des résultats ni des sorties du modèle vs 1784.
UG

...................................................

Replacement of the indicesol.h include by a module named indice_sol_mod. Modification of the calls in every affected files.
Results and outputs of simulations are unchanged in comparison with rev 1784.
UG

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 6.4 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       CALL limit_read_frac(itime, dtime, jour, pctsrf, is_modified)
40    ELSE
41       abort_message='Ocean slab model without forced sea-ice fractions has to be rewritten!!!'
42       CALL abort_gcm(modname,abort_message,1)
43! Here should sea-ice/ocean fraction either be calculated or returned if saved as a module varaiable
44! (in the case the new fractions are calculated in ocean_slab_ice or ocean_slab_noice subroutines). 
45    END IF
46
47  END SUBROUTINE ocean_slab_frac
48!
49!****************************************************************************************
50!
51  SUBROUTINE ocean_slab_noice( &
52       itime, dtime, jour, knon, knindex, &
53       p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, &
54       AcoefH, AcoefQ, BcoefH, BcoefQ, &
55       AcoefU, AcoefV, BcoefU, BcoefV, &
56       ps, u1, v1, tsurf_in, &
57       radsol, snow, agesno, &
58       qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
59       tsurf_new, dflux_s, dflux_l, lmt_bils)
60   
61    USE dimphy
62    USE calcul_fluxs_mod
63    USE indice_sol_mod
64
65    INCLUDE "iniprint.h"
66
67! Input arguments
68!****************************************************************************************
69    INTEGER, INTENT(IN)                  :: itime
70    INTEGER, INTENT(IN)                  :: jour
71    INTEGER, INTENT(IN)                  :: knon
72    INTEGER, DIMENSION(klon), INTENT(IN) :: knindex
73    REAL, INTENT(IN)                     :: dtime
74    REAL, DIMENSION(klon), INTENT(IN)    :: p1lay
75    REAL, DIMENSION(klon), INTENT(IN)    :: cdragh, cdragm
76    REAL, DIMENSION(klon), INTENT(IN)    :: precip_rain, precip_snow
77    REAL, DIMENSION(klon), INTENT(IN)    :: temp_air, spechum
78    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefH, AcoefQ, BcoefH, BcoefQ
79    REAL, DIMENSION(klon), INTENT(IN)    :: AcoefU, AcoefV, BcoefU, BcoefV
80    REAL, DIMENSION(klon), INTENT(IN)    :: ps
81    REAL, DIMENSION(klon), INTENT(IN)    :: u1, v1
82    REAL, DIMENSION(klon), INTENT(IN)    :: tsurf_in
83
84! In/Output arguments
85!****************************************************************************************
86    REAL, DIMENSION(klon), INTENT(INOUT) :: radsol
87    REAL, DIMENSION(klon), INTENT(INOUT) :: snow
88    REAL, DIMENSION(klon), INTENT(INOUT) :: agesno
89   
90! Output arguments
91!****************************************************************************************
92    REAL, DIMENSION(klon), INTENT(OUT)   :: qsurf
93    REAL, DIMENSION(klon), INTENT(OUT)   :: evap, fluxsens, fluxlat
94    REAL, DIMENSION(klon), INTENT(OUT)   :: flux_u1, flux_v1
95    REAL, DIMENSION(klon), INTENT(OUT)   :: tsurf_new
96    REAL, DIMENSION(klon), INTENT(OUT)   :: dflux_s, dflux_l     
97    REAL, DIMENSION(klon), INTENT(OUT)   :: lmt_bils
98
99! Local variables
100!****************************************************************************************
101    INTEGER               :: i
102    REAL, DIMENSION(klon) :: cal, beta, dif_grnd
103    REAL, DIMENSION(klon) :: lmt_bils_oce, lmt_foce, diff_sst
104    REAL, DIMENSION(klon) :: u0, v0
105    REAL, DIMENSION(klon) :: u1_lay, v1_lay
106    REAL                  :: calc_bils_oce, deltat
107    REAL, PARAMETER       :: cyang=50.0 * 4.228e+06 ! capacite calorifique volumetrique de l'eau J/(m2 K)
108
109!****************************************************************************************
110! 1) Flux calculation
111!
112!****************************************************************************************
113    cal(:)      = 0.
114    beta(:)     = 1.
115    dif_grnd(:) = 0.
116    agesno(:)   = 0.
117   
118! Suppose zero surface speed
119    u0(:)=0.0
120    v0(:)=0.0
121    u1_lay(:) = u1(:) - u0(:)
122    v1_lay(:) = v1(:) - v0(:)
123
124    CALL calcul_fluxs(knon, is_oce, dtime, &
125         tsurf_in, p1lay, cal, beta, cdragh, ps, &
126         precip_rain, precip_snow, snow, qsurf,  &
127         radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &
128         AcoefH, AcoefQ, BcoefH, BcoefQ, &
129         tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
130
131! - Flux calculation at first modele level for U and V
132    CALL calcul_flux_wind(knon, dtime, &
133         u0, v0, u1, v1, cdragm, &
134         AcoefU, AcoefV, BcoefU, BcoefV, &
135         p1lay, temp_air, &
136         flux_u1, flux_v1) 
137
138!****************************************************************************************
139! 2) Get global variables lmt_bils and lmt_foce from file limit_slab.nc
140!
141!****************************************************************************************
142    CALL limit_slab(itime, dtime, jour, lmt_bils, lmt_foce, diff_sst)  ! global pour un processus
143
144    lmt_bils_oce(:) = 0.
145    WHERE (lmt_foce > 0.)
146       lmt_bils_oce = lmt_bils / lmt_foce ! global
147    END WHERE
148
149!****************************************************************************************
150! 3) Recalculate new temperature
151!
152!****************************************************************************************
153    DO i = 1, knon
154       calc_bils_oce = radsol(i) + fluxsens(i) + fluxlat(i)
155       deltat        = (calc_bils_oce - lmt_bils_oce(knindex(i)))*dtime/cyang +diff_sst(knindex(i))
156       tsurf_new(i)  = tsurf_in(i) + deltat
157    END DO
158
159  END SUBROUTINE ocean_slab_noice
160!
161!****************************************************************************************
162!
163END MODULE ocean_slab_mod
Note: See TracBrowser for help on using the repository browser.