Changeset 3627


Ignore:
Timestamp:
Feb 14, 2025, 4:28:07 PM (37 hours ago)
Author:
tbertrand
Message:

Pluto PCM: a fix for ASR, some cleanups and additional output
TB

Location:
trunk/LMDZ.PLUTO/libf/phypluto
Files:
8 edited

Legend:

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

    r3613 r3627  
    3131      use tracer_h, only: igcm_ch4_gas,igcm_n2,mmol
    3232      use comcstfi_mod, only: pi, mugaz, cpp, r, g
    33       use callkeys_mod, only: diurnal,tracer,varfixed,satval, &
     33      use callkeys_mod, only: diurnal,tracer,varfixed, &
    3434                              diagdtau,kastprof,strictboundcorrk,specOLR, &
    3535                              tplanckmin,tplanckmax,global1d, &
  • trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90

    r3613 r3627  
    211211!     Initialization on first call
    212212
    213       qxvaer(:,:,:) = 0
    214       qsvaer(:,:,:) = 0
    215       gvaer(:,:,:) = 0
    216 
    217       qxiaer(:,:,:) = 0
    218       qsiaer(:,:,:) = 0
    219       giaer(:,:,:) = 0
     213      qxvaer(:,:,:) = 0.0
     214      qsvaer(:,:,:) = 0.0
     215      gvaer(:,:,:) = 0.0
     216
     217      qxiaer(:,:,:) = 0.0
     218      qsiaer(:,:,:) = 0.0
     219      giaer(:,:,:) = 0.0
    220220
    221221
  • trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90

    r3613 r3627  
    213213  condsub(1:klon) = .false.
    214214  pdicen2(1:klon) = 0.
    215   zfallheat=0
    216   pdqc(1:klon,1:klev,1:nq)=0
    217   pdtc(1:klon,1:klev)=0
    218   pduc(1:klon,1:klev)=0
    219   pdvc(1:klon,1:klev)=0
    220   zfallice(1:klon,1:klev+1)=0
    221   zcondicea(1:klon,1:klev)=0
    222   zdtlatent(1:klon,1:klev)=0
     215  zfallheat=0.
     216  pdqc(1:klon,1:klev,1:nq)=0.
     217  pdtc(1:klon,1:klev)=0.
     218  pduc(1:klon,1:klev)=0.
     219  pdvc(1:klon,1:klev)=0.
     220  zfallice(1:klon,1:klev+1)=0.
     221  zcondicea(1:klon,1:klev)=0.
     222  zdtlatent(1:klon,1:klev)=0.
    223223  zt(1:klon,1:klev)=0.
    224224
  • trunk/LMDZ.PLUTO/libf/phypluto/inifis_mod.F90

    r3592 r3627  
    312312     call getin_p("calldifv",calldifv)
    313313     if (is_master) write(*,*) trim(rname)//": calldifv = ",calldifv
     314     vertdiff=.true. ! default value
     315     call getin_p("vertdiff",vertdiff)
     316     if (is_master) write(*,*) trim(rname)//": vertdiff = ",vertdiff
    314317
    315318     if (is_master) write(*,*) trim(rname)//": use turbdiff instead of vdifc ?"
     
    12231226     if (is_master) write(*,*)trim(rname)//": varfixed = ",varfixed
    12241227
    1225      if (is_master) write(*,*)trim(rname)//&
    1226        ": What is the saturation % of the variable species?"
    1227      satval=0.8
    1228      call getin_p("satval",satval)
    1229      if (is_master) write(*,*)trim(rname)//": satval = ",satval
    1230 
    1231 
    12321228! Test of incompatibility:
    12331229! if varactive, then varfixed should be false
  • trunk/LMDZ.PLUTO/libf/phypluto/phys_state_var_mod.F90

    r3613 r3627  
    5454
    5555      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
     56      real,dimension(:),allocatable,save :: fluxtop_sw      ! Outgoing SW (IR) flux to space (W.m-2).
    5657      real,dimension(:),allocatable,save :: fluxtop_lw1      ! Outgoing LW (IR) flux to space (W.m-2) clear sky.
    5758      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
     
    5960      real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
    6061      real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
    61 !$OMP THREADPRIVATE(fluxtop_lw,fluxtop_lw1,fluxabs_sw,fluxabs_sw1,fluxtop_dn,fluxdyn)
     62!$OMP THREADPRIVATE(fluxtop_lw,fluxtop_sw,fluxtop_lw1,fluxabs_sw,fluxabs_sw1,fluxtop_dn,fluxdyn)
    6263
    6364      real,dimension(:,:),allocatable,save :: OLR_nu        ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)).
     
    143144        ALLOCATE(fluxsurfabs_sw(klon))
    144145        ALLOCATE(fluxtop_lw(klon))
     146        ALLOCATE(fluxtop_sw(klon))
    145147        ALLOCATE(fluxtop_lw1(klon))
    146148        ALLOCATE(fluxabs_sw(klon))
     
    218220        DEALLOCATE(fluxsurfabs_sw)
    219221        DEALLOCATE(fluxtop_lw)
     222        DEALLOCATE(fluxtop_sw)
    220223        DEALLOCATE(fluxtop_lw1)
    221224        DEALLOCATE(fluxabs_sw)
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3601 r3627  
    10201020                               zzlay,zzlev,tsurf,fract,dist_star,dtau_aer,       &
    10211021                               zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,   &
    1022                                fluxabs_sw,fluxtop_dn,reffrad,tau_col,ptime,pday, &
     1022                               fluxtop_sw,fluxtop_dn,reffrad,tau_col,ptime,pday, &
    10231023                               firstcall,lastcall)
    10241024                  albedo_equivalent(1:ngrid)=albedo(1:ngrid,1)
    10251025                  fluxrad_sky(1:ngrid)=emis(1:ngrid)*fluxsurf_lw(1:ngrid)+       &
    10261026                               fluxsurf_sw(1:ngrid)*(1.-albedo(1:ngrid,1))
     1027                  fluxabs_sw(1:ngrid)=fluxtop_dn(1:ngrid)-fluxtop_sw(1:ngrid)
    10271028               else
    10281029                muvar(1:ngrid,1:nlayer+1)=mugaz
     
    11461147
    11471148         if (oldplutovdifc) then
    1148             zdum1(:,:) = 0
    1149             zdum2(:,:) = 0
     1149            zdum1(:,:) = 0.
     1150            zdum2(:,:) = 0.
    11501151            zdh(:,:)=pdt(:,:)/zpopsk(:,:)
    11511152
     
    11591160                    zdqdif,zdqsdif,qsat_ch4,qsat_ch4_l1) !,zq1temp_ch4,qsat_ch4)
    11601161
    1161             zdtdif(1:ngrid,1:nlayer)=zdhdif(1:ngrid,1:nlayer)*zpopsk(1:ngrid,1:nlayer) ! for diagnostic only
     1162            zdtdif(1:ngrid,1:nlayer)=zdhdif(1:ngrid,1:nlayer)*zpopsk(1:ngrid,1:nlayer)
    11621163
    11631164            bcond=1./tcond1p4Pa
     
    12021203         endif
    12031204
    1204          ! if(ok_slab_ocean)then !AF24: removed
    1205          !    flux_sens_lat(1:ngrid)=(zdtsdif(1:ngrid)*capcal(1:ngrid)-fluxrad(1:ngrid))
    1206          ! endif
    1207 
    1208 !!         call writediagfi(ngrid,"vdifc_post_zdqsdif"," "," ",2,zdqsdif(1:ngrid,igcm_h2o_gas))
    1209 
    12101205         if (tracer) then
    12111206           pdq(1:ngrid,1:nlayer,1:nq)=pdq(1:ngrid,1:nlayer,1:nq)+ zdqdif(1:ngrid,1:nlayer,1:nq)
    12121207           dqsurf(1:ngrid,1:nq)=dqsurf(1:ngrid,1:nq) + zdqsdif(1:ngrid,1:nq)
    12131208         end if ! of if (tracer)
    1214 
    1215 !!         call writediagfi(ngrid,"vdifc_post_dqsurf"," "," ",2,dqsurf(1:ngrid,igcm_h2o_gas))
    1216 !!         call writediagfi(ngrid,"vdifc_post_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_gas))
    12171209
    12181210         ! test energy conservation
     
    21902182            call write_output("sensibFlux","sensible heat flux","w.m^-2",sensibFlux)
    21912183         endif
    2192 
    21932184         if (corrk) then
    2194             call write_output("dEzradsw","radiative heating","w.m^-2",dEzradsw)
    2195             call write_output("dEzradlw","radiative heating","w.m^-2",dEzradlw)
     2185            call write_output("dEzradsw","radiative heating","w.m^-2",dEzRadsw)
     2186            call write_output("dEzradlw","radiative heating","w.m^-2",dEzRadlw)
    21962187         endif
    21972188      endif ! end of 'enertest'
     
    21992190      ! Diagnostics of optical thickness
    22002191      ! Warning this is exp(-tau), I let you postproc with -log to have tau itself - JVO 19
    2201       if (diagdtau) then
     2192      if (diagdtau.and..not.oldplutocorrk) then
    22022193            do nw=1,L_NSPECTV
    22032194               write(str2,'(i2.2)') nw
     
    22122203      ! Temporary inclusions for heating diagnostics.
    22132204      if (.not.fast) then
    2214         call write_output("zdtsw","SW heating","T s-1",zdtsw)
    2215         call write_output("zdtlw","LW heating","T s-1",zdtlw)
     2205        call write_output("zdtsw","SW heating","K s-1",zdtsw)
     2206        call write_output("zdtlw","LW heating","K s-1",zdtlw)
    22162207        call write_output("dtrad","radiative heating","K s-1",dtrad)
    2217         call write_output("zdtdyn","Dyn. heating","T s-1",zdtdyn)
    2218       endif
    2219 
    2220       ! For Debugging.
    2221       !call write_output('rnat','Terrain type',' ',real(rnat))
     2208        call write_output("zdtdyn","Dyn. heating","K s-1",zdtdyn)
     2209        call write_output("zdudyn","Dyn. U","m s-2",zdudyn)
     2210        call write_output("zdtconduc","tendancy conduc","K s-1",zdtconduc)
     2211        call write_output("zdumolvis","tendancy molvis","m s-1",zdumolvis)
     2212        call write_output("zdvmolvis","tendancy molvis","m s-1",zdvmolvis)
     2213        call write_output("zdtdif","tendancy T diff","K s-1",zdtdif)
     2214        call write_output("zdtsdif","tendancy Ts diff","K s-1",zdtsdif)
     2215        call write_output("zdtadj","tendancy T adj","K s-1",zdtadj)
     2216      endif
    22222217
    22232218      ! Output tracers.
     
    22372232         call write_output('n2_iceflux','n2_iceflux',"kg m^-2 s^-1",flusurf(:,igcm_n2) )
    22382233         if (.not.fast) then
    2239             call write_output("zdtc","tendancy T cond N2","K",zdtc)
     2234            call write_output("zdtc","tendancy T cond N2","K s-1",zdtc)
     2235            call write_output("zdtsurfc","tendancy Ts cond N2","K s-1",zdtsurfc)
     2236            call write_output("zduc","tendancy U cond N2","m s-1",zduc)
     2237            call write_output("zdvc","tendancy V cond N2","m s-1",zdvc)
     2238            call write_output("zdqc_n2","tendancy tracer cond N2","kg kg-1 s-1",zdqc(:,:,1))
     2239            call write_output("zdqsc_n2","tendancy tracer surf cond N2","kg kg-1 s-1",zdqsc(:,1))
     2240            call write_output("zdqdif_n2","tendancy tracer diff","kg kg-1 s-1",zdqdif(:,:,1))
     2241            call write_output("zdqsdif_n2","tendancy tracer surf diff","kg kg-1 s-1",zdqsdif(:,1))
     2242            call write_output("zdqadj_n2","tendancy tracer adj","K s-1",zdqadj(:,:,1))
    22402243         endif
    22412244
     
    22732276
    22742277            if (metcloud.and.(.not.fast)) then
    2275                call write_output("zdtch4cloud","ch4 cloud","T s-1",&
     2278               call write_output("zdtch4cloud","ch4 cloud","K s-1",&
    22762279                           zdtch4cloud)
    2277                call write_output("zdqch4cloud","ch4 cloud","T s-1",&
     2280               call write_output("zdqch4cloud_gas","ch4 cloud","kg kg-1 s-1",&
    22782281                           zdqch4cloud(:,:,igcm_ch4_gas))
     2282               call write_output("zdqch4cloud_ice","ch4 cloud","kg kg-1 s-1",&
     2283                           zdqch4cloud(:,:,igcm_ch4_ice))
    22792284            endif
    22802285
  • trunk/LMDZ.PLUTO/libf/phypluto/testconserv.F90

    r3539 r3627  
    6464      REAL nconsMAX
    6565      INTEGER myig
    66       REAL vdifcncons(ngrid)
     66      REAL ncons(ngrid)
    6767!-----------------------------------------------------------------------
    6868
     
    7575      pqcs=pqs+pdqs*ptimestep
    7676      do ig = 1, ngrid
    77          vdifcncons(ig)=0.0
     77         ncons(ig)=0.0
    7878         do l = 1, nlayer
    7979             masse = (pplev(ig,l) - pplev(ig,l+1))/g
     
    8484             dWtot = dWtot + masse*zdq(ig,l,iq)*ptimestep*cell_area(ig)
    8585             ! for each column, total mass lost per sec : kg(tracer) / m2 /s
    86              vdifcncons(ig)=vdifcncons(ig) + masse*zdq(ig,l,iq)
     86             ncons(ig)=ncons(ig) + masse*zdq(ig,l,iq)
    8787 
    8888             ! if clouds :
     
    9191              dWtot = dWtot + masse*zdq(ig,l,iq)*ptimestep*cell_area(ig)
    9292              Wtot = Wtot + masse*pqc(ig,l,iq)*cell_area(ig)
    93               vdifcncons(ig)=vdifcncons(ig) + masse*zdq(ig,l,iq)
     93              ncons(ig)=ncons(ig) + masse*zdq(ig,l,iq)
    9494             ENDIF
    9595               
     
    9999         dWtots = dWtots + zdqs(ig,iq)*ptimestep*cell_area(ig)
    100100         Wtots = Wtots + pqcs(ig,iq)*cell_area(ig)
    101          vdifcncons(ig)=vdifcncons(ig)+zdqs(ig,iq)
     101         ncons(ig)=ncons(ig)+zdqs(ig,iq)
    102102
    103103         IF ((igcm2.eq.igcm_co_ice).or.(igcm2.eq.igcm_ch4_ice)) THEN
     
    105105              dWtots = dWtots + zdqs(ig,iq)*ptimestep*cell_area(ig)
    106106              Wtots = Wtots + pqcs(ig,iq)*cell_area(ig)
    107               vdifcncons(ig)=vdifcncons(ig)+zdqs(ig,iq)
     107              ncons(ig)=ncons(ig)+zdqs(ig,iq)
    108108         ENDIF
    109109             
    110         ! vdifcncons is the total amount of material that appear or
     110        ! ncons is the total amount of material that appear or
    111111        ! disapear per second in the routine
    112112        ! it is the non conservative factor
    113113
    114         if(abs(vdifcncons(ig)).gt.abs(nconsMAX))then
    115               nconsMAX=vdifcncons(ig)
     114        if(abs(ncons(ig)).gt.abs(nconsMAX))then
     115              nconsMAX=ncons(ig)
    116116              myig=ig
    117117        endif
  • trunk/LMDZ.PLUTO/libf/phypluto/vdifc_pluto_mod.F90

    r3258 r3627  
    697697          END IF ! of IF ((methane).and.(iq.eq.igcm_ch4_gas))
    698698
    699           !! Diffusion verticale : shut down vertical transport of vertdiff = false
     699          !! Diffusion verticale : shut down vertical transport if vertdiff = false
    700700          if (vertdiff) then
    701701           DO ilay=2,nlay
Note: See TracChangeset for help on using the changeset viewer.