--- trunk/dyn3d/etat0.f90 2013/11/15 18:45:49 76 +++ trunk/dyn3d/etat0.f90 2014/02/28 17:52:47 79 @@ -7,7 +7,7 @@ REAL pctsrf(klon, nbsrf) ! ("pctsrf(i, :)" is the composition of the surface at horizontal - ! position "i") + ! position "i") private nbsrf, klon @@ -18,14 +18,14 @@ ! From "etat0_netcdf.F", version 1.3 2005/05/25 13:10:09 use caldyn0_m, only: caldyn0 - use comconst, only: dtvr, daysec, cpp, kappa + use comconst, only: cpp, kappa, iniconst use comgeom, only: rlatu, rlonv, rlonu, rlatv, aire_2d, apoln, apols, & - cu_2d, cv_2d - use conf_gcm_m, only: day_step, iphysiq, dayref, anneeref + cu_2d, cv_2d, inigeom + use conf_gcm_m, only: dayref, anneeref use dimens_m, only: iim, jjm, llm, nqmx use dimphy, only: zmasq use dimsoil, only: nsoilmx - use disvert_m, only: ap, bp, preff, pa + use disvert_m, only: ap, bp, preff, pa, disvert use dynredem0_m, only: dynredem0 use dynredem1_m, only: dynredem1 use exner_hyb_m, only: exner_hyb @@ -36,7 +36,6 @@ use indicesol, only: is_oce, is_sic, is_ter, is_lic, epsfra use iniadvtrac_m, only: iniadvtrac use inifilr_m, only: inifilr - use inigeom_m, only: inigeom use massdair_m, only: massdair use netcdf, only: nf90_nowrite use netcdf95, only: nf95_close, nf95_get_var, nf95_gw_var, & @@ -50,7 +49,7 @@ use regr_pr_o3_m, only: regr_pr_o3 use serre, only: alphax use startdyn, only: start_init_dyn - USE start_init_orog_m, only: start_init_orog, mask, phis + 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, annee_ref, day_ref @@ -82,14 +81,15 @@ real seaice(klon) ! kg m-2 REAL frugs(klon, nbsrf), agesno(klon, nbsrf) REAL rugmer(klon) - real, dimension(iim + 1, jjm + 1):: relief, zstd_2d, zsig_2d, zgam_2d + REAL phis(iim + 1, jjm + 1) ! surface geopotential, in m2 s-2 + real, dimension(iim + 1, jjm + 1):: zmea_2d, zstd_2d, zsig_2d, zgam_2d real, dimension(iim + 1, jjm + 1):: zthe_2d, zpic_2d, zval_2d real, dimension(iim + 1, jjm + 1):: tsol_2d, qsol_2d, ps REAL zmea(klon), zstd(klon) REAL zsig(klon), zgam(klon) REAL zthe(klon) REAL zpic(klon), zval(klon) - REAL t_ancien(klon, llm), q_ancien(klon, llm) ! + REAL t_ancien(klon, llm), q_ancien(klon, llm) REAL run_off_lic_0(klon) real clwcon(klon, llm), rnebcon(klon, llm), ratqs(klon, llm) @@ -109,7 +109,6 @@ REAL phi(iim + 1, jjm + 1, llm) REAL pbaru(ip1jmp1, llm), pbarv(ip1jm, llm) REAL w(ip1jmp1, llm) - REAL phystep real sig1(klon, llm) ! section adiabatic updraft real w01(klon, llm) ! vertical velocity within adiabatic updraft @@ -118,13 +117,12 @@ print *, "Call sequence information: etat0" - dtvr = daysec / real(day_step) - print *, 'dtvr = ', dtvr + CALL iniconst ! Construct a grid: pa = 5e4 - CALL iniconst + CALL disvert CALL inigeom CALL inifilr @@ -138,14 +136,14 @@ ! (with conversion to degrees) lonfi(klon) = 0. - call start_init_orog(relief, zstd_2d, zsig_2d, zgam_2d, zthe_2d, zpic_2d, & - zval_2d) ! also compute "mask" and "phis" + call start_init_orog(phis, zmea_2d, zstd_2d, zsig_2d, zgam_2d, zthe_2d, & + zpic_2d, zval_2d) ! also compute "mask" call init_dyn_phy ! define the mask "dyn_phy" for distinct grid points zmasq = pack(mask, dyn_phy) PRINT *, 'Masque construit' call start_init_phys(tsol_2d, qsol_2d) - CALL start_init_dyn(tsol_2d, ps) + CALL start_init_dyn(tsol_2d, phis, ps) ! Compute pressure on intermediate levels: forall(l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps @@ -168,7 +166,7 @@ vcov(iim + 1, :, :) = vcov(1, :, :) call start_inter_3d('TEMP', rlonu, rlatv, pls, t3d) - PRINT *, 'minval(t3d) = ', minval(t3d) + PRINT *, 'minval(t3d) = ', minval(t3d) print *, "maxval(t3d) = ", maxval(t3d) teta(:iim, :, :) = t3d(:iim, :, :) * cpp / pk(:iim, :, :) @@ -202,7 +200,7 @@ call regr_lat_time_coefoz call regr_pr_o3(q(:, :, :, 5)) ! Convert from mole fraction to mass fraction: - q(:, :, :, 5) = q(:, :, :, 5) * 48. / 29. + q(:, :, :, 5) = q(:, :, :, 5) * 48. / 29. end if tsol = pack(tsol_2d, dyn_phy) @@ -212,7 +210,7 @@ tslab = 0. ! IM "slab" ocean seaice = 0. rugmer = 0.001 - zmea = pack(relief, dyn_phy) + zmea = pack(zmea_2d, dyn_phy) zstd = pack(zstd_2d, dyn_phy) zsig = pack(zsig_2d, dyn_phy) zgam = pack(zgam_2d, dyn_phy) @@ -246,7 +244,7 @@ print *, "jml_lic = ", jml_lic ! Si les coordonnées sont en degrés, on les transforme : - IF (MAXVAL(dlon_lic) > pi) THEN + IF (MAXVAL(dlon_lic) > pi) THEN dlon_lic = dlon_lic * pi / 180. ENDIF IF (maxval(dlat_lic) > pi) THEN @@ -295,7 +293,7 @@ print *, 'ALPHAX = ', alphax - forall (l = 1:llm) + forall (l = 1:llm) masse(:, 1, l) = SUM(aire_2d(:iim, 1) * masse(:iim, 1, l)) / apoln masse(:, jjm + 1, l) = & SUM(aire_2d(:iim, jjm + 1) * masse(:iim, jjm + 1, l)) / apols @@ -307,17 +305,12 @@ day_ref = dayref annee_ref = anneeref - CALL geopot(teta, pk , pks, phis, phi) + CALL geopot(teta, pk , pks, phis, phi) CALL caldyn0(ucov, vcov, teta, ps, masse, pk, phis, phi, w, pbaru, & pbarv) CALL dynredem0("start.nc", dayref, phis) CALL dynredem1("start.nc", vcov, ucov, teta, q, masse, ps, itau=0) - ! Ecriture état initial physique: - print *, "iphysiq = ", iphysiq - phystep = dtvr * REAL(iphysiq) - print *, 'phystep = ', phystep - ! Initialisations : tsolsrf(:, is_ter) = tsol tsolsrf(:, is_lic) = tsol @@ -350,8 +343,8 @@ seaice = 0. frugs(:, is_oce) = rugmer - frugs(:, is_ter) = MAX(1.e-05, zstd * zsig / 2) - frugs(:, is_lic) = MAX(1.e-05, zstd * zsig / 2) + frugs(:, is_ter) = MAX(1e-5, zstd * zsig / 2) + frugs(:, is_lic) = MAX(1e-5, zstd * zsig / 2) frugs(:, is_sic) = 0.001 fder = 0. clwcon = 0.