Ignore:
Timestamp:
Jul 29, 2024, 11:01:04 PM (3 months ago)
Author:
abarral
Message:

Put YOMCST.h into modules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt.F90

    r5111 r5144  
    1 
    21! $Id$
    32
    43SUBROUTINE aeropt(pplay, paprs, t_seri, msulfate, rhcl, tau_ae, piz_ae, &
    5     cg_ae, ai)
     4        cg_ae, ai)
    65
    76  USE dimphy
    87  USE lmdz_abort_physic, ONLY: abort_physic
     8  USE lmdz_yomcst
     9
    910  IMPLICIT NONE
    10 
    11 
    12 
    13   include "YOMCST.h"
    1411
    1512  ! Arguments:
    1613
    17   REAL, INTENT (IN) :: paprs(klon, klev+1)
     14  REAL, INTENT (IN) :: paprs(klon, klev + 1)
    1815  REAL, INTENT (IN) :: pplay(klon, klev), t_seri(klon, klev)
    1916  REAL, INTENT (IN) :: msulfate(klon, klev) ! masse sulfate ug SO4/m3  [ug/m^3]
     
    2825  INTEGER i, k, inu
    2926  INTEGER rh_num, nbre_rh
    30   PARAMETER (nbre_rh=12)
     27  PARAMETER (nbre_rh = 12)
    3128  REAL rh_tab(nbre_rh)
    3229  REAL rh_max, delta, rh
    33   PARAMETER (rh_max=95.)
     30  PARAMETER (rh_max = 95.)
    3431  DATA rh_tab/0., 10., 20., 30., 40., 50., 60., 70., 80., 85., 90., 95./
    3532  REAL zrho, zdz
     
    3936  REAL alphasulfate
    4037
    41   CHARACTER (LEN=20) :: modname = 'aeropt'
    42   CHARACTER (LEN=80) :: abort_message
     38  CHARACTER (LEN = 20) :: modname = 'aeropt'
     39  CHARACTER (LEN = 80) :: abort_message
    4340
    4441
     
    4845  REAL cg_aer(nbre_rh, 2)
    4946  DATA alpha_aer/.500130E+01, .500130E+01, .500130E+01, .500130E+01, &
    50     .500130E+01, .616710E+01, .826850E+01, .107687E+02, .136976E+02, &
    51     .162972E+02, .211690E+02, .354833E+02, .139460E+01, .139460E+01, &
    52     .139460E+01, .139460E+01, .139460E+01, .173910E+01, .244380E+01, &
    53     .332320E+01, .440120E+01, .539570E+01, .734580E+01, .136038E+02/
     47          .500130E+01, .616710E+01, .826850E+01, .107687E+02, .136976E+02, &
     48          .162972E+02, .211690E+02, .354833E+02, .139460E+01, .139460E+01, &
     49          .139460E+01, .139460E+01, .139460E+01, .173910E+01, .244380E+01, &
     50          .332320E+01, .440120E+01, .539570E+01, .734580E+01, .136038E+02/
    5451  DATA cg_aer/.619800E+00, .619800E+00, .619800E+00, .619800E+00, &
    55     .619800E+00, .662700E+00, .682100E+00, .698500E+00, .712500E+00, &
    56     .721800E+00, .734600E+00, .755800E+00, .545600E+00, .545600E+00, &
    57     .545600E+00, .545600E+00, .545600E+00, .583700E+00, .607100E+00, &
    58     .627700E+00, .645800E+00, .658400E+00, .676500E+00, .708500E+00/
     52          .619800E+00, .662700E+00, .682100E+00, .698500E+00, .712500E+00, &
     53          .721800E+00, .734600E+00, .755800E+00, .545600E+00, .545600E+00, &
     54          .545600E+00, .545600E+00, .545600E+00, .583700E+00, .607100E+00, &
     55          .627700E+00, .645800E+00, .658400E+00, .676500E+00, .708500E+00/
    5956  DATA alpha_aer_sulfate/4.910, 4.910, 4.910, 4.910, 6.547, 7.373, 8.373, &
    60     9.788, 12.167, 14.256, 17.924, 28.433, 1.453, 1.453, 1.453, 1.453, 2.003, &
    61     2.321, 2.711, 3.282, 4.287, 5.210, 6.914, 12.305, 4.308, 4.308, 4.308, &
    62     4.308, 5.753, 6.521, 7.449, 8.772, 11.014, 12.999, 16.518, 26.772, 3.265, &
    63     3.265, 3.265, 3.265, 4.388, 5.016, 5.775, 6.868, 8.745, 10.429, 13.457, &
    64     22.538, 2.116, 2.116, 2.116, 2.116, 2.882, 3.330, 3.876, 4.670, 6.059, &
    65     7.327, 9.650, 16.883/
     57          9.788, 12.167, 14.256, 17.924, 28.433, 1.453, 1.453, 1.453, 1.453, 2.003, &
     58          2.321, 2.711, 3.282, 4.287, 5.210, 6.914, 12.305, 4.308, 4.308, 4.308, &
     59          4.308, 5.753, 6.521, 7.449, 8.772, 11.014, 12.999, 16.518, 26.772, 3.265, &
     60          3.265, 3.265, 3.265, 4.388, 5.016, 5.775, 6.868, 8.745, 10.429, 13.457, &
     61          22.538, 2.116, 2.116, 2.116, 2.116, 2.882, 3.330, 3.876, 4.670, 6.059, &
     62          7.327, 9.650, 16.883/
    6663
    6764  DO i = 1, klon
     
    7269  DO k = 1, klev
    7370    DO i = 1, klon
    74       IF (t_seri(i,k)==0) WRITE (*, *) 'aeropt T ', i, k, t_seri(i, k)
    75       IF (pplay(i,k)==0) WRITE (*, *) 'aeropt p ', i, k, pplay(i, k)
    76       zrho = pplay(i, k)/t_seri(i, k)/rd ! kg/m3
    77       zdz = (paprs(i,k)-paprs(i,k+1))/zrho/rg ! m
    78       rh = min(rhcl(i,k)*100., rh_max)
    79       rh_num = int(rh/10.+1.)
     71      IF (t_seri(i, k)==0) WRITE (*, *) 'aeropt T ', i, k, t_seri(i, k)
     72      IF (pplay(i, k)==0) WRITE (*, *) 'aeropt p ', i, k, pplay(i, k)
     73      zrho = pplay(i, k) / t_seri(i, k) / rd ! kg/m3
     74      zdz = (paprs(i, k) - paprs(i, k + 1)) / zrho / rg ! m
     75      rh = min(rhcl(i, k) * 100., rh_max)
     76      rh_num = int(rh / 10. + 1.)
    8077      IF (rh<0.) THEN
    8178        abort_message = 'aeropt: RH < 0 not possible'
     
    8481      IF (rh>85.) rh_num = 10
    8582      IF (rh>90.) rh_num = 11
    86       delta = (rh-rh_tab(rh_num))/(rh_tab(rh_num+1)-rh_tab(rh_num))
     83      delta = (rh - rh_tab(rh_num)) / (rh_tab(rh_num + 1) - rh_tab(rh_num))
    8784
    8885      inu = 1
    89       tau_ae(i, k, inu) = alpha_aer(rh_num, inu) + delta*(alpha_aer(rh_num+1, &
    90         inu)-alpha_aer(rh_num,inu))
    91       tau_ae(i, k, inu) = tau_ae(i, k, inu)*msulfate(i, k)*zdz*1.E-6
     86      tau_ae(i, k, inu) = alpha_aer(rh_num, inu) + delta * (alpha_aer(rh_num + 1, &
     87              inu) - alpha_aer(rh_num, inu))
     88      tau_ae(i, k, inu) = tau_ae(i, k, inu) * msulfate(i, k) * zdz * 1.E-6
    9289      piz_ae(i, k, inu) = 1.0
    93       cg_ae(i, k, inu) = cg_aer(rh_num, inu) + delta*(cg_aer(rh_num+1,inu)- &
    94         cg_aer(rh_num,inu))
     90      cg_ae(i, k, inu) = cg_aer(rh_num, inu) + delta * (cg_aer(rh_num + 1, inu) - &
     91              cg_aer(rh_num, inu))
    9592
    9693      inu = 2
    97       tau_ae(i, k, inu) = alpha_aer(rh_num, inu) + delta*(alpha_aer(rh_num+1, &
    98         inu)-alpha_aer(rh_num,inu))
    99       tau_ae(i, k, inu) = tau_ae(i, k, inu)*msulfate(i, k)*zdz*1.E-6
     94      tau_ae(i, k, inu) = alpha_aer(rh_num, inu) + delta * (alpha_aer(rh_num + 1, &
     95              inu) - alpha_aer(rh_num, inu))
     96      tau_ae(i, k, inu) = tau_ae(i, k, inu) * msulfate(i, k) * zdz * 1.E-6
    10097      piz_ae(i, k, inu) = 1.0
    101       cg_ae(i, k, inu) = cg_aer(rh_num, inu) + delta*(cg_aer(rh_num+1,inu)- &
    102         cg_aer(rh_num,inu))
     98      cg_ae(i, k, inu) = cg_aer(rh_num, inu) + delta * (cg_aer(rh_num + 1, inu) - &
     99              cg_aer(rh_num, inu))
    103100      ! jq
    104101      ! jq for aerosol index
    105102
    106103      alphasulfate = alpha_aer_sulfate(rh_num, 4) + &
    107         delta*(alpha_aer_sulfate(rh_num+1,4)-alpha_aer_sulfate(rh_num,4)) !--m2/g
     104              delta * (alpha_aer_sulfate(rh_num + 1, 4) - alpha_aer_sulfate(rh_num, 4)) !--m2/g
    108105
    109       taue670(i) = taue670(i) + alphasulfate*msulfate(i, k)*zdz*1.E-6
     106      taue670(i) = taue670(i) + alphasulfate * msulfate(i, k) * zdz * 1.E-6
    110107
    111108      alphasulfate = alpha_aer_sulfate(rh_num, 5) + &
    112         delta*(alpha_aer_sulfate(rh_num+1,5)-alpha_aer_sulfate(rh_num,5)) !--m2/g
     109              delta * (alpha_aer_sulfate(rh_num + 1, 5) - alpha_aer_sulfate(rh_num, 5)) !--m2/g
    113110
    114       taue865(i) = taue865(i) + alphasulfate*msulfate(i, k)*zdz*1.E-6
     111      taue865(i) = taue865(i) + alphasulfate * msulfate(i, k) * zdz * 1.E-6
    115112
    116113    END DO
     
    118115
    119116  DO i = 1, klon
    120     ai(i) = (-log(max(taue670(i),0.0001)/max(taue865(i), &
    121       0.0001))/log(670./865.))*taue865(i)
     117    ai(i) = (-log(max(taue670(i), 0.0001) / max(taue865(i), &
     118            0.0001)) / log(670. / 865.)) * taue865(i)
    122119  END DO
    123120
    124 
    125121END SUBROUTINE aeropt
Note: See TracChangeset for help on using the changeset viewer.