Changeset 1429 for trunk/LMDZ.GENERIC


Ignore:
Timestamp:
May 22, 2015, 3:28:56 PM (10 years ago)
Author:
msylvestre
Message:

Some computations relative to the rings' shadow have been moved from physiq.f90 to call_rings.f90

Location:
trunk/LMDZ.GENERIC/libf/phystd
Files:
1 added
1 edited

Legend:

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

    r1397 r1429  
    1111      use watercommon_h, only : RLVTT, Psat_water,epsi
    1212      use gases_h, only: gnom, gfrac
    13       use radcommon_h, only: sigma, eclipse, glat, grav
     13      use radcommon_h, only: sigma, glat, grav
    1414      use radii_mod, only: h2o_reffrad, co2_reffrad
    1515      use aerosol_mod, only: iaero_co2, iaero_h2o
     
    441441!$OMP THREADPRIVATE(ice_initial,ice_min,ice_update)
    442442
    443 !     included by MS to compute the daily average of rings shadowing
    444       integer, parameter :: nb_hours = 1536 ! set how many times per day are used
    445       real :: pas
    446       integer :: m
    447       ! temporary variables computed at each step of this average
    448       real :: ptime_day ! Universal time in sol fraction
    449       real :: tmp_zls,tmp_dist_star, tmp_declin, tmp_right_ascen   ! tmp solar longitude, stellar dist, declin and RA
    450       real, dimension(:), allocatable :: tmp_fract ! day fraction of the time interval
    451       real, dimension(:), allocatable :: tmp_mu0 ! equivalent solar angle
    452 
    453443!     included by BC for slab ocean
    454444      real, dimension(:),allocatable,save ::  pctsrf_sic
     
    526516           
    527517         !! this is defined in radcommon_h
    528          ALLOCATE(eclipse(ngrid))
    529518         ALLOCATE(glat(ngrid))
    530519
     
    873862           
    874863           !! Eclipse incoming sunlight (e.g. Saturn ring shadowing)
    875 
    876            if(rings_shadow) then
    877                 write(*,*) 'Rings shadow activated'
    878                 if(diurnal .eqv. .false.) then ! we need to compute the daily average insolation
    879                     pas = 1./nb_hours
    880                     ptime_day = 0.
    881                     fract(:) = 0.
    882                     ALLOCATE(tmp_fract(ngrid))
    883                     ALLOCATE(tmp_mu0(ngrid))
    884                     tmp_fract(:) = 0.
    885                     eclipse(:) = 0.
    886                     tmp_mu0(:) = 0.
    887                    
    888                     do m=1, nb_hours
    889                         ptime_day = m*pas
    890                         call stellarlong(pday+ptime_day,tmp_zls)
    891                         call orbite(tmp_zls,tmp_dist_star,tmp_declin,tmp_right_ascen)
    892                         ztim1=SIN(tmp_declin)
    893                         ztim2=COS(tmp_declin)*COS(2.*pi*(pday+ptime_day-.5))
    894                         ztim3=-COS(tmp_declin)*SIN(2.*pi*(pday+ptime_day-.5))
    895 
    896                  
    897                         call stelang(ngrid,sinlon,coslon,sinlat,coslat,    &
    898                                  ztim1,ztim2,ztim3,tmp_mu0,tmp_fract, flatten)
    899                  
    900                         call rings(ngrid, tmp_declin, ptime_day, rad, flatten, eclipse)
    901                  
    902                         fract(:) = fract(:) + (1.-eclipse(:))*tmp_fract(:) !! fract prend en compte l'ombre des anneaux et l'alternance jour/nuit
    903                     enddo
    904                
    905                     DEALLOCATE(tmp_fract)
    906                     DEALLOCATE(tmp_mu0)
    907            
    908                     fract(:) = fract(:)/nb_hours
    909                  
    910                  else   
    911                     call rings(ngrid, declin, ptime, rad, 0., eclipse)
    912                     fract(:) = fract(:) * (1.-eclipse)
    913                  endif
    914             else
    915                  eclipse(:) = 0.0
    916             endif
     864       
     865            if(rings_shadow) then
     866                call call_rings(ngrid, ptime, pday, diurnal)
     867            endif   
     868
    917869
    918870           if (corrk) then
     
    934886     
    935887!             standard callcorrk
    936 
    937 
    938 
    939888
    940889              if(ok_slab_ocean) then
     
    22742223        !! this is defined in comsaison_h
    22752224        IF ( ALLOCATED(mu0)) DEALLOCATE(mu0)
    2276 
    22772225        IF ( ALLOCATED(fract)) DEALLOCATE(fract)
    2278 
    2279 
    2280         !! this is defined in radcommon_h
    2281         IF ( ALLOCATED(eclipse)) DEALLOCATE(eclipse)
    22822226
    22832227        !! this is defined in comsoil_h
Note: See TracChangeset for help on using the changeset viewer.