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/iniwrite.F

    r1528 r1532  
    1       SUBROUTINE iniwrite(nid,idayref,phis,area)
     1      SUBROUTINE iniwrite(nid,idayref,phis,area,nbplon,nbplat)
    22
    33      use comsoil_h, only: mlayer, nsoilmx
     
    3535      integer,intent(in) :: nid        ! NetCDF file ID
    3636      INTEGER*4,intent(in) :: idayref  ! date (initial date for this run)
    37       real,intent(in) :: phis(nbp_lon+1,nbp_lat) ! surface geopotential
    38       real,intent(in) :: area(nbp_lon+1,nbp_lat) ! mesh area (m2)
     37      real,intent(in) :: phis(nbplon,nbp_lat) ! surface geopotential
     38      real,intent(in) :: area(nbplon,nbp_lat) ! mesh area (m2)
     39      integer,intent(in) :: nbplon,nbplat ! sizes of area and phis arrays
    3940
    4041c   Local:
     
    4445      REAL tab_cntrl(length) ! run parameters are stored in this array
    4546      INTEGER ierr
    46       REAl :: lon_reg_ext(nbp_lon+1) ! extended longitudes
     47      REAl,ALLOCATABLE :: lon_reg_ext(:) ! extended longitudes
    4748
    4849      integer :: nvarid,idim_index,idim_rlonv
     
    5152      integer, dimension(2) :: id 
    5253c-----------------------------------------------------------------------
     54
     55      IF (nbp_lon*nbp_lat==1) THEN
     56        ! 1D model
     57        ALLOCATE(lon_reg_ext(1))
     58      ELSE
     59        ! 3D model
     60        ALLOCATE(lon_reg_ext(nbp_lon+1))
     61      ENDIF
    5362
    5463      DO l=1,length
     
    104113!      ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu)
    105114      ierr = NF_DEF_DIM (nid, "latitude", nbp_lat, idim_rlatu)
    106       ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv)
     115      IF (nbp_lon*nbp_lat==1) THEN
     116        ierr = NF_DEF_DIM (nid, "longitude", 1, idim_rlonv)
     117      ELSE
     118        ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv)
     119      ENDIF
    107120!      ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv)
    108121      ierr = NF_DEF_DIM (nid, "interlayer", (nbp_lev+1), idim_llmp1)
     
    166179c
    167180c --------------------------
     181     
    168182      lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon)
    169       !add extra redundant point (180 degrees, since lon_reg starts at -180
    170       lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1)
     183      IF (nbp_lon*nbp_lat/=1) THEN
     184        ! In 3D, add extra redundant point (180 degrees,
     185        ! since lon_reg starts at -180)
     186        lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1)
     187      ENDIF
    171188
    172189      ierr = NF_REDEF (nid)
Note: See TracChangeset for help on using the changeset viewer.