[135] | 1 | SUBROUTINE callsedim(ngrid,nlay, ptimestep, |
---|
[858] | 2 | & pplev,zlev, pt, pdt, |
---|
| 3 | & pq, pdqfi, pdqsed,pdqs_sed,nq) |
---|
[787] | 4 | |
---|
[858] | 5 | use radinc_h, only : naerkind |
---|
| 6 | use radii_mod, only: h2o_reffrad |
---|
| 7 | use aerosol_mod, only : iaero_h2o |
---|
| 8 | USE tracer_h, only : igcm_co2_ice,igcm_h2o_ice,radius,rho_q |
---|
[1384] | 9 | use comcstfi_mod, only: g |
---|
[1397] | 10 | use callkeys_mod, only : water |
---|
[787] | 11 | |
---|
[135] | 12 | IMPLICIT NONE |
---|
| 13 | |
---|
| 14 | !================================================================== |
---|
| 15 | ! |
---|
| 16 | ! Purpose |
---|
| 17 | ! ------- |
---|
| 18 | ! Calculates sedimentation of aerosols depending on their |
---|
| 19 | ! density and radius. |
---|
| 20 | ! |
---|
| 21 | ! Authors |
---|
| 22 | ! ------- |
---|
| 23 | ! F. Forget (1999) |
---|
| 24 | ! Tracer generalisation by E. Millour (2009) |
---|
| 25 | ! |
---|
| 26 | !================================================================== |
---|
| 27 | |
---|
| 28 | c----------------------------------------------------------------------- |
---|
| 29 | c declarations: |
---|
| 30 | c ------------- |
---|
| 31 | |
---|
| 32 | c arguments: |
---|
| 33 | c ---------- |
---|
| 34 | |
---|
[858] | 35 | integer,intent(in):: ngrid ! number of horizontal grid points |
---|
| 36 | integer,intent(in):: nlay ! number of atmospheric layers |
---|
| 37 | real,intent(in):: ptimestep ! physics time step (s) |
---|
| 38 | real,intent(in):: pplev(ngrid,nlay+1) ! pressure at inter-layers (Pa) |
---|
| 39 | real,intent(in):: pt(ngrid,nlay) ! temperature at mid-layer (K) |
---|
| 40 | real,intent(in):: pdt(ngrid,nlay) ! tendency on temperature |
---|
| 41 | real,intent(in):: zlev(ngrid,nlay+1) ! altitude at layer boundaries |
---|
| 42 | integer,intent(in) :: nq ! number of tracers |
---|
| 43 | real,intent(in) :: pq(ngrid,nlay,nq) ! tracers (kg/kg) |
---|
| 44 | real,intent(in) :: pdqfi(ngrid,nlay,nq) ! tendency on tracers before |
---|
| 45 | ! sedimentation (kg/kg.s-1) |
---|
[135] | 46 | |
---|
[858] | 47 | real,intent(out) :: pdqsed(ngrid,nlay,nq) ! tendency due to sedimentation (kg/kg.s-1) |
---|
| 48 | real,intent(out) :: pdqs_sed(ngrid,nq) ! flux at surface (kg.m-2.s-1) |
---|
| 49 | |
---|
[135] | 50 | c local: |
---|
| 51 | c ------ |
---|
| 52 | |
---|
| 53 | INTEGER l,ig, iq |
---|
| 54 | |
---|
[858] | 55 | ! for particles with varying radii: |
---|
| 56 | real reffrad(ngrid,nlay,naerkind) ! particle radius (m) |
---|
| 57 | real nueffrad(ngrid,nlay,naerkind) ! aerosol effective radius variance |
---|
| 58 | |
---|
| 59 | real zqi(ngrid,nlay,nq) ! to locally store tracers |
---|
| 60 | real zt(ngrid,nlay) ! to locally store temperature (K) |
---|
| 61 | real masse (ngrid,nlay) ! Layer mass (kg.m-2) |
---|
| 62 | real epaisseur (ngrid,nlay) ! Layer thickness (m) |
---|
| 63 | real wq(ngrid,nlay+1) ! displaced tracer mass (kg.m-2) |
---|
[1308] | 64 | c real dens(ngrid,nlay) ! Mean density of the ice part. accounting for dust core |
---|
[135] | 65 | |
---|
| 66 | |
---|
[858] | 67 | LOGICAL,SAVE :: firstcall=.true. |
---|
[1315] | 68 | !$OMP THREADPRIVATE(firstcall) |
---|
[135] | 69 | |
---|
| 70 | c ** un petit test de coherence |
---|
| 71 | c -------------------------- |
---|
| 72 | |
---|
| 73 | IF (firstcall) THEN |
---|
| 74 | firstcall=.false. |
---|
[1006] | 75 | ! add some tests on presence of required tracers/aerosols: |
---|
| 76 | if (water) then |
---|
| 77 | if (igcm_h2o_ice.eq.0) then |
---|
| 78 | write(*,*) "callsedim error: water=.true.", |
---|
| 79 | & " but igcm_h2o_ice=0" |
---|
| 80 | stop |
---|
| 81 | endif |
---|
| 82 | if (iaero_h2o.eq.0) then |
---|
| 83 | write(*,*) "callsedim error: water=.true.", |
---|
| 84 | & " but iaero_ho2=0" |
---|
| 85 | stop |
---|
| 86 | endif |
---|
| 87 | endif |
---|
[135] | 88 | ENDIF ! of IF (firstcall) |
---|
[486] | 89 | |
---|
[135] | 90 | !======================================================================= |
---|
| 91 | ! Preliminary calculation of the layer characteristics |
---|
| 92 | ! (mass (kg.m-2), thickness (m), etc. |
---|
| 93 | |
---|
| 94 | do l=1,nlay |
---|
| 95 | do ig=1, ngrid |
---|
| 96 | masse(ig,l)=(pplev(ig,l) - pplev(ig,l+1)) /g |
---|
| 97 | epaisseur(ig,l)= zlev(ig,l+1) - zlev(ig,l) |
---|
[858] | 98 | zt(ig,l)=pt(ig,l)+pdt(ig,l)*ptimestep |
---|
[135] | 99 | end do |
---|
| 100 | end do |
---|
| 101 | |
---|
[486] | 102 | !====================================================================== |
---|
| 103 | ! Calculate the transport due to sedimentation for each tracer |
---|
| 104 | ! [This has been rearranged by L. Kerber to allow the sedimentation |
---|
| 105 | ! of general tracers.] |
---|
| 106 | |
---|
| 107 | do iq=1,nq |
---|
[1764] | 108 | if((radius(iq).gt.1.e-9).and.(iq.ne.igcm_co2_ice)) then ! JVO 08/2017 : be careful radius was tested uninitialized (fixed) ... |
---|
| 109 | |
---|
[1477] | 110 | ! (no sedim for gases, and co2_ice sedim is done in condense_co2) |
---|
[135] | 111 | |
---|
[486] | 112 | ! store locally updated tracers |
---|
[135] | 113 | |
---|
[486] | 114 | do l=1,nlay |
---|
[787] | 115 | do ig=1, ngrid |
---|
[486] | 116 | zqi(ig,l,iq)=pq(ig,l,iq)+pdqfi(ig,l,iq)*ptimestep |
---|
[135] | 117 | enddo |
---|
| 118 | enddo ! of do l=1,nlay |
---|
[486] | 119 | |
---|
| 120 | !====================================================================== |
---|
| 121 | ! Sedimentation |
---|
| 122 | !====================================================================== |
---|
| 123 | ! Water |
---|
| 124 | if (water.and.(iq.eq.igcm_h2o_ice)) then |
---|
[858] | 125 | ! compute radii for h2o_ice |
---|
[1308] | 126 | call h2o_reffrad(ngrid,nlay,zqi(1,1,igcm_h2o_ice),zt, |
---|
[858] | 127 | & reffrad(1,1,iaero_h2o),nueffrad(1,1,iaero_h2o)) |
---|
| 128 | ! call sedimentation for h2o_ice |
---|
[486] | 129 | call newsedim(ngrid,nlay,ngrid*nlay,ptimestep, |
---|
[858] | 130 | & pplev,masse,epaisseur,zt,reffrad(1,1,iaero_h2o), |
---|
| 131 | & rho_q(iq),zqi(1,1,igcm_h2o_ice),wq) |
---|
[135] | 132 | |
---|
[486] | 133 | ! General Case |
---|
| 134 | else |
---|
| 135 | call newsedim(ngrid,nlay,1,ptimestep, |
---|
[858] | 136 | & pplev,masse,epaisseur,zt,radius(iq),rho_q(iq), |
---|
| 137 | & zqi(1,1,iq),wq) |
---|
[486] | 138 | endif |
---|
[253] | 139 | |
---|
[135] | 140 | !======================================================================= |
---|
| 141 | ! Calculate the tendencies |
---|
[486] | 142 | !====================================================================== |
---|
[135] | 143 | |
---|
[787] | 144 | do ig=1,ngrid |
---|
[135] | 145 | ! Ehouarn: with new way of tracking tracers by name, this is simply |
---|
[486] | 146 | pdqs_sed(ig,iq) = wq(ig,1)/ptimestep |
---|
[135] | 147 | end do |
---|
| 148 | |
---|
| 149 | DO l = 1, nlay |
---|
| 150 | DO ig=1,ngrid |
---|
[486] | 151 | pdqsed(ig,l,iq)=(zqi(ig,l,iq)- |
---|
| 152 | & (pq(ig,l,iq) + pdqfi(ig,l,iq)*ptimestep))/ptimestep |
---|
[135] | 153 | ENDDO |
---|
| 154 | ENDDO |
---|
[486] | 155 | endif ! of no gases no co2_ice |
---|
| 156 | enddo ! of do iq=1,nq |
---|
[253] | 157 | return |
---|
| 158 | end |
---|