--- trunk/phylmd/phyredem.f 2014/07/02 18:39:15 99 +++ trunk/Sources/phylmd/phyredem.f 2015/05/22 23:13:19 138 @@ -4,16 +4,17 @@ contains - SUBROUTINE phyredem(fichnom, rlat, rlon, pctsrf, tsol, tsoil, tslab, & - seaice, qsurf, qsol, snow, albedo, alblw, evap, rain_fall, snow_fall, & - solsw, sollw, fder, radsol, frugs, agesno, zmea, zstd, zsig, zgam, & - zthe, zpic, zval, t_ancien, q_ancien, rnebcon, ratqs, clwcon, & - run_off_lic_0, sig1, w01) + SUBROUTINE phyredem(fichnom, pctsrf, tsol, tsoil, tslab, seaice, qsurf, & + qsol, snow, albedo, alblw, evap, rain_fall, snow_fall, solsw, sollw, & + fder, radsol, frugs, agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, & + t_ancien, q_ancien, rnebcon, ratqs, clwcon, run_off_lic_0, sig1, w01) - ! From phylmd/phyredem.F, version 1.3 2005/05/25 13:10:09 + ! From phylmd/phyredem.F, version 1.3, 2005/05/25 13:10:09 ! Author: Z. X. Li (LMD/CNRS) ! Date: 1993/08/18 - ! Objet : écriture de l'état de démarrage ou redémarrage pour la physique + + ! Objet : \'ecriture de l'\'etat de d\'emarrage ou red\'emarrage + ! pour la physique USE dimphy, ONLY: klev, klon, zmasq USE dimsoil, ONLY: nsoilmx @@ -21,16 +22,19 @@ USE netcdf, ONLY: nf90_clobber, nf90_global, nf90_float USE netcdf95, ONLY: nf95_create, nf95_put_att, nf95_def_dim, & nf95_def_var, nf95_enddef, nf95_redef, nf95_put_var, nf95_close + use phyetat0_m, only: rlat, rlon USE temps, ONLY: itau_phy CHARACTER(len=*), INTENT(IN):: fichnom - REAL, INTENT(IN):: rlat(klon), rlon(klon) - REAL, INTENT(IN):: pctsrf(klon, nbsrf) + REAL, INTENT(IN):: pctsrf(:, :) ! (klon, nbsrf) REAL, INTENT(IN):: tsol(:, :) ! (klon, nbsrf) REAL, INTENT(IN):: tsoil(:, :, :) ! (klon, nsoilmx, nbsrf) REAL, INTENT(IN):: tslab(:), seaice(:) ! (klon) slab ocean REAL, INTENT(IN):: qsurf(:, :) ! (klon, nbsrf) + REAL, intent(in):: qsol(:) ! (klon) + ! column-density of water in soil, in kg m-2 + REAL, INTENT(IN):: snow(klon, nbsrf) REAL, INTENT(IN):: albedo(klon, nbsrf) REAL, INTENT(IN):: alblw(klon, nbsrf) @@ -61,7 +65,7 @@ ! Local: - INTEGER ncid, idim2, idim3 + INTEGER ncid, idim2, idim3, dimid_nbsrf integer varid, varid_run_off_lic_0, varid_sig1, varid_w01, varid_rlon integer varid_rlat, varid_zmasq, varid_fter, varid_flic, varid_foce integer varid_fsic @@ -75,11 +79,12 @@ CALL nf95_create(fichnom, nf90_clobber, ncid) call nf95_put_att(ncid, nf90_global, 'title', & - 'Fichier redémarrage physique') + 'start file for the physics code') call nf95_put_att(ncid, nf90_global, "itau_phy", itau_phy) call nf95_def_dim(ncid, 'points_physiques', klon, idim2) call nf95_def_dim(ncid, 'klev', klev, idim3) + call nf95_def_dim(ncid, 'nbsrf', nbsrf, dimid_nbsrf) call nf95_def_var(ncid, 'longitude', nf90_float, idim2, varid_rlon) call nf95_def_var(ncid, 'latitude', nf90_float, idim2, varid_rlat) @@ -111,20 +116,11 @@ call nf95_put_var(ncid, varid_foce, pctsrf(:, is_oce)) call nf95_put_var(ncid, varid_fsic, pctsrf(:, is_sic)) - DO nsrf = 1, nbsrf - IF (nsrf<=99) THEN - WRITE (str2, '(i2.2)') nsrf - call nf95_redef(ncid) - call nf95_def_var(ncid, 'TS'//str2, nf90_float, idim2, varid) - call nf95_put_att(ncid, varid, 'title', & - 'Temperature de surface No.'//str2) - call nf95_enddef(ncid) - ELSE - PRINT *, 'Trop de sous-mailles' - STOP 1 - END IF - call nf95_put_var(ncid, varid, tsol(:, nsrf)) - END DO + call nf95_redef(ncid) + call nf95_def_var(ncid, 'TS', nf90_float, (/idim2, dimid_nbsrf/), varid) + call nf95_put_att(ncid, varid, 'title', 'surface temperature') + call nf95_enddef(ncid) + call nf95_put_var(ncid, varid, tsol) DO nsrf = 1, nbsrf DO isoil = 1, nsoilmx