MODULE lmdz_wrf_variables_mod ! Module to initialize LMDZ variables to be accessible from WRF IMPLICIT NONE ! L. Fita, November 2013. Making them accessible. REAL, ALLOCATABLE, DIMENSION(:), SAVE :: albedo !$OMP THREADPRIVATE(albedo) REAL, ALLOCATABLE, DIMENSION(:), SAVE :: sst !$OMP THREADPRIVATE(sst) !! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: snow !!!$OMP THREADPRIVATE(snow) ! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: run_off_lic !!$OMP THREADPRIVATE(run_off_lic) LOGICAL,SAVE :: read_continents=.FALSE. !$OMP THREADPRIVATE(read_continents) REAL, ALLOCATABLE, DIMENSION(:), SAVE :: restart_runoff !$OMP THREADPRIVATE(restart_runoff) !! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: run_off_lic_0 !!$OMP THREADPRIVATE(run_off_lic_0) ! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: tsurf_lim ! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: z0_lim ! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: alb_lim REAL, ALLOCATABLE, DIMENSION(:), SAVE :: phy_glo !$OMP THREADPRIVATE(phy_glo) ! This is already initialized by phys_state_var_mod ! REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: pctsrf REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: pct_glo !$OMP THREADPRIVATE(pct_glo) REAL, ALLOCATABLE, DIMENSION(:), SAVE :: sst_glo !$OMP THREADPRIVATE(sst_glo) REAL, ALLOCATABLE, DIMENSION(:), SAVE :: alb_glo !$OMP THREADPRIVATE(alb_glo) REAL, ALLOCATABLE, DIMENSION(:), SAVE :: rug_glo !$OMP THREADPRIVATE(rug_glo) !! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: qsol !$OMP THREADPRIVATE(qsol) !! REAL, ALLOCATABLE, DIMENSION(:), SAVE :: fder !$OMP THREADPRIVATE(fder) !! REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: snow !!$OMP THREADPRIVATE(snow) !! REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: qsurf !$OMP THREADPRIVATE(qsurf) !! REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: evap !$OMP THREADPRIVATE(evap) !! REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: rugos !$OMP THREADPRIVATE(rugos) !! REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: agesno !$OMP THREADPRIVATE(agesno) !! REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: ftsoil !$OMP THREADPRIVATE(ftsoil) REAL, ALLOCATABLE, DIMENSION(:), SAVE :: qsol_rst !$OMP THREADPRIVATE(qsol_rst) REAL, ALLOCATABLE, DIMENSION(:), SAVE :: fder_rst !$OMP THREADPRIVATE(fder_rst) REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: snow_rst !$OMP THREADPRIVATE(snow_rst) REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: qsurf_rst !$OMP THREADPRIVATE(qsurf_rst) REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: evap_rst !$OMP THREADPRIVATE(evap_rst) REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: rugos_rst !$OMP THREADPRIVATE(rugos_rst) REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: agesno_rst !$OMP THREADPRIVATE(agesno_rst) REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: ftsoil_rst !$OMP THREADPRIVATE(ftsoil_rst) CONTAINS SUBROUTINE lmdz_vars_init(klon) ! Subroutine to initialize limit variables USE mod_grid_phy_lmdz, ONLY: klon_glo USE indice_sol_mod IMPLICIT NONE INCLUDE "dimensions.h" INCLUDE "dimsoil.h" INTEGER, INTENT(IN) :: klon IF (ALLOCATED(albedo)) DEALLOCATE(albedo) ALLOCATE(albedo(klon)) IF (ALLOCATED(sst)) DEALLOCATE(sst) ALLOCATE(sst(klon)) !! IF (ALLOCATED(snow)) DEALLOCATE(snow) !! ALLOCATE(snow(klon)) !! IF (ALLOCATED(run_off_lic)) DEALLOCATE(run_off_lic) !! ALLOCATE(run_off_lic(klon)) IF (ALLOCATED(phy_glo)) DEALLOCATE(phy_glo) ALLOCATE(phy_glo(klon)) IF (ALLOCATED(restart_runoff)) DEALLOCATE(restart_runoff) ALLOCATE(restart_runoff(klon)) !! IF (ALLOCATED(run_off_lic_0)) DEALLOCATE(run_off_lic_0) !! ALLOCATE(run_off_lic_0(klon)) ! IF (ALLOCATED(tsurf_lim)) DEALLOCATE(tsurf_lim) ! ALLOCATE(tsurf_lim(klon)) ! IF (ALLOCATED(z0_lim)) DEALLOCATE(z0_lim) ! ALLOCATE(z0_lim(klon)) ! IF (ALLOCATED(alb_lim)) DEALLOCATE(alb_lim) ! ALLOCATE(alb_lim(klon)) ! This is already initialized by phys_state_var_mod ! IF (ALLOCATED(pctsrf)) DEALLOCATE(pctsrf) ! ALLOCATE(pctsrf(klon,nbsrf)) IF (ALLOCATED(pct_glo)) DEALLOCATE(pct_glo) ALLOCATE(pct_glo(klon_glo,nbsrf)) IF (ALLOCATED(sst_glo)) DEALLOCATE(sst_glo) ALLOCATE(sst_glo(klon_glo)) IF (ALLOCATED(alb_glo)) DEALLOCATE(alb_glo) ALLOCATE(alb_glo(klon_glo)) IF (ALLOCATED(rug_glo)) DEALLOCATE(rug_glo) ALLOCATE(rug_glo(klon_glo)) !! IF (ALLOCATED(qsol)) DEALLOCATE(qsol) !! ALLOCATE(qsol(klon)) !! IF (ALLOCATED(fder)) DEALLOCATE(fder) !! ALLOCATE(fder(klon)) !! IF (ALLOCATED(snow)) DEALLOCATE(snow) !! ALLOCATE(snow(klon, nbsrf)) !! IF (ALLOCATED(qsurf)) DEALLOCATE(qsurf) !! ALLOCATE(qsurf(klon, nbsrf)) !! IF (ALLOCATED(evap)) DEALLOCATE(evap) !! ALLOCATE(evap(klon, nbsrf)) !! IF (ALLOCATED(rugos)) DEALLOCATE(rugos) !! ALLOCATE(rugos(klon, nbsrf)) !! IF (ALLOCATED(agesno)) DEALLOCATE(agesno) !! ALLOCATE(agesno(klon, nbsrf)) !! IF (ALLOCATED(ftsoil)) DEALLOCATE(ftsoil) !! ALLOCATE(ftsoil(klon, nsoilmx, nbsrf)) IF (ALLOCATED(qsol_rst)) DEALLOCATE(qsol_rst) ALLOCATE(qsol_rst(klon)) IF (ALLOCATED(fder_rst)) DEALLOCATE(fder_rst) ALLOCATE(fder_rst(klon)) IF (ALLOCATED(snow_rst)) DEALLOCATE(snow_rst) ALLOCATE(snow_rst(klon, nbsrf)) IF (ALLOCATED(qsurf_rst)) DEALLOCATE(qsurf_rst) ALLOCATE(qsurf_rst(klon, nbsrf)) IF (ALLOCATED(evap_rst)) DEALLOCATE(evap_rst) ALLOCATE(evap_rst(klon, nbsrf)) IF (ALLOCATED(rugos_rst)) DEALLOCATE(rugos_rst) ALLOCATE(rugos_rst(klon, nbsrf)) IF (ALLOCATED(agesno_rst)) DEALLOCATE(agesno_rst) ALLOCATE(agesno_rst(klon, nbsrf)) IF (ALLOCATED(ftsoil_rst)) DEALLOCATE(ftsoil_rst) ALLOCATE(ftsoil_rst(klon, nsoilmx, nbsrf)) RETURN END SUBROUTINE lmdz_vars_init END MODULE lmdz_wrf_variables_mod