Changeset 3067 for trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
- Timestamp:
- Oct 3, 2023, 11:21:28 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3066 r3067 1 1 PROGRAM testphys1d 2 2 3 use comsoil_h, 4 use surfdat_h, 5 use comslope_mod, 6 use phyredem, 7 use watersat_mod, 8 use tracer_mod, 9 use comcstfi_h, 10 use time_phylmdz_mod, 11 use dimradmars_mod, 12 use dust_param_mod, 13 use comvert_mod, 14 use physiq_mod, 15 use phyetat0_mod, only: phyetat016 use write_output_mod, 17 use init_testphys1d_mod, 3 use comsoil_h, only: inertiedat, inertiesoil, nsoilmx, tsoil 4 use surfdat_h, only: albedodat, perenial_co2ice, watercap, tsurf, emis, qsurf 5 use comslope_mod, only: def_slope, subslope_dist 6 use phyredem, only: physdem0, physdem1 7 use watersat_mod, only: watersat 8 use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice, noms 9 use comcstfi_h, only: pi, rad, omeg, g, mugaz, rcp, r, cpp 10 use time_phylmdz_mod, only: daysec, day_step 11 use dimradmars_mod, only: tauvis, totcloudfrac, albedo 12 use dust_param_mod, only: tauscaling 13 use comvert_mod, only: ap, bp, aps, bps, pa, preff, sig 14 use physiq_mod, only: physiq 15 use turb_mod, only: q2 16 use write_output_mod, only: write_output 17 use init_testphys1d_mod, only: init_testphys1d 18 18 ! Mostly for XIOS outputs: 19 use mod_const_mpi, 20 use parallel_lmdz, 19 use mod_const_mpi, only: init_const_mpi 20 use parallel_lmdz, only: init_parallel 21 21 22 22 implicit none … … 58 58 ! Declarations 59 59 !-------------------------------------------------------------- 60 integer, parameter :: ngrid = 1 ! (2+(jjm-1)*iim - 1/jjm) 61 integer, parameter :: nlayer = llm 62 real, parameter :: odpref = 610. ! DOD reference pressure (Pa) 63 integer :: unitstart ! unite d'ecriture de "startfi" 64 integer :: ndt, ilayer, ilevel, isoil, idt, iq 65 logical :: firstcall, lastcall 66 integer :: day0 ! initial (sol ; =0 at Ls=0) 67 real :: day ! date during the run 68 real :: time ! time (0<time<1 ; time=0.5 a midi) 69 real :: dttestphys ! testphys1d timestep 70 real, dimension(nlayer) :: play ! Pressure at the middle of the layers (Pa) 71 real, dimension(nlayer + 1) :: plev ! intermediate pressure levels (pa) 72 real :: psurf ! Surface pressure 73 real, dimension(nlayer) :: u, v ! zonal, meridional wind 74 real :: gru, grv ! prescribed "geostrophic" background wind 75 real, dimension(nlayer) :: temp ! temperature at the middle of the layers 76 real, dimension(:,:), allocatable :: q ! tracer mixing ratio (e.g. kg/kg) 77 real, dimension(1) :: wstar = 0. ! Thermals vertical velocity 78 real, dimension(nlayer + 1) :: q2 ! Turbulent Kinetic Energy 60 integer, parameter :: ngrid = 1 ! (2+(jjm-1)*iim - 1/jjm) 61 integer, parameter :: nlayer = llm 62 real, parameter :: odpref = 610. ! DOD reference pressure (Pa) 63 integer :: unitstart ! unite d'ecriture de "startfi" 64 integer :: ndt, ilayer, ilevel, isoil, idt, iq 65 logical :: firstcall, lastcall 66 integer :: day0 ! initial (sol ; =0 at Ls=0) 67 real :: day ! date during the run 68 real :: time ! time (0<time<1 ; time=0.5 a midi) 69 real :: dttestphys ! testphys1d timestep 70 real, dimension(nlayer) :: play ! Pressure at the middle of the layers (Pa) 71 real, dimension(nlayer + 1) :: plev ! intermediate pressure levels (pa) 72 real :: psurf ! Surface pressure 73 real, dimension(nlayer) :: u, v ! zonal, meridional wind 74 real :: gru, grv ! prescribed "geostrophic" background wind 75 real, dimension(nlayer) :: temp ! temperature at the middle of the layers 76 real, dimension(:,:,:), allocatable :: q ! tracer mixing ratio (e.g. kg/kg) 77 real, dimension(1) :: wstar = 0. ! Thermals vertical velocity 79 78 80 79 ! Physical and dynamical tandencies (e.g. m.s-2, K/s, Pa/s) 81 real, dimension(nlayer) :: du, dv, dtemp, dudyn, dvdyn, dtempdyn82 real, dimension(1) :: dpsurf83 real, dimension(:,: ), allocatable :: dq, dqdyn80 real, dimension(nlayer) :: du, dv, dtemp, dudyn, dvdyn, dtempdyn 81 real, dimension(1) :: dpsurf 82 real, dimension(:,:,:), allocatable :: dq, dqdyn 84 83 85 84 ! Various intermediate variables … … 115 114 !call initcomgeomphy 116 115 117 call init_testphys1d(.false.,ngrid,nlayer,odpref,nq,q,time,psurf,u,v,temp,startfiles_1D,therestart1D, therestartfi,&118 ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w,q2,play,plev,&119 latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau)116 call init_testphys1d(.false.,ngrid,nlayer,odpref,nq,q,time,psurf,u,v,temp,startfiles_1D,therestart1D, & 117 therestartfi,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 118 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 120 119 121 120 ! Write a "startfi" file … … 171 170 ! If atmospheric water is monitored 172 171 if (atm_wat_tau < 0.) then ! Prescribed atm_wat_profile: wet if >0, dry if =0 173 q( :,igcm_h2o_vap) = min(zqsat(:),atm_wat_profile*g/psurf)174 q( :,igcm_h2o_ice) = 0. ! reset h2o ice172 q(1,:,igcm_h2o_vap) = min(zqsat(:),atm_wat_profile*g/psurf) 173 q(1,:,igcm_h2o_ice) = 0. ! reset h2o ice 175 174 else ! Relaxation towards the value atm_wat_profile with relaxation time atm_wat_tau 176 q( :,igcm_h2o_vap) = atm_wat_profile*g/psurf + (q(:,igcm_h2o_vap) - atm_wat_profile*g/psurf)*dexp(-dttestphys/atm_wat_tau)177 q( :,igcm_h2o_vap) = min(zqsat(:),q(:,igcm_h2o_vap))178 q( :,igcm_h2o_ice) = 0. ! reset h2o ice175 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) 176 q(1,:,igcm_h2o_vap) = min(zqsat(:),q(1,:,igcm_h2o_vap)) 177 q(1,:,igcm_h2o_ice) = 0. ! reset h2o ice 179 178 endif 180 179 endif … … 195 194 !enddo 196 195 ! For some tests: No coriolis force at equator 197 !if (latitude(1) == 0.) then196 !if (latitude(1) == 0.) then 198 197 du(:) = du(:) + (gru - u(:))/1.e4 199 198 dv(:) = dv(:) + (grv - v(:))/1.e4 … … 222 221 223 222 ! Increment tracers 224 q( :,:) = q(:,:) + dttestphys*dq(:,:)223 q(1,:,:) = q(1,:,:) + dttestphys*dq(1,:,:) 225 224 enddo ! End of time stepping loop (idt=1,ndt) 226 225
Note: See TracChangeset
for help on using the changeset viewer.