--- trunk/libf/phylmd/phyetat0.f90 2012/07/26 14:37:37 62 +++ trunk/phylmd/phyetat0.f 2014/07/02 18:39:15 99 @@ -10,42 +10,42 @@ contains - SUBROUTINE phyetat0(fichnom, pctsrf, tsol, tsoil, ocean, tslab, seaice, & - qsurf, qsol, snow, albe, alblw, evap, rain_fall, snow_fall, solsw, & - sollw, fder, radsol, frugs, agesno, zmea, zstd, zsig, zgam, zthe, & - zpic, zval, t_ancien, q_ancien, ancien_ok, rnebcon, ratqs, clwcon, & - run_off_lic_0) + SUBROUTINE phyetat0(pctsrf, tsol, tsoil, tslab, seaice, qsurf, qsol, & + snow, albe, alblw, evap, rain_fall, snow_fall, solsw, sollw, fder, & + radsol, frugs, agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, & + t_ancien, q_ancien, ancien_ok, rnebcon, ratqs, clwcon, run_off_lic_0, & + sig1, w01) ! From phylmd/phyetat0.F, version 1.4 2005/06/03 10:03:07 ! Author: Z.X. Li (LMD/CNRS) ! Date: 1993/08/18 - ! Objet : Lecture de l'état initial pour la physique + ! Objet : lecture de l'état initial pour la physique - USE indicesol, ONLY : epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf + use dimphy, only: zmasq, klev USE dimsoil, ONLY : nsoilmx - USE temps, ONLY : itau_phy + USE indicesol, ONLY : epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf use netcdf, only: nf90_get_att, nf90_global, nf90_inq_varid, NF90_NOERR, & NF90_NOWRITE use netcdf95, only: handle_err, nf95_get_var, nf95_close, NF95_OPEN, & nf95_inq_varid - use dimphy, only: zmasq, klev + USE temps, ONLY : itau_phy - CHARACTER(len=*), intent(in):: fichnom + REAL pctsrf(klon, nbsrf) REAL tsol(klon, nbsrf) REAL tsoil(klon, nsoilmx, nbsrf) REAL tslab(klon), seaice(klon) REAL qsurf(klon, nbsrf) - REAL qsol(klon) + REAL, intent(out):: qsol(:) ! (klon) REAL snow(klon, nbsrf) REAL albe(klon, nbsrf) REAL alblw(klon, nbsrf) REAL evap(klon, nbsrf) - REAL radsol(klon) REAL, intent(out):: rain_fall(klon) REAL snow_fall(klon) - REAL sollw(klon) real solsw(klon) + REAL, intent(out):: sollw(klon) real fder(klon) + REAL radsol(klon) REAL frugs(klon, nbsrf) REAL agesno(klon, nbsrf) REAL zmea(klon) @@ -55,30 +55,29 @@ REAL zthe(klon) REAL zpic(klon) REAL zval(klon) - REAL pctsrf(klon, nbsrf) - REAL fractint(klon) - REAL run_off_lic_0(klon) - REAL t_ancien(klon, klev), q_ancien(klon, klev) - real rnebcon(klon, klev), clwcon(klon, klev), ratqs(klon, klev) LOGICAL, intent(out):: ancien_ok + real rnebcon(klon, klev), ratqs(klon, klev), clwcon(klon, klev) + REAL run_off_lic_0(klon) + real, intent(out):: sig1(klon, klev) ! section adiabatic updraft - CHARACTER(len=*), intent(in):: ocean + real, intent(out):: w01(klon, klev) + ! vertical velocity within adiabatic updraft + ! Local: + REAL fractint(klon) REAL xmin, xmax - INTEGER ncid, varid INTEGER ierr, i, nsrf, isoil - CHARACTER*7 str7 - CHARACTER*2 str2 + CHARACTER(len=7) str7 + CHARACTER(len=2) str2 !--------------------------------------------------------------- print *, "Call sequence information: phyetat0" - ! Ouvrir le fichier contenant l'etat initial: - print *, 'fichnom = ', fichnom - call NF95_OPEN(fichnom, NF90_NOWRITE, ncid) + ! Fichier contenant l'état initial : + call NF95_OPEN("startphy.nc", NF90_NOWRITE, ncid) ierr = nf90_get_att(ncid, nf90_global, "itau_phy", itau_phy) call handle_err("phyetat0 itau_phy", ierr, ncid, nf90_global) @@ -226,35 +225,9 @@ ENDDO !IM "slab" ocean - ! Lecture de tslab (pour slab ocean seulement): - - IF (ocean .eq. 'slab ') then - call NF95_INQ_VARID(ncid, "TSLAB", varid) - call nf95_get_var(ncid, varid, tslab) - xmin = 1.0E+20 - xmax = -1.0E+20 - DO i = 1, klon - xmin = MIN(tslab(i), xmin) - xmax = MAX(tslab(i), xmax) - ENDDO - PRINT *, 'Ecart de la SST tslab:', xmin, xmax - - ! Lecture de seaice (pour slab ocean seulement): - - call NF95_INQ_VARID(ncid, "SEAICE", varid) - call nf95_get_var(ncid, varid, seaice) - xmin = 1.0E+20 - xmax = -1.0E+20 - DO i = 1, klon - xmin = MIN(seaice(i), xmin) - xmax = MAX(seaice(i), xmax) - ENDDO - PRINT *, 'Masse de la glace de mer seaice:', xmin, xmax - ELSE - tslab = 0. - seaice = 0. - ENDIF + tslab = 0. + seaice = 0. ! Lecture de l'humidite de l'air juste au dessus du sol: @@ -306,13 +279,6 @@ PRINT *, ' Valeur par defaut nulle' qsol = 0. ENDIF - xmin = 1.0E+20 - xmax = -1.0E+20 - DO i = 1, klon - xmin = MIN(qsol(i), xmin) - xmax = MAX(qsol(i), xmax) - ENDDO - PRINT *, 'Eau dans le sol (mm) ', xmin, xmax ! Lecture de neige au sol: @@ -516,13 +482,7 @@ ELSE call nf95_get_var(ncid, varid, sollw) ENDIF - xmin = 1.0E+20 - xmax = -1.0E+20 - DO i = 1, klon - xmin = MIN(sollw(i), xmin) - xmax = MAX(sollw(i), xmax) - ENDDO - PRINT *, 'Rayonnement IF au sol sollw:', xmin, xmax + PRINT *, 'Rayonnement IF au sol sollw:', minval(sollw), maxval(sollw) ! Lecture derive des flux: @@ -734,7 +694,8 @@ PRINT *, "Depart legerement fausse. Mais je continue" clwcon = 0. ELSE - call nf95_get_var(ncid, varid, clwcon) + call nf95_get_var(ncid, varid, clwcon(:, 1)) + clwcon(:, 2:) = 0. ENDIF xmin = 1.0E+20 xmax = -1.0E+20 @@ -748,7 +709,8 @@ PRINT *, "Depart legerement fausse. Mais je continue" rnebcon = 0. ELSE - call nf95_get_var(ncid, varid, rnebcon) + call nf95_get_var(ncid, varid, rnebcon(:, 1)) + rnebcon(:, 2:) = 0. ENDIF xmin = 1.0E+20 xmax = -1.0E+20 @@ -764,7 +726,8 @@ PRINT *, "Depart legerement fausse. Mais je continue" ratqs = 0. ELSE - call nf95_get_var(ncid, varid, ratqs) + call nf95_get_var(ncid, varid, ratqs(:, 1)) + ratqs(:, 2:) = 0. ENDIF xmin = 1.0E+20 xmax = -1.0E+20 @@ -788,6 +751,12 @@ xmax = MAXval(run_off_lic_0) PRINT *, '(ecart-type) run_off_lic_0:', xmin, xmax + call nf95_inq_varid(ncid, "sig1", varid) + call nf95_get_var(ncid, varid, sig1) + + call nf95_inq_varid(ncid, "w01", varid) + call nf95_get_var(ncid, varid, w01) + call NF95_CLOSE(ncid) END SUBROUTINE phyetat0