Changeset 1532 for trunk/LMDZ.MARS/libf/phymars/iniwrite.F
- Timestamp:
- Apr 7, 2016, 3:53:15 PM (9 years ago)
- 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) 2 2 3 3 use comsoil_h, only: mlayer, nsoilmx … … 35 35 integer,intent(in) :: nid ! NetCDF file ID 36 36 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 39 40 40 41 c Local: … … 44 45 REAL tab_cntrl(length) ! run parameters are stored in this array 45 46 INTEGER ierr 46 REAl :: lon_reg_ext(nbp_lon+1) ! extended longitudes47 REAl,ALLOCATABLE :: lon_reg_ext(:) ! extended longitudes 47 48 48 49 integer :: nvarid,idim_index,idim_rlonv … … 51 52 integer, dimension(2) :: id 52 53 c----------------------------------------------------------------------- 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 53 62 54 63 DO l=1,length … … 104 113 ! ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 105 114 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 107 120 ! ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 108 121 ierr = NF_DEF_DIM (nid, "interlayer", (nbp_lev+1), idim_llmp1) … … 166 179 c 167 180 c -------------------------- 181 168 182 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 171 188 172 189 ierr = NF_REDEF (nid)
Note: See TracChangeset
for help on using the changeset viewer.