--- trunk/Sources/dyn3d/etat0.f 2016/05/09 19:56:28 191 +++ trunk/dyn3d/etat0.f 2018/07/12 14:49:20 276 @@ -1,28 +1,19 @@ -module etat0_mod - - use indicesol, only: nbsrf - use dimphy, only: klon +module etat0_m IMPLICIT NONE - REAL pctsrf(klon, nbsrf) - ! ("pctsrf(i, :)" is the composition of the surface at horizontal - ! position "i") - - private nbsrf, klon - contains - SUBROUTINE etat0(phis) + SUBROUTINE etat0(phis, pctsrf) ! From "etat0_netcdf.F", version 1.3, 2005/05/25 13:10:09 use caldyn0_m, only: caldyn0 use comconst, only: cpp, kappa, iniconst use comgeom, only: aire_2d, apoln, apols, cu_2d, cv_2d, inigeom - use conf_gcm_m, only: nday, day_step, iphysiq - use dimens_m, only: iim, jjm, llm, nqmx - use dimphy, only: zmasq + use conf_gcm_m, only: nday + use dimensions, only: iim, jjm, llm, nqmx + use dimphy, only: klon use dimsoil, only: nsoilmx use disvert_m, only: ap, bp, preff, pa, disvert use dynetat0_m, only: day_ref, annee_ref, xprimp025, xprimm025, rlatu1, & @@ -33,9 +24,9 @@ use fxhyp_m, only: fxhyp use fyhyp_m, only: fyhyp use geopot_m, only: geopot - use grid_atob, only: grille_m + use grille_m_m, only: grille_m use grid_change, only: init_dyn_phy, dyn_phy - use indicesol, only: is_oce, is_sic, is_ter, is_lic, epsfra + use indicesol, only: is_oce, is_sic, is_ter, is_lic, epsfra, nbsrf use iniadvtrac_m, only: iniadvtrac use inifilr_m, only: inifilr use massdair_m, only: massdair @@ -43,7 +34,7 @@ use netcdf95, only: nf95_close, nf95_get_var, nf95_gw_var, nf95_put_var, & nf95_inq_varid, nf95_open use nr_util, only: pi, assert - use phyetat0_m, only: rlat, rlon, itau_phy + use phyetat0_m, only: rlat, rlon, itau_phy, zmasq use phyredem0_m, only: phyredem0, ncid_restartphy use phyredem_m, only: phyredem use q_sat_m, only: q_sat @@ -59,6 +50,10 @@ REAL, intent(out):: phis(:, :) ! (iim + 1, jjm + 1) ! surface geopotential, in m2 s-2 + REAL, intent(out):: pctsrf(:, :) ! (klon, nbsrf) + ! "pctsrf(i, :)" is the composition of the surface at horizontal + ! position "i". + ! Local: REAL, dimension(iim + 1, jjm + 1, llm):: ucov, t3d, teta @@ -91,7 +86,7 @@ ! D\'eclarations pour lecture glace de mer : INTEGER iml_lic, jml_lic INTEGER ncid, varid - REAL, pointer:: dlon_lic(:), dlat_lic(:) + REAL, ALLOCATABLE:: dlon_lic(:), dlat_lic(:) REAL, ALLOCATABLE:: fraclic(:, :) ! fraction land ice REAL flic_tmp(iim + 1, jjm + 1) ! fraction land ice temporary @@ -261,15 +256,13 @@ rlatu) flic_tmp(iim + 1, :) = flic_tmp(1, :) - deallocate(dlon_lic, dlat_lic) ! pointers - ! Passage sur la grille physique pctsrf = 0. pctsrf(:, is_lic) = pack(flic_tmp, dyn_phy) ! Ad\'equation avec le maque terre/mer WHERE (pctsrf(:, is_lic) < EPSFRA) pctsrf(:, is_lic) = 0. WHERE (zmasq < EPSFRA) pctsrf(:, is_lic) = 0. - pctsrf(:, is_ter) = zmasq + where (zmasq <= EPSFRA) pctsrf(:, is_ter) = zmasq where (zmasq > EPSFRA) where (pctsrf(:, is_lic) >= zmasq) pctsrf(:, is_lic) = zmasq @@ -336,7 +329,7 @@ nday = 0 itau_phy = 0 ! side effect - call phyredem0(lmt_pas = day_step / iphysiq) + call phyredem0 call nf95_inq_varid(ncid_restartphy, "trs", varid) call nf95_put_var(ncid_restartphy, varid, null_array) @@ -349,4 +342,4 @@ END SUBROUTINE etat0 -end module etat0_mod +end module etat0_m