Ignore:
Timestamp:
Mar 8, 2011, 9:10:25 AM (14 years ago)
Author:
Laurent Fairhead
Message:

Merge of development branch LMDZ5V2.0-dev r1455:r1491 into the trunk.
Validation made locally: restart files are strictly equal between the HEAD of the trunk
and r1491 of LMDZ5V2.0-dev


Synchro de la branche de développement LMDZ5V2.0-dev r1455:r1491 et de la trunk
Validation faite en local: les fichiers restart sont équivalents entre la HEAD de la trunk
et la révision r1491 de LMDZ5V2.0-dev

Location:
LMDZ5/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk

  • LMDZ5/trunk/libf/phylmd/readaerosol.F90

    r1403 r1492  
    77CONTAINS
    88
    9 SUBROUTINE readaerosol(name_aero, type, iyr_in, klev_src, pt_ap, pt_b, pt_out, psurf, load)
     9SUBROUTINE readaerosol(name_aero, type, filename, iyr_in, klev_src, pt_ap, pt_b, pt_out, psurf, load)
    1010
    1111!****************************************************************************************
     
    2727  ! Input arguments
    2828  CHARACTER(len=7), INTENT(IN) :: name_aero
    29   CHARACTER(len=*), INTENT(IN) :: type  ! correspond to aer_type in clesphys.h
     29  CHARACTER(len=*), INTENT(IN) :: type  ! actuel, annuel, scenario or preind
     30  CHARACTER(len=8), INTENT(IN) :: filename
    3031  INTEGER, INTENT(IN)          :: iyr_in
    3132
     
    5859     ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    5960     ! pt_out has dimensions (klon, klev_src, 12)
    60      CALL get_aero_fromfile(name_aero, cyear, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
     61     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    6162     
    6263
     
    6768     ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    6869     ! pt_out has dimensions (klon, klev_src, 12)
    69      CALL get_aero_fromfile(name_aero, cyear, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
     70     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    7071     
    7172  ELSE IF (type == 'annuel') THEN
     
    7677     ! get_aero_fromfile returns pt_out allocated and initialized with data for nbr_tsteps month
    7778     ! pt_out has dimensions (klon, klev_src, 12)
    78      CALL get_aero_fromfile(name_aero, cyear, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
     79     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    7980     
    8081  ELSE IF (type == 'scenario') THEN
     
    8687        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    8788        ! pt_out has dimensions (klon, klev_src, 12)
    88         CALL get_aero_fromfile(name_aero, cyear, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
     89        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    8990       
    9091     ELSE IF (iyr_in .GE. 2100) THEN
     
    9394        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    9495        ! pt_out has dimensions (klon, klev_src, 12)
    95         CALL get_aero_fromfile(name_aero, cyear, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
     96        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    9697       
    9798     ELSE
     
    113114        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month
    114115        ! pt_out has dimensions (klon, klev_src, 12)
    115         CALL get_aero_fromfile(name_aero, cyear, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
     116        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, p0, pt_out, psurf, load)
    116117       
    117118        ! If to read two decades:
     
    125126           ! get_aero_fromfile returns pt_2 allocated and initialized with data for 12 month
    126127           ! pt_2 has dimensions (klon, klev_src, 12)
    127            CALL get_aero_fromfile(name_aero, cyear, klev_src2, pt_ap, pt_b, p0, pt_2, psurf2, load2)
     128           CALL get_aero_fromfile(name_aero, cyear, filename, klev_src2, pt_ap, pt_b, p0, pt_2, psurf2, load2)
    128129           ! Test for same number of vertical levels
    129130           IF (klev_src /= klev_src2) THEN
     
    160161
    161162  ELSE
    162      WRITE(lunout,*)'This option is not implemented : aer_type = ', type
     163     WRITE(lunout,*)'This option is not implemented : aer_type = ', type,' name_aero=',name_aero
    163164     CALL abort_gcm('readaerosol','Error : aer_type parameter not accepted',1)
    164165  END IF ! type
     
    168169
    169170
    170   SUBROUTINE get_aero_fromfile(varname, cyr, klev_src, pt_ap, pt_b, p0, pt_year, psurf_out, load_out)
     171  SUBROUTINE get_aero_fromfile(varname, cyr, filename, klev_src, pt_ap, pt_b, p0, pt_year, psurf_out, load_out)
    171172!****************************************************************************************
    172173! Read 12 month aerosol from file and distribute to local process on physical grid.
     
    200201    CHARACTER(len=7), INTENT(IN)          :: varname
    201202    CHARACTER(len=4), INTENT(IN)          :: cyr
     203    CHARACTER(len=8), INTENT(IN)          :: filename
    202204
    203205! Output arguments
     
    213215! Local variables
    214216    CHARACTER(len=30)     :: fname
    215     CHARACTER(len=8)      :: filename='aerosols'
    216217    CHARACTER(len=30)     :: cvar
    217218    INTEGER               :: ncid, dimid, varid
     
    242243! 1) Open file
    243244!****************************************************************************************
    244        fname = filename//cyr//'.nc'
     245! Add suffix to filename
     246       fname = trim(filename)//cyr//'.nc'
    245247 
    246        WRITE(lunout,*) 'reading ', TRIM(fname)
     248       WRITE(lunout,*) 'reading variable ',TRIM(varname),' in file ', TRIM(fname)
    247249       CALL check_err( nf90_open(TRIM(fname), NF90_NOWRITE, ncid) )
    248250
     
    283285          CALL abort_gcm('get_aero_fromfile', 'latitudes do not correspond between file and model',1)
    284286       END IF
    285 
    286 ! 1.5) Check number of month in file opened
    287 !
    288 !**************************************************************************************************
    289        ierr = nf90_inq_dimid(ncid, 'TIME',dimid)
    290        CALL check_err( nf90_inquire_dimension(ncid, dimid, len = nbr_tsteps) )
    291 !       IF (nbr_tsteps /= 12 .AND. nbr_tsteps /= 14) THEN
    292        IF (nbr_tsteps /= 12 ) THEN
    293          CALL abort_gcm('get_aero_fromfile', 'not the right number of months in aerosol file read (should be 12 for the moment)',1)
    294        ENDIF
    295287
    296288
     
    335327
    336328       IF (new_file) THEN
     329! ++) Check number of month in file opened
     330!**************************************************************************************************
     331       ierr = nf90_inq_dimid(ncid, 'TIME',dimid)
     332       CALL check_err( nf90_inquire_dimension(ncid, dimid, len = nbr_tsteps) )
     333!       IF (nbr_tsteps /= 12 .AND. nbr_tsteps /= 14) THEN
     334       IF (nbr_tsteps /= 12 ) THEN
     335         CALL abort_gcm('get_aero_fromfile', 'not the right number of months in aerosol file read (should be 12 for the moment)',1)
     336       ENDIF
    337337
    338338! ++) Read the aerosol concentration month by month and concatenate to total variable varyear
Note: See TracChangeset for help on using the changeset viewer.