ozoneClim_mod sourceΒΆ

  1module ozoneClim_mod
  2  ! MODULE ozoneClim_mod (prefix='ozo' category='5. Observation operators')
  3  !
  4  !:Purpose: Climatological ozone (1998)
  5  !
  6  use obsSpaceData_mod
  7  use presProfileOperators_mod
  8  use utilities_mod
  9  implicit none
 10  save
 11  private
 12
 13  ! public procedures  
 14  public :: OZO_GET_PROFILE, OZO_READ_CLIMATOLOGY
 15
 16
 17  ! Number of latitudes and vertical levels in climatology file
 18  INTEGER, PARAMETER    :: NLATO3=19, NLEVO3=28
 19
 20  ! Climatological ozone field (ppmv) and total ozone 
 21  REAL                  :: FOZO_r4(NLATO3,NLEVO3), TOTOZO_r4(NLATO3,12)
 22
 23  ! Pressure height of climatology file vertical levels (mb)
 24  REAL(8)               :: PO3(NLEVO3)
 25
 26  DATA PO3 /    0.010D0, 0.015D0, 0.022D0, 0.032D0, 0.046D0, 0.068D0, 0.100D0,   &
 27       0.150D0, 0.200D0, 0.300D0, 0.500D0, 1.000D0, 2.000D0, 3.000D0,   &
 28       5.000D0, 7.000D0, 10.00D0, 20.00D0, 30.00D0, 50.00D0, 70.00D0,   &
 29       100.0D0, 150.0D0, 200.0D0, 300.0D0, 500.0D0, 700.0D0, 1000.D0 / 
 30
 31contains
 32
 33  !--------------------------------------------------------------------------
 34  ! ozo_get_profile
 35  !--------------------------------------------------------------------------
 36  subroutine ozo_get_profile(o3p,zlat,plev,nlev,nprf)
 37    !
 38    !:Purpose: Get ozone profile from climatology interpolated to desired P levels
 39    !
 40    implicit none
 41
 42    ! Arguments:
 43    integer, intent(in)  :: nlev            ! NUMBER OF VERTICAL LEVELS
 44    integer, intent(in)  :: nprf            ! NUMBER OF PROFILES
 45    REAL(8), intent(in)  :: ZLAT(NPRF)      ! ARRAY OF LATITUDE (-90S TO 90N)
 46    REAL(8), intent(in)  :: PLEV(NLEV,NPRF) ! PRESSURE LEVELS (HPA)
 47    REAL(8), intent(out) :: O3P(NLEV,NPRF)  ! OZONE PROFILES (PPMV)
 48
 49    ! Locals:
 50    INTEGER   :: JN, K, NUMLAT
 51    REAL(8)   :: QO3B(NLEVO3,NPRF)
 52    REAL(8)   :: PRO3(NLEVO3,NPRF)
 53
 54    !* assign default qgas values if need be
 55
 56    DO JN = 1, NPRF
 57       NUMLAT = NINT( (ZLAT(JN)+90.D0) / (180.D0/(REAL(NLATO3-1,8))) ) + 1
 58       DO K = 1, NLEVO3
 59          QO3B(K,JN) = FOZO_r4(NUMLAT,K)
 60       END DO
 61    END DO
 62
 63    !* interpolation of field QO3B at NLEVO3 levels of height PO3mbb
 64    !* into field O3P at NLEV levels of height PLEV
 65
 66    FORALL(K=1:NLEVO3) PRO3(K,:) = PO3(K)
 67
 68    CALL ppo_LINTV(pro3,qo3b,nlevo3,nprf,nlev,plev,O3P)
 69
 70  end subroutine ozo_get_profile
 71
 72  !--------------------------------------------------------------------------
 73  ! ozo_read_climatology
 74  !--------------------------------------------------------------------------
 75  subroutine ozo_read_climatology(datestamp,nlat_opt,nlev_opt,press_opt,ozone_opt)
 76    !
 77    !:Purpose: READ OZONE CLIMATOLOGICAL FIELDS
 78    !
 79    implicit none
 80    
 81    ! Arguments:
 82    integer,                        intent(in)  :: datestamp ! Datestamp
 83    integer,              optional, intent(out) :: nlat_opt  ! Number of latitudes
 84    integer,              optional, intent(out) :: nlev_opt  ! Number of vertical levels
 85    real(8), allocatable, optional, intent(out) :: ozone_opt(:,:) ! Ozone field
 86    real(8), allocatable, optional, intent(out) :: press_opt(:)   ! Pressure levels
 87
 88    ! Locals:
 89    INTEGER            :: IJOUR,ITIME,IMONTH,IJ,IER
 90    CHARACTER(len=100) :: CFILE
 91    INTEGER            :: NIOZO,NJOZO,NKOZO
 92    INTEGER, EXTERNAL  :: FNOM,FSTOUV,FSTLIR,FSTFRM,FCLOS,NEWDATE
 93    integer            :: IOZTEST
 94    integer            :: iv1,iv2,iv3,iv4,iv5,iv6
 95
 96    ier = newdate(datestamp,ijour,itime,-3)
 97
 98    IJ= IJOUR/100
 99    IMONTH = IJ - (IJ/100)*100
100
101    ioztest=0
102
103    CFILE='ozoneclim98'
104    IV1=FNOM(IOZTEST,CFILE,'RND+R/O',0)
105    IV2=FSTOUV(IOZTEST,'RND')
106    IV3=FSTLIR(FOZO_r4,IOZTEST,NIOZO,NJOZO,NKOZO,-1,' ',-1,-1,IMONTH,' ','O3')
107    IV4=FSTLIR(TOTOZO_r4,IOZTEST,NIOZO,NJOZO,NKOZO,-1,' ',-1,-1,-1,' ','TO')
108    IV5=FSTFRM(IOZTEST)
109    IV6=FCLOS(IOZTEST)
110
111    if(iv1.lt.0.or.iv2.lt.0.or.iv3.lt.0.or.iv4.lt.0.or.iv5.lt.0.or.iv6.lt.0) then
112       write(*,*) 'LES IV DE OZO_READ_CLIMATOLOGY ',iv1,iv2,iv3,iv4,iv5,iv6
113       write(*,*) 'THESE NUMBERS SHOULD NOT BE NEGATIVE'
114       write(*,*) 'datestamp,ijour,itime,imonth = ',datestamp,ijour,itime,imonth
115       call utl_abort('Problem with file in ozo_read_climatology (ozoneclim_mod)')
116    endif
117
118    if (present(nlat_opt)) then
119       nlat_opt=NLATO3
120       nlev_opt=NLEVO3
121       allocate(press_opt(nlevo3),ozone_opt(nlato3,nlevo3))
122       press_opt(1:nlevo3)=PO3(1:nlevo3)
123       ozone_opt(1:nlato3,1:nlevo3)=FOZO_r4(1:nlato3,1:nlevo3)
124    endif
125    
126  end subroutine OZO_READ_CLIMATOLOGY
127
128end module ozoneClim_mod