Changeset 2435 for trunk


Ignore:
Timestamp:
Nov 23, 2020, 11:50:01 AM (4 years ago)
Author:
abierjon
Message:

Mars GCM:
Add stormdust in the aerosol opacities computed by aeroptical.F90
+ add a description of aeroptical in util/README

AB

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r2434 r2435  
    32353235- extend size of long_name character string (ticket #57)
    32363236- remove the use of #ifdef NC_DOUBLE (ticket #67)
     3237 
     3238== 23/11/2020 == AB
     3239Add stormdust in the aerosol opacities computed by aeroptical.F90
     3240+ add a description of aeroptical in util/README
  • trunk/LMDZ.MARS/util/README

    r2432 r2435  
    2222This program is used to concatenate consecutive
    2323output files ("diagfi", and even "stats") for a selection of
    24 variable, in order to obtain one single big file. The time simension can
     24variable, in order to obtain one single big file. The time dimension can
    2525be "sols" or "Ls" (in that last case, Ls will not be linear, and
    2626software like Grads may not be able to use it. To have a linear "Ls"
     
    187187extract.e < extract.points.def
    188188
    189  
     189--------------------------------------------------------------------
     1909) aeroptical.e : compute aerosol opacities at a given wavelength
     191--------------------------------------------------------------------
     192
     193Program to compute opacities [1/km] of all aerosols from dust, water ice
     194and stormdust present in the input file, at a wavelength given by the user.
     195Computation is made from the aerosol mass mixing ratios and effective radius,
     196associated with air density (rho) and files containing the aerosol
     197optical properties (generally present in the GCM datadir/ directory).
     198
     199NB : water ice effective radius is known to be a bit inaccurate in the GCM,
     200so reffwice can be prescribed by the user.
     201
     202input : diagfi.nc  / concat.nc / stats.nc kind of files
     203
     204output file is : name_of_input_file_OPA.nc
     205aeroptical.e < aeroptical.def
  • trunk/LMDZ.MARS/util/aeroptical.F90

    r2327 r2435  
    88! This program takes as inputs a GCM output file (diagfi,stats,concat) that
    99! contains:
    10 !      - the Mass Mixing Ratios of dust (dustq) and water ice (h2o_ice)
    11 !      - their effective radius (reffdust, reffice(*))
     10!      - the Mass Mixing Ratios of dust (dustq), water ice (h2o_ice)
     11!                                 & stormdust (rdsdustq)
     12!      - their effective radius (reffdust, reffice(*), reffstormdust)
    1213!      - the atmospheric density (rho)
    1314! as well as a wavelength to calibrate the opacities, and the directory
    1415! containing the ASCII files of the aerosols' optical properties.
    1516!
    16 ! It outputs a netcdf file containing the opacities [1/km] of the dust and
    17 ! water ice aerosols calibrated at the prescribed wavelength.
     17! It outputs a netcdf file containing the opacities [1/km] of the dust,
     18! water ice and stormdust aerosols calibrated at the prescribed wavelength.
    1819!
    1920!
     
    5657real,dimension(:,:,:,:),allocatable :: rho    ! atmospheric density [kg.m-3]
    5758integer :: naerkind                           ! nb of aerosols to consider
    58 integer :: iaer                               ! aerosol kind index (1=dust, 2=water ice) ! + NEW AER?
     59integer :: iaer                               ! aerosol kind index (1=dust, 2=water ice, 3=stormdust) ! + NEW AER?
    5960integer :: ilon,ilat,ialt,it                  ! Loop indices for coordinates
    6061
     
    174175
    175176! Number of aerosols
    176 naerkind = 2 ! dust & water ice ! + NEW AER?
     177naerkind = 3 ! dust, water ice, stormdust ! + NEW AER?
    177178
    178179! Length allocation of the variables
     
    288289
    289290!==========================================================================
    290 ! --> 1.2.3 + NEW AER?
    291 
    292 !==========================================================================
    293 ! --> 1.2.3 ATMOSPHERIC DENSITY
     291! --> 1.2.3 STORMDUST
     292
     293! STORMDUST MASS MIXING RATIO
     294! Check that the GCM file contains that variable
     295ierr=nf90_inq_varid(gcmfid,"rdsdustq",tmpvarid)
     296error_text="Failed to find variable rdsdustq in "//trim(gcmfile)&
     297            //" We'll skip the stormdust aerosol."
     298if (ierr.ne.nf90_noerr) then
     299  write(*,*)trim(error_text)
     300  aerok(3)=.false.
     301else
     302  ! Load datasets
     303  ierr=NF90_GET_VAR(gcmfid,tmpvarid,mmr(3,:,:,:,:))
     304  error_text="Failed to load stormdust mass mixing ratio"
     305  call status_check(ierr,error_text)
     306  write(*,*) "Stormdust mass mixing ratio loaded from "//trim(gcmfile)
     307  ! Get missing value
     308  ierr=nf90_get_att(gcmfid,tmpvarid,"missing_value",missval(3))
     309  if (ierr.ne.nf90_noerr) then
     310    missval(3) = 1.e+20
     311  endif
     312endif
     313
     314! STORMDUST EFFECTIVE RADIUS
     315if (aerok(3)) then
     316  ! Check that the GCM file contains that variable
     317  ierr=nf90_inq_varid(gcmfid,"reffstormdust",tmpvarid)
     318  error_text="Failed to find variable reffstormdust in "//trim(gcmfile)&
     319              //" We'll skip the dust aerosol."
     320  if (ierr.ne.nf90_noerr) then
     321    write(*,*)trim(error_text)
     322    aerok(3)=.false.
     323  else
     324    ! Load datasets
     325    ierr=NF90_GET_VAR(gcmfid,tmpvarid,reff(3,:,:,:,:))
     326    error_text="Failed to load stormdust effective radius"
     327    call status_check(ierr,error_text)
     328    write(*,*) "Stormdust effective radius loaded from "//trim(gcmfile)
     329  endif
     330endif
     331
     332
     333!==========================================================================
     334! --> 1.2.4 + NEW AER?
     335
     336
     337!==========================================================================
     338! --> 1.2.5 ATMOSPHERIC DENSITY
    294339
    295340! Check that the GCM file contains that variable
     
    319364rho_aer(1)=2500. ! dust
    320365rho_aer(2)=920.  ! water ice
     366rho_aer(3)=2500. ! stormdust
    321367! + NEW AER?
    322368
     
    344390        ! Water ice file
    345391        optpropfile = "optprop_icevis_n30.dat"
     392      CASE(3) ! STORMDUST
     393        ! Dust file
     394        optpropfile = "optprop_dustvis_TM_n50.dat"
    346395! + NEW AER?
    347396      END SELECT ! iaer
     
    357406        ! Water ice file
    358407        optpropfile = "optprop_iceir_n30.dat"
     408      CASE(3) ! STORMDUST
     409        ! Dust file
     410        optpropfile = "optprop_dustir_n50.dat"
    359411! + NEW AER?
    360412      END SELECT ! iaer
     
    540592      ! Write the attributes
    541593      ierr=nf90_put_att(outfid,tmpvaridout,"long_name","Water ice extinction opacity at reference wavelength")
     594     
     595    CASE(3) ! STORMDUST
     596      ! Insert the definition of the variable
     597      tmpvarname="opastormdust"
     598      ierr=NF90_DEF_VAR(outfid,trim(tmpvarname),nf90_float,varshape,tmpvaridout)
     599      error_text="ERROR: Couldn't create "//trim(tmpvarname)//" in the outfile"
     600      call status_check(ierr,error_text)
     601      write(*,*) trim(tmpvarname)//" has been created in the outfile"
     602     
     603      ! Write the attributes
     604      ierr=nf90_put_att(outfid,tmpvaridout,"long_name","Stormdust extinction opacity at reference wavelength")
    542605
    543606! + NEW AER?   
Note: See TracChangeset for help on using the changeset viewer.