--- trunk/Sources/dyn3d/etat0.f 2015/07/20 16:01:49 157 +++ trunk/dyn3d/etat0.f 2018/03/20 09:35:59 265 @@ -20,8 +20,8 @@ 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 conf_gcm_m, only: nday + use dimensions, only: iim, jjm, llm, nqmx use dimphy, only: zmasq use dimsoil, only: nsoilmx use disvert_m, only: ap, bp, preff, pa, disvert @@ -33,7 +33,7 @@ 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 iniadvtrac_m, only: iniadvtrac @@ -43,8 +43,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 paramet_m, only: ip1jm, ip1jmp1 - use phyetat0_m, only: rlat, rlon + use phyetat0_m, only: rlat, rlon, itau_phy use phyredem0_m, only: phyredem0, ncid_restartphy use phyredem_m, only: phyredem use q_sat_m, only: q_sat @@ -54,7 +53,6 @@ USE start_init_orog_m, only: start_init_orog, mask use start_init_phys_m, only: start_init_phys use start_inter_3d_m, only: start_inter_3d - use temps, only: itau_phy use test_disvert_m, only: test_disvert use unit_nml_m, only: unit_nml @@ -93,7 +91,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 @@ -101,12 +99,8 @@ REAL pk(iim + 1, jjm + 1, llm) ! fonction d'Exner aux milieux des couches real pks(iim + 1, jjm + 1) - REAL masse(iim + 1, jjm + 1, llm) REAL phi(iim + 1, jjm + 1, llm) - REAL pbaru(ip1jmp1, llm), pbarv(ip1jm, llm) - REAL w(iim + 1, jjm + 1, llm) - real sig1(klon, llm) ! section adiabatic updraft real w01(klon, llm) ! vertical velocity within adiabatic updraft @@ -267,15 +261,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 @@ -294,7 +286,7 @@ pctsrf(:, is_oce) = 1. - zmasq WHERE (pctsrf(:, is_oce) < EPSFRA) pctsrf(:, is_oce) = 0. - ! V\'erification que somme des sous-surfaces vaut 1 : + ! V\'erification que la somme des sous-surfaces vaut 1 : ji = count(abs(sum(pctsrf, dim = 2) - 1.) > EPSFRA) IF (ji /= 0) then PRINT *, 'Bad surface percentages for ', ji, 'points' @@ -311,7 +303,7 @@ call iniadvtrac CALL geopot(teta, pk , pks, phis, phi) - CALL caldyn0(ucov, vcov, teta, ps, masse, pk, phis, phi, w, pbaru, pbarv) + CALL caldyn0(ucov, vcov, teta, ps, pk, phis, phi) CALL dynredem0(day_ref, phis) CALL dynredem1(vcov, ucov, teta, q, masse, ps, itau = 0) @@ -340,18 +332,18 @@ sig1 = 0. w01 = 0. - itau_phy = 0 nday = 0 - call phyredem0(lmt_pas = day_step / iphysiq) + itau_phy = 0 ! side effect + call phyredem0 call nf95_inq_varid(ncid_restartphy, "trs", varid) call nf95_put_var(ncid_restartphy, varid, null_array) - call phyredem(pctsrf, tsoil(:, 1, :), tsoil, tsoil(:, 1, is_oce), & - null_array, qsolsrf, pack(qsol_2d, dyn_phy), snsrf, albe, evap, & - null_array, null_array, solsw, sollw, null_array, null_array, frugs, & - agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, t_ancien, & - q_ancien, rnebcon, ratqs, clwcon, null_array, sig1, w01) + call phyredem(pctsrf, tsoil(:, 1, :), tsoil, qsolsrf, & + pack(qsol_2d, dyn_phy), snsrf, albe, evap, null_array, null_array, & + solsw, sollw, null_array, null_array, frugs, agesno, zmea, zstd, & + zsig, zgam, zthe, zpic, zval, t_ancien, q_ancien, rnebcon, ratqs, & + clwcon, null_array, sig1, w01) END SUBROUTINE etat0