Ignore:
Timestamp:
Mar 30, 2017, 10:59:48 AM (8 years ago)
Author:
acozic
Message:

remove commit 2836 and come back to previous version. There was a bug that need to be fixed before a new commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/readaerosol.F90

    r2836 r2837  
    4242  REAL, POINTER, DIMENSION(:,:,:) :: pt_2
    4343  REAL, DIMENSION(klon,12)        :: psurf2, load2
     44  REAL                            :: p0           ! Reference pressure
    4445  INTEGER                         :: iyr1, iyr2, klev_src2
    4546  INTEGER                         :: it, k, i
     
    5758     ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    5859     ! pt_out has dimensions (klon, klev_src, 12)
    59      CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
     60     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    6061     
    6162
     
    6667     ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    6768     ! pt_out has dimensions (klon, klev_src, 12)
    68      CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
     69     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    6970     
    7071  ELSE IF (type == 'annuel') THEN
     
    7576     ! get_aero_fromfile returns pt_out allocated and initialized with data for nbr_tsteps month
    7677     ! pt_out has dimensions (klon, klev_src, 12)
    77      CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
     78     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    7879     
    7980  ELSE IF (type == 'scenario') THEN
     
    8586        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    8687        ! pt_out has dimensions (klon, klev_src, 12)
    87         CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
     88        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    8889       
    8990     ELSE IF (iyr_in .GE. 2100) THEN
     
    9293        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    9394        ! pt_out has dimensions (klon, klev_src, 12)
    94         CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
     95        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    9596       
    9697     ELSE
     
    112113        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    113114        ! pt_out has dimensions (klon, klev_src, 12)
    114         CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
     115        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    115116       
    116117        ! If to read two decades:
     
    124125           ! get_aero_fromfile returns pt_2 allocated and initialized with data for 12 month
    125126           ! pt_2 has dimensions (klon, klev_src, 12)
    126            CALL get_aero_fromfile(name_aero, cyear, filename, klev_src2, pt_ap, pt_b, pt_2, psurf2, load2)
     127           CALL get_aero_fromfile(name_aero, cyear, filename, klev_src2, pt_ap, pt_b, p0, pt_2, psurf2, load2)
    127128           ! Test for same number of vertical levels
    128129           IF (klev_src /= klev_src2) THEN
     
    167168
    168169
    169   SUBROUTINE get_aero_fromfile(varname, cyr, filename, klev_src, pt_ap, pt_b, pt_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)
    170171!****************************************************************************************
    171172! Read 12 month aerosol from file and distribute to local process on physical grid.
     
    204205    REAL, POINTER, DIMENSION(:)           :: pt_ap        ! Pointer for describing the vertical levels     
    205206    REAL, POINTER, DIMENSION(:)           :: pt_b         ! Pointer for describing the vertical levels     
     207    REAL                                  :: p0           ! Reference pressure value
    206208    REAL, POINTER, DIMENSION(:,:,:)       :: pt_year      ! Pointer-variabale from file, 12 month, grid : klon,klev_src
    207209    REAL, DIMENSION(klon,12), INTENT(OUT) :: psurf_out    ! Surface pression for 12 months
     
    290292       IF (ierr /= NF90_NOERR) THEN
    291293          ! Coordinate axe lev not found. Check for presnivs.
    292           ierr = nf90_inq_dimid(ncid, 'presnivs', dimid)
     294          ierr = nf90_inq_dimid(ncid, 'PRESNIVS', dimid)
    293295          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
    308303       ELSE
    309304          ! New file found
     
    333328!**************************************************************************************************
    334329       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" )
    339331!       IF (nbr_tsteps /= 12 .AND. nbr_tsteps /= 14) THEN
    340332       IF (nbr_tsteps /= 12 ) THEN
     
    390382          CALL check_err( nf90_get_var(ncid, varid, pt_b),"pb get var b" )
    391383
     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" )
    392390         
    393391
Note: See TracChangeset for help on using the changeset viewer.