Ignore:
Timestamp:
Apr 25, 2025, 6:26:55 PM (3 months ago)
Author:
jbclement
Message:

1D Mars PCM:

  • The value for atmospheric water profile is now imposed as a uniform mixing ratio and not.
  • When atmospheric water profile is monitored, ice value is not put to 0 anymore.
  • The user can now prescribe a non-uniform atmospheric water profile with a file "profile_def_h2o_vap".

JBC

Location:
trunk/LMDZ.MARS/libf/phymars/dyn1d
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90

    r3734 r3737  
    77SUBROUTINE init_testphys1d(start1Dname,startfiname,therestart1D,therestartfi,ngrid,nlayer,odpref,               &
    88                           nq,q,time,psurf,u,v,temp,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w,  &
    9                            play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau)
     9                           play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau,q_def_h2o_vap)
    1010
    1111use ioipsl_getincom,          only: getin ! To use 'getin'
     
    7171real,                                intent(out) :: ptif, pks
    7272real,                                intent(out) :: dttestphys                   ! testphys1d timestep
    73 real, dimension(:),     allocatable, intent(out) :: zqsat                        ! useful for (atm_wat_profile=2)
     73real, dimension(:),     allocatable, intent(out) :: zqsat
    7474real, dimension(:,:,:), allocatable, intent(out) :: dq, dqdyn                    ! Physical and dynamical tandencies
    7575integer,                             intent(out) :: day0                         ! initial (sol ; =0 at Ls=0) and final date
     
    8181real, dimension(1),                  intent(out) :: latitude, longitude, cell_area
    8282real,                                intent(out) :: atm_wat_profile, atm_wat_tau ! Force atmospheric water profiles
     83real, dimension(nlayer),             intent(out) :: q_def_h2o_vap                ! User-defined atmospheric water profile
    8384
    8485!=======================================================================
     
    9495real, dimension(:,:),     allocatable :: psdyn
    9596
    96 ! RV & JBC: Use of starting files for 1D
     97! Use of starting files for 1D
    9798logical                :: found
    9899character(30)          :: header
     
    778779! Check if the atmospheric water profile is specified
    779780! ---------------------------------------------------
    780 ! Adding an option to force atmospheric water values JN
     781! Adding an option to force atmospheric water values
    781782atm_wat_profile = -1. ! Default: free atmospheric water profile
     783q_def_h2o_vap = 0. ! Default
    782784if (water) then
    783     write(*,*)'Force atmospheric water vapor profile (uniform column value in kg.m-2)?'
     785    write(*,*)'Force atmospheric water vapor profile (mixing ratio in kg/kg)?'
    784786    call getin('atm_wat_profile',atm_wat_profile)
    785787    write(*,*) 'atm_wat_profile = ', atm_wat_profile
     
    789791    else if (abs(atm_wat_profile) < 1.e-15) then ! if == 0.
    790792        write(*,*) 'Dry atmospheric water vapor profile'
    791     else if (0. < atm_wat_profile) then
    792         write(*,*) 'Prescribed atmospheric water vapor profile'
     793    else if (0. < atm_wat_profile .and. atm_wat_profile <= 1.) then ! if 0. <= and <= 1.
     794        write(*,*) 'Prescribed uniform atmospheric water vapor profile'
    793795        write(*,*) 'Unless it reaches saturation (maximal value)'
     796    else if (abs(atm_wat_profile + 2.) < 1.e-15) then ! if == -2.
     797        write(*,*) 'Prescribed user-defined atmospheric water vapor profile'
     798        write(*,*) 'Unless it reaches saturation (maximal value)'
     799        open(10,file = 'profile_def_h2o_vap',status = 'old',form = 'formatted',action = 'read',iostat = ierr)
     800        if (ierr == 0) then
     801            do ilayer = 1,nlayer
     802                read(10,*) q_def_h2o_vap(ilayer)
     803            enddo
     804        else
     805            error stop 'File "profile_def_h2o_vap" was not found!'
     806        endif
     807        close(10)
    794808    else
    795         error stop 'Water vapor profile value not correct!'
     809        error stop 'Water vapor profile value is not correct!'
    796810    endif
    797811endif
     
    799813! Check if the atmospheric water profile relaxation is specified
    800814! --------------------------------------------------------------
    801 ! Adding an option to relax atmospheric water values JBC
     815! Adding an option to relax atmospheric water values
    802816atm_wat_tau = -1. ! Default: no time relaxation
    803817if (water) then
     
    808822        write(*,*) 'Atmospheric water vapor profile is not relaxed (forcing).'
    809823    else
    810         if (0. <= atm_wat_profile) then
     824        if (0. <= atm_wat_profile .and. atm_wat_profile <= 1. .or. abs(atm_wat_profile + 2.) < 1.e-15) then
    811825            write(*,*) 'Relaxed atmospheric water vapor profile towards ', atm_wat_profile
    812826            write(*,*) 'Unless it reaches saturation (maximal value)'
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90

    r3734 r3737  
    8181real, dimension(1)      :: latitude, longitude, cell_area
    8282
    83 ! RV & JBC: Use of starting files for 1D
     83! Use of starting files for 1D
    8484logical :: startfiles_1D, therestart1D, therestartfi, there
    8585
    86 ! JN & JBC: Force atmospheric water profiles
     86! Force atmospheric water profiles
    8787real                            :: atm_wat_profile, atm_wat_tau
    88 real, dimension(:), allocatable :: zqsat ! useful for (atm_wat_profile=2)
     88real, dimension(nlayer)         :: q_def_h2o_vap
     89real, dimension(:), allocatable :: zqsat
    8990!=======================================================================
    9091
     
    149150call init_testphys1d('start1D.txt','startfi.nc',therestart1D,therestartfi,ngrid,nlayer,odpref,nq,q, &
    150151                     time,psurf,u,v,temp,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, &
    151                      play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau)
     152                     play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau,q_def_h2o_vap)
    152153
    153154! Write a "startfi" file
     
    196197
    197198    ! Modify atmospheric water if asked
    198     ! Added "atm_wat_profile" flag (JN + JBC)
    199     ! ---------------------------------------
     199    ! Added "atm_wat_profile" flag
     200    ! ----------------------------
    200201    if (water) then
    201202        call watersat(nlayer,temp,play,zqsat)
    202         if (0. <= atm_wat_profile) then ! If atmospheric water is monitored
     203        if (0. <= atm_wat_profile .and. atm_wat_profile <= 1.) then ! If atmospheric water is monitored with a uniform value
    203204            if (atm_wat_tau < 0.) then ! Case for prescribed atm_wat_profile: wet if >0, dry if =0
    204                 q(1,:,igcm_h2o_vap) = min(zqsat,atm_wat_profile*g/psurf)
    205                 q(1,:,igcm_h2o_ice) = 0. ! reset h2o ice
    206             else !  Case for relaxation towards the value atm_wat_profile with relaxation time atm_wat_tau
    207                 q(1,:,igcm_h2o_vap) = atm_wat_profile*g/psurf + (q(1,:,igcm_h2o_vap) - atm_wat_profile*g/psurf)*dexp(-dttestphys/atm_wat_tau)
    208                 q(1,:,igcm_h2o_ice) = 0. ! reset h2o ice
     205                q(1,:,igcm_h2o_vap) = min(zqsat,atm_wat_profile)
     206            else ! Case for relaxation towards the value atm_wat_profile with relaxation time atm_wat_tau
     207                q(1,:,igcm_h2o_vap) = atm_wat_profile + (q(1,:,igcm_h2o_vap) - atm_wat_profile)*dexp(-dttestphys/atm_wat_tau)
     208            endif
     209        else if (abs(atm_wat_profile + 2.) < 1.e-15) then ! If atmospheric water is monitored with a user-defined water profile (with file "profile_def_h2o_vap")
     210            if (atm_wat_tau < 0.) then ! Case for prescribed atm_wat_profile: wet if >0, dry if =0
     211                q(1,:,igcm_h2o_vap) = min(zqsat(:),q_def_h2o_vap(:))
     212            else ! Case for relaxation towards the value atm_wat_profile with relaxation time atm_wat_tau
     213                q(1,:,igcm_h2o_vap) = q_def_h2o_vap(:) + (q(1,:,igcm_h2o_vap) - q_def_h2o_vap(:))*dexp(-dttestphys/atm_wat_tau)
    209214            endif
    210215        endif
Note: See TracChangeset for help on using the changeset viewer.