Changeset 804


Ignore:
Timestamp:
Oct 10, 2012, 12:19:55 PM (12 years ago)
Author:
lkerber
Message:

A bug was found in gfluxi.F. If co2_ice was the only aerosol, the single scattering albedo was occasionally equal to 1. This led to NaNs? in gfluxi.F because we divide by a (1-W0) statement. Now there is a test in gfluxi.F which puts any W0=1 to W0=99999. This change removed the necessity in aeropacity.F90 for aerosols which are supposed to be zero to be put at 1.E-9 (they are now set to zero). In the case of zero aerosols, a dummy co2 aerosol is created and set to zero abundance everywhere. An obsolete test was removed from inifis.F. Some extraneous print statements were removed from physiq.F90.

Location:
trunk/LMDZ.GENERIC/libf/phystd
Files:
5 edited

Legend:

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

    r787 r804  
    137137            aerosol(1:ngrid,1:nlayermx,iaer)=0.0
    138138!       2. Opacity calculation
    139             if (noaero) then ! aerosol set to a very low value
    140              aerosol(1:ngrid,1:nlayermx,iaer)=1.e-9
     139            if (noaero) then ! aerosol set to zero
     140             aerosol(1:ngrid,1:nlayermx,iaer)=0.0
    141141            elseif (aerofixco2.or.(i_co2ice.eq.0)) then !  CO2 ice cloud prescribed
    142142               aerosol(1:ngrid,1:nlayermx,iaer)=1.e-9
  • trunk/LMDZ.GENERIC/libf/phystd/gfluxi.F

    r543 r804  
    6767
    6868      DO L=1,L_NLAYRAD-1
     69
     70!----------------------------------------------------
     71! There is a problem when W0 = 1
     72!         open(888,file='W0')
     73!           if ((W0(L).eq.0.).or.(W0(L).eq.1.)) then
     74!             write(888,*) W0(L), L, 'gfluxi'
     75!           endif
     76! Prevent this with an if statement:
     77        if (W0(L).eq.1.) then
     78           W0(L) = 0.99999
     79        endif
     80!----------------------------------------------------
     81
    6982        ALPHA(L) = SQRT( (1.0-W0(L))/(1.0-W0(L)*COSBAR(L)) )
    7083        LAMDA(L) = ALPHA(L)*(1.0-W0(L)*COSBAR(L))/UBARI
     
    8295
    8396      L        = L_NLAYRAD
     97
     98      if (W0(L).eq.1.) then
     99          W0(L) = 0.99999
     100      end if
     101
    84102      ALPHA(L) = SQRT( (1.0-W0(L))/(1.0-W0(L)*COSBAR(L)) )
    85103      LAMDA(L) = ALPHA(L)*(1.0-W0(L)*COSBAR(L))/UBARI
  • trunk/LMDZ.GENERIC/libf/phystd/inifis.F

    r787 r804  
    449449         call getin("satval",satval)
    450450         write(*,*)" satval = ",satval
    451 
    452 ! Test of incompatibility:
    453 ! if no tracers, then the variable aerosols should be turned off
    454          if ((.not.tracer).and.(.not.aerofixco2)) then
    455            print*,'if tracers are off, you must turn aerofixco2 on.'
    456            print*, '(i.e., you must fix the aerosol distribution)'
    457            print*, 'This option was formerly known as aerofixed'
    458            stop
    459          endif
    460          if ((.not.tracer).and.(.not.aerofixh2o)) then
    461            print*,'if tracers are off, you must turn aerofixh2o on.'
    462            print*, '(i.e., you must fix the aerosol distribution)'
    463            print*, 'This option was formerly known as aerofixed'
    464            stop
    465          endif
    466451
    467452
  • trunk/LMDZ.GENERIC/libf/phystd/physiq.F90

    r787 r804  
    451451      if (firstcall) then
    452452
    453          print*,'FIRSTCALL INITIALIZATION'
    454 
    455453         !! this is defined in comsaison_h
    456454         ALLOCATE(mu0(ngrid))
     
    598596                            ! need epsi for the wvp definitions in callcorrk.F
    599597
    600          print*,'end FIRSTCALL INITIALIZATION'
    601 
    602598      endif        !  (end of "if firstcall")
    603599
     
    605601! 1.2   Initializations done at every physical timestep:
    606602! ---------------------------------------------------
    607 
    608       print*,'ALL INITIALIZATION'
    609603
    610604!     Initialize various variables
     
    660654         enddo
    661655      enddo
    662 
    663       print*,'end ALL INITIALIZATION'
    664656
    665657!-----------------------------------------------------------------------
     
    828820!-------------------------
    829821
    830       print*,'end RADIATIVE TRANSFER'
    831822      endif ! of if (callrad)
    832823
     
    996987         !-------------------------
    997988         
    998       print*,'end CONVADJ'
    999989      endif ! of if(calladj)
    1000990
     
    1008998            call abort
    1009999         endif
    1010      print*, 'we are in co2cond!!!!!'
    10111000         call condense_cloud(ngrid,nlayer,nq,ptimestep,   &
    10121001              capcal,pplay,pplev,tsurf,pt,                  &
  • trunk/LMDZ.GENERIC/libf/phystd/suaer_corrk.F90

    r726 r804  
    101101!     Please also choose the reference wavelengths of each aerosol
    102102
     103      if (noaero) then
     104        print*, 'naerkind= 0'
     105      endif
    103106      do iaer=1,naerkind
    104        if (iaer.eq.iaero_co2)then
     107       if (iaer.eq.iaero_co2) then
    105108        forgetit=.true.
    106         print*, 'naerkind= co2', iaer
    107 
     109          if (.not.noaero) then
     110              print*, 'naerkind= co2', iaer
     111          end if
    108112!     visible
    109113        if(forgetit)then
Note: See TracChangeset for help on using the changeset viewer.