Changeset 1208 for trunk


Ignore:
Timestamp:
Mar 12, 2014, 4:30:18 PM (11 years ago)
Author:
tnavarro
Message:

added tauscaling in startfi + moved start_archive routines from dyn3d to phymars

Location:
trunk/LMDZ.MARS
Files:
8 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r1207 r1208  
    20002000  to be done in newstart, and that these values be stored in startfi.nc
    20012001
     2002== 12/03/2014 == TN
     2003- Added tauscaling (the conversion factor from virtual to real dust) in startfi.nc file.
     2004  It is needed for 3 cases:
     2005  1. Compute ice particles size when using microphysics on the first physics step
     2006     before the call to the radiative transfer (updatereffrad)
     2007  2. The conversion to real dust values with newstart, to be used for the freedust mode.
     2008  3. It brings the necessary information for the calculation of the dust 3D opacity
     2009     from start & startfi files only when using virtual dust.
     2010  If tauscaling is not present, the default value is 10^-3 everywhere when needed.
     2011  If the freedust mode is used, tauscaling is equal to 1 everywhere.
     2012  Modified accordingly startfi and start_archive writing and reading routines.
     2013
     2014
  • trunk/LMDZ.MARS/libf/phymars/aeropacity.F

    r1104 r1208  
    120120c       when computing the dust opacity in each layer
    121121c       (this applies when doubleq and active are true)
    122       INTEGER, PARAMETER :: cstdustlevel = 7
     122      INTEGER, PARAMETER :: cstdustlevel0 = 7
     123      INTEGER, SAVE      :: cstdustlevel
    123124
    124125      LOGICAL,SAVE :: firstcall=.true.
     
    198199!       otherwise default value read from starfi.nc file will be used)
    199200        call getin("tauvis",tauvis)
     201
     202        IF (freedust) THEN
     203          cstdustlevel = 1
     204        ELSE
     205          cstdustlevel = cstdustlevel0
     206        ENDIF
     207
    200208
    201209        firstcall=.false.
     
    454462            tauscaling(ig) = tauref(ig) *
    455463     &                       pplev(ig,1) / odpref / taudusttmp(ig)
    456 c            tauscaling(ig) = 1.e-4
    457464        ENDDO
    458465
     
    470477
    471478      IF (freedust) THEN
    472        ! tauref has been initialized to 0 before.
    473        DO iaer=1,naerdust
    474         DO l=1,nlayer
    475          DO ig=1,ngrid
    476           tauref(ig) = tauref(ig) +
    477      &                aerosol(ig,l,iaerdust(iaer))
    478           ENDDO
    479         ENDDO
    480        ENDDO
     479        ! tauref has been initialized to 0 before.
     480        DO iaer=1,naerdust
     481          DO l=1,nlayer
     482            DO ig=1,ngrid
     483              tauref(ig) = tauref(ig) +
     484     &                    aerosol(ig,l,iaerdust(iaer))
     485            ENDDO
     486          ENDDO
     487        ENDDO
     488        tauref(:) = tauref(:) * odpref / pplev(:,1)
    481489      ENDIF
    482490     
  • trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F

    r1207 r1208  
    22     &     date,tsurf,tsoil,emis,q2,
    33     &     t,ucov,vcov,ps,co2ice,h,phisold_newgrid,
    4      &     q,qsurf,surfith,nid)
     4     &     q,qsurf,tauscaling,surfith,nid)
    55c=======================================================================
    66c
     
    109109      REAL emis(ngrid)
    110110      REAL q2(ngrid,nlayer+1),qsurf(ngrid,nqtot)
     111      REAL tauscaling(ngrid) ! dust conversion factor
    111112c     REAL phisfi(ngrid)
    112113
     
    136137      real co2iceS(iip1,jjp1),emisS(iip1,jjp1)
    137138      REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nqtot)
     139      real tauscalingS(iip1,jjp1)
    138140
    139141      real ptotal, co2icetotal
     
    163165      real, dimension(:,:), allocatable :: emisold
    164166      real, dimension(:,:,:,:), allocatable :: qold
     167      real, dimension(:,:), allocatable :: tauscalingold
    165168
    166169      real tab_cntrl(100)
     
    337340      allocate(mlayerold(nsoilold))
    338341      allocate(qsurfold(imold+1,jmold+1,nqtot))
     342      allocate(tauscalingold(imold+1,jmold+1))
    339343
    340344      allocate(var (imold+1,jmold+1,llm))
     
    662666
    663667c-----------------------------------------------------------------------
    664 c 5.1 Lecture des champs 2D (co2ice, emis,ps,tsurf,Tg[10], q2surf)
     668c 5.1 Lecture des champs 2D (co2ice, emis,ps,tsurf,Tg[10], q2surf, tauscaling)
    665669c-----------------------------------------------------------------------
    666670 
     
    742746         PRINT*, "lect_start_archive: Failed loading <q2surf>"
    743747         CALL abort
     748      ENDIF
     749c
     750      ierr = NF_INQ_VARID (nid, "tauscaling", nvarid)
     751      IF (ierr .NE. NF_NOERR) THEN
     752         PRINT*, "lect_start_archive: <tauscaling> not in file"
     753         tauscalingold(:,:) = -1
     754      ELSE
     755#ifdef NC_DOUBLE
     756        ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,tauscalingold)
     757#else
     758        ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,tauscalingold)
     759#endif
     760        IF (ierr .NE. NF_NOERR) THEN
     761           PRINT*, "lect_start_archive: Failed loading <tauscaling>"
     762           PRINT*, NF_STRERROR(ierr)
     763           CALL abort
     764        ENDIF
    744765      ENDIF
    745766c
     
    10191040      call interp_horiz (emisold,emiss,imold,jmold,iim,jjm,1,
    10201041     &                   rlonuold,rlatvold,rlonu,rlatv)
    1021       call gr_dyn_fi (1,iim+1,jjm+1,ngrid,emiss,emis)
     1042c Dust conversion factor
     1043      call interp_horiz (tauscalingold,tauscalings,imold,jmold,iim,jjm,
     1044     &                   1,rlonuold,rlatvold,rlonu,rlatv)
     1045      call gr_dyn_fi (1,iim+1,jjm+1,ngrid,tauscalings,tauscaling)
    10221046c     write(46,*) 'emis',emis
    10231047c-----------------------------------------------------------------------
     
    13781402      deallocate(mlayerold)
    13791403      deallocate(qsurfold)
     1404      deallocate(tauscalingold)
    13801405      deallocate(var,varp1)
    13811406
  • trunk/LMDZ.MARS/libf/phymars/newstart.F

    r1130 r1208  
    109109      REAL co2ice(ngridmx)      ! CO2 ice layer
    110110      REAL emis(ngridmx)        ! surface emissivity
     111      REAL tauscaling(ngridmx) ! dust conversion factor
     112      REAL tauscadyn(iip1,jjp1) ! dust conversion factor on the dynamics grid
    111113      REAL,ALLOCATABLE :: qsurf(:,:)
    112114      REAL q2(ngridmx,nlayermx+1)
     
    426428     &   date,tsurf,tsoil,emis,q2,
    427429     &   t,ucov,vcov,ps,co2ice,teta,phisold_newgrid,q,qsurf,
    428      &   surfith,nid)
     430     &   tauscaling,surfith,nid)
    429431        write(*,*) "OK, read start_archive file"
    430432        ! copy soil thermal inertia
     
    447449        CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,ngridmx,llm,nqtot,
    448450     .        day_ini,time,
    449      .        tsurf,tsoil,emis,q2,qsurf,co2ice)
     451     .        tsurf,tsoil,emis,q2,qsurf,co2ice,tauscaling)
    450452       
    451453        ! copy albedo and soil thermal inertia
     
    858860             endif
    859861             
    860 c       q=profile : initialize tracer with a given profile
     862c       convert dust from virtual to true values
    861863c       --------------------------------------------------
    862864        else if (trim(modif) .eq. 'freedust') then
     865         if (minval(tauscaling) .lt. 0) then
     866           write(*,*) 'WARNING conversion factor negative'
     867           write(*,*) 'This is probably because it was not present
     868     &in the file'
     869           write(*,*) 'A constant conversion is used instead.'
     870           tauscaling(:) = 1.e-3
     871         endif
     872         CALL gr_fi_dyn(1,ngridmx,iip1,jjp1,tauscaling,tauscadyn)
    863873          do l=1,llm
    864874            do j=1,jjp1
    865875              do i=1,iip1
    866876                if (igcm_dust_number .ne. 0)
    867      &          q(i,j,l,igcm_dust_number)=
    868      &                q(i,j,l,igcm_dust_number) * 1e-3 ! grosso modo
     877     &            q(i,j,l,igcm_dust_number) =
     878     &            q(i,j,l,igcm_dust_number) * tauscadyn(i,j)
    869879                if (igcm_dust_mass .ne. 0)
    870      &          q(i,j,l,igcm_dust_mass)=
    871      &                q(i,j,l,igcm_dust_mass)   * 1e-3 ! grosso modo
     880     &            q(i,j,l,igcm_dust_mass) =
     881     &            q(i,j,l,igcm_dust_mass) * tauscadyn(i,j)
    872882                if (igcm_ccn_number .ne. 0)
    873      &          q(i,j,l,igcm_ccn_number)=
    874      &                q(i,j,l,igcm_ccn_number) * 1e-3 ! grosso modo
     883     &            q(i,j,l,igcm_ccn_number) =
     884     &            q(i,j,l,igcm_ccn_number) * tauscadyn(i,j)
    875885                if (igcm_ccn_mass .ne. 0)
    876      &          q(i,j,l,igcm_ccn_mass)=
    877      &                q(i,j,l,igcm_ccn_mass)   * 1e-3 ! grosso modo
     886     &            q(i,j,l,igcm_ccn_mass) =
     887     &            q(i,j,l,igcm_ccn_mass) * tauscadyn(i,j)
    878888              end do
    879889            end do
    880890          end do
     891
     892          tauscaling(:) = 1.
    881893
    882894         ! We want to have the very same value at lon -180 and lon 180
     
    888900             end do
    889901          end do
     902
     903          write(*,*) 'done rescaling to true vale'
    890904
    891905c       ini_q : Initialize tracers for chemistry
     
    15291543      call physdem1("restartfi.nc",nsoilmx,ngridmx,llm,nqtot,
    15301544     .              dtphys,hour_ini,
    1531      .              tsurf,tsoil,co2ice,emis,q2,qsurf)
     1545     .              tsurf,tsoil,co2ice,emis,q2,qsurf,tauscaling)
    15321546
    15331547c=======================================================================
  • trunk/LMDZ.MARS/libf/phymars/phyetat0.F90

    r1130 r1208  
    11subroutine phyetat0 (fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq, &
    2                      day_ini,time0,tsurf,tsoil,emis,q2,qsurf,co2ice)
    3 
     2                     day_ini,time0,tsurf,tsoil,emis,q2,qsurf,co2ice, &
     3                     tauscaling)
    44!  use netcdf
    55  use infotrac, only: nqtot, tname
     
    5757  real,intent(out) :: qsurf(ngrid,nq) ! tracers on surface
    5858  real,intent(out) :: co2ice(ngrid) ! co2 ice cover
     59  real,intent(out) :: tauscaling(ngrid) ! dust conversion factor
    5960
    6061!======================================================================
     
    236237
    237238
     239! Dust conversion factor
     240call get_field("tauscaling",tauscaling,found,indextime)
     241if (.not.found) then
     242  write(*,*) "phyetat0: <tauscaling> not in file"
     243  tauscaling(:) = -1
     244else
     245  write(*,*) "phyetat0: dust conversion factor <tauscaling> range:", &
     246             minval(tauscaling), maxval(tauscaling)
     247endif
     248
     249
    238250! Surface temperature :
    239251call get_field("tsurf",tsurf,found,indextime)
  • trunk/LMDZ.MARS/libf/phymars/phyredem.F90

    r1130 r1208  
    143143
    144144subroutine physdem1(filename,nsoil,ngrid,nlay,nq, &
    145                     phystep,time,tsurf,tsoil,co2ice,emis,q2,qsurf)
     145                    phystep,time,tsurf,tsoil,co2ice,emis,q2,qsurf,&
     146                    tauscaling)
    146147  ! write time-dependent variable to restart file
    147148  use iostart, only : open_restartphy, close_restartphy, &
     
    162163  real,intent(in) :: q2(ngrid,nlay+1)
    163164  real,intent(in) :: qsurf(ngrid,nq)
     165  real,intent(in) :: tauscaling(ngrid)
    164166 
    165167  integer :: iq
     
    192194  call put_field("q2","pbl wind variance",q2,time)
    193195 
     196  ! Dust conversion factor
     197  ! Only to be read by newstart to convert to actual dust values
     198  ! Or by any user who wants to reconstruct dust, opacity from the start files.
     199  call put_field("tauscaling","dust conversion factor",tauscaling,time)
     200
    194201  ! Tracers on the surface
    195202  ! preliminary stuff: look for water vapour & water ice tracers (if any)
  • trunk/LMDZ.MARS/libf/phymars/physiq.F

    r1130 r1208  
    436436     &         nsoilmx,ngrid,nlayer,nq,
    437437     &         day_ini,time_phys,
    438      &         tsurf,tsoil,emis,q2,qsurf,co2ice)
     438     &         tsurf,tsoil,emis,q2,qsurf,co2ice,tauscaling)
    439439#else
    440440#include "meso_inc/meso_inc_ini.F"
     
    15821582          call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq,
    15831583     .                ptimestep,ztime_fin,
    1584      .                tsurf,tsoil,co2ice,emis,q2,qsurf)
     1584     .                tsurf,tsoil,co2ice,emis,q2,qsurf,tauscaling)
    15851585         
    15861586         ENDIF
     
    21362136c            call WRITEDIAGFI(ngrid,'dqsdif','diffusion',
    21372137c     &                       'kg.m-2.s-1',2,zdqsdif(1,1))
     2138c             call WRITEDIAGFI(ngrid,'sedice','sedimented ice',
     2139c     &                       'kg.m-2.s-1',2,zdqssed(:,igcm_h2o_ice))
     2140c             call WRITEDIAGFI(ngrid,'subice','sublimated ice',
     2141c     &                       'kg.m-2.s-1',2,zdqsdif(:,igcm_h2o_ice))
    21382142             call WRITEDIAGFI(ngrid,'dqsdust',
    21392143     &                        'deposited surface dust mass',
     
    21482152             call WRITEDIAGFI(ngrid,'dustN','Dust number',
    21492153     &                        'part/kg',3,ndust)
     2154c             call WRITEDIAGFI(ngrid,"tauscaling",
     2155c     &                    "dust conversion factor"," ",2,tauscaling)
    21502156#ifdef MESOINI
    21512157!     !!! to initialize mesoscale we need scaled variables
  • trunk/LMDZ.MARS/libf/phymars/start2archive.F

    r1130 r1208  
    6767      REAL tsoil(ngridmx,nsoilmx) ! Soil temperature
    6868      REAL co2ice(ngridmx)      ! CO2 ice layer
     69      REAL tauscaling(ngridmx) ! dust conversion factor
    6970      REAL q2(ngridmx,llm+1)
    7071      REAL,ALLOCATABLE :: qsurf(:,:)
     
    8283      REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia
    8384      REAL co2iceS(ip1jmp1)
     85      REAL tauscalingS(ip1jmp1)
    8486      REAL q2S(ip1jmp1,llm+1)
    8587      REAL,ALLOCATABLE :: qsurfS(:,:)
     
    147149
    148150      CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,ngridmx,llm,nqtot,
    149      &      day_ini_fi,timefi,tsurf,tsoil,emis,q2,qsurf,co2ice)
     151     &      day_ini_fi,timefi,tsurf,tsoil,emis,q2,qsurf,co2ice,
     152     &      tauscaling)
    150153
    151154       ierr = NF_OPEN (fichnom, NF_NOWRITE,nid1)
     
    242245c q2 --> q2S
    243246c qsurf --> qsurfS
     247c tauscaling --> tauscalingS
    244248c
    245249c-----------------------------------------------------------------------
     
    253257      call gr_fi_dyn(llm+1,ngridmx,iip1,jjp1,q2,q2S)
    254258      call gr_fi_dyn(nqtot,ngridmx,iip1,jjp1,qsurf,qsurfS)
     259      call gr_fi_dyn(1,ngridmx,iip1,jjp1,tauscaling,tauscalingS)
    255260
    256261c=======================================================================
     
    341346      call write_archive(nid,ntime,'co2ice','couche de glace co2',
    342347     &  'kg/m2',2,co2iceS)
     348      call write_archive(nid,ntime,'tauscaling',
     349     &  'dust conversion factor',' ',2,tauscalingS)
    343350      call write_archive(nid,ntime,'emis','grd emis',' ',2,emisS)
    344351      call write_archive(nid,ntime,'ps','Psurf','Pa',2,ps)
  • trunk/LMDZ.MARS/libf/phymars/updatereffrad.F

    r1047 r1208  
    128128        IF (water.AND.activice) THEN
    129129         IF (microphys) THEN
    130          
    131           IF (firstcall) THEN
    132             DO l=1,nlayer
    133               DO ig=1,ngrid
    134                 call updaterice_micro(pq(ig,l,igcm_h2o_ice),
    135      &                                pq(ig,l,igcm_ccn_mass),
    136      &                                pq(ig,l,igcm_ccn_number),
    137      &                                1.e-3,rice(ig,l),
    138      &                                rhocloud(ig,l))
    139                 nuice(ig,l) = nuice_ref
    140               ENDDO
    141             ENDDO
    142           firstcall = .false.
     130       
    143131c    At firstcall, the true number and true mass of cloud condensation nuclei are not known.
    144132c    Indeed it is scaled on the prescribed dust opacity via a 'tauscaling' coefficient
    145 c    computed after radiative transfer.
    146           ELSE
    147             DO l=1,nlayer
    148               DO ig=1,ngrid
    149                 call updaterice_micro(pq(ig,l,igcm_h2o_ice),
    150      &                                pq(ig,l,igcm_ccn_mass),
    151      &                                pq(ig,l,igcm_ccn_number),
    152      &                                tauscaling(ig),rice(ig,l),
    153      &                                rhocloud(ig,l))
    154                 nuice(ig,l) = nuice_ref
    155                ENDDO
    156              ENDDO
    157           ENDIF ! of if firstcall
     133c    computed after radiative transfer. If tauscaling is not in startfi, we make an assumption for its value.
     134
     135          IF (firstcall) THEN
     136            IF (minval(tauscaling).lt.0) tauscaling(:) = 1.e-3 ! default value when non-read in startfi is -1
     137            IF (freedust)                tauscaling(:) = 1.    ! if freedust, enforce no rescaling at all
     138            firstcall = .false.
     139          ENDIF
     140 
     141          DO l=1,nlayer
     142            DO ig=1,ngrid
     143              call updaterice_micro(pq(ig,l,igcm_h2o_ice),
     144     &                              pq(ig,l,igcm_ccn_mass),
     145     &                              pq(ig,l,igcm_ccn_number),
     146     &                              tauscaling(ig),rice(ig,l),
     147     &                              rhocloud(ig,l))
     148              nuice(ig,l) = nuice_ref
     149            ENDDO
     150          ENDDO
    158151         
    159152        ELSE ! if not microphys
Note: See TracChangeset for help on using the changeset viewer.