Changeset 2841 for LMDZ5/trunk
- Timestamp:
- Mar 31, 2017, 12:12:27 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/readaerosol.F90
r2837 r2841 42 42 REAL, POINTER, DIMENSION(:,:,:) :: pt_2 43 43 REAL, DIMENSION(klon,12) :: psurf2, load2 44 REAL :: p0 ! Reference pressure45 44 INTEGER :: iyr1, iyr2, klev_src2 46 45 INTEGER :: it, k, i … … 58 57 ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 59 58 ! pt_out has dimensions (klon, klev_src, 12) 60 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p 0, pt_out, psurf, load)59 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load) 61 60 62 61 … … 67 66 ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 68 67 ! pt_out has dimensions (klon, klev_src, 12) 69 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p 0, pt_out, psurf, load)68 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load) 70 69 71 70 ELSE IF (type == 'annuel') THEN … … 76 75 ! get_aero_fromfile returns pt_out allocated and initialized with data for nbr_tsteps month 77 76 ! pt_out has dimensions (klon, klev_src, 12) 78 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p 0, pt_out, psurf, load)77 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load) 79 78 80 79 ELSE IF (type == 'scenario') THEN … … 86 85 ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 87 86 ! pt_out has dimensions (klon, klev_src, 12) 88 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p 0, pt_out, psurf, load)87 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load) 89 88 90 89 ELSE IF (iyr_in .GE. 2100) THEN … … 93 92 ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 94 93 ! pt_out has dimensions (klon, klev_src, 12) 95 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p 0, pt_out, psurf, load)94 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load) 96 95 97 96 ELSE … … 113 112 ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 114 113 ! pt_out has dimensions (klon, klev_src, 12) 115 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p 0, pt_out, psurf, load)114 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load) 116 115 117 116 ! If to read two decades: … … 125 124 ! get_aero_fromfile returns pt_2 allocated and initialized with data for 12 month 126 125 ! pt_2 has dimensions (klon, klev_src, 12) 127 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src2, pt_ap, pt_b, p 0, pt_2, psurf2, load2)126 CALL get_aero_fromfile(name_aero, cyear, filename, klev_src2, pt_ap, pt_b, pt_2, psurf2, load2) 128 127 ! Test for same number of vertical levels 129 128 IF (klev_src /= klev_src2) THEN … … 168 167 169 168 170 SUBROUTINE get_aero_fromfile(varname, cyr, filename, klev_src, pt_ap, pt_b, p 0, pt_year, psurf_out, load_out)169 SUBROUTINE get_aero_fromfile(varname, cyr, filename, klev_src, pt_ap, pt_b, pt_year, psurf_out, load_out) 171 170 !**************************************************************************************** 172 171 ! Read 12 month aerosol from file and distribute to local process on physical grid. … … 205 204 REAL, POINTER, DIMENSION(:) :: pt_ap ! Pointer for describing the vertical levels 206 205 REAL, POINTER, DIMENSION(:) :: pt_b ! Pointer for describing the vertical levels 207 REAL :: p0 ! Reference pressure value208 206 REAL, POINTER, DIMENSION(:,:,:) :: pt_year ! Pointer-variabale from file, 12 month, grid : klon,klev_src 209 207 REAL, DIMENSION(klon,12), INTENT(OUT) :: psurf_out ! Surface pression for 12 months … … 292 290 IF (ierr /= NF90_NOERR) THEN 293 291 ! Coordinate axe lev not found. Check for presnivs. 294 ierr = nf90_inq_dimid(ncid, ' PRESNIVS', dimid)292 ierr = nf90_inq_dimid(ncid, 'presnivs', dimid) 295 293 IF (ierr /= NF90_NOERR) THEN 296 ! Dimension PRESNIVS not found either 297 CALL abort_physic('get_aero_fromfile', 'dimension lev or presnivs not in file',1) 298 ELSE 299 ! Old file found 300 new_file=.FALSE. 301 WRITE(lunout,*) 'Vertical interpolation for ',TRIM(varname),' will not be done' 302 END IF 294 ierr = nf90_inq_dimid(ncid, 'PRESNIVS', dimid) 295 IF (ierr /= NF90_NOERR) THEN 296 ! Dimension PRESNIVS not found either 297 CALL abort_physic('get_aero_fromfile', 'dimension lev,PRESNIVS or presnivs not in file',1) 298 ELSE 299 ! Old file found 300 new_file=.FALSE. 301 WRITE(lunout,*) 'Vertical interpolation for ',TRIM(varname),' will not be done' 302 END IF 303 ELSE 304 ! New file found 305 new_file=.TRUE. 306 WRITE(lunout,*) 'Vertical interpolation for ',TRIM(varname),' will be done' 307 ENDIF 303 308 ELSE 304 309 ! New file found … … 328 333 !************************************************************************************************** 329 334 ierr = nf90_inq_dimid(ncid, 'TIME',dimid) 330 CALL check_err( nf90_inquire_dimension(ncid, dimid, len = nbr_tsteps),"pb inq dim TIME" ) 335 if (ierr /= NF90_NOERR) THEN 336 ierr = nf90_inq_dimid(ncid, 'time_counter', dimid) 337 ENDIF 338 CALL check_err( nf90_inquire_dimension(ncid, dimid, len = nbr_tsteps),"pb inq dim TIME or time_counter" ) 331 339 ! IF (nbr_tsteps /= 12 .AND. nbr_tsteps /= 14) THEN 332 340 IF (nbr_tsteps /= 12 ) THEN … … 382 390 CALL check_err( nf90_get_var(ncid, varid, pt_b),"pb get var b" ) 383 391 384 ! ++) Read p0 : reference pressure385 !****************************************************************************************386 ! Get variable id387 CALL check_err( nf90_inq_varid(ncid, "p0", varid),"pb inq var p0" )388 ! Get the variable389 CALL check_err( nf90_get_var(ncid, varid, p0),"pb get var p0" )390 392 391 393
Note: See TracChangeset
for help on using the changeset viewer.