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