Ignore:
Timestamp:
Jun 5, 2014, 12:34:37 PM (10 years ago)
Author:
emillour
Message:

Generic GCM:
Bug fixes:

  • hice() in physiq.F90 must be a saved array.
  • bad use of min/max on arrays in h2o_cloudrad (radii_mod.F90) which actually ended up setting all array elements to the same value.

And some cosmetic cleanup in rain.F90, vdif_kc.F and turbdiff.F90
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/radii_mod.F90

    r1026 r1283  
    3838      Implicit none
    3939
    40 #include "callkeys.h"
    41 #include "dimensions.h"
    42 #include "dimphys.h"
     40      include "callkeys.h"
     41      include "dimensions.h"
     42      include "dimphys.h"
    4343
    4444      integer,intent(in) :: ngrid
     
    140140      Implicit none
    141141
    142 #include "callkeys.h"
    143 #include "dimensions.h"
    144 #include "dimphys.h"
    145 #include "comcstfi.h"
     142      include "callkeys.h"
     143      include "dimensions.h"
     144      include "dimphys.h"
     145      include "comcstfi.h"
    146146
    147147      integer,intent(in) :: ngrid
     
    200200      Implicit none
    201201
    202 #include "callkeys.h"
    203 #include "dimensions.h"
    204 #include "dimphys.h"
    205 #include "comcstfi.h"
     202      include "callkeys.h"
     203      include "dimensions.h"
     204      include "dimphys.h"
     205      include "comcstfi.h"
    206206
    207207      integer,intent(in) :: ngrid
    208208
    209209      real, intent(in) :: pql(ngrid,nlayermx) !condensed water mixing ratios (kg/kg)
    210       real, intent(out) :: reffliq(ngrid,nlayermx),reffice(ngrid,nlayermx)     !liquid and ice water particle radii (K)
     210      real, intent(out) :: reffliq(ngrid,nlayermx),reffice(ngrid,nlayermx)     !liquid and ice water particle radii (m)
    211211
    212212      real,external :: CBRT           
    213      
     213      integer :: i,k
    214214
    215215      if (radfixed) then
     
    217217         reffice(1:ngrid,1:nlayermx)= rad_h2o_ice
    218218      else
    219          reffliq(1:ngrid,1:nlayermx)  = CBRT( 3*pql(1:ngrid,1:nlayermx)/(4*Nmix_h2o*pi*rhowater) )
    220          reffliq(1:ngrid,1:nlayermx)  = min(max(reffliq(1:ngrid,1:nlayermx),1.e-6),1000.e-6)
    221          reffice(1:ngrid,1:nlayermx)  = CBRT( 3*pql(1:ngrid,1:nlayermx)/(4*Nmix_h2o_ice*pi*rhowaterice) )
    222          reffice(1:ngrid,1:nlayermx)  = min(max(reffice(1:ngrid,1:nlayermx),1.e-6),1000.e-6)
    223       end if
     219         do k=1,nlayermx
     220           do i=1,ngrid
     221             reffliq(i,k) = CBRT(3*pql(i,k)/(4*Nmix_h2o*pi*rhowater))
     222             reffliq(i,k) = min(max(reffliq(i,k),1.e-6),1000.e-6)
     223           
     224             reffice(i,k) = CBRT(3*pql(i,k)/(4*Nmix_h2o_ice*pi*rhowaterice))
     225             reffice(i,k) = min(max(reffice(i,k),1.e-6),1000.e-6)
     226           enddo
     227         enddo
     228      endif
    224229
    225230   end subroutine h2o_cloudrad
     
    243248      Implicit none
    244249
    245 #include "callkeys.h"
    246 #include "dimensions.h"
    247 #include "dimphys.h"
    248 #include "comcstfi.h"
     250      include "callkeys.h"
     251      include "dimensions.h"
     252      include "dimphys.h"
     253      include "comcstfi.h"
    249254
    250255      integer,intent(in) :: ngrid,nq
     
    289294      Implicit none
    290295
    291 #include "callkeys.h"
    292 #include "dimensions.h"
    293 #include "dimphys.h"
     296      include "callkeys.h"
     297      include "dimensions.h"
     298      include "dimphys.h"
    294299
    295300      integer,intent(in) :: ngrid
     
    317322      Implicit none
    318323
    319 #include "callkeys.h"
    320 #include "dimensions.h"
    321 #include "dimphys.h"
     324      include "callkeys.h"
     325      include "dimensions.h"
     326      include "dimphys.h"
    322327
    323328      integer,intent(in) :: ngrid
     
    346351     Implicit none
    347352
    348 #include "callkeys.h"
    349 #include "dimensions.h"
    350 #include "dimphys.h"
     353     include "callkeys.h"
     354     include "dimensions.h"
     355     include "dimphys.h"
    351356
    352357      integer,intent(in) :: ngrid
Note: See TracChangeset for help on using the changeset viewer.