Changeset 3243


Ignore:
Timestamp:
Feb 28, 2024, 6:55:38 PM (9 months ago)
Author:
afalco
Message:

Pluto PCM:
Get rid of real_area (should use cell_area probably)
AF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3241 r3243  
    1616      use write_field_phy, only: Writefield_phy
    1717!!
     18      use ieee_arithmetic
    1819      use ioipsl_getin_p_mod, only: getin_p
    1920      use radinc_h, only : L_NSPECTI,L_NSPECTV,naerkind, corrkdir, banddir
     
    2930      use comsaison_h, only: mu0, fract, dist_star, declin, right_ascen
    3031      use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat
    31       use geometry_mod, only: latitude, longitude, cell_area, real_area
     32      use geometry_mod, only: latitude, longitude, cell_area
    3233      USE comgeomfi_h, only: totarea, totarea_planet
    3334      USE tracer_h, only: noms, mmol, radius, rho_q, qext, &
     
    5556                              n2cond,nearn2cond,noseason_day,conservn2, &
    5657                              kbo,triton,paleo,paleoyears, &
    57                               fast, carbox, methane, UseVdifcPlutold, &
     58                              carbox, methane, UseVdifcPlutold, &
    5859                              aerohaze,haze_proffix,source_haze, &
    5960                              season, sedimentation,generic_condensation, &
     
    286287      REAL flusurf(ngrid,nq)     ! flux cond/sub kg.m-2.s-1
    287288      REAL flusurfold(ngrid,nq)  ! old flux cond/sub kg.m-2.s-1
     289      REAL zplev(ngrid,nlayer+1),zplay(ngrid,nlayer)
    288290
    289291
     
    842844! II. Compute radiative tendencies
    843845!---------------------------------
     846!     Saving qsurf to compute paleo flux condensation/sublimation
     847      DO iq=1, nq
     848         DO ig=1,ngrid
     849             IF (qsurf(ig,iq).lt.0.) then
     850                qsurf(ig,iq)=0.
     851             ENDIF
     852             qsurf1(ig,iq)=qsurf(ig,iq)
     853         ENDDO
     854      ENDDO
     855
    844856
    845857      ! Compute local stellar zenith angles
     
    16531665      ps(1:ngrid) = pplev(1:ngrid,1) + pdpsrf(1:ngrid)*ptimestep
    16541666
     1667      ! pressure density !pluto specific
     1668      IF (.not.fast) then !
     1669         do ig=1,ngrid
     1670            do l=1,nlayer
     1671               zplev(ig,l)=pplev(ig,l)/pplev(ig,1)*ps(ig)
     1672               zplay(ig,l)=pplay(ig,l)/pplev(ig,1)*ps(ig)
     1673               rho(ig,l) = zplay(ig,l)/(r*zt(ig,l))
     1674            enddo
     1675            zplev(ig,nlayer+1)=pplev(ig,nlayer+1)/pplev(ig,1)*ps(ig)
     1676         enddo
     1677      ENDIF
     1678
    16551679
    16561680      ! Surface and soil temperature information
     
    17951819         ENDIF
    17961820       endif
    1797  
     1821
    17981822       if (carbox) then
    17991823         IF (fast) then
     
    18141838         ENDIF
    18151839       endif
    1816  
     1840
    18171841       zrho_haze(:,:)=0.
    18181842       zdqrho_photprec(:,:)=0.
     
    18251849         ENDDO
    18261850       ENDIF
    1827  
     1851
    18281852       IF (fasthaze) then
    18291853        DO ig=1,ngrid
     
    18321856        ENDDO
    18331857       ENDIF
    1834  
     1858
    18351859 !     Info about Ls, declin...
    18361860       IF (fast) THEN
     
    18431867         if (is_master) write(*,*),'Ls=',zls*180./pi,'decli=',declin*180./pi,'zday=',zday
    18441868       ENDIF
    1845  
     1869
    18461870       lecttsoil=0 ! default value for lecttsoil
    18471871       call getin_p("lecttsoil",lecttsoil)
     
    18541878          CLOSE(13)
    18551879       ENDIF
    1856  
    1857  
     1880
     1881
    18581882      if (is_master) print*,'--> Ls =',zls*180./pi
    18591883
     
    18931917
    18941918               ! special case if we sublime the entire reservoir
    1895                 IF (-qsurfyear(ig,iq).gt.qsurf(ig,iq)) THEN
    1896                   masslost(iq)=masslost(iq)+real_area(ig)*   &
    1897                         (-qsurfyear(ig,iq)-qsurf(ig,iq))
    1898                   qsurfyear(ig,iq)=-qsurf(ig,iq)
    1899                 ENDIF
    1900 
    1901                 IF (qsurfyear(ig,iq).gt.0.) THEN
    1902                   massacc(iq)=massacc(iq)+real_area(ig)*qsurfyear(ig,iq)
    1903                 ENDIF
     1919               !! AF: TODO : fix following lines (real_area), using line below:
     1920            ! call planetwide_sumval((-qsurfyear(:,iq)-qsurf(:,iq))*cell_area(:),masslost)
     1921
     1922               !  IF (-qsurfyear(ig,iq).gt.qsurf(ig,iq)) THEN
     1923               !    masslost(iq)=masslost(iq)+real_area(ig)*   &
     1924               !          (-qsurfyear(ig,iq)-qsurf(ig,iq))
     1925               !    qsurfyear(ig,iq)=-qsurf(ig,iq)
     1926               !  ENDIF
     1927
     1928               !  IF (qsurfyear(ig,iq).gt.0.) THEN
     1929               !    massacc(iq)=massacc(iq)+real_area(ig)*qsurfyear(ig,iq)
     1930               !  ENDIF
     1931
    19041932
    19051933               ENDDO
     
    20682096
    20692097      !! Pluto outputs
    2070       call writediagfi(ngrid,"rice_ch4","ch4 ice mass mean radius","m",3,rice_ch4)
     2098      ! call writediagfi(ngrid,"rice_ch4","ch4 ice mass mean radius","m",3,rice_ch4)
    20712099      call writediagfi(ngrid,"dist_star","dist_star","AU",0,dist_star)
    20722100
     
    20752103         !AF: TODO which outputs?
    20762104      else
     2105         if (check_physics_outputs) then
     2106            ! Check the validity of updated fields at the end of the physics step
     2107            call check_physics_fields("HERE physiq:", zt, zu, zv, pplev, zq)
     2108         endif
     2109
    20772110       call writediagfi(ngrid,"temp","temperature","K",3,zt)
    20782111       call writediagfi(ngrid,"teta","potential temperature","K",3,zh)
     
    22292262               call writediagfi(ngrid,"zrho_ch4","zrho_ch4","kg.m-3",3,zrho_ch4(:,:))
    22302263            endif
    2231    
     2264
    22322265             ! Tendancies
    22332266             call writediagfi(ngrid,"zdqch4cloud","ch4 cloud","T s-1",&
     
    22412274             call writediagfi(ngrid,"zdqadj_ch4","zdqadj ch4","",&
    22422275                            3,zdqadj(:,:,igcm_ch4_gas))
    2243              call writediagfi(ngrid,"zdqsed_ch4","zdqsed ch4","",&
    2244                             3,zdqsed(:,:,igcm_ch4_gas))
    2245              call writediagfi(ngrid,"zdqssed_ch4","zdqssed ch4","",&
    2246                             2,zdqssed(:,igcm_ch4_gas))
    2247             call writediagfi(ngrid,"zdtch4cloud","ch4 cloud","T s-1",&
     2276             if (sedimentation) then
     2277               call writediagfi(ngrid,"zdqsed_ch4","zdqsed ch4","",&
     2278                              3,zdqsed(:,:,igcm_ch4_gas))
     2279               call writediagfi(ngrid,"zdqssed_ch4","zdqssed ch4","",&
     2280                              2,zdqssed(:,igcm_ch4_gas))
     2281             endif
     2282             if (metcloud) then
     2283               call writediagfi(ngrid,"zdtch4cloud","ch4 cloud","T s-1",&
    22482284                           3,zdtch4cloud)
    2249    
    2250          endif
    2251    
     2285             endif
     2286
     2287         endif
     2288
    22522289         if (carbox) then
    22532290            call writediagfi(ngrid,'co_iceflux','co_iceflux',&
     
    22582295            endif
    22592296         endif
    2260    
     2297
    22612298         if (haze) then
    22622299   !         call writediagfi(ngrid,"zrho_haze","zrho_haze","kg.m-3",3,zrho_haze(:,:))
     
    22702307                     3,zdqhaze(:,:,igcm_prec_haze))
    22712308            if (igcm_haze.ne.0) then
    2272             call writediagfi(ngrid,"zdqhaze_haze","zdqhaze_haze","",&
    2273                      3,zdqhaze(:,:,igcm_haze))
    2274             call writediagfi(ngrid,"zdqssed_haze","zdqssed haze",&
    2275                   "kg/m2/s",2,zdqssed(:,igcm_haze))
     2309               call writediagfi(ngrid,"zdqhaze_haze","zdqhaze_haze","",&
     2310                        3,zdqhaze(:,:,igcm_haze))
     2311               if (sedimentation) then
     2312                  call writediagfi(ngrid,"zdqssed_haze","zdqssed haze",&
     2313                     "kg/m2/s",2,zdqssed(:,igcm_haze))
     2314               endif
    22762315            endif
    22772316            call writediagfi(ngrid,"zdqphot_ch4","zdqphot_ch4","",&
     
    22822321   !     &                   2,zdqhaze_col(:))
    22832322         endif
    2284    
     2323
    22852324         if (aerohaze) then
    22862325            call writediagfi(ngrid,"tau_col",&
Note: See TracChangeset for help on using the changeset viewer.