--- trunk/phylmd/Interface_surf/interfsur_lim.f 2014/09/09 12:54:30 106 +++ trunk/phylmd/Interface_surf/interfsur_lim.f 2018/08/02 14:27:11 299 @@ -4,33 +4,27 @@ contains - SUBROUTINE interfsur_lim(itime, dtime, jour, nisurf, knindex, debut, & - alb_new, z0_new) + SUBROUTINE interfsur_lim(jour, knindex, debut, albedo, z0_new) - ! Cette routine sert d'interface entre le modèle atmosphérique et + ! Cette routine sert d'interface entre le mod\`ele atmosph\'erique et ! un fichier de conditions aux limites. ! Laurent FAIRHEAD, February 2000 - use abort_gcm_m, only: abort_gcm + use comconst, only: dtphys USE dimphy, ONLY: klon use netcdf, only: NF90_NOWRITE use netcdf95, only: NF95_close, NF95_GET_VAR, NF95_INQ_VARID, NF95_OPEN + use time_phylmdz, only: itap - integer, intent(IN):: itime ! numero du pas de temps courant - real, intent(IN):: dtime ! pas de temps de la physique (en s) integer, intent(IN):: jour ! jour a lire dans l'annee - integer, intent(IN):: nisurf - ! index de la surface à traiter (1 = sol continental) - - integer, intent(in):: knindex(:) ! (knon) - ! index des points de la surface à traiter + ! index des points de la surface \`a traiter - logical, intent(IN):: debut ! premier appel à la physique (initialisation) - real, intent(out):: alb_new(:) ! (klon) albedo lu - real, intent(out):: z0_new(:) ! (klon) longueur de rugosité lue + logical, intent(IN):: debut ! premier appel \`a la physique (initialisation) + real, intent(out):: albedo(:) ! (knon) albedo lu + real, intent(out):: z0_new(:) ! (knon) longueur de rugosit\'e lue ! Local: @@ -40,7 +34,7 @@ ! (en pas de physique) logical, save:: deja_lu_sur - ! jour à lire déjà lu pour une surface précédente + ! jour \`a lire d\'ej\`a lu pour une surface pr\'ec\'edente integer, save:: jour_lu_sur @@ -54,7 +48,7 @@ knon = size(knindex) if (debut) then - lmt_pas = nint(86400./dtime * 1.0) ! pour une lecture une fois par jour + lmt_pas = nint(86400. / dtphys) ! pour une lecture une fois par jour jour_lu_sur = jour - 1 allocate(alb_lu(klon)) allocate(rug_lu(klon)) @@ -63,14 +57,14 @@ if (jour - jour_lu_sur /= 0) deja_lu_sur = .false. ! Tester d'abord si c'est le moment de lire le fichier - if (mod(itime - 1, lmt_pas) == 0 .and. .not. deja_lu_sur) then + if (mod(itap - 1, lmt_pas) == 0 .and. .not. deja_lu_sur) then call NF95_OPEN('limit.nc', NF90_NOWRITE, ncid) ! Lecture Albedo call NF95_INQ_VARID(ncid, 'ALB', varid) call NF95_GET_VAR(ncid, varid, alb_lu, start=(/1, jour/)) - ! Lecture rugosité + ! Lecture rugosit\'e call NF95_INQ_VARID(ncid, 'RUG', varid) call NF95_GET_VAR(ncid, varid, rug_lu, start=(/1, jour/)) @@ -80,10 +74,8 @@ endif ! Recopie des variables dans les champs de sortie - alb_new(:knon) = alb_lu(knindex(:knon)) - z0_new(:knon) = rug_lu(knindex(:knon)) - alb_new(knon + 1:) = 999999. - z0_new(knon + 1:) = 999999. + albedo = alb_lu(knindex) + z0_new = rug_lu(knindex) END SUBROUTINE interfsur_lim