source: lmdz_wrf/trunk/WRFV3/lmdz/lmdz_wrf_variables_mod.F90 @ 1531

Last change on this file since 1531 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:

File size: 6.1 KB
Line 
1MODULE lmdz_wrf_variables_mod
2! Module to initialize LMDZ variables to be accessible from WRF
3
4  IMPLICIT NONE
5
6! L. Fita, November 2013. Making them accessible.
7    REAL, ALLOCATABLE, DIMENSION(:),   SAVE              :: albedo
8!$OMP THREADPRIVATE(albedo) 
9    REAL, ALLOCATABLE, DIMENSION(:),   SAVE              :: sst
10!$OMP THREADPRIVATE(sst) 
11!!    REAL, ALLOCATABLE, DIMENSION(:),   SAVE              :: snow
12!!!$OMP THREADPRIVATE(snow) 
13!    REAL, ALLOCATABLE, DIMENSION(:),   SAVE              :: run_off_lic
14!!$OMP THREADPRIVATE(run_off_lic) 
15  LOGICAL,SAVE :: read_continents=.FALSE.
16!$OMP THREADPRIVATE(read_continents)
17    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: restart_runoff
18!$OMP THREADPRIVATE(restart_runoff)
19!!    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: run_off_lic_0
20!!$OMP THREADPRIVATE(run_off_lic_0)
21!    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: tsurf_lim
22!    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: z0_lim
23!    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: alb_lim
24    REAL, ALLOCATABLE, DIMENSION(:),   SAVE              :: phy_glo
25!$OMP THREADPRIVATE(phy_glo) 
26
27! This is already initialized by phys_state_var_mod
28!    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: pctsrf
29    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: pct_glo
30!$OMP THREADPRIVATE(pct_glo)
31    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: sst_glo
32!$OMP THREADPRIVATE(sst_glo)
33    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: alb_glo
34!$OMP THREADPRIVATE(alb_glo)
35    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: rug_glo
36!$OMP THREADPRIVATE(rug_glo)
37
38!!    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: qsol
39!$OMP THREADPRIVATE(qsol)
40!!    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: fder
41!$OMP THREADPRIVATE(fder)
42!!    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: snow
43!!$OMP THREADPRIVATE(snow)
44!!    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: qsurf
45!$OMP THREADPRIVATE(qsurf)
46!!    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: evap
47!$OMP THREADPRIVATE(evap)
48!!    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: rugos
49!$OMP THREADPRIVATE(rugos)
50!!    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: agesno
51!$OMP THREADPRIVATE(agesno)
52!!    REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE            :: ftsoil
53!$OMP THREADPRIVATE(ftsoil)
54
55    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: qsol_rst
56!$OMP THREADPRIVATE(qsol_rst)
57    REAL, ALLOCATABLE, DIMENSION(:), SAVE                :: fder_rst
58!$OMP THREADPRIVATE(fder_rst)
59    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: snow_rst
60!$OMP THREADPRIVATE(snow_rst)
61    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: qsurf_rst
62!$OMP THREADPRIVATE(qsurf_rst)
63    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: evap_rst
64!$OMP THREADPRIVATE(evap_rst)
65    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: rugos_rst
66!$OMP THREADPRIVATE(rugos_rst)
67    REAL, ALLOCATABLE, DIMENSION(:,:), SAVE              :: agesno_rst
68!$OMP THREADPRIVATE(agesno_rst)
69    REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE            :: ftsoil_rst
70!$OMP THREADPRIVATE(ftsoil_rst)
71
72  CONTAINS
73
74  SUBROUTINE lmdz_vars_init(klon)
75! Subroutine to initialize limit variables
76
77    USE mod_grid_phy_lmdz, ONLY: klon_glo
78    USE indice_sol_mod
79
80    IMPLICIT NONE
81
82    INCLUDE "dimensions.h"
83    INCLUDE "dimsoil.h"
84
85    INTEGER, INTENT(IN)                                  :: klon
86
87    IF (ALLOCATED(albedo)) DEALLOCATE(albedo)
88    ALLOCATE(albedo(klon))
89    IF (ALLOCATED(sst)) DEALLOCATE(sst)
90    ALLOCATE(sst(klon))
91!!    IF (ALLOCATED(snow)) DEALLOCATE(snow)
92!!    ALLOCATE(snow(klon))
93!!    IF (ALLOCATED(run_off_lic)) DEALLOCATE(run_off_lic)
94!!    ALLOCATE(run_off_lic(klon))
95    IF (ALLOCATED(phy_glo)) DEALLOCATE(phy_glo)
96    ALLOCATE(phy_glo(klon))
97
98    IF (ALLOCATED(restart_runoff)) DEALLOCATE(restart_runoff)
99    ALLOCATE(restart_runoff(klon))
100!!    IF (ALLOCATED(run_off_lic_0)) DEALLOCATE(run_off_lic_0)
101!!    ALLOCATE(run_off_lic_0(klon))
102!    IF (ALLOCATED(tsurf_lim)) DEALLOCATE(tsurf_lim)
103!    ALLOCATE(tsurf_lim(klon))
104!    IF (ALLOCATED(z0_lim)) DEALLOCATE(z0_lim)
105!    ALLOCATE(z0_lim(klon))
106!    IF (ALLOCATED(alb_lim)) DEALLOCATE(alb_lim)
107!    ALLOCATE(alb_lim(klon))
108
109! This is already initialized by phys_state_var_mod
110!    IF (ALLOCATED(pctsrf)) DEALLOCATE(pctsrf)
111!    ALLOCATE(pctsrf(klon,nbsrf))
112    IF (ALLOCATED(pct_glo)) DEALLOCATE(pct_glo)
113    ALLOCATE(pct_glo(klon_glo,nbsrf))
114    IF (ALLOCATED(sst_glo)) DEALLOCATE(sst_glo)
115    ALLOCATE(sst_glo(klon_glo))
116    IF (ALLOCATED(alb_glo)) DEALLOCATE(alb_glo)
117    ALLOCATE(alb_glo(klon_glo))
118    IF (ALLOCATED(rug_glo)) DEALLOCATE(rug_glo)
119    ALLOCATE(rug_glo(klon_glo))
120
121!!    IF (ALLOCATED(qsol)) DEALLOCATE(qsol)
122!!    ALLOCATE(qsol(klon))
123!!    IF (ALLOCATED(fder)) DEALLOCATE(fder)
124!!    ALLOCATE(fder(klon))
125!!    IF (ALLOCATED(snow)) DEALLOCATE(snow)
126!!    ALLOCATE(snow(klon, nbsrf))
127!!    IF (ALLOCATED(qsurf)) DEALLOCATE(qsurf)
128!!    ALLOCATE(qsurf(klon, nbsrf))
129!!    IF (ALLOCATED(evap)) DEALLOCATE(evap)
130!!    ALLOCATE(evap(klon, nbsrf))
131!!    IF (ALLOCATED(rugos)) DEALLOCATE(rugos)
132!!    ALLOCATE(rugos(klon, nbsrf))
133!!    IF (ALLOCATED(agesno)) DEALLOCATE(agesno)
134!!    ALLOCATE(agesno(klon, nbsrf))
135!!    IF (ALLOCATED(ftsoil)) DEALLOCATE(ftsoil)
136!!    ALLOCATE(ftsoil(klon, nsoilmx, nbsrf))
137
138    IF (ALLOCATED(qsol_rst)) DEALLOCATE(qsol_rst)
139    ALLOCATE(qsol_rst(klon))
140    IF (ALLOCATED(fder_rst)) DEALLOCATE(fder_rst)
141    ALLOCATE(fder_rst(klon))
142    IF (ALLOCATED(snow_rst)) DEALLOCATE(snow_rst)
143    ALLOCATE(snow_rst(klon, nbsrf))
144    IF (ALLOCATED(qsurf_rst)) DEALLOCATE(qsurf_rst)
145    ALLOCATE(qsurf_rst(klon, nbsrf))
146    IF (ALLOCATED(evap_rst)) DEALLOCATE(evap_rst)
147    ALLOCATE(evap_rst(klon, nbsrf))
148    IF (ALLOCATED(rugos_rst)) DEALLOCATE(rugos_rst)
149    ALLOCATE(rugos_rst(klon, nbsrf))
150    IF (ALLOCATED(agesno_rst)) DEALLOCATE(agesno_rst)
151    ALLOCATE(agesno_rst(klon, nbsrf))
152    IF (ALLOCATED(ftsoil_rst)) DEALLOCATE(ftsoil_rst)
153    ALLOCATE(ftsoil_rst(klon, nsoilmx, nbsrf))
154
155    RETURN
156
157  END SUBROUTINE lmdz_vars_init
158
159END MODULE lmdz_wrf_variables_mod
Note: See TracBrowser for help on using the repository browser.