Changeset 1532 for trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90
- Timestamp:
- Apr 7, 2016, 3:53:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90
r1528 r1532 1 subroutine iniwritesoil(nid,ngrid,inertia,area )1 subroutine iniwritesoil(nid,ngrid,inertia,area,nbplon,nbplat) 2 2 3 3 ! initialization routine for 'writediagoil'. Here we create/define … … 17 17 integer,intent(in) :: ngrid 18 18 integer,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) 19 real,intent(in) :: inertia(nbplon,nbplat,nsoilmx) 20 real,intent(in) :: area(nbplon,nbp_lat) ! mesh area (m2) 21 integer,intent(in) :: nbplon,nbplat ! sizes of area 21 22 22 23 ! Local variables: … … 33 34 real,dimension(nbp_lon+1,nbp_lat,nsoilmx) :: data3 ! to store 3D data 34 35 integer :: i,j,l,ig0 35 real :: lon_reg_ext(nbp_lon+1) ! extended longitudes 36 real,allocatable :: lon_reg_ext(:) ! extended longitudes 37 38 39 if (nbp_lon*nbp_lat==1) then 40 ! 1D model 41 allocate(lon_reg_ext(1)) 42 else 43 ! 3D model 44 allocate(lon_reg_ext(nbp_lon+1)) 45 endif 36 46 37 47 ! 1. Define the dimensions … … 40 50 41 51 ! Define the dimensions 42 ierr=NF_DEF_DIM(nid,"longitude",nbp_lon+1,idim_rlonv) 52 if (nbp_lon*nbp_lat==1) then 53 ierr=NF_DEF_DIM(nid,"longitude",1,idim_rlonv) 54 else 55 ierr=NF_DEF_DIM(nid,"longitude",nbp_lon+1,idim_rlonv) 56 endif 43 57 if (ierr.ne.NF_NOERR) then 44 58 write(*,*)"iniwritesoil: Error, could not define longitude dimension" … … 82 96 83 97 lon_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) 98 if (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) 101 endif 86 102 87 103 ! Write longitude to file
Note: See TracChangeset
for help on using the changeset viewer.