Changeset 1323 for LMDZ4/trunk


Ignore:
Timestamp:
Mar 12, 2010, 5:19:12 PM (15 years ago)
Author:
Laurent Fairhead
Message:

Changes made in r1293 are integrated into the trunk
Start files are identical between r1293 and this version


Les modifications de la r1293 sont intégrées à la trunk
Les fichiers start et startphy sont identiques entre la version 1293 et celle-ci

Location:
LMDZ4/trunk/libf
Files:
1 added
6 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/trunk/libf/bibio/assert_eq_m.F90

    r1279 r1323  
    4848    else
    4949       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
    50             string
     50            string,n1,n2,n3,n4
    5151       print *, 'program terminated by assert_eq4'
    5252       stop 1
  • LMDZ4/trunk/libf/dyn3d/ce0l.F90

    r1319 r1323  
    55!
    66PROGRAM ce0l
    7 !
    87!-------------------------------------------------------------------------------
    98! Purpose: Calls etat0, creates initial states and limit_netcdf
  • LMDZ4/trunk/libf/dyn3d/conf_gcm.F

    r1319 r1323  
    786786
    787787      write(lunout,*)' #########################################'
    788       write(lunout,*)' Configuration des parametres de create_etat0'
     788      write(lunout,*)' Configuration des parametres de cel0'
    789789     &             //'_limit: '
    790790      write(lunout,*)' planet_type = ', planet_type
  • LMDZ4/trunk/libf/dyn3d/etat0_netcdf.F90

    r1319 r1323  
    171171    x='masque'
    172172    masque(:,:)=0.0
    173     CALL startget(x, iip1, jjp1, rlonv, rlatu, masque, 0.0, jjm, rlonu,    &
    174                  rlatv, ib)
     173    CALL startget_phys2d(x, iip1, jjp1, rlonv, rlatu, masque, 0.0, jjm, &
     174   &              rlonu, rlatv, ib)
    175175    WRITE(lunout,*)'MASQUE construit : Masque'
    176176    WRITE(lunout,'(97I1)') nINT(masque)
     
    179179    WHERE(1.-zmasq(:)<EPSFRA) zmasq(:)=1.
    180180  ELSE
     181    WRITE(lunout,*)'ATTENTION!! fichier o2a.nc trouve'
     182    WRITE(lunout,*)'Run couple'
    181183    couple=.true.
    182184    iret=NF90_CLOSE(nid_o2a)
     
    189191     &ean',1)
    190192    END IF
    191     ALLOCATE(  ocemask(iml_omask,jml_omask),   ocetmp(iml_omask,jml_omask))
    192     ALLOCATE(lon_omask(iml_omask,jml_omask),lat_omask(iml_omask,jml_omask))
    193     ALLOCATE(dlon_omask(iml_omask),dlat_omask(jml_omask))
    194     CALL flinopen("o2a.nc", .FALSE., iml_omask, jml_omask, llm_tmp,            &
    195                    lon_omask, lat_omask, lev, ttm_tmp, itaul, date, dt, fid)
    196     CALL flinget(fid,'OceMask',iml_omask,jml_omask,llm_tmp,ttm_tmp,1,1,ocetmp)
    197     CALL flinclo(fid)
    198     dlon_omask(:)=lon_omask(:,1)
    199     dlat_omask(:)=lat_omask(1,:)
    200     ocemask=ocetmp
    201     IF(dlat_omask(1)<dlat_omask(jml_omask)) THEN
    202       DO j=1,jml_omask
    203         ocemask(:,j) = ocetmp(:,jml_omask-j+1)
    204       END DO
    205     END IF
    206193    ALLOCATE(   ocemask(iml_omask,jml_omask),   ocetmp(iml_omask,jml_omask))
    207194    ALLOCATE( lon_omask(iml_omask,jml_omask),lat_omask(iml_omask,jml_omask))
    208195    ALLOCATE(dlon_omask(iml_omask),         dlat_omask(jml_omask))
    209     CALL flinopen("o2a.nc", .FALSE., iml_omask, jml_omask, llm_tmp, lon_omask, &
    210                   lat_omask, lev, ttm_tmp, itaul, date, dt, fid)
    211     CALL flinget(fid, 'OceMask', iml_omask, jml_omask, llm_tmp, ttm_tmp,       &
    212                   1, 1, ocetmp)
     196    CALL flinopen("o2a.nc", .FALSE., iml_omask, jml_omask, llm_tmp, lon_omask,&
     197   &              lat_omask, lev, ttm_tmp, itaul, date, dt, fid)
     198    CALL flinget(fid, 'OceMask', iml_omask, jml_omask, llm_tmp, ttm_tmp, &
     199   &              1, 1, ocetmp)
    213200    CALL flinclo(fid)
    214201    dlon_omask(1:iml_omask) = lon_omask(1:iml_omask,1)
     
    237224  ! values in the restart file
    238225  x = 'relief'; orog(:,:) = 0.0
    239   CALL startget(x,iip1,jjp1,rlonv,rlatu,          orog, 0.0,jjm,rlonu,rlatv,ib,&
    240                 masque)
     226  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu, orog, 0.0,jjm,rlonu,rlatv,ib,&
     227 &               masque)
    241228
    242229  x = 'rugosite'; rugo(:,:) = 0.0
    243   CALL startget(x,iip1,jjp1,rlonv,rlatu,          rugo, 0.0,jjm, rlonu,rlatv,ib)
     230  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu, rugo, 0.0,jjm, rlonu,rlatv,ib)
    244231!  WRITE(lunout,'(49I1)') INT(orog(:,:)*10)
    245232!  WRITE(lunout,'(49I1)') INT(rugo(:,:)*10)
     
    249236  pctsrf=0.
    250237  x = 'psol'; psol(:,:) = 0.0
    251   CALL startget(x,iip1,jjp1,rlonv,rlatu,psol,0.0,jjm,rlonu,rlatv,ib)
     238  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu,psol,0.0,jjm,rlonu,rlatv,ib)
    252239!  WRITE(lunout,*) 'PSOL :', psol(10,20)
    253240!  WRITE(lunout,*) ap(:), bp(:)
     
    263250
    264251  x = 'surfgeo'; phis(:,:) = 0.0
    265   CALL startget(x,iip1,jjp1,rlonv,rlatu,          phis, 0.0,jjm, rlonu,rlatv,ib)
     252  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu,phis, 0.0,jjm, rlonu,rlatv,ib)
    266253
    267254  x = 'u';    uvent(:,:,:) = 0.0
    268   CALL startget(x,iip1,jjp1,rlonu,rlatu,llm,pls,y,uvent,0.0,jjm, rlonv,rlatv,ib)
     255  CALL startget_dyn(x,rlonu,rlatu,pls,y,uvent,0.0,  &
     256 &                  rlonv,rlatv,ib)
    269257
    270258  x = 'v';    vvent(:,:,:) = 0.0
    271   CALL startget(x,iip1,jjm, rlonv,rlatv,llm,pls,y,vvent,0.0,jjp1,rlonu,rlatu,ib)
     259  CALL startget_dyn(x, rlonv,rlatv,pls(:, :jjm, :),y(:, :jjm, :),vvent,0.0, &
     260 &                  rlonu,rlatu(:jjm),ib)
    272261
    273262  x = 't';    t3d(:,:,:) = 0.0
    274   CALL startget(x,iip1,jjp1,rlonv,rlatu,llm,pls,y,t3d,  0.0,jjm, rlonu,rlatv,ib)
     263  CALL startget_dyn(x,rlonv,rlatu,pls,y,t3d,0.0,    &
     264 &                  rlonu,rlatv,ib)
    275265
    276266  x = 'tpot'; tpot(:,:,:) = 0.0
    277   CALL startget(x,iip1,jjp1,rlonv,rlatu,llm,pls,pk,tpot,0.0,jjm, rlonu,rlatv,ib)
     267  CALL startget_dyn(x,rlonv,rlatu,pls,pk,tpot,0.0,  &
     268 &                  rlonu,rlatv,ib)
    278269
    279270  WRITE(lunout,*) 'T3D min,max:',minval(t3d(:,:,:)),maxval(t3d(:,:,:))
     
    289280
    290281  x = 'q';    qd (:,:,:) = 0.0
    291   CALL startget(x,iip1,jjp1,rlonv,rlatu,llm,pls,qsat,qd,0.0,jjm, rlonu,rlatv,ib)
     282  CALL startget_dyn(x,rlonv,rlatu,pls,qsat,qd,0.0, rlonu,rlatv,ib)
    292283  q3d(:,:,:,:) = 0.0 ; q3d(:,:,:,1) = qd(:,:,:)
    293284
     
    296287
    297288  x = 'tsol'; tsol(:) = 0.0
    298   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,tsol,  0.0,jjm,rlonu,rlatv,ib)
     289  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,tsol,0.0,jjm,rlonu,rlatv,ib)
    299290
    300291  x = 'qsol';  qsol(:) = 0.0
    301   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,qsol,  0.0,jjm,rlonu,rlatv,ib)
     292  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,qsol,0.0,jjm,rlonu,rlatv,ib)
    302293
    303294  x = 'snow';  sn(:) = 0.0
    304   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,sn,    0.0,jjm,rlonu,rlatv,ib)
     295  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,sn,0.0,jjm,rlonu,rlatv,ib)
    305296
    306297  x = 'rads';  radsol(:) = 0.0
    307   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0,jjm,rlonu,rlatv,ib)
     298  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0,jjm,rlonu,rlatv,ib)
    308299
    309300  x = 'rugmer'; rugmer(:) = 0.0
    310   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0,jjm,rlonu,rlatv,ib)
     301  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0,jjm,rlonu,rlatv,ib)
    311302
    312303  x = 'zmea';  zmea(:) = 0.0
    313   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zmea,  0.0,jjm,rlonu,rlatv,ib)
     304  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zmea,0.0,jjm,rlonu,rlatv,ib)
    314305
    315306  x = 'zstd';  zstd(:) = 0.0
    316   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zstd,  0.0,jjm,rlonu,rlatv,ib)
     307  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zstd,0.0,jjm,rlonu,rlatv,ib)
    317308
    318309  x = 'zsig';  zsig(:) = 0.0
    319   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zsig,  0.0,jjm,rlonu,rlatv,ib)
     310  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zsig,0.0,jjm,rlonu,rlatv,ib)
    320311
    321312  x = 'zgam';  zgam(:) = 0.0
    322   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zgam,  0.0,jjm,rlonu,rlatv,ib)
     313  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zgam,0.0,jjm,rlonu,rlatv,ib)
    323314
    324315  x = 'zthe';  zthe(:) = 0.0
    325   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zthe,  0.0,jjm,rlonu,rlatv,ib)
     316  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zthe,0.0,jjm,rlonu,rlatv,ib)
    326317
    327318  x = 'zpic';  zpic(:) = 0.0
    328   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zpic,  0.0,jjm,rlonu,rlatv,ib)
     319  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zpic,0.0,jjm,rlonu,rlatv,ib)
    329320
    330321  x = 'zval';  zval(:) = 0.0
    331   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zval,  0.0,jjm,rlonu,rlatv,ib)
     322  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zval,0.0,jjm,rlonu,rlatv,ib)
    332323
    333324!  WRITE(lunout,'(48I3)') 'TSOL :', INT(tsol(2:klon)-273)
     
    339330  ALLOCATE(dlat_lic(jml_lic),       dlon_lic(iml_lic))
    340331  ALLOCATE( fraclic(iml_lic,jml_lic))
    341   CALL flinopen("landiceref.nc", .FALSE., iml_lic, jml_lic, llm_tmp,           &
    342                 lon_lic, lat_lic, lev, ttm_tmp, itaul, date, dt, fid)
     332  CALL flinopen("landiceref.nc", .FALSE., iml_lic, jml_lic, llm_tmp,  &
     333 &               lon_lic, lat_lic, lev, ttm_tmp, itaul, date, dt, fid)
    343334  CALL flinget(fid, 'landice', iml_lic, jml_lic, llm_tmp, ttm_tmp, 1,1, fraclic)
    344335  CALL flinclo(fid)
     
    352343  dlon_lic(:)=lon_lic(:,1)
    353344  dlat_lic(:)=lat_lic(1,:)
    354   CALL grille_m( iml_lic, jml_lic, dlon_lic, dlat_lic, fraclic, iim,jjp1,      &
    355                  rlonv, rlatu, flic_tmp(1:iim,:) )
     345  CALL grille_m( iml_lic, jml_lic, dlon_lic, dlat_lic, fraclic, iim,jjp1,   &
     346 &               rlonv, rlatu, flic_tmp(1:iim,:) )
    356347  flic_tmp(iip1,:)=flic_tmp(1,:)
    357348
     
    494485  CALL phyredem( "startphy.nc" )
    495486
    496   WRITE(lunout,*)'CCCCCCCCCCCCCCCCCC REACTIVER SORTIE VISU DANS ETAT0'
    497   WRITE(lunout,*)'entree histclo'
     487!  WRITE(lunout,*)'CCCCCCCCCCCCCCCCCC REACTIVER SORTIE VISU DANS ETAT0'
     488!  WRITE(lunout,*)'entree histclo'
    498489  CALL histclo()
    499490
  • LMDZ4/trunk/libf/dyn3d/limit_netcdf.F90

    r1319 r1323  
    2828                   NF90_NOERR,   NF90_NOWRITE, NF90_DOUBLE,  NF90_GLOBAL,      &
    2929                   NF90_CLOBBER, NF90_ENDDEF,  NF90_UNLIMITED
     30  USE inter_barxy_m, only: inter_barxy
    3031#endif
    3132  IMPLICIT NONE
     
    327328!--- fields
    328329  INTEGER :: imdep, jmdep, lmdep                ! dimensions of 'champ'
    329   REAL, ALLOCATABLE, DIMENSION(:) :: champ      ! wanted field on initial grid
     330  REAL, ALLOCATABLE, DIMENSION(:,:) :: champ      ! wanted field on initial grid
    330331  REAL, ALLOCATABLE, DIMENSION(:) :: yder, timeyear
    331332  REAL,              DIMENSION(iim,jjp1) :: champint   ! interpolated field
     
    399400
    400401!--- GETTING THE FIELD AND INTERPOLATING IT ------------------------------------
    401   ALLOCATE(champ(imdep*jmdep),champtime(iim,jjp1,lmdep))
     402  ALLOCATE(champ(imdep,jmdep),champtime(iim,jjp1,lmdep))
    402403  IF(extrp) ALLOCATE(work(imdep,jmdep))
    403404
     
    422423      END IF
    423424      IF(mode=='RUG') champ=LOG(champ)
    424       CALL inter_barxy(imdep, jmdep-1, dlon, dlat, champ, iim, jjm, rlonu,     &
    425                          rlatv, jjp1, champint)
     425      CALL inter_barxy(dlon, dlat(:jmdep-1), champ, rlonu(:iim),     &
     426                         rlatv, champint)
    426427      IF(mode=='RUG') THEN
    427428        champint=EXP(champint)
     
    430431    ELSE
    431432      SELECT CASE(mode)
    432         CASE('RUG');       CALL rugosite(imdep, jmdep, dlon, dlat, champ,      &
     433        CASE('RUG');       CALL rugosite(imdep, jmdep, dlon, dlat, champ,    &
    433434                                    iim, jjp1, rlonv, rlatu, champint, mask)
    434         CASE('SIC');       CALL sea_ice (imdep, jmdep, dlon, dlat, champ,      &
     435        CASE('SIC');       CALL sea_ice (imdep, jmdep, dlon, dlat, champ,    &
    435436                                    iim, jjp1, rlonv, rlatu, champint)
    436         CASE('SST','ALB'); CALL grille_m(imdep, jmdep, dlon, dlat, champ,      &
     437        CASE('SST','ALB'); CALL grille_m(imdep, jmdep, dlon, dlat, champ,    &
    437438                                    iim, jjp1, rlonv, rlatu, champint)
    438439      END SELECT
  • LMDZ4/trunk/libf/dyn3d/startvar.F90

    r1319 r1323  
    2020!
    2121!  - A 1D variable on the physical grid :
    22 !    CALL startget(varname, iml, jml,  lon_in,  lat_in,  nbindex,              &
     22!    CALL startget_phys1d((varname, iml, jml,  lon_in,  lat_in,  nbindex,              &
    2323!           champ, val_exp,      jml2, lon_in2, lat_in2, ibar )
    2424!
    2525!  - A 2D variable on the dynamical grid :
    26 !    CALL startget(varname, iml, jml,  lon_in,  lat_in,                        &
     26!    CALL startget_phys2d(varname, iml, jml,  lon_in,  lat_in,                        &
    2727!           champ, val_exp,      jml2, lon_in2, lat_in2, ibar )             
    2828!
    2929!  - A 3D variable on the dynamical grid :
    30 !    CALL startget(varname, iml, jml,  lon_in,  lat_in,  lml, pls, workvar,    &
     30!    CALL startget_dyn((varname, iml, jml,  lon_in,  lat_in,  lml, pls, workvar,    &
    3131!           champ, val_exp,      jml2, lon_in2, lat_in2, ibar )
    3232!
     
    5454
    5555  PRIVATE
    56   PUBLIC startget
    57   INTERFACE startget
    58     MODULE PROCEDURE startget_phys1d, startget_phys2d, startget_dyn
    59   END INTERFACE
     56  PUBLIC startget_phys2d, startget_phys1d, startget_dyn
     57!  INTERFACE startget
     58!    MODULE PROCEDURE startget_phys1d, startget_phys2d, startget_dyn
     59!  END INTERFACE
    6060
    6161  REAL,    SAVE :: deg2rad,  pi
     
    254254!-------------------------------------------------------------------------------
    255255!
    256 SUBROUTINE startget_dyn(varname, iml, jml,  lon_in,  lat_in,  lml, pls,workvar,&
    257                      champ, val_exp,  jml2, lon_in2, lat_in2, ibar)
     256SUBROUTINE startget_dyn(varname,  lon_in,  lat_in, pls,workvar,&
     257                     champ, val_exp, lon_in2, lat_in2, ibar)
     258
     259      use assert_eq_m, only: assert_eq
     260
     261
    258262!-------------------------------------------------------------------------------
    259263! Comment:
     
    261265!-------------------------------------------------------------------------------
    262266! Arguments:
    263   CHARACTER(LEN=*),             INTENT(IN)    :: varname
    264   INTEGER,                      INTENT(IN)    :: iml, jml
    265   REAL, DIMENSION(iml),         INTENT(IN)    :: lon_in
    266   REAL, DIMENSION(jml),         INTENT(IN)    :: lat_in
    267   INTEGER,                      INTENT(IN)    :: lml
    268   REAL, DIMENSION(iml,jml,lml), INTENT(IN)    :: pls, workvar
    269   REAL, DIMENSION(iml,jml,lml), INTENT(INOUT) :: champ
    270   REAL,                         INTENT(IN)    :: val_exp
    271   INTEGER,                      INTENT(IN)    :: jml2
    272   REAL, DIMENSION(iml),         INTENT(IN)    :: lon_in2
    273   REAL, DIMENSION(jml2),        INTENT(IN)    :: lat_in2
     267  CHARACTER(LEN=*), INTENT(IN)    :: varname
     268  REAL, INTENT(IN)    :: lon_in(:) ! dim(iml)
     269  REAL, INTENT(IN)    :: lat_in(:) ! dim(jml)
     270  REAL, INTENT(IN)    :: pls(:, :, :) ! dim(iml, jml, lml)
     271  REAL, INTENT(IN)    :: workvar(:, :, :) ! dim(iml, jml, lml)
     272  REAL, INTENT(INOUT) :: champ(:, :, :) ! dim(iml, jml, lml)
     273  REAL, INTENT(IN)    :: val_exp
     274  REAL, INTENT(IN)    :: lon_in2(:) ! dim(iml)
     275  REAL, INTENT(IN)    :: lat_in2(:) ! dim(jml2)
    274276  LOGICAL,                      INTENT(IN)    :: ibar
    275277!-------------------------------------------------------------------------------
     
    280282#include "paramet.h"
    281283#include "comgeom2.h"
     284  INTEGER    :: iml, jml
     285  INTEGER    :: lml
     286  INTEGER    :: jml2
    282287  REAL, DIMENSION(:,:,:), POINTER :: v3d=>NULL()
    283288  CHARACTER(LEN=10) :: vname
     
    287292  NULLIFY(v3d)
    288293  IF(MINVAL(champ)==MAXVAL(champ).AND.MINVAL(champ)==val_exp) THEN
     294
     295      iml = assert_eq((/size(lon_in), size(pls, 1), size(workvar, 1), &
     296     &     size(champ, 1), size(lon_in2)/), "startget_dyn iml")
     297      jml = assert_eq(size(lat_in), size(pls, 2), size(workvar, 2),   &
     298     &     size(champ, 2), "startget_dyn jml")
     299      lml = assert_eq(size(pls, 3), size(workvar, 3), size(champ, 3), &
     300     &     "startget_dyn lml")
     301      jml2 = size(lat_in2)
    289302
    290303!--- READING UNALLOCATED FILES
     
    723736!
    724737!-------------------------------------------------------------------------------
     738
     739  USE inter_barxy_m, only: inter_barxy
     740
    725741! Arguments:
    726742  CHARACTER(LEN=*),       INTENT(IN)  :: vname
     
    750766               '---------------------------------------------------------------'
    751767    END IF
    752     CALL inter_barxy(ii, jj-1, lon, lat, vari, i1-1, j2, lon2, lat2, j1, vtmp)
     768    CALL inter_barxy(lon, lat(:jj-1), vari, lon2(:i1-1), lat2(:j2), vtmp)
    753769  ELSE
    754770    CALL grille_m   (ii, jj,   lon, lat, vari, i1-1, j1, lon1, lat1,     vtmp)
  • LMDZ4/trunk/libf/dyn3dpar/conf_gcm.F

    r1319 r1323  
    832832
    833833      write(lunout,*)' #########################################'
    834       write(lunout,*)' Configuration des parametres de create_etat0'
     834      write(lunout,*)' Configuration des parametres de cel0'
    835835     &             //'_limit: '
    836836      write(lunout,*)' planet_type = ', planet_type
  • LMDZ4/trunk/libf/dyn3dpar/etat0_netcdf.F90

    r1319 r1323  
    171171    x='masque'
    172172    masque(:,:)=0.0
    173     CALL startget(x, iip1, jjp1, rlonv, rlatu, masque, 0.0, jjm, rlonu,    &
    174                  rlatv, ib)
     173    CALL startget_phys2d(x, iip1, jjp1, rlonv, rlatu, masque, 0.0, jjm, &
     174   &              rlonu, rlatv, ib)
    175175    WRITE(lunout,*)'MASQUE construit : Masque'
    176176    WRITE(lunout,'(97I1)') nINT(masque)
     
    179179    WHERE(1.-zmasq(:)<EPSFRA) zmasq(:)=1.
    180180  ELSE
     181    WRITE(lunout,*)'ATTENTION!! fichier o2a.nc trouve'
     182    WRITE(lunout,*)'Run couple'
    181183    couple=.true.
    182184    iret=NF90_CLOSE(nid_o2a)
     
    189191     &ean',1)
    190192    END IF
    191     ALLOCATE(  ocemask(iml_omask,jml_omask),   ocetmp(iml_omask,jml_omask))
    192     ALLOCATE(lon_omask(iml_omask,jml_omask),lat_omask(iml_omask,jml_omask))
    193     ALLOCATE(dlon_omask(iml_omask),dlat_omask(jml_omask))
    194     CALL flinopen("o2a.nc", .FALSE., iml_omask, jml_omask, llm_tmp,            &
    195                    lon_omask, lat_omask, lev, ttm_tmp, itaul, date, dt, fid)
    196     CALL flinget(fid,'OceMask',iml_omask,jml_omask,llm_tmp,ttm_tmp,1,1,ocetmp)
    197     CALL flinclo(fid)
    198     dlon_omask(:)=lon_omask(:,1)
    199     dlat_omask(:)=lat_omask(1,:)
    200     ocemask=ocetmp
    201     IF(dlat_omask(1)<dlat_omask(jml_omask)) THEN
    202       DO j=1,jml_omask
    203         ocemask(:,j) = ocetmp(:,jml_omask-j+1)
    204       END DO
    205     END IF
    206193    ALLOCATE(   ocemask(iml_omask,jml_omask),   ocetmp(iml_omask,jml_omask))
    207194    ALLOCATE( lon_omask(iml_omask,jml_omask),lat_omask(iml_omask,jml_omask))
    208195    ALLOCATE(dlon_omask(iml_omask),         dlat_omask(jml_omask))
    209     CALL flinopen("o2a.nc", .FALSE., iml_omask, jml_omask, llm_tmp, lon_omask, &
    210                   lat_omask, lev, ttm_tmp, itaul, date, dt, fid)
    211     CALL flinget(fid, 'OceMask', iml_omask, jml_omask, llm_tmp, ttm_tmp,       &
    212                   1, 1, ocetmp)
     196    CALL flinopen("o2a.nc", .FALSE., iml_omask, jml_omask, llm_tmp, lon_omask,&
     197   &              lat_omask, lev, ttm_tmp, itaul, date, dt, fid)
     198    CALL flinget(fid, 'OceMask', iml_omask, jml_omask, llm_tmp, ttm_tmp, &
     199   &              1, 1, ocetmp)
    213200    CALL flinclo(fid)
    214201    dlon_omask(1:iml_omask) = lon_omask(1:iml_omask,1)
     
    237224  ! values in the restart file
    238225  x = 'relief'; orog(:,:) = 0.0
    239   CALL startget(x,iip1,jjp1,rlonv,rlatu,          orog, 0.0,jjm,rlonu,rlatv,ib,&
    240                 masque)
     226  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu, orog, 0.0,jjm,rlonu,rlatv,ib,&
     227 &               masque)
    241228
    242229  x = 'rugosite'; rugo(:,:) = 0.0
    243   CALL startget(x,iip1,jjp1,rlonv,rlatu,          rugo, 0.0,jjm, rlonu,rlatv,ib)
     230  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu, rugo, 0.0,jjm, rlonu,rlatv,ib)
    244231!  WRITE(lunout,'(49I1)') INT(orog(:,:)*10)
    245232!  WRITE(lunout,'(49I1)') INT(rugo(:,:)*10)
     
    249236  pctsrf=0.
    250237  x = 'psol'; psol(:,:) = 0.0
    251   CALL startget(x,iip1,jjp1,rlonv,rlatu,psol,0.0,jjm,rlonu,rlatv,ib)
     238  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu,psol,0.0,jjm,rlonu,rlatv,ib)
    252239!  WRITE(lunout,*) 'PSOL :', psol(10,20)
    253240!  WRITE(lunout,*) ap(:), bp(:)
     
    263250
    264251  x = 'surfgeo'; phis(:,:) = 0.0
    265   CALL startget(x,iip1,jjp1,rlonv,rlatu,          phis, 0.0,jjm, rlonu,rlatv,ib)
     252  CALL startget_phys2d(x,iip1,jjp1,rlonv,rlatu,phis, 0.0,jjm, rlonu,rlatv,ib)
    266253
    267254  x = 'u';    uvent(:,:,:) = 0.0
    268   CALL startget(x,iip1,jjp1,rlonu,rlatu,llm,pls,y,uvent,0.0,jjm, rlonv,rlatv,ib)
     255  CALL startget_dyn(x,rlonu,rlatu,pls,y,uvent,0.0,  &
     256 &                  rlonv,rlatv,ib)
    269257
    270258  x = 'v';    vvent(:,:,:) = 0.0
    271   CALL startget(x,iip1,jjm, rlonv,rlatv,llm,pls,y,vvent,0.0,jjp1,rlonu,rlatu,ib)
     259  CALL startget_dyn(x, rlonv,rlatv,pls(:, :jjm, :),y(:, :jjm, :),vvent,0.0, &
     260 &                  rlonu,rlatu(:jjm),ib)
    272261
    273262  x = 't';    t3d(:,:,:) = 0.0
    274   CALL startget(x,iip1,jjp1,rlonv,rlatu,llm,pls,y,t3d,  0.0,jjm, rlonu,rlatv,ib)
     263  CALL startget_dyn(x,rlonv,rlatu,pls,y,t3d,0.0,    &
     264 &                  rlonu,rlatv,ib)
    275265
    276266  x = 'tpot'; tpot(:,:,:) = 0.0
    277   CALL startget(x,iip1,jjp1,rlonv,rlatu,llm,pls,pk,tpot,0.0,jjm, rlonu,rlatv,ib)
     267  CALL startget_dyn(x,rlonv,rlatu,pls,pk,tpot,0.0,  &
     268 &                  rlonu,rlatv,ib)
    278269
    279270  WRITE(lunout,*) 'T3D min,max:',minval(t3d(:,:,:)),maxval(t3d(:,:,:))
     
    289280
    290281  x = 'q';    qd (:,:,:) = 0.0
    291   CALL startget(x,iip1,jjp1,rlonv,rlatu,llm,pls,qsat,qd,0.0,jjm, rlonu,rlatv,ib)
     282  CALL startget_dyn(x,rlonv,rlatu,pls,qsat,qd,0.0, rlonu,rlatv,ib)
    292283  q3d(:,:,:,:) = 0.0 ; q3d(:,:,:,1) = qd(:,:,:)
    293284
     
    296287
    297288  x = 'tsol'; tsol(:) = 0.0
    298   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,tsol,  0.0,jjm,rlonu,rlatv,ib)
     289  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,tsol,0.0,jjm,rlonu,rlatv,ib)
    299290
    300291  x = 'qsol';  qsol(:) = 0.0
    301   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,qsol,  0.0,jjm,rlonu,rlatv,ib)
     292  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,qsol,0.0,jjm,rlonu,rlatv,ib)
    302293
    303294  x = 'snow';  sn(:) = 0.0
    304   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,sn,    0.0,jjm,rlonu,rlatv,ib)
     295  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,sn,0.0,jjm,rlonu,rlatv,ib)
    305296
    306297  x = 'rads';  radsol(:) = 0.0
    307   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0,jjm,rlonu,rlatv,ib)
     298  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0,jjm,rlonu,rlatv,ib)
    308299
    309300  x = 'rugmer'; rugmer(:) = 0.0
    310   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0,jjm,rlonu,rlatv,ib)
     301  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0,jjm,rlonu,rlatv,ib)
    311302
    312303  x = 'zmea';  zmea(:) = 0.0
    313   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zmea,  0.0,jjm,rlonu,rlatv,ib)
     304  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zmea,0.0,jjm,rlonu,rlatv,ib)
    314305
    315306  x = 'zstd';  zstd(:) = 0.0
    316   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zstd,  0.0,jjm,rlonu,rlatv,ib)
     307  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zstd,0.0,jjm,rlonu,rlatv,ib)
    317308
    318309  x = 'zsig';  zsig(:) = 0.0
    319   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zsig,  0.0,jjm,rlonu,rlatv,ib)
     310  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zsig,0.0,jjm,rlonu,rlatv,ib)
    320311
    321312  x = 'zgam';  zgam(:) = 0.0
    322   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zgam,  0.0,jjm,rlonu,rlatv,ib)
     313  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zgam,0.0,jjm,rlonu,rlatv,ib)
    323314
    324315  x = 'zthe';  zthe(:) = 0.0
    325   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zthe,  0.0,jjm,rlonu,rlatv,ib)
     316  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zthe,0.0,jjm,rlonu,rlatv,ib)
    326317
    327318  x = 'zpic';  zpic(:) = 0.0
    328   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zpic,  0.0,jjm,rlonu,rlatv,ib)
     319  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zpic,0.0,jjm,rlonu,rlatv,ib)
    329320
    330321  x = 'zval';  zval(:) = 0.0
    331   CALL startget(x,iip1,jjp1,rlonv,rlatu,klon,zval,  0.0,jjm,rlonu,rlatv,ib)
     322  CALL startget_phys1d(x,iip1,jjp1,rlonv,rlatu,klon,zval,0.0,jjm,rlonu,rlatv,ib)
    332323
    333324!  WRITE(lunout,'(48I3)') 'TSOL :', INT(tsol(2:klon)-273)
     
    339330  ALLOCATE(dlat_lic(jml_lic),       dlon_lic(iml_lic))
    340331  ALLOCATE( fraclic(iml_lic,jml_lic))
    341   CALL flinopen("landiceref.nc", .FALSE., iml_lic, jml_lic, llm_tmp,           &
    342                 lon_lic, lat_lic, lev, ttm_tmp, itaul, date, dt, fid)
     332  CALL flinopen("landiceref.nc", .FALSE., iml_lic, jml_lic, llm_tmp,  &
     333 &               lon_lic, lat_lic, lev, ttm_tmp, itaul, date, dt, fid)
    343334  CALL flinget(fid, 'landice', iml_lic, jml_lic, llm_tmp, ttm_tmp, 1,1, fraclic)
    344335  CALL flinclo(fid)
     
    352343  dlon_lic(:)=lon_lic(:,1)
    353344  dlat_lic(:)=lat_lic(1,:)
    354   CALL grille_m( iml_lic, jml_lic, dlon_lic, dlat_lic, fraclic, iim,jjp1,      &
    355                  rlonv, rlatu, flic_tmp(1:iim,:) )
     345  CALL grille_m( iml_lic, jml_lic, dlon_lic, dlat_lic, fraclic, iim,jjp1,   &
     346 &               rlonv, rlatu, flic_tmp(1:iim,:) )
    356347  flic_tmp(iip1,:)=flic_tmp(1,:)
    357348
     
    494485  CALL phyredem( "startphy.nc" )
    495486
    496   WRITE(lunout,*)'CCCCCCCCCCCCCCCCCC REACTIVER SORTIE VISU DANS ETAT0'
    497   WRITE(lunout,*)'entree histclo'
     487!  WRITE(lunout,*)'CCCCCCCCCCCCCCCCCC REACTIVER SORTIE VISU DANS ETAT0'
     488!  WRITE(lunout,*)'entree histclo'
    498489  CALL histclo()
    499490
  • LMDZ4/trunk/libf/dyn3dpar/limit_netcdf.F90

    r1319 r1323  
    2828                   NF90_NOERR,   NF90_NOWRITE, NF90_DOUBLE,  NF90_GLOBAL,      &
    2929                   NF90_CLOBBER, NF90_ENDDEF,  NF90_UNLIMITED
     30  USE inter_barxy_m, only: inter_barxy
    3031#endif
    3132  IMPLICIT NONE
     
    327328!--- fields
    328329  INTEGER :: imdep, jmdep, lmdep                ! dimensions of 'champ'
    329   REAL, ALLOCATABLE, DIMENSION(:) :: champ      ! wanted field on initial grid
     330  REAL, ALLOCATABLE, DIMENSION(:,:) :: champ      ! wanted field on initial grid
    330331  REAL, ALLOCATABLE, DIMENSION(:) :: yder, timeyear
    331332  REAL,              DIMENSION(iim,jjp1) :: champint   ! interpolated field
     
    399400
    400401!--- GETTING THE FIELD AND INTERPOLATING IT ------------------------------------
    401   ALLOCATE(champ(imdep*jmdep),champtime(iim,jjp1,lmdep))
     402  ALLOCATE(champ(imdep,jmdep),champtime(iim,jjp1,lmdep))
    402403  IF(extrp) ALLOCATE(work(imdep,jmdep))
    403404
     
    422423      END IF
    423424      IF(mode=='RUG') champ=LOG(champ)
    424       CALL inter_barxy(imdep, jmdep-1, dlon, dlat, champ, iim, jjm, rlonu,     &
    425                          rlatv, jjp1, champint)
     425      CALL inter_barxy(dlon, dlat(:jmdep-1), champ, rlonu(:iim),     &
     426                         rlatv, champint)
    426427      IF(mode=='RUG') THEN
    427428        champint=EXP(champint)
     
    430431    ELSE
    431432      SELECT CASE(mode)
    432         CASE('RUG');       CALL rugosite(imdep, jmdep, dlon, dlat, champ,      &
     433        CASE('RUG');       CALL rugosite(imdep, jmdep, dlon, dlat, champ,    &
    433434                                    iim, jjp1, rlonv, rlatu, champint, mask)
    434         CASE('SIC');       CALL sea_ice (imdep, jmdep, dlon, dlat, champ,      &
     435        CASE('SIC');       CALL sea_ice (imdep, jmdep, dlon, dlat, champ,    &
    435436                                    iim, jjp1, rlonv, rlatu, champint)
    436         CASE('SST','ALB'); CALL grille_m(imdep, jmdep, dlon, dlat, champ,      &
     437        CASE('SST','ALB'); CALL grille_m(imdep, jmdep, dlon, dlat, champ,    &
    437438                                    iim, jjp1, rlonv, rlatu, champint)
    438439      END SELECT
  • LMDZ4/trunk/libf/dyn3dpar/startvar.F90

    r1319 r1323  
    2020!
    2121!  - A 1D variable on the physical grid :
    22 !    CALL startget(varname, iml, jml,  lon_in,  lat_in,  nbindex,              &
     22!    CALL startget_phys1d((varname, iml, jml,  lon_in,  lat_in,  nbindex,              &
    2323!           champ, val_exp,      jml2, lon_in2, lat_in2, ibar )
    2424!
    2525!  - A 2D variable on the dynamical grid :
    26 !    CALL startget(varname, iml, jml,  lon_in,  lat_in,                        &
     26!    CALL startget_phys2d(varname, iml, jml,  lon_in,  lat_in,                        &
    2727!           champ, val_exp,      jml2, lon_in2, lat_in2, ibar )             
    2828!
    2929!  - A 3D variable on the dynamical grid :
    30 !    CALL startget(varname, iml, jml,  lon_in,  lat_in,  lml, pls, workvar,    &
     30!    CALL startget_dyn((varname, iml, jml,  lon_in,  lat_in,  lml, pls, workvar,    &
    3131!           champ, val_exp,      jml2, lon_in2, lat_in2, ibar )
    3232!
     
    5454
    5555  PRIVATE
    56   PUBLIC startget
    57   INTERFACE startget
    58     MODULE PROCEDURE startget_phys1d, startget_phys2d, startget_dyn
    59   END INTERFACE
     56  PUBLIC startget_phys2d, startget_phys1d, startget_dyn
     57!  INTERFACE startget
     58!    MODULE PROCEDURE startget_phys1d, startget_phys2d, startget_dyn
     59!  END INTERFACE
    6060
    6161  REAL,    SAVE :: deg2rad,  pi
     
    254254!-------------------------------------------------------------------------------
    255255!
    256 SUBROUTINE startget_dyn(varname, iml, jml,  lon_in,  lat_in,  lml, pls,workvar,&
    257                      champ, val_exp,  jml2, lon_in2, lat_in2, ibar)
     256SUBROUTINE startget_dyn(varname,  lon_in,  lat_in, pls,workvar,&
     257                     champ, val_exp, lon_in2, lat_in2, ibar)
     258
     259      use assert_eq_m, only: assert_eq
     260
     261
    258262!-------------------------------------------------------------------------------
    259263! Comment:
     
    261265!-------------------------------------------------------------------------------
    262266! Arguments:
    263   CHARACTER(LEN=*),             INTENT(IN)    :: varname
    264   INTEGER,                      INTENT(IN)    :: iml, jml
    265   REAL, DIMENSION(iml),         INTENT(IN)    :: lon_in
    266   REAL, DIMENSION(jml),         INTENT(IN)    :: lat_in
    267   INTEGER,                      INTENT(IN)    :: lml
    268   REAL, DIMENSION(iml,jml,lml), INTENT(IN)    :: pls, workvar
    269   REAL, DIMENSION(iml,jml,lml), INTENT(INOUT) :: champ
    270   REAL,                         INTENT(IN)    :: val_exp
    271   INTEGER,                      INTENT(IN)    :: jml2
    272   REAL, DIMENSION(iml),         INTENT(IN)    :: lon_in2
    273   REAL, DIMENSION(jml2),        INTENT(IN)    :: lat_in2
     267  CHARACTER(LEN=*), INTENT(IN)    :: varname
     268  REAL, INTENT(IN)    :: lon_in(:) ! dim(iml)
     269  REAL, INTENT(IN)    :: lat_in(:) ! dim(jml)
     270  REAL, INTENT(IN)    :: pls(:, :, :) ! dim(iml, jml, lml)
     271  REAL, INTENT(IN)    :: workvar(:, :, :) ! dim(iml, jml, lml)
     272  REAL, INTENT(INOUT) :: champ(:, :, :) ! dim(iml, jml, lml)
     273  REAL, INTENT(IN)    :: val_exp
     274  REAL, INTENT(IN)    :: lon_in2(:) ! dim(iml)
     275  REAL, INTENT(IN)    :: lat_in2(:) ! dim(jml2)
    274276  LOGICAL,                      INTENT(IN)    :: ibar
    275277!-------------------------------------------------------------------------------
     
    280282#include "paramet.h"
    281283#include "comgeom2.h"
     284  INTEGER    :: iml, jml
     285  INTEGER    :: lml
     286  INTEGER    :: jml2
    282287  REAL, DIMENSION(:,:,:), POINTER :: v3d=>NULL()
    283288  CHARACTER(LEN=10) :: vname
     
    287292  NULLIFY(v3d)
    288293  IF(MINVAL(champ)==MAXVAL(champ).AND.MINVAL(champ)==val_exp) THEN
     294
     295      iml = assert_eq((/size(lon_in), size(pls, 1), size(workvar, 1), &
     296     &     size(champ, 1), size(lon_in2)/), "startget_dyn iml")
     297      jml = assert_eq(size(lat_in), size(pls, 2), size(workvar, 2),   &
     298     &     size(champ, 2), "startget_dyn jml")
     299      lml = assert_eq(size(pls, 3), size(workvar, 3), size(champ, 3), &
     300     &     "startget_dyn lml")
     301      jml2 = size(lat_in2)
    289302
    290303!--- READING UNALLOCATED FILES
     
    723736!
    724737!-------------------------------------------------------------------------------
     738
     739  USE inter_barxy_m, only: inter_barxy
     740
    725741! Arguments:
    726742  CHARACTER(LEN=*),       INTENT(IN)  :: vname
     
    750766               '---------------------------------------------------------------'
    751767    END IF
    752     CALL inter_barxy(ii, jj-1, lon, lat, vari, i1-1, j2, lon2, lat2, j1, vtmp)
     768    CALL inter_barxy(lon, lat(:jj-1), vari, lon2(:i1-1), lat2(:j2), vtmp)
    753769  ELSE
    754770    CALL grille_m   (ii, jj,   lon, lat, vari, i1-1, j1, lon1, lat1,     vtmp)
Note: See TracChangeset for help on using the changeset viewer.