Changeset 3923
- Timestamp:
- Oct 6, 2025, 11:24:25 AM (3 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 4 edited
-
changelog.txt (modified) (1 diff)
-
libf/phymars/conf_phys.F (modified) (2 diffs)
-
libf/phymars/time_phylmdz_mod.F90 (modified) (1 diff)
-
libf/phymars/writediagfi.F (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3919 r3923 4980 4980 == 26/09/2025 == JBC 4981 4981 Formating "improveclouds" into F90 and simplifying some instructions. 4982 4983 == 06/09/2025 == JM 4984 Adding a slow_diagfi flag to the run.def file for 1D model only. When False, the netcdf 4985 file is opened/closed once, thus saving significant computing time. When true, 4986 the opening frequency is at output frequency (required in debug mode). -
trunk/LMDZ.MARS/libf/phymars/conf_phys.F
r3913 r3923 24 24 & frost_metam_threshold,old_wsublimation_scheme 25 25 use time_phylmdz_mod, only: steps_per_sol,outputs_per_sol,iphysiq, 26 & ecritstart,daysec,dtphys 26 & ecritstart,daysec,dtphys,slow_diagfi 27 27 use dimradmars_mod, only: naerkind, name_iaer, 28 28 & ini_scatterers,tauvis … … 105 105 & "Error: inadequate value for outputs_per_sol",1) 106 106 endif 107 108 slow_diagfi =.false. ! default value, open/close diagfi once (1D only) 109 call getin_p("slow_diagfi",slow_diagfi) ! if true, open/close the diagfi.nc 110 ! at output frequency instead of once 111 ! (slower but required for debug) 112 write(*,*) "Develop: slow_diagfi is ", slow_diagfi 107 113 108 114 iphysiq=20 ! default value -
trunk/LMDZ.MARS/libf/phymars/time_phylmdz_mod.F90
r3369 r3923 22 22 ! per sol (set via conf_phys) 23 23 !$OMP THREADPRIVATE(outputs_per_sol) 24 25 LOGICAL,SAVE :: slow_diagfi ! to handle wether the netcdf file is 26 ! opened/close once or at output frequency 27 !$OMP THREADPRIVATE(slow_diagfi) 24 28 25 29 INTEGER,SAVE :: iphysiq ! call physics every iphysiq dynamical step -
trunk/LMDZ.MARS/libf/phymars/writediagfi.F
r3870 r3923 41 41 use surfdat_h, only: phisfi 42 42 use geometry_mod, only: cell_area 43 use time_phylmdz_mod, only: steps_per_sol, outputs_per_sol 44 use time_phylmdz_mod, only: day_ini43 use time_phylmdz_mod, only: steps_per_sol, outputs_per_sol, 44 & day_end, day_ini, slow_diagfi 45 45 USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root, 46 46 & is_master, gather … … 79 79 80 80 integer,save :: zitau=0 81 integer,save :: lastzitau=0 81 82 character(len=27),save :: firstnom='1234567890' 83 character(len=27),save :: prevnom='1234567890' 84 character(len=27),save :: lastnom='1234567890' 82 85 !$OMP THREADPRIVATE(zitau,firstnom) 83 86 … … 86 89 !$OMP THREADPRIVATE(ntime) 87 90 integer :: idim,varid 88 integer :: nid91 integer, save :: nid 89 92 character(len=*),parameter :: fichnom="diagfi.nc" 90 93 integer, dimension(4) :: id … … 130 133 ! Compute the output rate 131 134 isample=steps_per_sol/outputs_per_sol 132 135 lastzitau=(day_end-day_ini)*steps_per_sol-1 133 136 !$OMP MASTER 134 137 ! Open diagfi.def definition file if there is one: … … 254 257 endif ! if (firstnom.eq.'1234567890') 255 258 256 ! Increment time index 'zitau' if it is the "fist call" (at given time level) 259 ! Find lastnom 260 if (lastnom.eq.'1234567890') then 261 if (nom.eq.firstnom) then 262 if (prevnom.ne.'1234567890') then 263 lastnom=prevnom 264 endif 265 endif 266 prevnom=nom 267 endif 268 269 ! Increment time index 'zitau' if it is the "first call" (at given time level) 257 270 ! to writediagfi 258 271 !------------------------------------------------------------------------ … … 264 277 ! Write the variables to output file if it's time to do so 265 278 !-------------------------------------------------------- 266 267 279 if ( MOD(zitau+1,isample) .eq.0.) then 268 280 … … 273 285 if (is_master) then 274 286 ! only the master is required to do this 275 276 ! Time to write data, open NETCDF file 277 ierr=NF_OPEN(fichnom,NF_WRITE,nid) 278 279 if (nom.eq.firstnom) then 287 288 ! 1D and slow_diagfi=.false. => open/close once 289 if ((klon_glo.eq.1).and.(.not.slow_diagfi)) then 290 ! if the very first time to write, open 291 if ((nom.eq.firstnom).and.((zitau+1)/isample.eq.1)) then 292 write(*,*) "Open NETCDF file for firstnom=", firstnom, " and zitau=", zitau 293 ierr=NF_OPEN(fichnom,NF_WRITE,nid) ! open once in all simu 294 endif 295 else ! 3D or slow_diagfi=.true. => open/close at output frequency 296 ierr=NF_OPEN(fichnom,NF_WRITE,nid) 297 endif 298 299 if(nom.eq.firstnom) then 280 300 ! We have identified a "first call" (at given date) 281 301 ntime=ntime+1 ! increment # of stored time steps … … 613 633 endif ! of if (dim.eq.3) elseif(dim.eq.2)... 614 634 635 ! Only the master do it 615 636 if (is_master) then 616 ! Close until next variable to dump or next dump iteration 617 ierr= NF_CLOSE(nid) 637 ! 1D and slow_diagfi=.false. => open/close once 638 if ((klon_glo.eq.1).and.(.not.slow_diagfi)) then 639 ! if the very last time to write, close 640 if ((nom.eq.lastnom).and.(zitau.eq.lastzitau)) then 641 write(*,*) "Close NETCDF file for lastnom=",lastnom, "and zitau=", zitau 642 ierr = NF_CLOSE(nid) ! close once in all simu 643 endif 644 else ! 3D or slow_diagfi=.true. => open/close at output frequency 645 ierr = NF_CLOSE(nid) 646 endif 618 647 endif 619 648
Note: See TracChangeset
for help on using the changeset viewer.
