Ignore:
Timestamp:
Apr 7, 2016, 9:17:30 AM (9 years ago)
Author:
mturbet
Message:

Generic GCM:

  • Fix buggy ouputs in 1D introduced by previous code modifications.

EM+MT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/inistats.F

    r1529 r1531  
    1616      integer :: l,nsteppd
    1717      real, dimension(nbp_lev) ::  sig_s
    18       real :: lon_reg_ext(nbp_lon+1) ! extended longitudes
     18      real,allocatable :: lon_reg_ext(:) ! extended longitudes
    1919      integer :: idim_lat,idim_lon,idim_llm,idim_llmp1,idim_time
    2020      real, dimension(istime) :: lt
    2121      integer :: nvarid
    2222
     23
     24      IF (nbp_lon*nbp_lat==1) THEN
     25        ! 1D model
     26        ALLOCATE(lon_reg_ext(1))
     27      ELSE
     28        ! 3D model
     29        ALLOCATE(lon_reg_ext(nbp_lon+1))
     30      ENDIF
     31     
    2332      write (*,*)
    2433      write (*,*) '                        || STATS ||'
     
    4655     
    4756      lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon)
    48       !add extra redundant point (180 degrees, since lon_reg starts at -180
    49       lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1)
     57      IF (nbp_lon*nbp_lat/=1) THEN
     58        ! In 3D, add extra redundant point (180 degrees,
     59        ! since lon_reg starts at -180)
     60        lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1)
     61      ENDIF
    5062
    5163      if (is_master) then
     
    5971
    6072      ierr = NF_DEF_DIM (nid, "latitude", nbp_lat, idim_lat)
    61       ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_lon)
     73      IF (nbp_lon*nbp_lat==1) THEN
     74        ierr = NF_DEF_DIM (nid, "longitude", 1, idim_lon)
     75      ELSE
     76        ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_lon)
     77      ENDIF
    6278      ierr = NF_DEF_DIM (nid, "altitude", nbp_lev, idim_llm)
    6379      ierr = NF_DEF_DIM (nid, "llmp1", nbp_lev+1, idim_llmp1)
Note: See TracChangeset for help on using the changeset viewer.