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/iniwritesoil.F90

    r1528 r1532  
    1 subroutine iniwritesoil(nid,ngrid,inertia,area)
     1subroutine iniwritesoil(nid,ngrid,inertia,area,nbplon,nbplat)
    22
    33! initialization routine for 'writediagoil'. Here we create/define
     
    1717integer,intent(in) :: ngrid
    1818integer,intent(in) :: nid ! NetCDF output file ID
    19 real,intent(in) :: inertia(nbp_lon+1,nbp_lat,nsoilmx)
    20 real,intent(in) :: area(nbp_lon+1,nbp_lat) ! mesh area (m2)
     19real,intent(in) :: inertia(nbplon,nbplat,nsoilmx)
     20real,intent(in) :: area(nbplon,nbp_lat) ! mesh area (m2)
     21integer,intent(in) :: nbplon,nbplat ! sizes of area
    2122
    2223! Local variables:
     
    3334real,dimension(nbp_lon+1,nbp_lat,nsoilmx) :: data3 ! to store 3D data
    3435integer :: i,j,l,ig0
    35 real :: lon_reg_ext(nbp_lon+1) ! extended longitudes
     36real,allocatable :: lon_reg_ext(:) ! extended longitudes
     37
     38
     39if (nbp_lon*nbp_lat==1) then
     40  ! 1D model
     41  allocate(lon_reg_ext(1))
     42else
     43  ! 3D model
     44  allocate(lon_reg_ext(nbp_lon+1))
     45endif
    3646
    3747! 1. Define the dimensions
     
    4050
    4151! Define the dimensions
    42 ierr=NF_DEF_DIM(nid,"longitude",nbp_lon+1,idim_rlonv)
     52if (nbp_lon*nbp_lat==1) then
     53  ierr=NF_DEF_DIM(nid,"longitude",1,idim_rlonv)
     54else
     55  ierr=NF_DEF_DIM(nid,"longitude",nbp_lon+1,idim_rlonv)
     56endif
    4357if (ierr.ne.NF_NOERR) then
    4458  write(*,*)"iniwritesoil: Error, could not define longitude dimension"
     
    8296
    8397lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon)
    84 !add extra redundant point (180 degrees, since lon_reg starts at -180
    85 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1)
     98if (nbp_lon*nbp_lat/=1) then ! in 3D only:
     99  ! add extra redundant point (180 degrees, since lon_reg starts at -180
     100  lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1)
     101endif
    86102
    87103! Write longitude to file
Note: See TracChangeset for help on using the changeset viewer.