Ignore:
Timestamp:
Apr 7, 2016, 3:53:15 PM (9 years ago)
Author:
emillour
Message:

Mars GCM:

  • Some fixes for buggy outputs in 1D introduced by previous code modifications.
  • made statto.h a module.
  • ecritphy in dyn3d/control_mod.F90 should be an integer, not a real.

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/inistats.F

    r1528 r1532  
    11      subroutine inistats(ierr)
    22
     3      use statto_mod, only: istats,istime
    34      use mod_phys_lmdz_para, only : is_master
    45      USE comvert_mod, ONLY: ap,bp,aps,bps,preff,pseudoalt,presnivs
     
    910      implicit none
    1011
    11       include "statto.h"
    1212      include "netcdf.inc"
    1313
     
    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.