Ignore:
Timestamp:
Jul 31, 2025, 1:01:40 PM (3 months ago)
Author:
jbclement
Message:

Mars PCM:
Big corrections related to "simpleclouds" ("mircophys=.false.") because of r2984:

  • getting "simpleclouds" calls out of the loop to save unnecessary iterations (spotted by Jonah M.). Running time is particularly improved!
  • giving well-updated arguments to "simpleclouds" subroutine.
  • bringing the old 'imicro' time subsampling back again for "simpleclouds" subroutine (which was deleted in r2966 to implement an adaptative timestep within the "improvedclouds" subroutine).

Resuls are now consistent in 1D with code versions before r2966).
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F

    r3739 r3871  
    5151c
    5252c     2023: J. Naar, now with adaptative timestep for improvedclouds
    53 c          (done in improvedclouds_mod).
     53c           (done in improvedclouds).
     54c     2025: J.-B. Clement, bringing the old imicro back again for simpleclouds
    5455c=======================================================================
    5556
     
    110111
    111112      ! global tendency (clouds+physics)
    112       ! JN : keeping this for simpleclouds scheme
    113113      REAL sum_subpdq(ngrid,nlay,nq)      ! cf. pdqcloud
    114114      REAL sum_subpdt(ngrid,nlay)         ! cf. pdtcloud
     
    202202      rhocloud(1:ngrid,1:nlay) = rho_dust
    203203
    204 c-------------------------------------------------------------------
    205 c   0.  Representation of sub-grid water ice clouds
    206 c------------------
     204c------------------------------------------------------------------
     205c   Representation of sub-grid water ice clouds
     206c------------------------------------------------------------------
    207207c-----Initialization
    208208      pteff(1:ngrid,1:nlay) = 0
     
    299299!     &             'K',cloudfrac(:,:))
    300300      END IF ! end if (CLFvarying)
     301
    301302c------------------------------------------------------------------
    302 c Cloud physics (nucleation, condensation / sublimation)
     303c   Cloud physics (nucleation, condensation / sublimation)
    303304c------------------------------------------------------------------
    304305      rhocloud(1:ngrid,1:nlay) = rho_dust
    305306
    306 c     Initialisation of all the stuff (JN,2023)
     307c Initialisation of all the stuff (JN,2023)
    307308      zt_micro(:,:)=pt(:,:)
    308309      zq_micro(:,:,:)=pq(:,:,:)
    309310
    310 c-------------------------------------------------------------------
    311 c   1.  Main call to the different cloud schemes:
    312 c------------------------------------------------
    313 c ds.
     311c------------------------------------------------------------------
     312c   Main call to the different cloud schemes
     313c------------------------------------------------------------------
    314314      IF (microphys) THEN
    315            CALL improvedclouds(ngrid,nlay,ptimestep,
     315        call improvedclouds(ngrid,nlay,ptimestep,
    316316     &          pplay,pt,pdt,pq,pdq,nq,tauscaling,imicro,
    317317     &          zt_micro,zq_micro)
    318318
    319319      ELSE
    320 
    321 c Specific loop for simpleclouds.
    322        DO l=1,nlay
    323          DO ig=1,ngrid
    324            CALL simpleclouds(ngrid,nlay,ptimestep,
    325      &             pplay,pzlay,pteff,sum_subpdt,
    326      &             pqeff,sum_subpdq,subpdqcloud,subpdtcloud,
    327      &             nq,tau,rice)
    328 c-------------------------------------------------------------------
    329 c   2.  Updating tracers and temperature after cloud scheme:
    330 c   For improved clouds (with microphysics) this is done directly
    331 c   in the microphysics, during the subtimestep
    332 c   I put it like that to be retrocompatible (JN)
    333 c-----------------------------------------------
    334 
    335             zq_micro(ig,l,igcm_h2o_ice) =
    336      &       zq_micro(ig,l,igcm_h2o_ice)+
    337      &         (pdq(ig,l,igcm_h2o_ice)
    338      &        + subpdqcloud(ig,l,igcm_h2o_ice))*ptimestep
    339             zq_micro(ig,l,igcm_h2o_vap) =
    340      &       zq_micro(ig,l,igcm_h2o_vap)+
    341      &         (pdq(ig,l,igcm_h2o_vap)
    342      &        + subpdqcloud(ig,l,igcm_h2o_vap))*ptimestep
    343 
    344             IF (hdo) THEN
    345             zq_micro(ig,l,igcm_hdo_ice) =
    346      &       zq_micro(ig,l,igcm_hdo_ice)+
    347      &         (pdq(ig,l,igcm_hdo_ice)
    348      &        + subpdqcloud(ig,l,igcm_hdo_ice))*ptimestep
    349             zq_micro(ig,l,igcm_hdo_vap) =
    350      &       zq_micro(ig,l,igcm_hdo_vap)+
    351      &         (pdq(ig,l,igcm_hdo_vap)
    352      &        + subpdqcloud(ig,l,igcm_hdo_vap))*ptimestep
    353             ENDIF ! hdo
    354 
    355 c  Could also set subpdtcloud to 0 if not activice to make it simpler
    356 c  or change name of the flag
    357             IF (activice) THEN
    358                 zt_micro(ig,l) = zt_micro(ig,l)+
    359      &             subpdtcloud(ig,l)*ptimestep
    360             ENDIF
    361 
    362          ENDDO !ig=1,ngrid
    363        ENDDO !l=1,nlay
    364       ENDIF
    365 
    366 
    367      
    368 c-------------------------------------------------------------------
    369 c   3.  Compute final tendencies after time loop:
    370 c------------------------------------------------
     320c Time subsampling for microphysics
     321        DO microstep = 1,imicro
     322c       Tendencies:
     323c------------------
     324c------ Temperature tendency subpdt
     325        ! Each microtimestep we give the cloud scheme a stepped entry subpdt instead of pdt
     326        ! If imicro=1 subpdt is the same as pdt
     327          DO l = 1,nlay
     328            DO ig = 1,ngrid
     329               sum_subpdt(ig,l) = sum_subpdt(ig,l) + pdt(ig,l) ! At each micro timestep we add pdt in order to have a stepped entry
     330            ENDDO
     331          ENDDO
     332c------ Tracers tendencies subpdq are additionned
     333c------ At each micro timestep we add pdq in order to have a stepped entry
     334          DO l = 1,nlay
     335            DO ig = 1,ngrid
     336              sum_subpdq(ig,l,igcm_h2o_ice) =
     337     &            sum_subpdq(ig,l,igcm_h2o_ice) + pdq(ig,l,igcm_h2o_ice)
     338              sum_subpdq(ig,l,igcm_h2o_vap) =
     339     &            sum_subpdq(ig,l,igcm_h2o_vap) + pdq(ig,l,igcm_h2o_vap)
     340              IF (hdo) THEN
     341              sum_subpdq(ig,l,igcm_hdo_ice) =
     342     &            sum_subpdq(ig,l,igcm_hdo_ice) + pdq(ig,l,igcm_hdo_ice)
     343              sum_subpdq(ig,l,igcm_hdo_vap) =
     344     &            sum_subpdq(ig,l,igcm_hdo_vap) + pdq(ig,l,igcm_hdo_vap)
     345              ENDIF !hdo
     346            ENDDO
     347          ENDDO     
     348          call simpleclouds(ngrid,nlay,microtimestep,
     349     &            pplay,pzlay,pteff,sum_subpdt,
     350     &            pqeff,sum_subpdq,subpdqcloud,subpdtcloud,nq,tau,rice)
     351          DO l = 1,nlay
     352            DO ig = 1,ngrid
     353              sum_subpdq(ig,l,igcm_h2o_ice) =
     354     &            sum_subpdq(ig,l,igcm_h2o_ice)
     355     &            + subpdqcloud(ig,l,igcm_h2o_ice)
     356              sum_subpdq(ig,l,igcm_h2o_vap) =
     357     &            sum_subpdq(ig,l,igcm_h2o_vap)
     358     &            + subpdqcloud(ig,l,igcm_h2o_vap)
     359
     360              IF (hdo) THEN
     361                sum_subpdq(ig,l,igcm_hdo_ice) =
     362     &              sum_subpdq(ig,l,igcm_hdo_ice)
     363     &              + subpdqcloud(ig,l,igcm_hdo_ice)
     364                sum_subpdq(ig,l,igcm_hdo_vap) =
     365     &              sum_subpdq(ig,l,igcm_hdo_vap)
     366     &              + subpdqcloud(ig,l,igcm_hdo_vap)
     367              ENDIF ! hdo
     368            ENDDO
     369          ENDDO
     370       
     371          IF (activice) THEN
     372            DO l = 1,nlay
     373              DO ig = 1,ngrid
     374                sum_subpdt(ig,l) = sum_subpdt(ig,l) + subpdtcloud(ig,l)
     375              ENDDO
     376            ENDDO
     377          ENDIF
     378        ENDDO ! of DO microstep = 1,imicro
     379
     380c------ Updating tracers and temperature to be consistent
     381c------ with the variables used for the improvedclouds scheme
     382        zt_micro(:,:) = pt(:,:) + ptimestep*sum_subpdt(:,:)/real(imicro)
     383        zq_micro(:,:,:) = pq(:,:,:)
     384     &                    + ptimestep*sum_subpdq(:,:,:)/real(imicro)
     385
     386      ENDIF ! microphys
     387
     388c------------------------------------------------------------------
     389c   Compute final tendencies after time loop:
     390c------------------------------------------------------------------
    371391
    372392c------ Temperature tendency pdtcloud
     
    725745       end subroutine end_watercloud_mod
    726746
    727 
    728 
    729747      END MODULE watercloud_mod
Note: See TracChangeset for help on using the changeset viewer.