Ignore:
Timestamp:
Mar 8, 2021, 1:43:22 PM (4 years ago)
Author:
yjaziri
Message:

Generic GCM:
global1d and szangle for 1D simulation moved from callcorrk to callkeys
to defined a consistent 1D sza in physiq_mod used also in chemistry
+ typo
YJ

Location:
trunk/LMDZ.GENERIC/libf
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/dynphy_lonlat/inigeomphy_mod.F90

    r1682 r2470  
    77                     rlatu,rlatv,rlonu,rlonv,aire,cu,cv)
    88  USE mod_grid_phy_lmdz, ONLY: klon_glo,  & ! number of atmospheric columns (on full grid)
    9                                regular_lonlat, &  ! regular longitude-latitude grid type
    10                                nbp_lon, nbp_lat, nbp_lev
     9                               regular_lonlat  ! regular longitude-latitude grid type
    1110  USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid)
    1211                                klon_omp_begin, & ! start index of local omp subgrid
     
    4847  INTEGER :: ibegin, iend, offset
    4948  INTEGER :: i,j,k
    50   CHARACTER (LEN=20) :: modname = 'iniphysiq'
     49  CHARACTER (LEN=20) :: modname = 'inigeomphy'
    5150  CHARACTER (LEN=80) :: abort_message
    5251  REAL :: total_area_phy, total_area_dyn
     
    170169    total_area_phy=sum(airefi_glo(1:klon_glo))
    171170    IF (total_area_dyn/=total_area_phy) THEN
    172       WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
     171      WRITE (lunout, *) 'inigeomphy: planet total surface discrepancy !!!'
    173172      WRITE (lunout, *) '     in the dynamics total_area_dyn=', total_area_dyn
    174173      WRITE (lunout, *) '  but in the physics total_area_phy=', total_area_phy
  • trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90

    r2446 r2470  
    3333      use callkeys_mod, only: varactive,diurnal,tracer,water,varfixed,satval,diagdtau,    &
    3434                              kastprof,strictboundcorrk,specOLR,CLFvarying,               &
    35                               tplanckmin,tplanckmax
     35                              tplanckmin,tplanckmax,global1d
    3636      use optcv_mod, only: optcv
    3737      use optci_mod, only: optci
     
    154154      INTEGER ig,l,k,nw,iaer
    155155
    156       real,save :: szangle
    157       logical,save :: global1d
    158 !$OMP THREADPRIVATE(szangle,global1d)
    159 
    160156      real*8,allocatable,save :: taugsurf(:,:)
    161157      real*8,allocatable,save :: taugsurfi(:,:)
     
    271267            message='varactive in callcorrk but no h2o_vap tracer.'
    272268            call abort_physic(subname,message,1)
    273          endif
    274 
    275          if (ngrid.eq.1) then
    276             PRINT*, 'Simulate global averaged conditions ?'
    277             global1d = .false. ! default value
    278             call getin_p("global1d",global1d)
    279             write(*,*) "global1d = ",global1d
    280            
    281             ! Test of incompatibility : if global1d is true, there should not be any diurnal cycle.
    282             if (global1d.and.diurnal) then
    283                message='if global1d is true, diurnal must be set to false'
    284                call abort_physic(subname,message,1)
    285             endif
    286 
    287             if (global1d) then
    288                PRINT *,'Solar Zenith angle (deg.) ?'
    289                PRINT *,'(assumed for averaged solar flux S/4)'
    290                szangle=60.0  ! default value
    291                call getin_p("szangle",szangle)
    292                write(*,*) "szangle = ",szangle
    293             endif
    294269         endif
    295270
     
    531506         ENDDO
    532507
    533       if ((ngrid.eq.1).and.(global1d)) then ! Fixed zenith angle 'szangle' in 1D simulations w/ globally-averaged sunlight.
    534          acosz = cos(pi*szangle/180.0)
    535          print*,'acosz=',acosz,', szangle=',szangle
    536       else
    537508         acosz=mu0(ig) ! Cosine of sun incident angle : 3D simulations or local 1D simulations using latitude.
    538       endif
    539509
    540510!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • trunk/LMDZ.GENERIC/libf/phystd/callkeys_mod.F90

    r2340 r2470  
    6464      logical,save :: gwd_convective_source
    6565!$OMP THREADPRIVATE(calllott_nonoro,gwd_convective_source)
     66      logical,save :: global1d
     67      real,save    :: szangle
     68!$OMP THREADPRIVATE(global1d,szangle)
    6669
    6770      integer,save :: iddist
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90

    r2436 r2470  
    88  use comsaison_h, only: mu0, fract, dist_star
    99  use planete_mod
    10   use callkeys_mod, only: check_cpp_match, pceil, tstrat, tracer
     10  use callkeys_mod, only: check_cpp_match, pceil, tstrat, tracer, global1d
    1111  use inifis_mod, only: inifis
    1212  use comcstfi_mod
     
    8484
    8585  integer ierr
    86   logical firstcall,lastcall,global1d
     86  logical firstcall,lastcall
    8787
    8888  character*20,allocatable :: nametrac(:)   ! name of the tracer (no need for adv trac common)
     
    217217
    218218
    219   global1d = .false. ! default value
    220   call getin("global1d",global1d)
    221   write(*,*) " global1d = ",global1d
    222   if(.not.global1d)then
    223      print*,'Error, kcm1d must have global1d=.true. in kcm1d.def!'
    224      stop
    225   end if
    226219
    227220  psurf_n=100000. ! default value for psurf
     
    328321  cpp=1.d-7 !JL because we divide by cpp in inifis, there may be a more elegant solution
    329322  CALL inifis(1,llm,nq,0,86400.0,1,1.0,latitude,longitude,cell_area,rad,g,r,cpp)
     323
     324  if(.not.global1d)then
     325     print*,'Error, kcm1d must have global1d=.true. in kcm1d.def!'
     326     stop
     327  end if
    330328
    331329  !write(*,*) 'BASE 1'
  • trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90

    r2340 r2470  
    432432     write(*,*)" haze = ",haze
    433433
     434! Global1D mean and solar zenith angle
     435
     436     if (ngrid.eq.1) then
     437      PRINT*, 'Simulate global averaged conditions ?'
     438      global1d = .false. ! default value
     439      call getin_p("global1d",global1d)
     440      write(*,*) "global1d = ",global1d
     441     
     442      ! Test of incompatibility : if global1d is true, there should not be any diurnal cycle.
     443      if (global1d.and.diurnal) then
     444         call abort_physic("inifis",'if global1d is true, diurnal must be set to false',1)
     445      endif
     446
     447      if (global1d) then
     448         PRINT *,'Solar Zenith angle (deg.) ?'
     449         PRINT *,'(assumed for averaged solar flux S/4)'
     450         szangle=60.0  ! default value
     451         call getin_p("szangle",szangle)
     452         write(*,*) "szangle = ",szangle
     453      endif
     454   endif
    434455
    435456! Test of incompatibility:
  • trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90

    r2446 r2470  
    5858                              startphy_file, testradtimes, tlocked, &
    5959                              tracer, UseTurbDiff, water, watercond, &
    60                               waterrain
     60                              waterrain, global1d, szangle
    6161      use nonoro_gwd_ran_mod, only: nonoro_gwd_ran
    6262      use conc_mod
     
    863863               call mucorr(ngrid,declin,latitude,mu0,fract,10000.,rad,flatten)
    864864               ! WARNING: this function appears not to work in 1D
     865
     866               if ((ngrid.eq.1).and.(global1d)) then ! Fixed zenith angle 'szangle' in 1D simulations w/ globally-averaged sunlight.
     867                  mu0 = cos(pi*szangle/180.0)
     868                  !print*,'acosz=',mu0,', szangle=',szangle
     869               endif
    865870
    866871            endif
  • trunk/LMDZ.GENERIC/libf/phystd/profile.F

    r2233 r2470  
    185185101   STOP'fichier profile inexistant'
    186186201   CONTINUE
    187       CLOSE(10)
     187      CLOSE(11)
    188188
    189189c-----------------------------------------------------------------------
  • trunk/LMDZ.GENERIC/libf/phystd/thermcell_plume.F90

    r2232 r2470  
    249249               &          + entr_star(ig,l) * zhl(ig,l))                      &
    250250               &          / (f_star(ig,l+1) + detr_star(ig,l))
    251                zqta(ig,l) = (f_star(ig,l) * zqta(ig,l-1) +                    &  ! zqta is set to qt in plume (mixed)
     251               zqta(ig,l) = (f_star(ig,l) * zqta(ig,l-1)                      &  ! zqta is set to qt in plume (mixed)
    252252               &          + entr_star(ig,l) * zqt(ig,l))                      &
    253253               &          / (f_star(ig,l+1) + detr_star(ig,l))
Note: See TracChangeset for help on using the changeset viewer.