Changeset 3737 for trunk/LMDZ.MARS/libf/phymars
- Timestamp:
- Apr 25, 2025, 6:26:55 PM (3 months ago)
- 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 7 7 SUBROUTINE init_testphys1d(start1Dname,startfiname,therestart1D,therestartfi,ngrid,nlayer,odpref, & 8 8 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) 10 10 11 11 use ioipsl_getincom, only: getin ! To use 'getin' … … 71 71 real, intent(out) :: ptif, pks 72 72 real, intent(out) :: dttestphys ! testphys1d timestep 73 real, dimension(:), allocatable, intent(out) :: zqsat ! useful for (atm_wat_profile=2)73 real, dimension(:), allocatable, intent(out) :: zqsat 74 74 real, dimension(:,:,:), allocatable, intent(out) :: dq, dqdyn ! Physical and dynamical tandencies 75 75 integer, intent(out) :: day0 ! initial (sol ; =0 at Ls=0) and final date … … 81 81 real, dimension(1), intent(out) :: latitude, longitude, cell_area 82 82 real, intent(out) :: atm_wat_profile, atm_wat_tau ! Force atmospheric water profiles 83 real, dimension(nlayer), intent(out) :: q_def_h2o_vap ! User-defined atmospheric water profile 83 84 84 85 !======================================================================= … … 94 95 real, dimension(:,:), allocatable :: psdyn 95 96 96 ! RV & JBC:Use of starting files for 1D97 ! Use of starting files for 1D 97 98 logical :: found 98 99 character(30) :: header … … 778 779 ! Check if the atmospheric water profile is specified 779 780 ! --------------------------------------------------- 780 ! Adding an option to force atmospheric water values JN781 ! Adding an option to force atmospheric water values 781 782 atm_wat_profile = -1. ! Default: free atmospheric water profile 783 q_def_h2o_vap = 0. ! Default 782 784 if (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)?' 784 786 call getin('atm_wat_profile',atm_wat_profile) 785 787 write(*,*) 'atm_wat_profile = ', atm_wat_profile … … 789 791 else if (abs(atm_wat_profile) < 1.e-15) then ! if == 0. 790 792 write(*,*) 'Dry atmospheric water vapor profile' 791 else if (0. < atm_wat_profile ) then792 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' 793 795 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) 794 808 else 795 error stop 'Water vapor profile value not correct!'809 error stop 'Water vapor profile value is not correct!' 796 810 endif 797 811 endif … … 799 813 ! Check if the atmospheric water profile relaxation is specified 800 814 ! -------------------------------------------------------------- 801 ! Adding an option to relax atmospheric water values JBC815 ! Adding an option to relax atmospheric water values 802 816 atm_wat_tau = -1. ! Default: no time relaxation 803 817 if (water) then … … 808 822 write(*,*) 'Atmospheric water vapor profile is not relaxed (forcing).' 809 823 else 810 if (0. <= atm_wat_profile ) then824 if (0. <= atm_wat_profile .and. atm_wat_profile <= 1. .or. abs(atm_wat_profile + 2.) < 1.e-15) then 811 825 write(*,*) 'Relaxed atmospheric water vapor profile towards ', atm_wat_profile 812 826 write(*,*) 'Unless it reaches saturation (maximal value)' -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3734 r3737 81 81 real, dimension(1) :: latitude, longitude, cell_area 82 82 83 ! RV & JBC:Use of starting files for 1D83 ! Use of starting files for 1D 84 84 logical :: startfiles_1D, therestart1D, therestartfi, there 85 85 86 ! JN & JBC:Force atmospheric water profiles86 ! Force atmospheric water profiles 87 87 real :: atm_wat_profile, atm_wat_tau 88 real, dimension(:), allocatable :: zqsat ! useful for (atm_wat_profile=2) 88 real, dimension(nlayer) :: q_def_h2o_vap 89 real, dimension(:), allocatable :: zqsat 89 90 !======================================================================= 90 91 … … 149 150 call init_testphys1d('start1D.txt','startfi.nc',therestart1D,therestartfi,ngrid,nlayer,odpref,nq,q, & 150 151 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) 152 153 153 154 ! Write a "startfi" file … … 196 197 197 198 ! Modify atmospheric water if asked 198 ! Added "atm_wat_profile" flag (JN + JBC)199 ! ---------------------------- -----------199 ! Added "atm_wat_profile" flag 200 ! ---------------------------- 200 201 if (water) then 201 202 call watersat(nlayer,temp,play,zqsat) 202 if (0. <= atm_wat_profile ) then ! If atmospheric water is monitored203 if (0. <= atm_wat_profile .and. atm_wat_profile <= 1.) then ! If atmospheric water is monitored with a uniform value 203 204 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) 209 214 endif 210 215 endif
Note: See TracChangeset
for help on using the changeset viewer.