Changeset 3369 for trunk/LMDZ.MARS/libf
- Timestamp:
- Jun 12, 2024, 11:00:16 AM (7 months ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/conf_phys.F
r3343 r3369 22 22 & frost_albedo_threshold, inert_h2o_ice, 23 23 & frost_metam_threshold,old_wsublimation_scheme 24 use time_phylmdz_mod, only: ecritphy,day_step,iphysiq,ecritstart,25 & daysec,dtphys24 use time_phylmdz_mod, only: steps_per_sol,outputs_per_sol,iphysiq, 25 & ecritstart,daysec,dtphys 26 26 use dimradmars_mod, only: naerkind, name_iaer, 27 27 & ini_scatterers,tauvis … … 55 55 INTEGER ierr,j 56 56 character(len=20),parameter :: modname="conf_phys" 57 58 real :: ecritphy ! to check that this obsolete flag is no longer used... 57 59 58 60 CHARACTER ch1*12 … … 60 62 ! read in some parameters from "run.def" for physics, 61 63 ! or shared between dynamics and physics. 62 ecritphy= 240 !default value64 ecritphy=-666 ! dummy default value 63 65 call getin_p("ecritphy",ecritphy) ! frequency of outputs in physics, 64 66 ! in dynamical steps 65 day_step=960 ! default value 66 call getin_p("day_step",day_step) ! number of dynamical steps per day 67 if (ecritphy/=-666) then 68 call abort_physic(modname, 69 & "Error: parameter ecritphy is obsolete! Remove it! "// 70 & "And use outputs_per_sol instead",1) 71 endif 72 73 outputs_per_sol=4 ! default value, 4 outputs per sol 74 call getin_p("outputs_per_sol",outputs_per_sol) 75 ! check that indeed it is possible for given physics time step 76 if (modulo(steps_per_sol,outputs_per_sol)/=0) then 77 write(*,*) "Error: outputs_per_sol = ",outputs_per_sol 78 write(*,*) " is not a divisor of number of steps per sol = ", 79 & steps_per_sol 80 call abort_physic(modname, 81 & "Error: inadequate value for outputs_per_sol",1) 82 endif 83 67 84 iphysiq=20 ! default value 68 85 call getin_p("iphysiq",iphysiq) ! call physics every iphysiq dyn step -
trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
r3316 r3369 11 11 use ioipsl_getincom, only: getin ! To use 'getin' 12 12 use comcstfi_h, only: pi, rad, omeg, g, mugaz, rcp, r, cpp 13 use time_phylmdz_mod, only: daysec, day_step, ecritphy, iphysiq13 use time_phylmdz_mod, only: daysec, steps_per_sol, outputs_per_sol, iphysiq 14 14 use planete_h, only: year_day, periheli, aphelie, peri_day, obliquit, emin_turb, lmixmin 15 15 use surfdat_h, only: albedodat, z0_default, z0, emissiv, emisice, albedice, iceradius, dtemisice, & … … 287 287 nsoil = nsoilmx 288 288 289 day_step = 48 ! Default value for day_step 289 steps_per_sol = 48 ! Default value for day_step (old name for steps_per_sol) 290 290 write(*,*)'Number of time steps per sol?' 291 call getin("day_step", day_step)292 write(*,*) " day_step = ",day_step293 294 ecritphy = day_step ! Default value for ecritphy, output every time step 291 call getin("day_step",steps_per_sol) 292 write(*,*) " steps_per_sol (aka day_step) = ",steps_per_sol 293 294 outputs_per_sol = steps_per_sol ! Default value for outputs_per_sol 295 295 296 296 ndt = 10 ! Default value for ndt … … 300 300 301 301 dayn = day0 + ndt 302 ndt = ndt* day_step303 dttestphys = daysec/ day_step302 ndt = ndt*steps_per_sol 303 dttestphys = daysec/steps_per_sol 304 304 305 305 ! Imposed surface pressure -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3350 r3369 8 8 use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice, igcm_co2, noms 9 9 use comcstfi_h, only: pi, g, rcp, cpp 10 use time_phylmdz_mod, only: daysec, day_step10 use time_phylmdz_mod, only: daysec 11 11 use dimradmars_mod, only: tauvis, totcloudfrac, albedo 12 12 use dust_param_mod, only: tauscaling -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3325 r3369 65 65 use conc_mod, only: init_r_cp_mu, update_r_cp_mu_ak, rnew, 66 66 & cpnew, mmean 67 use time_phylmdz_mod, only: iphysiq, day_step, ecritstart, daysec 67 use time_phylmdz_mod, only: steps_per_sol 68 use time_phylmdz_mod, only: iphysiq, ecritstart, daysec 68 69 use dimradmars_mod, only: aerosol, totcloudfrac, 69 70 & dtrad, fluxrad_sky, fluxrad, albedo, … … 1007 1008 ENDIF !end callnlte 1008 1009 1009 c Find number of layers for LTE radiation calculations 1010 IF(MOD(iphysiq*(icount-1),day_step).EQ.0) 1010 ! Find number of layers for LTE radiation calculations 1011 ! (done only once per sol) 1012 IF(MOD((icount-1),steps_per_sol).EQ.0) 1011 1013 & CALL nlthermeq(ngrid,nlayer,zplev,zplay) 1012 1014 -
trunk/LMDZ.MARS/libf/phymars/time_phylmdz_mod.F90
r2511 r3369 4 4 REAL,SAVE :: dtphys ! physics time step (s) 5 5 !$OMP THREADPRIVATE(dtphys) 6 INTEGER,SAVE :: day_step ! number of dynamical steps per day 7 ! (set via conf_phys) 8 !$OMP THREADPRIVATE(day_step) 6 9 7 REAL,SAVE :: daysec ! length of day (s) 10 8 !$OMP THREADPRIVATE(daysec) 9 10 INTEGER,SAVE :: steps_per_sol ! number of physics steps per sol 11 !$OMP THREADPRIVATE(steps_per_sol) 12 11 13 INTEGER,SAVE :: day_ini ! initial day of the run 12 14 !$OMP THREADPRIVATE(day_ini) … … 17 19 !$OMP THREADPRIVATE(hour_ini) 18 20 19 INTEGER,SAVE :: ecritphy ! for diagfi.nc outputs, write every ecritphy 20 ! dynamical steps (set via conf_phys) 21 !$OMP THREADPRIVATE(ecritphy) 21 INTEGER,SAVE :: outputs_per_sol ! for diagfi.nc outputs, number of outputs 22 ! per sol (set via conf_phys) 23 !$OMP THREADPRIVATE(outputs_per_sol) 24 22 25 INTEGER,SAVE :: iphysiq ! call physics every iphysiq dynamical step 23 26 ! (set via conf_phys) … … 43 46 dtphys=dtphys_ 44 47 48 ! compute number of physics steps per sol 49 steps_per_sol=nint(daysec/dtphys) 50 45 51 END SUBROUTINE init_time 46 52 -
trunk/LMDZ.MARS/libf/phymars/writediagfi.F
r3092 r3369 41 41 use surfdat_h, only: phisfi 42 42 use geometry_mod, only: cell_area 43 use time_phylmdz_mod, only: ecritphy, day_step, iphysiq, day_ini 43 use time_phylmdz_mod, only: steps_per_sol, outputs_per_sol 44 use time_phylmdz_mod, only: day_ini 44 45 USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root, 45 46 & is_master, gather … … 73 74 REAL area((nbp_lon+1),nbp_lat) 74 75 75 integer i rythme76 integer isample 76 77 integer ierr,ierr2 77 78 integer i,j,l, ig0 … … 121 122 122 123 !*************************************************************** 123 ! Sortie des variables au rythme voulu124 125 i rythme = int(ecritphy) ! output rate set by ecritphy124 ! Compute the output rate 125 126 isample=steps_per_sol/outputs_per_sol 126 127 127 128 !*************************************************************** … … 267 268 !------------------------------------------------------------------------ 268 269 if (nom.eq.firstnom) then 269 zitau = zitau + iphysiq270 zitau = zitau + 1 270 271 end if 271 272 … … 274 275 !-------------------------------------------------------- 275 276 276 if ( MOD(zitau+1,i rythme) .eq.0.) then277 if ( MOD(zitau+1,isample) .eq.0.) then 277 278 278 279 ! Compute/write/extend 'Time' coordinate (date given in days) … … 287 288 ntime=ntime+1 ! increment # of stored time steps 288 289 ! compute corresponding date (in days and fractions thereof) 289 date=(zitau +1.)/ day_step290 date=(zitau +1.)/steps_per_sol 290 291 ! Get NetCDF ID of 'Time' variable 291 292 ierr= NF_INQ_VARID(nid,"Time",varid) … … 620 621 endif ! of if (dim.eq.3) elseif(dim.eq.2)... 621 622 622 endif ! of if ( MOD(zitau+1,i rythme) .eq.0.)623 endif ! of if ( MOD(zitau+1,isample) .eq.0.) 623 624 624 625 if (is_master) then -
trunk/LMDZ.MARS/libf/phymars/writediagmicrofi.F
r2616 r3369 45 45 use surfdat_h, only: phisfi 46 46 use geometry_mod, only: cell_area 47 use time_phylmdz_mod, only: ecritphy, day_step, iphysiq, day_ini 47 use time_phylmdz_mod, only: steps_per_sol, outputs_per_sol 48 use time_phylmdz_mod, only: day_ini 48 49 USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root, 49 50 & is_master, gather … … 80 81 REAL area((nbp_lon+1),nbp_lat) 81 82 82 integer i rythme83 integer isample 83 84 integer ierr,ierr2 84 85 integer i,j,l, ig0 … … 124 125 125 126 !*************************************************************** 126 ! Sortie des variables au rythme voulu127 128 i rythme = int(ecritphy) ! output rate set by ecritphy127 ! Compute the output rate 128 129 isample = steps_per_sol/outputs_per_sol 129 130 130 131 !*************************************************************** … … 280 281 !------------------------------------------------------------------------ 281 282 if ((nom.eq.firstnom) .and. (microstep.eq.1)) then 282 zitau = zitau + iphysiq283 zitau = zitau + 1 283 284 end if 284 285 … … 287 288 !-------------------------------------------------------- 288 289 289 if ( MOD(zitau+1,i rythme) .eq.0.) then290 if ( MOD(zitau+1,isample) .eq.0.) then 290 291 291 292 ! Compute/write/extend 'Time' coordinate (date given in days) … … 300 301 ntime=ntime+1 ! increment # of stored time steps 301 302 ! compute corresponding date (in days and fractions thereof) 302 date=(zitau +1.)/ day_step303 date=(zitau +1.)/steps_per_sol 303 304 subdate=0. 304 305 ! Get NetCDF ID of 'Time' variable … … 668 669 endif ! of if (dim.eq.3) elseif(dim.eq.2)... 669 670 670 endif ! of if ( MOD(zitau+1,i rythme) .eq.0.)671 endif ! of if ( MOD(zitau+1,isample) .eq.0.) 671 672 672 673 if (is_master) then -
trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90
r3344 r3369 23 23 use comsoil_h, only: mlayer, nsoilmx, inertiedat 24 24 use geometry_mod, only: cell_area 25 use time_phylmdz_mod, only: ecritphy, day_step, iphysiq25 use time_phylmdz_mod, only: steps_per_sol, outputs_per_sol 26 26 use mod_phys_lmdz_para, only: is_mpi_root, is_master, gather 27 27 use mod_grid_phy_lmdz, only: klon_glo, Grid1Dto2D_glo, nbp_lon, nbp_lat … … 109 109 110 110 ! Set output sample rate 111 isample= int(ecritphy)! same as for diagfi outputs111 isample=steps_per_sol/outputs_per_sol ! same as for diagfi outputs 112 112 ! Note ecritphy is known from control.h 113 113 … … 175 175 if (name.eq.firstname) then 176 176 ! if we run across 'firstname', then it is a new time step 177 zitau=zitau+iphysiq 178 ! Note iphysiq is known from control.h 177 zitau=zitau+1 179 178 endif 180 179 … … 185 184 if (name.eq.firstname) then 186 185 ntime=ntime+1 187 date=float(zitau+1)/float(day_step) 188 ! Note: day_step is known from control.h 186 date=float(zitau+1)/float(steps_per_sol) 189 187 190 188 if (is_master) then
Note: See TracChangeset
for help on using the changeset viewer.