Ignore:
Timestamp:
Nov 21, 2025, 2:37:14 PM (4 weeks ago)
Author:
tbertrand
Message:

PLUTO PCM:
Cleaning and adding conservation tests
TB

File:
1 edited

Legend:

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

    r3965 r3971  
    285285      REAL flusurfold(ngrid,nq)  ! old flux cond/sub kg.m-2.s-1
    286286      REAL zplev(ngrid,nlayer+1),zplay(ngrid,nlayer)
     287      REAL vecnull(ngrid,nq)      ! null vector used to check conservation of tracer
    287288
    288289      REAL,SAVE :: ptime0    ! store the first time
     
    531532!        Variables set to 0
    532533!        ~~~~~~~~~~~~~~~~~~
     534         vecnull(:,:) = 0.0
    533535         dtrad(:,:) = 0.0
    534536         fluxrad(:) = 0.0
     
    11821184
    11831185      if (calldifv) then
    1184 
     1186         zdqdif(:,:,:)=0.
     1187         zdqsdif(:,:)=0.
    11851188         zflubid(1:ngrid)=fluxrad(1:ngrid)+fluxgrd(1:ngrid)
    11861189
     
    13611364         zdvadj(1:ngrid,1:nlayer)=0.0
    13621365         zdhadj(1:ngrid,1:nlayer)=0.0
    1363 
     1366         zdqadj(1:ngrid,1:nlayer,1:nq)=0.0
    13641367
    13651368         call convadj(ngrid,nlayer,nq,ptimestep,            &
     
    13851388         endif
    13861389
    1387          ! ! Test water conservation !AF24: removed
     1390         ! Test tracer conservation
     1391         if (methane.and.conservch4) then
     1392           write(*,*) 'conservch4 calladj'
     1393           call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, &
     1394                   igcm_ch4_gas,igcm_ch4_ice, &
     1395                   ptimestep,pplev,zdqadj,vecnull,'CH4','calladj')
     1396         endif
    13881397
    13891398      endif ! end of 'calladj'
     
    14301439           pdq(1:ngrid,1:nlayer,1:nq)=pdq(1:ngrid,1:nlayer,1:nq) + &
    14311440                                      zdq_mix(1:ngrid,1:nlayer,1:nq)
     1441
     1442           ! Test tracer conservation
     1443           if (methane.and.conservch4) then
     1444             write(*,*) 'conservch4 nonoro'
     1445             call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, &
     1446                   igcm_ch4_gas,igcm_ch4_ice, &
     1447                   ptimestep,pplev,zdq_mix,vecnull,'CH4','nonorog')
     1448           endif
     1449
    14321450          ENDIF
    1433  
    14341451 
    14351452        ENDIF ! of IF (calllott_nonoro)
     
    15271544         zdqch4cloud(:,:,:)=0.
    15281545         if ((methane).and.(metcloud).and.(.not.fast)) THEN
     1546            zdqch4cloud(:,:,:)=0.
    15291547            call ch4cloud(ngrid,nlayer,ptimestep,  &
    15301548                      pplev,pplay,pdpsrf,zzlev,zzlay, pt,pdt,  &
     
    15531571               ENDDO
    15541572            ENDDO
     1573
     1574            ! Test tracer conservation
     1575            if (methane.and.conservch4) then
     1576             write(*,*) 'conservch4 ch4clouds'
     1577             call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, &
     1578                   igcm_ch4_gas,igcm_ch4_ice, &
     1579                   ptimestep,pplev,zdqch4cloud,zdqsch4cloud,'CH4',' cloud ')
     1580            endif
     1581
    15551582         end if
    15561583
     
    15581585         ! CO ice condensation in the atmosphere
    15591586         !--------------------------------------
    1560          zdqcocloud(:,:,:)=0.
    15611587         IF ((carbox).and.(monoxcloud).and.(.not.fast)) THEN
     1588            zdqcocloud(:,:,:)=0.
    15621589            call cocloud(ngrid,nlayer,ptimestep,   &
    15631590                      pplev,pplay,pdpsrf,zzlev,zzlay, pt,pdt,  &
     
    16141641                              zdqphot_prec,zdqphot_ch4,zdqconv_prec,declin)
    16151642               pdq(:,:,:) = pdq(:,:,:) + pdqmufi_prod(:,:,:) ! Should be updated
     1643
     1644               ! Test tracer conservation
     1645               if (methane.and.conservch4) then
     1646                 write(*,*) 'conservch4 hazeprod'
     1647                 call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, &
     1648                   igcm_ch4_gas,igcm_ch4_ice, &
     1649                   ptimestep,pplev,pdqmufi_prod,vecnull,'CH4','hazepro')
     1650               endif
     1651
    16161652            ENDIF ! end call_haze_prod_pCH4
    16171653
     
    16731709            ENDIF ! end fast.and.fasthaze
    16741710
     1711            ! Test tracer conservation
     1712            if (methane.and.conservch4) then
     1713                 write(*,*) 'conservch4 zdqhaze'
     1714                 call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, &
     1715                   igcm_ch4_gas,igcm_ch4_ice, &
     1716                   ptimestep,pplev,zdqhaze,vecnull,'CH4','zdqhaze')
     1717            endif
     1718
    16751719            ! Sedimentation.
    16761720            if (sedimentation) then
     
    16911735            end if ! end of 'sedimentation'
    16921736
     1737            ! Test tracer conservation
     1738            if (methane.and.conservch4) then
     1739                 write(*,*) 'conservch4 sedim'
     1740                 call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, &
     1741                   igcm_ch4_gas,igcm_ch4_ice, &
     1742                   ptimestep,pplev,zdqsed,zdqssed,'CH4',' sedim ')
     1743            endif
     1744
    16931745         ENDIF ! end callmufi
    16941746
     
    17261778            pdpsrf(1:ngrid)            = pdpsrf(1:ngrid) + zdpsrfmr(1:ngrid)
    17271779            zdtsurf(1:ngrid)           = zdtsurf(1:ngrid) + zdtsurfmr(1:ngrid)
     1780
     1781            ! Test tracer conservation
     1782            if (methane.and.conservch4) then
     1783                 write(*,*) 'conservch4 mass redistrib'
     1784                 call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, &
     1785                   igcm_ch4_gas,igcm_ch4_ice, &
     1786                   ptimestep,pplev,zdqmr,zdqsurfmr,'CH4','massred')
     1787            endif
    17281788
    17291789         endif
     
    22952355      ! Total energy balance diagnostics
    22962356      if(callrad)then
     2357         call write_output("mu0","ycosinus incident angle"," ",mu0)
    22972358         call write_output("ALB","Surface albedo"," ",albedo_equivalent)
    22982359         call write_output("ASR","absorbed stellar rad.","W m-2",fluxabs_sw)
Note: See TracChangeset for help on using the changeset viewer.