Ignore:
Timestamp:
Mar 25, 2021, 7:01:21 PM (4 years ago)
Author:
emillour
Message:

Generic GCM:
Move some variables defined in physiq to phys_state_var_mod where they are now
allocated and saved, which is important as they may not be filled or computed
at every physics time step (e.g. when radiative transfert is not called).
GC

Location:
trunk/LMDZ.GENERIC/libf/phystd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90

    r2299 r2485  
    2929      real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
    3030      real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
     31      real, dimension(:),allocatable,save :: albedo_equivalent1     ! Spectral Mean albedo clear sky.
    3132      real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
    3233      real, dimension(:),allocatable,save :: albedo_co2_ice_SPECTV ! CO2 ice Spectral albedo.
    33 !$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
     34!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_equivalent1,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
    3435
    3536      real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
     
    4950
    5051      real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
     52      real,dimension(:),allocatable,save :: fluxsurf_lw1     ! Incident Long Wave (IR) surface flux (W.m-2) clear sky.
    5153      real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
     54      real,dimension(:),allocatable,save :: fluxsurf_sw1     ! Incident Short Wave (stellar) surface flux (W.m-2) clear sky.
    5255      real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
    53 !$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw)
     56!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_lw1,fluxsurf_sw,fluxsurf_sw1,fluxsurfabs_sw)
    5457
    5558      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
     59      real,dimension(:),allocatable,save :: fluxtop_lw1      ! Outgoing LW (IR) flux to space (W.m-2) clear sky.
    5660      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
     61      real,dimension(:),allocatable,save :: fluxabs_sw1      ! Absorbed SW (stellar) flux (W.m-2) clear sky.
    5762      real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
    5863      real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
    59 !$OMP THREADPRIVATE(fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn)
     64!$OMP THREADPRIVATE(fluxtop_lw,fluxtop_lw1,fluxabs_sw,fluxabs_sw1,fluxtop_dn,fluxdyn)
    6065
    6166      real,dimension(:,:),allocatable,save :: OLR_nu        ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)).
     
    8691!$OMP THREADPRIVATE(ice_initial,ice_min)
    8792
    88       real, dimension(:),allocatable,save ::  pctsrf_sic
    89       real, dimension(:,:),allocatable,save :: tslab
    90       real, dimension(:),allocatable,save ::  tsea_ice
    91       real, dimension(:),allocatable,save :: sea_ice
    92       real, dimension(:),allocatable,save :: zmasq
    93       integer, dimension(:),allocatable,save ::knindex
     93      real,dimension(:),allocatable,save ::  pctsrf_sic
     94      real,dimension(:,:),allocatable,save :: tslab        ! Slab_ocean temperature (K)
     95      real,dimension(:),allocatable,save ::  tsea_ice      ! Sea ice temperature (K)
     96      real,dimension(:),allocatable,save :: sea_ice
     97      real,dimension(:),allocatable,save :: zmasq
     98      integer,dimension(:),allocatable,save ::knindex
    9499      real,allocatable,dimension(:,:,:),save :: reffrad
    95 !$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex,reffrad)
     100      real,dimension(:), allocatable,save :: fluxgrdocean  ! Surface conduction flux (W.m-2) with slab_ocean.
     101!$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex,reffrad,fluxgrdocean)
     102
     103      real,dimension(:,:),allocatable,save :: dEzdiff   ! Turbulent diffusion heating (W.m-2)
     104      real,dimension(:),allocatable,save :: dEdiff      ! Integrated turbulent diffusion heating (W.m-2)
     105      real,dimension(:),allocatable,save :: dEdiffs
     106      real,dimension(:,:),allocatable,save :: dEzRadsw  ! Radiative heating (W.m-2)
     107      real,dimension(:,:),allocatable,save :: dEzRadlw  ! Radiative heating (W.m-2)
     108!$OMP THREADPRIVATE(dEzdiff,dEzdiffs,dEzRadsw,dEzRadlw)
     109
     110      real,dimension(:),allocatable,save :: madjdE      ! Heat from moistadj (W.m-2)
     111      real,dimension(:,:),allocatable,save :: madjdEz   ! Heat from moistadj (W.m-2)
     112      real,dimension(:),allocatable,save :: lscaledE    ! Heat from largescale (W.m-2)
     113      real,dimension(:,:),allocatable,save :: lscaledEz ! Heat from largescale (W.m-2)
     114!$OMP THREADPRIVATE(madjdE,madjdEz,lscaledE,lscaledEz)
     115     
     116      real,dimension(:),allocatable,save :: H2Omaxcol ! Maximum possible H2O column amount (at 100% saturation) (kg.m-2).
     117!$OMP THREADPRIVATE(H2Omaxcol)
    96118     
    97119CONTAINS
     
    114136!zval(:)   ! Minimum de l'OESM
    115137!rugoro(:) ! longueur de rugosite de l'OESM
    116         print*,'klon',klon,'klev',klev
     138
    117139        ALLOCATE(phisfi(klon))
    118140        ALLOCATE(tsurf(klon))
     
    120142        ALLOCATE(albedo(klon,L_NSPECTV))
    121143        ALLOCATE(albedo_equivalent(klon))
     144        ALLOCATE(albedo_equivalent1(klon))
    122145        ALLOCATE(albedo_snow_SPECTV(L_NSPECTV))
    123146        ALLOCATE(albedo_co2_ice_SPECTV(L_NSPECTV))
     
    130153        ALLOCATE(capcal(klon))
    131154        ALLOCATE(fluxgrd(klon))
     155        ALLOCATE(fluxgrdocean(klon))
    132156        ALLOCATE(qsurf(klon,nqtot))
    133157        ALLOCATE(q2(klon,klev+1))
     
    143167        ALLOCATE(ice_min(klon))
    144168        ALLOCATE(fluxsurf_lw(klon))
     169        ALLOCATE(fluxsurf_lw1(klon))
    145170        ALLOCATE(fluxsurf_sw(klon))
     171        ALLOCATE(fluxsurf_sw1(klon))
    146172        ALLOCATE(fluxsurfabs_sw(klon))
    147173        ALLOCATE(fluxtop_lw(klon))
     174        ALLOCATE(fluxtop_lw1(klon))
    148175        ALLOCATE(fluxabs_sw(klon))
     176        ALLOCATE(fluxabs_sw1(klon))
    149177        ALLOCATE(fluxtop_dn(klon))
    150178        ALLOCATE(fluxdyn(klon))
     
    163191        ALLOCATE(zmasq(klon))
    164192        ALLOCATE(knindex(klon))
     193        ALLOCATE(dEzdiff(klon,klev))
     194        ALLOCATE(dEdiff(klon))
     195        ALLOCATE(dEdiffs(klon))
     196        ALLOCATE(dEzRadsw(klon,klev))
     197        ALLOCATE(dEzRadlw(klon,klev))
     198        ALLOCATE(madjdE(klon))
     199        ALLOCATE(madjdEz(klon,klev))
     200        ALLOCATE(lscaledE(klon))
     201        ALLOCATE(lscaledEz(klon,klev))
     202        ALLOCATE(H2Omaxcol(klon))
    165203        ! This is defined in comsaison_h
    166204        ALLOCATE(mu0(klon))
     
    193231        DEALLOCATE(albedo)
    194232        DEALLOCATE(albedo_equivalent)
     233        DEALLOCATE(albedo_equivalent1)
    195234        DEALLOCATE(albedo_snow_SPECTV)
    196235        DEALLOCATE(albedo_co2_ice_SPECTV)
     
    204243
    205244        DEALLOCATE(fluxgrd)
     245        DEALLOCATE(fluxgrdocean)
    206246        DEALLOCATE(qsurf)
    207247        DEALLOCATE(q2)
     
    217257        DEALLOCATE(ice_min)
    218258        DEALLOCATE(fluxsurf_lw)
     259        DEALLOCATE(fluxsurf_lw1)
    219260        DEALLOCATE(fluxsurf_sw)
     261        DEALLOCATE(fluxsurf_sw1)
    220262        DEALLOCATE(fluxsurfabs_sw)
    221263        DEALLOCATE(fluxtop_lw)
     264        DEALLOCATE(fluxtop_lw1)
    222265        DEALLOCATE(fluxabs_sw)
     266        DEALLOCATE(fluxabs_sw1)
    223267        DEALLOCATE(fluxtop_dn)
    224268        DEALLOCATE(fluxdyn)
     
    237281        DEALLOCATE(zmasq)
    238282        DEALLOCATE(knindex)
     283        DEALLOCATE(dEzdiff)
     284        DEALLOCATE(dEdiff)
     285        DEALLOCATE(dEdiffs)
     286        DEALLOCATE(dEzRadsw)
     287        DEALLOCATE(dEzRadlw)
     288        DEALLOCATE(madjdE)
     289        DEALLOCATE(madjdEz)
     290        DEALLOCATE(lscaledE)
     291        DEALLOCATE(lscaledEz)
     292        DEALLOCATE(H2Omaxcol)       
    239293        DEALLOCATE(mu0)
    240294        DEALLOCATE(fract)
  • trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90

    r2470 r2485  
    383383      real,save :: dEtotSW, dEtotsSW, dEtotLW, dEtotsLW
    384384!$OMP THREADPRIVATE(dEtotSW, dEtotsSW, dEtotLW, dEtotsLW)
    385       real dEzRadsw(ngrid,nlayer),dEzRadlw(ngrid,nlayer),dEzdiff(ngrid,nlayer)
    386       real dEdiffs(ngrid),dEdiff(ngrid)
    387       real madjdE(ngrid), lscaledE(ngrid),madjdEz(ngrid,nlayer), lscaledEz(ngrid,nlayer)
    388385     
    389386!JL12 conservation test for mean flow kinetic energy has been disabled temporarily
     
    401398      real qsat(ngrid,nlayer) ! Water Vapor Volume Mixing Ratio at saturation (kg/kg_of_air).
    402399      real RH(ngrid,nlayer)   ! Relative humidity.
    403       real H2Omaxcol(ngrid)   ! Maximum possible H2O column amount (at 100% saturation) (kg/m2).
    404400      real psat_tmp
    405401     
     
    407403     
    408404      ! For Clear Sky Case.
    409       real fluxsurf_lw1(ngrid), fluxsurf_sw1(ngrid), fluxsurfabs_sw1(ngrid)  ! For SW/LW flux.
    410       real fluxtop_lw1(ngrid), fluxabs_sw1(ngrid)                            ! For SW/LW flux.
    411       real albedo_equivalent1(ngrid)                                         ! For Equivalent albedo calculation.
     405      real fluxsurfabs_sw1(ngrid)  ! For SW/LW flux.
    412406      real tau_col1(ngrid)                                                   ! For aerosol optical depth diagnostic.
    413407      real OLR_nu1(ngrid,L_NSPECTI), OSR_nu1(ngrid,L_NSPECTV)                ! For Outgoing Radiation diagnostics.
     
    433427
    434428      real :: tsurf2(ngrid)
    435       real :: flux_o(ngrid),flux_g(ngrid),fluxgrdocean(ngrid)
     429      real :: flux_o(ngrid),flux_g(ngrid)
    436430      real :: flux_sens_lat(ngrid)
    437431      real :: qsurfint(ngrid,nq)
Note: See TracChangeset for help on using the changeset viewer.