Changeset 3060
- Timestamp:
- Sep 28, 2023, 3:15:23 PM (14 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3058 r3060 4232 4232 - update callphys.def.MCD6 to disable Frost metamorphism option 4233 4233 4234 4234 == 28/09/2023 == JBC 4235 Related to commit r3056, correction of bugs and some adaptations of the subroutine 'init_testphys1d'. -
trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
r3056 r3060 5 5 contains 6 6 7 SUBROUTINE init_testphys1d( ngrid,nq,nlayer,odpref,ndt,ptif,pks,dttestphys,startfiles_1D,q,zqsat,qsurf,dq,dqdyn, &8 day0,day,time,psurf,tsurf,gru,grv,u,v,w,q2,play,plev,tsoil,temp,albedo,emis,&9 latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau)7 SUBROUTINE init_testphys1d(startfiles_1D,therestart1D,therestartfi,ngrid,nlayer,odpref,nq,ndt,ptif,pks,dttestphys, & 8 q,zqsat,qsurf,dq,dqdyn,day0,day,time,psurf,tsurf,gru,grv,u,v,w,q2,play,plev,tsoil,temp, & 9 albedo,emis,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 10 10 11 11 use ioipsl_getincom, only: getin ! To use 'getin' … … 47 47 ! Arguments 48 48 !======================================================================= 49 logical, intent(in) :: startfiles_1D, therestart1D, therestartfi ! Use of "start1D.txt" and "startfi.nc" files 49 50 integer, intent(in) :: ngrid, nlayer 50 51 real, intent(in) :: odpref ! DOD reference pressure (Pa) … … 55 56 real, intent(out) :: ptif, pks 56 57 real, intent(out) :: dttestphys ! testphys1d timestep 57 logical, intent(out) :: startfiles_1D ! Use of "start1D.txt" and "startfi.nc" files58 58 real, dimension(:,:), allocatable, intent(out) :: q ! tracer mixing ratio (e.g. kg/kg) 59 59 real, dimension(:), allocatable, intent(out) :: zqsat ! useful for (atm_wat_profile=2) … … 62 62 integer, intent(out) :: day0 ! initial (sol ; =0 at Ls=0) and final date 63 63 real, intent(out) :: day ! date during the run 64 real, intent(out) :: time ! time (0<time<1 ; time=0.5 a midi)64 real, intent(out) :: time ! time (0<time<1; time=0.5 at noon) 65 65 real, intent(out) :: psurf ! Surface pressure 66 66 real, dimension(1), intent(out) :: tsurf ! Surface temperature … … 70 70 real, dimension(nlayer), intent(out) :: play ! Pressure at the middle of the layers (Pa) 71 71 real, dimension(nlayer + 1), intent(out) :: plev ! intermediate pressure levels (pa) 72 real, dimension(nsoilmx), intent(out) :: tsoil ! subsurface soi ktemperature (K)72 real, dimension(nsoilmx), intent(out) :: tsoil ! subsurface soil temperature (K) 73 73 real, dimension(nlayer), intent(out) :: temp ! temperature at the middle of the layers 74 74 real, dimension(1,1), intent(out) :: albedo ! surface albedo … … 90 90 91 91 ! RV & JBC: Use of "start1D.txt" and "startfi.nc" files 92 logical :: found , therestart1D, therestartfi92 logical :: found 93 93 character(len = 30) :: header 94 94 real, dimension(100) :: tab_cntrl … … 118 118 119 119 !------------------------------------------------------ 120 ! Loading run parameters from "run.def" file121 !------------------------------------------------------122 ! check if 'run.def' file is around (otherwise reading parameters123 ! from callphys.def via getin() routine won't work.124 inquire(file = 'run.def',exist = there)125 if (.not. there) then126 write(*,*) 'Cannot find required file "run.def"'127 write(*,*) ' (which should contain some input parameters along with the following line: INCLUDEDEF=callphys.def)'128 write(*,*) ' ... might as well stop here ...'129 stop130 endif131 132 write(*,*)'Do you want to use "start1D.txt" and "startfi.nc" files?'133 startfiles_1D = .false.134 call getin("startfiles_1D",startfiles_1D)135 write(*,*) " startfiles_1D = ", startfiles_1D136 137 if (startfiles_1D) then138 inquire(file = 'start1D.txt',exist = therestart1D)139 if (.not. therestart1D) then140 write(*,*) 'There is no "start1D.txt" file!'141 write(*,*) 'Initialization is done with default values.'142 endif143 inquire(file = 'startfi.nc',exist = therestartfi)144 if (.not. therestartfi) then145 write(*,*) 'There is no "startfi.nc" file!'146 write(*,*) 'Initialization is done with default values.'147 endif148 endif149 150 !------------------------------------------------------151 120 ! Prescribed constants to be set here 152 121 !------------------------------------------------------ … … 155 124 ! Mars planetary constants 156 125 ! ------------------------ 157 rad = 3397200. ! mars radius (m) ~3397200 m 158 omeg = 4.*asin(1.)/(daysec) ! rotation rate (rad.s-1) 159 g = 3.72 ! gravity (m.s-2) ~3.72 160 mugaz = 43.49 ! atmosphere mola mass (g.mol-1) ~43.49 161 rcp = .256793 ! = r/cp ~0.256793 126 rad = 3397200. ! mars radius (m) ~3397200 m 127 daysec = 88775. ! length of a sol (s) ~88775 s 128 omeg = 4.*asin(1.)/daysec ! rotation rate (rad.s-1) 129 g = 3.72 ! gravity (m.s-2) ~3.72 130 mugaz = 43.49 ! atmosphere mola mass (g.mol-1) ~43.49 131 rcp = .256793 ! = r/cp ~0.256793 162 132 r = 8.314511*1000./mugaz 163 133 cpp = r/rcp 164 daysec = 88775. ! length of a sol (s) ~88775 s 165 year_day = 669 ! length of year (sols) ~668.6 166 periheli = 206.66 ! minimum sun-mars distance (Mkm) ~206.66 167 aphelie = 249.22 ! maximum sun-mars distance (Mkm) ~249.22 168 halfaxe = 227.94 ! demi-grand axe de l'ellipse 169 peri_day = 485. ! perihelion date (sols since N. Spring) 170 obliquit = 25.2 ! Obliquity (deg) ~25.2 171 eccentric = 0.0934 ! Eccentricity (0.0934) 134 year_day = 669 ! length of year (sols) ~668.6 135 periheli = 206.66 ! minimum sun-mars distance (Mkm) ~206.66 136 aphelie = 249.22 ! maximum sun-mars distance (Mkm) ~249.22 137 halfaxe = 227.94 ! demi-grand axe de l'ellipse 138 peri_day = 485. ! perihelion date (sols since N. Spring) 139 obliquit = 25.2 ! Obliquity (deg) ~25.2 140 eccentric = 0.0934 ! Eccentricity (0.0934) 172 141 173 142 ! Planetary Boundary Layer and Turbulence parameters … … 202 171 stop 203 172 else 204 write(*,*) " testphys1d: Reading file traceur.def"173 write(*,*) "init_testphys1d: Reading file traceur.def" 205 174 ! read number of tracers: 206 175 read(90,*,iostat = ierr) nq 207 176 nqtot = nq ! set value of nqtot (in infotrac module) as nq 208 177 if (ierr /= 0) then 209 write(*,*) " testphys1d: error reading number of tracers"178 write(*,*) "init_testphys1d: error reading number of tracers" 210 179 write(*,*) " (first line of traceur.def) " 211 180 stop 212 181 endif 213 182 if (nq < 1) then 214 write(*,*) " testphys1d: error number of tracers"183 write(*,*) "init_testphys1d: error number of tracers" 215 184 write(*,*) "is nq=",nq," but must be >=1!" 216 185 stop … … 225 194 read(90,'(80a)',iostat = ierr) line ! store the line from traceur.def 226 195 if (ierr /= 0) then 227 write(*,*) ' testphys1d: error reading tracer names...'196 write(*,*) 'init_testphys1d: error reading tracer names...' 228 197 stop 229 198 endif … … 271 240 272 241 ! Initialize tracers here: 273 write(*,*) " testphys1d: initializing tracers"242 write(*,*) "init_testphys1d: initializing tracers" 274 243 if (.not. therestart1D) then 275 244 call read_profile(nq,nlayer,qsurf,q) … … 434 403 ! ovverride iphysiq value that has been set by conf_phys 435 404 if (iphysiq /= 1) then 436 write(*,*) " testphys1d: setting iphysiq=1"405 write(*,*) "init_testphys1d: setting iphysiq=1" 437 406 iphysiq = 1 438 407 endif … … 538 507 enddo 539 508 if (igcm_co2 == 0) then 540 write(*,*) " testphys1d error, missing co2 tracer!"509 write(*,*) "init_testphys1d error, missing co2 tracer!" 541 510 stop 542 511 endif … … 725 694 726 695 END MODULE init_testphys1d_mod 727 -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3056 r3060 1 1 PROGRAM testphys1d 2 2 3 use ioipsl_getincom, only: getin ! To use 'getin' 3 4 use comsoil_h, only: inertiedat, inertiesoil, nsoilmx 4 5 use surfdat_h, only: albedodat, perenial_co2ice, watercap … … 94 95 integer :: nq = 1 ! number of tracers 95 96 real, dimension(1) :: latitude, longitude, cell_area 96 97 character(len = 2) :: str298 character(len = 7) :: str799 character(len = 44) :: txt97 logical :: there 98 character(len = 2) :: str2 99 character(len = 7) :: str7 100 character(len = 44) :: txt 100 101 101 102 ! RV & JBC: Use of "start1D.txt" and "startfi.nc" files 102 logical :: startfiles_1D 103 logical :: startfiles_1D, therestart1D, therestartfi 103 104 104 105 ! JN & JBC: Force atmospheric water profiles … … 120 121 !call initcomgeomphy 121 122 122 call init_testphys1d(ngrid,nq,nlayer,odpref,ndt,ptif,pks,dttestphys,startfiles_1D,q,zqsat,qsurf,dq,dqdyn, & 123 day0,day,time,psurf,tsurf,gru,grv,u,v,w,q2,play,plev,tsoil,temp,albedo,emis, & 124 latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 123 !------------------------------------------------------ 124 ! Loading run parameters from "run.def" file 125 !------------------------------------------------------ 126 ! check if 'run.def' file is around. Otherwise reading parameters 127 ! from callphys.def via getin() routine won't work. 128 inquire(file = 'run.def',exist = there) 129 if (.not. there) then 130 write(*,*) 'Cannot find required file "run.def"' 131 write(*,*) ' (which should contain some input parameters along with the following line: INCLUDEDEF=callphys.def)' 132 write(*,*) ' ... might as well stop here ...' 133 stop 134 endif 135 136 write(*,*)'Do you want to use "start1D.txt" and "startfi.nc" files?' 137 startfiles_1D = .false. 138 therestart1D = .false. 139 therestartfi = .false. 140 call getin("startfiles_1D",startfiles_1D) 141 write(*,*) " startfiles_1D = ", startfiles_1D 142 143 if (startfiles_1D) then 144 inquire(file = 'start1D.txt',exist = therestart1D) 145 if (.not. therestart1D) then 146 write(*,*) 'There is no "start1D.txt" file!' 147 write(*,*) 'Initialization is done with default values.' 148 endif 149 inquire(file = 'startfi.nc',exist = therestartfi) 150 if (.not. therestartfi) then 151 write(*,*) 'There is no "startfi.nc" file!' 152 write(*,*) 'Initialization is done with default values.' 153 endif 154 endif 155 156 call init_testphys1d(startfiles_1D,therestart1D,therestartfi,ngrid,nlayer,odpref,nq,ndt,ptif,pks,dttestphys, & 157 q,zqsat,qsurf,dq,dqdyn,day0,day,time,psurf,tsurf,gru,grv,u,v,w,q2,play,plev,tsoil,temp, & 158 albedo,emis,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 125 159 126 160 ! Write a "startfi" file … … 128 162 ! This file will be read during the first call to "physiq". 129 163 ! It is needed to transfert physics variables to "physiq"... 130 if (.not. startfiles_1D) then164 if (.not. therestartfi) then 131 165 call physdem0("startfi.nc",longitude,latitude,nsoilmx,ngrid, & 132 166 llm,nq,dttestphys,float(day0),0.,cell_area, & … … 135 169 tsurf,tsoil,inertiesoil,albedo,emis,q2,qsurf,tauscaling, & 136 170 totcloudfrac,wstar,watercap,perenial_co2ice) 137 endif !(.not. startfiles_1D)171 endif !(.not. therestartfi) 138 172 139 173 !======================================================================= … … 260 294 !*********************************************************************** 261 295 !*********************************************************************** 262
Note: See TracChangeset
for help on using the changeset viewer.