Ignore:
Timestamp:
Nov 21, 2019, 4:43:45 PM (4 years ago)
Author:
lguez
Message:

Merge revisions 3427:3600 of trunk into branch Ocean_skin

Location:
LMDZ6/branches/Ocean_skin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Ocean_skin

  • LMDZ6/branches/Ocean_skin/libf/phylmd/regr_pr_time_av_m.F90

    r3141 r3605  
    118118  USE assert_m,       ONLY: assert
    119119  USE assert_eq_m,    ONLY: assert_eq
    120   USE comvert_mod,    ONLY: scaleheight
     120!!  USE comvert_mod,    ONLY: scaleheight
    121121  USE interpolation,  ONLY: locate
    122122  USE regr_conserv_m, ONLY: regr_conserv
    123123  USE regr_lint_m,    ONLY: regr_lint
    124124  USE slopes_m,       ONLY: slopes
    125   USE mod_phys_lmdz_mpi_data,       ONLY: is_mpi_root
    126   USE mod_grid_phy_lmdz, ONLY: nlon=>nbp_lon, nlat=>nbp_lat, nlev_ou=>nbp_lev
    127   USE mod_phys_lmdz_transfert_para, ONLY: scatter2d, scatter
     125  USE mod_phys_lmdz_para,           ONLY: is_mpi_root,is_master
     126  USE mod_grid_phy_lmdz,            ONLY: nlon=>nbp_lon, nlat=>nbp_lat, nlev_ou=>nbp_lev, klon_glo, grid_type, unstructured
     127  USE mod_phys_lmdz_transfert_para, ONLY: scatter2d, scatter, gather
    128128  USE phys_cal_mod,                 ONLY: calend, year_len, days_elapsed, jH_cur
     129  USE geometry_mod,                 ONLY: ind_cell_glo
    129130!-------------------------------------------------------------------------------
    130131! Arguments:
     
    175176    v2i(klon,SIZE(Pre_in)-1,SIZE(nam)), &     !--- v2 in Ploc=='I' case
    176177    v2c(klon,SIZE(Pre_in)  ,SIZE(nam))        !--- v2 in Ploc=='C' case
     178  INTEGER,ALLOCATABLE :: ind_cell_glo_glo(:)
    177179  LOGICAL :: ll
    178180!--- For debug
     
    247249      IF(lO3Tfile) ot1=al*otm+(1.-al)*otp
    248250    END IF
     251  ELSE
     252    IF (lfirst) ALLOCATE(v1(0,0,0,0))
    249253  END IF
    250254  !$OMP END MASTER
     255  !$OMP BARRIER
    251256  IF(lfirst) THEN
    252257    lfirst=.FALSE.;       CALL bcast(lfirst)
     
    255260    CALL bcast(lO3Tfile); CALL bcast(linterp)
    256261  END IF
     262 
     263  IF (is_master) THEN
     264    ALLOCATE(ind_cell_glo_glo(klon_glo))
     265  ELSE
     266    ALLOCATE(ind_cell_glo_glo(0))
     267  ENDIF
     268  CALL gather(ind_cell_glo,ind_cell_glo_glo)
     269  IF (is_master .AND. grid_type==unstructured) v1(:,:,:,:)=v1(:,ind_cell_glo_glo(:),:,:)
     270 
    257271  CALL scatter2d(v1,v2)
    258   IF(lPrSfile) CALL scatter2d(pg1,Pgnd_in)
    259   IF(lPrTfile) CALL scatter2d(pt1,Ptrp_in)
    260   IF(lO3Tfile) CALL scatter2d(ot1,Otrp_in)
     272
     273  !--- No "ps" in input file => assumed to be equal to current LMDZ ground press
     274  IF(lPrSfile) THEN
     275    IF (is_master .AND. grid_type==unstructured) pg1(:,:)=pg1(:,ind_cell_glo_glo(:))
     276    CALL scatter2d(pg1,Pgnd_in)
     277  ELSE
     278    Pgnd_in=Pre_ou(:,1)
     279  END IF
     280
     281  IF(lPrTfile) THEN
     282    IF (is_master .AND. grid_type==unstructured) pt1(:,:)=pt1(:,ind_cell_glo_glo(:))
     283    CALL scatter2d(pt1,Ptrp_in)
     284  ENDIF
     285
     286  IF(lO3Tfile) THEN
     287    IF (is_master .AND. grid_type==unstructured) ot1(:,:)=ot1(:,ind_cell_glo_glo(:))
     288    CALL scatter2d(ot1,Otrp_in)
     289  ENDIF
    261290  !--- No ground pressure in input file => choose it to be the one of LMDZ
    262291  IF(lAdjTro.AND..NOT.lPrSfile) Pgnd_in(:)=Pgrnd_ou(:)
    263  
    264 !-------------------------------------------------------------------------------
    265   IF(.NOT.lAdjTro) THEN       !--- REGRID IN PRESSURE ; NO TROPOPAUSE ADJUSTMENT
    266 !-------------------------------------------------------------------------------
     292
     293  !--- REGRID IN PRESSURE ; 3rd index inverted because "paprs" is decreasing
     294  IF(.NOT.lAdjTro) THEN
    267295    DO i=1,klon
    268296      Pres_ou=Pre_ou(i,SIZE(Pre_ou,2):1:-1)   !--- pplay & paprs are decreasing
Note: See TracChangeset for help on using the changeset viewer.