Ignore:
Timestamp:
May 4, 2005, 5:11:29 PM (19 years ago)
Author:
Laurent Fairhead
Message:

Modifications faites à la physique pour la rendre parallele YM
Une branche de travail LMDZ4_par_0 a été créée provisoirement afin de tester
les modifs pleinement avant leurs inclusions dans le tronc principal
LF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4_par_0/libf/phylmd/interface_surf.F90

    r633 r634  
    2222! L. Fairhead, LMD, 02/2000
    2323
    24   USE ioipsl
     24!ym  USE ioipsl
    2525
    2626  IMPLICIT none
     
    7676      & z0_new, pctsrf_new, agesno,fqcalving,ffonte, run_off_lic_0)
    7777
    78 
     78   USE dimphy,only : monocpu
    7979! Cette routine sert d'aiguillage entre l'atmosphere et la surface en general
    8080! (sols continentaux, oceans, glaces) pour les fluxs de chaleur et d'humidite.
     
    235235  real, dimension(klon):: fder_prev
    236236  REAL, dimension(klon) :: bidule
     237  INTEGER :: j
    237238
    238239  if (check) write(*,*) 'Entree ', modname
     
    394395
    395396    else
     397   
     398      if (.not.monocpu) then
     399        abort_message='Appel a ORCHIDEE non encore parallelise !!'
     400        call abort_gcm(modname,abort_message,1)
     401      endif
    396402!!      CALL albsno(klon,agesno,alb_neig_grid) 
    397403!
     
    434440!
    435441    if (ocean == 'couple') then
     442      if (.not.monocpu) then
     443        abort_message='Couplage avec l OCEAN non encore parallelise !!'
     444        call abort_gcm(modname,abort_message,1)
     445      endif
     446
    436447      if (nexca == 0) then
    437448        abort_message='nexca = 0 dans interfoce_cpl'
     
    510521    if (ocean == 'couple') then
    511522
     523      if (.not.monocpu) then
     524        abort_message='Couplage avec l OCEAN non encore parallelise !!'
     525        call abort_gcm(modname,abort_message,1)
     526      endif
     527
    512528      cumul = .true.
    513529
     
    555571!
    556572    if (ocean == 'couple') then
    557 
     573     
     574      if (.not.monocpu) then
     575        abort_message='Couplage avec l OCEAN non encore parallelise !!'
     576        call abort_gcm(modname,abort_message,1)
     577      endif
     578     
    558579      cumul =.false.
    559580
     
    596617!IM cf LF
    597618      DO ii = 1, knon
    598        IF (pctsrf_new(ii,nisurf) < EPSFRA) then
     619       j=knindex(ii)
     620       IF (pctsrf_new(j,nisurf) < EPSFRA) then
    599621          snow(ii) = 0.0
    600622!IM cf LF/JLD         tsurf(ii) = RTT - 1.8
     
    666688    if (ocean == 'couple') then
    667689
     690      if (.not.monocpu) then
     691        abort_message='Couplage avec l OCEAN non encore parallelise !!'
     692        call abort_gcm(modname,abort_message,1)
     693      endif
     694
    668695      cumul =.true.
    669696
     
    733760
    734761! passage du run-off des glaciers calcule dans fonte_neige au coupleur
    735     bidule=0.
    736     bidule(1:knon)= run_off_lic(1:knon)   
    737     call gath2cpl(bidule, tmp_rlic, klon, knon,iim,jjm,knindex)
     762    if (ocean=='couple') then
     763     
     764      if (.not.monocpu) then
     765        abort_message='Couplage avec l OCEAN non encore parallelise !!'
     766        call abort_gcm(modname,abort_message,1)
     767      endif
     768
     769      bidule=0.
     770      bidule(1:knon)= run_off_lic(1:knon)   
     771      call gath2cpl(bidule, tmp_rlic, klon, knon,iim,jjm,knindex)
     772   
     773    endif
    738774!
    739775! calcul albedo
     
    12391275      & pctsrf_new)
    12401276
     1277   USE ioipsl
    12411278! Cette routine sert d'interface entre le modele atmospherique et un
    12421279! coupleur avec un modele d'ocean 'complet' derriere
     
    19091946!
    19101947  SUBROUTINE interfoce_lim(itime, dtime, jour, &
    1911      & klon, nisurf, knon, knindex, &
     1948     & klon_xx, nisurf, knon, knindex, &
    19121949     & debut,  &
    1913      & lmt_sst, pctsrf_new)
     1950     & lmt_sst_p, pctsrf_new_p)
     1951     
     1952     USE dimphy,klon=>klon2,klon2=>klon
    19141953
    19151954! Cette routine sert d'interface entre le modele atmospherique et un fichier
     
    19381977  real   , intent(IN) :: dtime
    19391978  integer, intent(IN) :: jour
     1979  integer, intent(in) :: klon_xx
    19401980  integer, intent(IN) :: nisurf
    19411981  integer, intent(IN) :: knon
    1942   integer, intent(IN) :: klon
    1943   integer, dimension(klon), intent(in) :: knindex
     1982  integer, dimension(klon2), intent(in) :: knindex
    19441983  logical, intent(IN) :: debut
    19451984
    19461985! Parametres de sortie
    1947   real, intent(out), dimension(klon) :: lmt_sst
    1948   real, intent(out), dimension(klon,nbsrf) :: pctsrf_new
     1986  real, intent(out), dimension(klon2) :: lmt_sst_p
     1987  real, intent(out), dimension(klon2,nbsrf) :: pctsrf_new_p
     1988
     1989!  real, dimension(klon) :: lmt_sst
     1990  real, dimension(klon,nbsrf) :: pctsrf_new
    19491991
    19501992! Variables locales
     
    19622004  logical, save     :: check = .FALSE.
    19632005! Champs lus dans le fichier de CL
    1964   real, allocatable , save, dimension(:) :: sst_lu, rug_lu, nat_lu
    1965   real, allocatable , save, dimension(:,:) :: pct_tmp
     2006  real, allocatable , save, dimension(:) :: sst_lu_p, rug_lu_p, nat_lu_p
     2007  real, allocatable , save, dimension(:,:) :: pct_tmp_p
     2008  real, dimension(klon,nbsrf) :: pct_tmp
     2009  real, dimension(klon) :: sst_lu
     2010  real, dimension(klon) :: nat_lu
    19662011!
    19672012! quelques variables pour netcdf
     
    19732018! Fin déclaration
    19742019!
    1975    
    1976   if (debut .and. .not. allocated(sst_lu)) then
     2020 
     2021  if (debut .and. .not. allocated(sst_lu_p)) then
    19772022    lmt_pas = nint(86400./dtime * 1.0) ! pour une lecture une fois par jour
    19782023    jour_lu = jour - 1
    1979     allocate(sst_lu(klon))
    1980     allocate(nat_lu(klon))
    1981     allocate(pct_tmp(klon,nbsrf))
     2024    allocate(sst_lu_p(klon2))
     2025    allocate(nat_lu_p(klon2))
     2026    allocate(pct_tmp_p(klon2,nbsrf))
    19822027  endif
    19832028
     
    19922037! Ouverture du fichier
    19932038!
     2039    if (phy_rank==0) then
     2040   
    19942041    fich = trim(fich)
    19952042    ierr = NF_OPEN (fich, NF_NOWRITE,nid)
     
    21312178!
    21322179    ierr = NF_CLOSE(nid)
    2133     deja_lu = .true.
    2134     jour_lu = jour
    2135   endif
     2180   endif ! phyrank
    21362181!
    21372182! Recopie des variables dans les champs de sortie
    21382183!
    2139   lmt_sst = 999999999.
     2184  call ScatterField(sst_lu,sst_lu_p,1)
     2185  call ScatterField(pct_tmp(:,is_oce),pct_tmp_p(:,is_oce),1)
     2186  call ScatterField(pct_tmp(:,is_sic),pct_tmp_p(:,is_sic),1)
     2187 
     2188   deja_lu = .true.
     2189   jour_lu = jour
     2190  endif   
     2191 
     2192  lmt_sst_p = 999999999.
     2193 
    21402194  do ii = 1, knon
    2141     lmt_sst(ii) = sst_lu(knindex(ii))
     2195    lmt_sst_p(ii) = sst_lu_p(knindex(ii))
    21422196  enddo
    21432197
    2144   pctsrf_new(:,is_oce) = pct_tmp(:,is_oce)
    2145   pctsrf_new(:,is_sic) = pct_tmp(:,is_sic)
     2198  do ii=1,klon2
     2199    pctsrf_new_p(ii,is_oce)=pct_tmp_p(ii,is_oce)
     2200    pctsrf_new_p(ii,is_sic)=pct_tmp_p(ii,is_sic)
     2201  enddo
     2202 
    21462203
    21472204  END SUBROUTINE interfoce_lim
     
    21512208!
    21522209  SUBROUTINE interfsur_lim(itime, dtime, jour, &
    2153      & klon, nisurf, knon, knindex, &
     2210     & klon_xx, nisurf, knon, knindex, &
    21542211     & debut,  &
    2155      & lmt_alb, lmt_rug)
     2212     & lmt_alb_p, lmt_rug_p)
     2213
     2214     USE dimphy,klon=>klon2,klon2=>klon
    21562215
    21572216! Cette routine sert d'interface entre le modele atmospherique et un fichier
     
    21842243  integer, intent(IN) :: nisurf
    21852244  integer, intent(IN) :: knon
    2186   integer, intent(IN) :: klon
    2187   integer, dimension(klon), intent(in) :: knindex
     2245  integer, intent(IN) :: klon_xx
     2246  integer, dimension(klon2), intent(in) :: knindex
    21882247  logical, intent(IN) :: debut
    21892248
    21902249! Parametres de sortie
    2191   real, intent(out), dimension(klon) :: lmt_alb
    2192   real, intent(out), dimension(klon) :: lmt_rug
     2250  real, intent(out), dimension(klon2) :: lmt_alb_p
     2251  real, intent(out), dimension(klon2) :: lmt_rug_p
     2252
     2253!  real,  dimension(klon) :: lmt_alb
     2254!  real,  dimension(klon) :: lmt_rug
    21932255
    21942256! Variables locales
     
    22062268  logical,save     :: check = .false.
    22072269! Champs lus dans le fichier de CL
    2208   real, allocatable , save, dimension(:) :: alb_lu, rug_lu
     2270  real, allocatable , save, dimension(:) :: alb_lu_p, rug_lu_p
     2271  real, dimension(klon) :: alb_lu, rug_lu
    22092272!
    22102273! quelques variables pour netcdf
     
    22202283    lmt_pas = nint(86400./dtime * 1.0) ! pour une lecture une fois par jour
    22212284    jour_lu_sur = jour - 1
    2222     allocate(alb_lu(klon))
    2223     allocate(rug_lu(klon))
     2285    allocate(alb_lu_p(klon2))
     2286    allocate(rug_lu_p(klon2))
    22242287  endif
    22252288
     
    22322295! Tester d'abord si c'est le moment de lire le fichier
    22332296  if (mod(itime-1, lmt_pas) == 0 .and. .not. deja_lu_sur) then
     2297 
     2298  if (phy_rank==0) then
    22342299!
    22352300! Ouverture du fichier
     
    22892354!
    22902355    ierr = NF_CLOSE(nid)
     2356
     2357
     2358  endif  !! phyrank
     2359
     2360    call ScatterField(alb_lu,alb_lu_p,1)
     2361    call ScatterField(rug_lu,rug_lu_p,1)
     2362
    22912363    deja_lu_sur = .true.
    22922364    jour_lu_sur = jour
     
    22972369!!$  lmt_alb(:) = 0.0
    22982370!!$  lmt_rug(:) = 0.0
    2299   lmt_alb(:) = 999999.
    2300   lmt_rug(:) = 999999.
     2371 
     2372  lmt_alb_p(:) = 999999.
     2373  lmt_rug_p(:) = 999999.
    23012374  DO ii = 1, knon
    2302     lmt_alb(ii) = alb_lu(knindex(ii))
    2303     lmt_rug(ii) = rug_lu(knindex(ii))
     2375    lmt_alb_p(ii) = alb_lu_p(knindex(ii))
     2376    lmt_rug_p(ii) = rug_lu_p(knindex(ii))
    23042377  enddo
    23052378
Note: See TracChangeset for help on using the changeset viewer.