Ignore:
Timestamp:
Apr 17, 2020, 4:58:05 PM (5 years ago)
Author:
mlefevre
Message:

MESOSCALE. Implementation of mesoscale architecture for Titan physics. See MESOSCALE flags.

Location:
trunk/LMDZ.TITAN/libf/phytitan
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90

    r2242 r2291  
    3838                             zzlevbar, zzlaybar, ztfibar, zqfibar
    3939      use callkeys_mod
     40      use phys_state_var_mod
     41      use turb_mod, only : q2,sensibFlux,turb_resolved
     42#ifndef MESOSCALE
    4043      use vertical_layers_mod, only: presnivs, pseudoalt
    4144      use ioipsl_getin_p_mod, only: getin_p
    4245      use mod_phys_lmdz_omp_data, ONLY: is_omp_master
     46#else
     47use comm_wrf, only : comm_HR_SW, comm_HR_LW, &
     48                     comm_FLUXTOP_DN,comm_FLUXABS_SW,&
     49                     comm_FLUXTOP_LW,comm_FLUXSURF_SW,&
     50                     comm_FLUXSURF_LW,comm_FLXGRD
     51#endif
    4352#ifdef CPP_XIOS     
    4453      use xios_output_mod, only: initialize_xios_output, &
     
    207216!$OMP THREADPRIVATE(day_ini,icount)
    208217
    209       real, dimension(:),allocatable,save ::  tsurf                ! Surface temperature (K).
    210       real, dimension(:,:),allocatable,save ::  tsoil              ! Sub-surface temperatures (K).
    211       real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
    212       real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
    213      
    214218!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent)
    215219
    216       real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
    217      
    218220!$OMP THREADPRIVATE(albedo_bareground)
    219221
    220       real,dimension(:),allocatable,save :: emis        ! Thermal IR surface emissivity.
    221       real,dimension(:,:),allocatable,save :: dtrad     ! Net atmospheric radiative heating rate (K.s-1).
    222       real,dimension(:),allocatable,save :: fluxrad_sky ! Radiative flux from sky absorbed by surface (W.m-2).
    223       real,dimension(:),allocatable,save :: fluxrad     ! Net radiative surface flux (W.m-2).
    224       real,dimension(:),allocatable,save :: capcal      ! Surface heat capacity (J m-2 K-1).
    225       real,dimension(:),allocatable,save :: fluxgrd     ! Surface conduction flux (W.m-2).
    226       real,dimension(:,:),allocatable,save :: qsurf     ! Tracer on surface (e.g. kg.m-2).
    227       real,dimension(:,:),allocatable,save :: q2        ! Turbulent Kinetic Energy.
    228      
    229222!$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf,q2)
    230223
     
    240233      ! FOR DIAGNOSTIC :
    241234     
    242       real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
    243       real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
    244       real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
    245       real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
    246       real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
    247       real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
    248       real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
    249       real,dimension(:,:),allocatable,save :: OLR_nu        ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)).
    250       real,dimension(:,:),allocatable,save :: OSR_nu        ! Outgoing SW radiation in each band (Normalized to the band width (W/m2/cm-1)).
    251       real,dimension(:,:),allocatable,save :: zdtlw         ! LW heating tendencies (K/s).
    252       real,dimension(:,:),allocatable,save :: zdtsw         ! SW heating tendencies (K/s).
    253       real,dimension(:),allocatable,save :: sensibFlux      ! Turbulent flux given by the atmosphere to the surface (W.m-2).
    254       real,dimension(:,:,:),allocatable,save :: int_dtauv   ! VI optical thickness of layers within narrowbands for diags ().
    255       real,dimension(:,:,:),allocatable,save :: int_dtaui   ! IR optical thickness of layers within narrowbands for diags ().
    256      
    257235!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn,OLR_nu,OSR_nu,&       
    258236        !$OMP zdtlw,zdtsw,sensibFlux,int_dtauv,int_dtaui))
     
    331309      real zdtdyn(ngrid,nlayer)                          ! Dynamical Heating (K/s).
    332310      real zdudyn(ngrid,nlayer)                          ! Dynamical Zonal Wind tendency (m.s-2).
    333       real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K)                                                         ! Useful for Dynamical Heating calculation.
    334       real,allocatable,dimension(:,:),save :: zuprevious ! Previous loop Zonal Wind (m.s-1)                                                                  ! Useful for Zonal Wind tendency calculation.
    335311!$OMP THREADPRIVATE(ztprevious,zuprevious)
    336312
     
    363339      real tf, ntf   
    364340
    365       real,allocatable,dimension(:,:),save :: qsurf_hist
    366341!$OMP THREADPRIVATE(qsurf_hist)
    367342   
     
    393368
    394369      ! Surface methane
    395       real, dimension(:), allocatable, save       :: tankCH4    ! Depth of surface methane tank (m)
    396370!$OMP THREADPRIVATE(tankCH4)
    397371
     
    434408! --------------------------------
    435409      if (firstcall) then
     410#ifndef MESOSCALE
    436411        allocate(tpq(ngrid,nlayer,nq))
    437412        tpq(:,:,:) = pq(:,:,:)
     
    442417        endif
    443418
    444         ! Allocate saved arrays.
    445         ALLOCATE(tsurf(ngrid))
    446         ALLOCATE(tsoil(ngrid,nsoilmx))   
    447         ALLOCATE(albedo(ngrid,L_NSPECTV))
    448         ALLOCATE(albedo_equivalent(ngrid))       
    449         ALLOCATE(albedo_bareground(ngrid))               
    450         ALLOCATE(emis(ngrid))   
    451         ALLOCATE(dtrad(ngrid,nlayer))
    452         ALLOCATE(fluxrad_sky(ngrid))
    453         ALLOCATE(fluxrad(ngrid))   
    454         ALLOCATE(capcal(ngrid))   
    455         ALLOCATE(fluxgrd(ngrid)) 
    456         ALLOCATE(qsurf(ngrid,nq)) 
    457         ALLOCATE(q2(ngrid,nlayer+1))
    458         ALLOCATE(tankCH4(ngrid))
    459         ALLOCATE(ztprevious(ngrid,nlayer))
    460         ALLOCATE(zuprevious(ngrid,nlayer))
    461         ALLOCATE(qsurf_hist(ngrid,nq))
    462         ALLOCATE(fluxsurf_lw(ngrid))
    463         ALLOCATE(fluxsurf_sw(ngrid))
    464         ALLOCATE(fluxsurfabs_sw(ngrid))
    465         ALLOCATE(fluxtop_lw(ngrid))
    466         ALLOCATE(fluxabs_sw(ngrid))
    467         ALLOCATE(fluxtop_dn(ngrid))
    468         ALLOCATE(fluxdyn(ngrid))
    469         ALLOCATE(OLR_nu(ngrid,L_NSPECTI))
    470         ALLOCATE(OSR_nu(ngrid,L_NSPECTV))
    471         ALLOCATE(sensibFlux(ngrid))
    472         ALLOCATE(zdtlw(ngrid,nlayer))
    473         ALLOCATE(zdtsw(ngrid,nlayer))
    474         ALLOCATE(int_dtaui(ngrid,nlayer,L_NSPECTI))
    475         ALLOCATE(int_dtauv(ngrid,nlayer,L_NSPECTV))
    476  
    477         ! This is defined in comsaison_h
    478         ALLOCATE(mu0(ngrid))
    479         ALLOCATE(fract(ngrid))           
    480          ! This is defined in radcommon_h
    481         ALLOCATE(gzlat(ngrid,nlayer))
    482         ALLOCATE(gzlat_ig(nlayer))
    483         ALLOCATE(Cmk(nlayer))         
     419        call phys_state_var_init(nq)
     420
     421#endif
    484422
    485423!        Variables set to 0
     
    565503!        Read 'startfi.nc' file.
    566504!        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     505#ifndef MESOSCALE
    567506         call phyetat0(startphy_file,ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq,      &
    568507                       day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf,tankCH4)                       
     508#else
     509         emis(:)=0.0
     510         q2(:,:)=0.0
     511         qsurf(:,:)=0.0
     512         day_ini = pday
     513#endif
     514
     515#ifndef MESOSCALE
    569516         if (.not.startphy_file) then
    570517           ! additionnal "academic" initialization of physics
     
    578525           day_ini=pday
    579526         endif
     527#endif
    580528
    581529         if (pday.ne.day_ini) then
     
    639587         endif
    640588
     589#ifndef MESOSCALE
    641590         if (ngrid.ne.1) then
    642591            ! Note : no need to create a restart file in 1d.
     
    645594                          albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe)
    646595         endif
     596#endif
    647597         
    648598         ! XIOS outputs
     
    991941         end if !end of 'UseTurbDiff'
    992942
    993 
    994          pdv(:,:)=pdv(:,:)+zdvdif(:,:)
    995          pdu(:,:)=pdu(:,:)+zdudif(:,:)
    996          pdt(:,:)=pdt(:,:)+zdtdif(:,:)
    997          zdtsurf(:)=zdtsurf(:)+zdtsdif(:)
     943         if (.not. turb_resolved) then
     944           pdv(:,:)=pdv(:,:)+zdvdif(:,:)
     945           pdu(:,:)=pdu(:,:)+zdudif(:,:)
     946           pdt(:,:)=pdt(:,:)+zdtdif(:,:)
     947         endif
     948           zdtsurf(:)=zdtsurf(:)+zdtsdif(:)
    998949
    999950         if (tracer) then
     
    14661417         ztime_fin = ptime + ptimestep/(float(iphysiq)*daysec)
    14671418
     1419#ifndef MESOSCALE
    14681420         if (ngrid.ne.1) then
    14691421            write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin
     
    14731425                          tsurf,tsoil,emis,q2,qsurf_hist,tankCH4)
    14741426         endif
     1427#endif
     1428
    14751429    endif ! end of 'lastcall'
    14761430
    1477 
     1431#ifndef MESOSCALE
    14781432!-----------------------------------------------------------------------------------------------------
    14791433!           OUTPUT in netcdf file "DIAGFI.NC", containing any variable for diagnostic
     
    17331687      endif
    17341688#endif
     1689#else
     1690      !MESOSCALE outputs     
     1691      comm_HR_SW(1:ngrid,1:nlayer) = zdtsw(1:ngrid,1:nlayer)
     1692      comm_HR_LW(1:ngrid,1:nlayer) = zdtlw(1:ngrid,1:nlayer)
     1693      comm_FLUXTOP_DN(1:ngrid)=fluxtop_dn(1:ngrid)
     1694      comm_FLUXABS_SW(1:ngrid)=fluxabs_sw(1:ngrid)
     1695      comm_FLUXTOP_LW(1:ngrid)=fluxtop_lw(1:ngrid)
     1696      comm_FLUXSURF_SW(1:ngrid)=fluxsurf_sw(1:ngrid)
     1697      comm_FLUXSURF_LW(1:ngrid)=fluxsurf_lw(1:ngrid)
     1698      comm_FLXGRD(1:ngrid)=fluxgrd(1:ngrid)
     1699#endif     
    17351700
    17361701      icount=icount+1
  • trunk/LMDZ.TITAN/libf/phytitan/turbdiff.F90

    r1947 r2291  
    1010      use comcstfi_mod, only: rcp, g, r, cpp
    1111      use callkeys_mod, only: tracer,nosurf
     12      use turb_mod, only : ustar
    1213
    1314      implicit none
     
    327328         zcdh(ig) = zcdh_true(ig)*sqrt(zu2)
    328329         zkh(ig,1)= zcdh(ig)
     330         ustar(ig)= sqrt(zcdv_true(ig))*sqrt(zu2)
    329331      ENDDO
    330332
Note: See TracChangeset for help on using the changeset viewer.